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.

78 lines
1.9 KiB

1 month ago

using Sog;
namespace HttpProxy
{
public static class HttpProxyServerUtils
{
public static int HttpProxyLoginWorkThreadCount
{
get
{
var cfg = HttpProxyServerUtils.GetServerConfig();
if (cfg != null && cfg.TaskThreadCount > 0)
{
return cfg.TaskThreadCount;
}
return 10;
}
}
public static HttpProxyServerData GetHttpProxyServerData()
{
return ServerDataObjMgr.GetDataObj<HttpProxyServerData>(HttpProxyDataObjType.HttpProxyServerData);
}
public static ProtoCSStructPacker GetProtoPacker()
{
return ProtoPackerFactory.Instance.GetProtoCSStructPacker();
}
public static StructPacketSender GetPacketSender()
{
return GetHttpProxyServerData().m_packetSender;
}
public static HttpProxyMsgHandler GetMsgHandler()
{
return ServiceMgr.GetService<HttpProxyMsgHandler>(HttpProxyServiceType.HttpProxyMsgHandler);
}
public static long GetTimeSecond()
{
return GetHttpProxyServerData().m_app.Time.GetTimeSecond();
}
public static long GetTimeMs()
{
return GetHttpProxyServerData().m_app.Time.GetTime();
}
public static ServerApp GetApp()
{
return GetHttpProxyServerData().m_app;
}
public static uint GetAppID()
{
return GetHttpProxyServerData().m_app.ServerID;
}
public static bool IsTestFacebookMode()
{
return GetServerConfig().testFacebookFriend == 1;
}
/// <summary>
/// 获取服务器配置方法
/// </summary>
public static HttpProxyServerConfig GetServerConfig()
{
return (HttpProxyServerConfig)ServerConfigMgr.Instance.m_serverConfig;
}
}
}