using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Game; using Gate; using Sog; namespace Name { public static class NameServerUtils { public static string GetNameTableName(int accountType, string hashName) { int accountTableIndex = TableIndexCalc.CalcNameTableIndex(accountType, hashName); return "tbname_" + accountTableIndex.ToString(); } public static string GetAccountRealmUidLinkTableName(int accountType, string accountID) { int accountTableIndex = TableIndexCalc.CalcAccountTableIndex(accountType, accountID); return "tbacc_realmuid_link_" + accountTableIndex.ToString(); } public static NameServerData GetNameServerData() { return ServerDataObjMgr.GetDataObj(NameServiceType.NameServerData); } public static ProtoCSStructPacker GetProtoPacker() { return ProtoPackerFactory.Instance.GetProtoCSStructPacker(); } public static StructPacketSender GetPacketSender() { return GetNameServerData().m_packetSender; } public static long GetTimeSecond() { return GetNameServerData().m_app.Time.GetTimeSecond(); } public static uint GetAppID() { return GetNameServerData().m_app.ServerID; } /// /// 获取服务器配置方法 /// public static NameServerConfig GetServerConfig() { return (NameServerConfig)ServerConfigMgr.Instance.m_serverConfig; } } }