6 major server modules (PdkFriendServer/GlobalSever/ServerCore/GameModule/GameNetModule) + game logic (GameFix/GameDAL/ServerData) + network layer (NetWorkMessage) + data layer (ObjectModel) + utilities (MrWu/Core/Config/CloudAPI/dll) + adapters (zyxAdapter/base) .NET 8.0 C# solution, 16 projects, 958 source files
64 lines
1.7 KiB
C#
64 lines
1.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
#if Server
|
|
namespace Server
|
|
#else
|
|
namespace UnityGame
|
|
#endif
|
|
{
|
|
public abstract class ActivityPropDataInfo
|
|
{
|
|
/// <summary>
|
|
/// 活动道具类型
|
|
/// </summary>
|
|
public abstract ActivityPropType PropType
|
|
{
|
|
get;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取道具名称 英文名 也是Redis中的Key
|
|
/// </summary>
|
|
public abstract string[] GetPropNames();
|
|
|
|
/// <summary>
|
|
/// 获取道具的过期时间
|
|
/// </summary>
|
|
/// <param name="propName">道具名称</param>
|
|
/// <returns></returns>
|
|
public abstract DateTime GetExpireTime(string propName);
|
|
|
|
/// <summary>
|
|
/// 道具中文名称
|
|
/// </summary>
|
|
public static readonly Dictionary<ActivityPropType, string> PropName =
|
|
new Dictionary<ActivityPropType, string>()
|
|
{
|
|
{
|
|
ActivityPropType.MenPiao,
|
|
"门票"
|
|
},
|
|
};
|
|
|
|
/// <summary>
|
|
/// 获取当前周的星期天的24时
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public static DateTime GetNowWeekSunDay()
|
|
{
|
|
DateTime now = DateTime.Now;
|
|
int daysUntilSunday = ((DayOfWeek.Sunday - now.DayOfWeek) + 7) % 7;
|
|
return now.Date.AddDays(daysUntilSunday + 1); //星期天的24点就是下周一的0点
|
|
}
|
|
}
|
|
|
|
public enum ActivityPropType
|
|
{
|
|
/// <summary>
|
|
/// 门票
|
|
/// </summary>
|
|
MenPiao = 1,
|
|
}
|
|
}
|
|
|