You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
99 lines
2.7 KiB
99 lines
2.7 KiB
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<RankServerData>(RankDataObjType.RankServerData);
|
|
}
|
|
|
|
public static WorldRankData GetRankData()
|
|
{
|
|
RankServerData serverData = ServerDataObjMgr.GetDataObj<RankServerData>(RankDataObjType.RankServerData);
|
|
|
|
return serverData.m_RankData;
|
|
}
|
|
public static Dictionary<int, ActRemRank> GetActRankData()
|
|
{
|
|
RankServerData serverData = ServerDataObjMgr.GetDataObj<RankServerData>(RankDataObjType.RankServerData);
|
|
|
|
return serverData.m_ActRank;
|
|
}
|
|
|
|
public static Dictionary<long, DBActRankTopPlayerInfo> GetAllplayerInfo()
|
|
{
|
|
RankServerData serverData = ServerDataObjMgr.GetDataObj<RankServerData>(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<PlayerTable>(RankDataObjType.PlayerTable);
|
|
}
|
|
|
|
|
|
|
|
public static RankMsgHandler GetWorldMsgHandler()
|
|
{
|
|
return ServiceMgr.GetService<RankMsgHandler>(RankServiceType.RankMsgHandler);
|
|
}
|
|
|
|
|
|
public static EventHandlerMgr GetEventHandlerMgr()
|
|
{
|
|
return ServiceMgr.GetService<EventHandlerMgr>(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;
|
|
|
|
}
|
|
}
|
|
}
|
|
|