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.

82 lines
2.3 KiB

1 month ago
using Sog;
namespace Account
{
public static class AccountServerUtils
{
public static AccountServerData GetAccountServerData()
{
return ServerDataObjMgr.GetDataObj<AccountServerData>(AccountDataObjType.AccountServerData);
}
public static ProtoCSStructPacker GetProtoPacker()
{
return ProtoPackerFactory.Instance.GetProtoCSStructPacker();
}
public static StructPacketSender GetPacketSender()
{
return GetAccountServerData().m_packetSender;
}
//client
public static PlayerTable GetPlayerTable()
{
return ServerDataObjMgr.GetDataObj<PlayerTable>(AccountDataObjType.PlayerTable);
}
public static PlayerTableOp GetPlayerTableOp()
{
return ServiceMgr.GetService<PlayerTableOp>(AccountServiceType.PlayerTableOp);
}
public static SnsFriendAccountInfoCache GetSnsFriendCache()
{
return ServerDataObjMgr.GetDataObj<SnsFriendAccountInfoCache>(AccountDataObjType.SnsFriendInfoCache);
}
public static AccountTable GetAccountTable()
{
return ServerDataObjMgr.GetDataObj<AccountTable>(AccountDataObjType.AccountTable);
}
public static AccountTableOp GetAccountTableOp()
{
return ServiceMgr.GetService<AccountTableOp>(AccountServiceType.AccountTableOp);
}
public static AccountMsgHandler GetAccountMsgHandler()
{
return ServiceMgr.GetService<AccountMsgHandler>(AccountServiceType.AccountMsgHandler);
}
public static long GetTimeSecond()
{
return GetAccountServerData().m_app.Time.GetTimeSecond();
}
public static uint GetAppID()
{
return GetAccountServerData().m_app.ServerID;
}
public static ServerApp GetApp()
{
return GetAccountServerData().m_app;
}
public static SnsFriendCacheOp GetSnsFriendCacheOp()
{
return ServiceMgr.GetService<SnsFriendCacheOp>(AccountServiceType.SnsFriendCacheOp);
}
/// <summary>
/// 获取服务器配置方法
/// </summary>
public static AccountServerConfig GetServerConfig()
{
return (AccountServerConfig)ServerConfigMgr.Instance.m_serverConfig;
}
}
}