using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Sog; using ProtoCSStruct; namespace Rank { public static class RankServerUtils { public static RankServerData GetRankServerData() { return ServerDataObjMgr.GetDataObj(RankDataObjType.RankServerData); } public static WorldRankData GetRankData() { RankServerData serverData = ServerDataObjMgr.GetDataObj(RankDataObjType.RankServerData); return serverData.m_RankData; } public static Dictionary GetActRankData() { RankServerData serverData = ServerDataObjMgr.GetDataObj(RankDataObjType.RankServerData); return serverData.m_ActRank; } public static Dictionary GetAllplayerInfo() { RankServerData serverData = ServerDataObjMgr.GetDataObj(RankDataObjType.RankServerData); return serverData.playerInfo; } public static ProtoCSStructPacker GetProtoPacker() { return ProtoPackerFactory.Instance.GetProtoCSStructPacker(); } public static StructPacketSender GetPacketSender() { return GetRankServerData().m_packetSender; } public static PlayerTable GetPlayerTable() { return ServerDataObjMgr.GetDataObj(RankDataObjType.PlayerTable); } public static RankMsgHandler GetWorldMsgHandler() { return ServiceMgr.GetService(RankServiceType.RankMsgHandler); } public static EventHandlerMgr GetEventHandlerMgr() { return ServiceMgr.GetService(RankServiceType.EventHandlerMgr); } public static long GetTimeMs() { return GetRankServerData().m_app.Time.GetTime(); } public static long GetTimeSecond() { return GetRankServerData().m_app.Time.GetTimeSecond(); } public static DateTime GetDateTime() { return GetRankServerData().m_app.Time.GetDateTime(); } public static ServerApp GetApp() { return GetRankServerData().m_app; } public static uint GetAppID() { return GetRankServerData().m_app.ServerID; } public static RealmBriefInfo GetRealmBriefInfo(int realmId) { GetRankServerData().m_configRealm.TryGetValue(realmId, out var briefInfo); return briefInfo; } } }