本文整理汇总了C++中nfmsg::ServerInfoReport::server_name方法的典型用法代码示例。如果您正苦于以下问题:C++ ServerInfoReport::server_name方法的具体用法?C++ ServerInfoReport::server_name怎么用?C++ ServerInfoReport::server_name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nfmsg::ServerInfoReport
的用法示例。
在下文中一共展示了ServerInfoReport::server_name方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnRefreshWorldInfoProcess
int NFCMasterNet_ServerModule::OnRefreshWorldInfoProcess(const int nSockIndex, const int nMsgID, const char* msg, const uint32_t nLen)
{
NFGUID nPlayerID;
NFMsg::ServerInfoReportList xMsg;
if (!RecivePB(nSockIndex, nMsgID, msg, nLen, xMsg, nPlayerID))
{
return 0;
}
for (int i = 0; i < xMsg.server_list_size(); ++i)
{
NFMsg::ServerInfoReport* pData = xMsg.mutable_server_list(i);
NF_SHARE_PTR<ServerData> pServerData = mWorldMap.GetElement(pData->server_id());
if (!pServerData.get())
{
pServerData = NF_SHARE_PTR<ServerData>(NF_NEW ServerData());
mWorldMap.AddElement(pData->server_id(), pServerData);
}
pServerData->nFD = nSockIndex;
*(pServerData->pData) = *pData;
m_pLogModule->LogNormal(NFILogModule::NLL_INFO_NORMAL, NFGUID(0, pData->server_id()), pData->server_name(), "RefreshWorldInfo");
}
SynWorldToLogin();
return 0;
}
示例2: OnProxyServerRegisteredProcess
int NFCWorldNet_ServerModule::OnProxyServerRegisteredProcess(const NFIPacket& msg)
{
NFIDENTID nPlayerID;
NFMsg::ServerInfoReportList xMsg;
if (!RecivePB(msg, xMsg, nPlayerID))
{
return 0;
}
for (int i = 0; i < xMsg.server_list_size(); ++i)
{
NFMsg::ServerInfoReport* pData = xMsg.mutable_server_list(i);
NF_SHARE_PTR<ServerData> pServerData = mProxyMap.GetElement(pData->server_id());
if (!pServerData)
{
pServerData = NF_SHARE_PTR<ServerData>(NF_NEW ServerData());
mProxyMap.AddElement(pData->server_id(), pServerData);
}
pServerData->nFD = msg.GetFd();
*(pServerData->pData) = *pData;
m_pLogModule->LogNormal(NFILogModule::NLL_INFO_NORMAL, NFIDENTID(0, pData->server_id()), pData->server_name(), "Proxy Registered");
SynGameToProxy(msg.GetFd());
}
return 0;
}
示例3: OnWorldUnRegisteredProcess
int NFCMasterNet_ServerModule::OnWorldUnRegisteredProcess(const int nSockIndex, const int nMsgID, const char* msg, const uint32_t nLen)
{
NFGUID nPlayerID;
NFMsg::ServerInfoReportList xMsg;
if (!RecivePB(nSockIndex, nMsgID, msg, nLen, xMsg, nPlayerID))
{
return 0;
}
for (int i = 0; i < xMsg.server_list_size(); ++i)
{
NFMsg::ServerInfoReport* pData = xMsg.mutable_server_list(i);
mWorldMap.RemoveElement(pData->server_id());
m_pLogModule->LogNormal(NFILogModule::NLL_INFO_NORMAL, NFGUID(0, pData->server_id()), pData->server_name(), "WorldUnRegistered");
}
SynWorldToLogin();
return 0;
}