using SCHALE.Common.Database; using SCHALE.Common.FlatData; namespace SCHALE.Common.NetworkProtocol { public class SessionKey { public long AccountServerId { get; set; } public required string MxToken { get; set; } } public abstract class BasePacket { public SessionKey? SessionKey { get; set; } public abstract Protocol Protocol { get; } public long AccountId => SessionKey?.AccountServerId ?? 0; } public abstract class RequestPacket : BasePacket { private static int _counter; public int ClientUpTime { get; set; } public bool Resendable { get; set; } = true; public long Hash { get; set; } public bool IsTest { get; set; } public DateTime? ModifiedServerTime__DebugOnly { get; set; } public static long CreateHash(Protocol protocol) { return _counter++ | ((int)protocol << 32); } } // TODO: Fix properties public abstract class ResponsePacket : BasePacket { public long ServerTimeTicks { get; set; } = DateTimeOffset.Now.Ticks; public ServerNotificationFlag ServerNotification { get; set; } public List MissionProgressDBs { get; set; } public Dictionary> EventMissionProgressDBDict { get; set; } public Dictionary StaticOpenConditions { get; set; } } }