using System.Text; using Milimoe.FunGame.Core.Entity; namespace Milimoe.FunGame.Core.Library.Constant { /// /// 此类保存常用的对象常量 /// public class General { #region Static Variable /// /// 空的实体类 用于object返回 /// public static Empty EntityInstance => new(); /// /// 默认的未知用户 /// public static User UnknownUserInstance => new(); /// /// 大厅(空房间)实例 /// public static Room HallInstance => new(); /// /// 默认的字符编码 /// public static Encoding DefaultEncoding => Encoding.Unicode; /// /// 默认的时间格式 /// public static string GeneralDateTimeFormat => "yyyy-MM-dd HH:mm:ss.fff"; /// /// 默认的时间值(1970年8月1日8点0分0秒) /// public static DateTime DefaultTime => new(1970, 1, 1, 8, 0, 0); #endregion #region Const /// /// 最多自动重试连接次数 /// public const int MaxRetryTimes = 20; /// /// 1C2G推荐的任务数量 /// public const int MaxTask_1C2G = 10; /// /// 2C2G推荐的任务数量 /// public const int MaxTask_2C2G = 20; /// /// 4C4G推荐的任务数量 /// public const int MaxTask_4C4G = 40; /// /// 默认Socket数据包大小 /// public const int SocketByteSize = 512 * 1024; /// /// 默认Stream传输大小 /// public const int StreamByteSize = 2048; #endregion } }