using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Threading.Tasks; using Sog; namespace SMCenter { public static class SMCenterUtils { private static ServerApp m_app; private static PacketSender m_packetSender; public static SMCenterConfig Config; public static string HostName { get; private set; } public static void Init(ServerApp app) { m_app = app; m_packetSender = new PacketSender(); HostName = Dns.GetHostName(); } public static ProtoBufPacker GetProtoPacker() { return ProtoPackerFactory.Instance.GetProtoBufPacker(); } public static PacketSender GetPacketSender() { return m_packetSender; } public static long GetTimeMs() { return m_app.Time.GetTime(); } public static long GetTimeSecond() { return m_app.Time.GetTimeSecond(); } public static uint GetAppID() { return m_app.ServerID; } public static ServerApp GetApp() { return m_app; } } }