本文整理汇总了C++中CGameClient::GetNetworkIDString方法的典型用法代码示例。如果您正苦于以下问题:C++ CGameClient::GetNetworkIDString方法的具体用法?C++ CGameClient::GetNetworkIDString怎么用?C++ CGameClient::GetNetworkIDString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGameClient
的用法示例。
在下文中一共展示了CGameClient::GetNetworkIDString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetPlayerList
//-----------------------------------------------------------------------------
// Purpose: Fills buffer with details on everyone in the server
//-----------------------------------------------------------------------------
void CServerRemoteAccess::GetPlayerList(CUtlBuffer &value)
{
if ( !serverGameClients )
{
return;
}
for ( int i=0 ; i< sv.GetClientCount() ; i++ )
{
CGameClient *client = sv.Client(i);
if ( !client || !client->IsActive() )
continue;
CPlayerState *pl = serverGameClients->GetPlayerState( client->edict );
if ( !pl )
continue;
// valid user, add to buffer
// format per user, each user seperated by a newline '\n'
// "name authID ipAddress ping loss frags time"
if ( client->IsFakeClient() )
{
value.Printf("\"%s\" %s 0 0 0 %d 0\n",
client->GetClientName(),
client->GetNetworkIDString(),
pl->frags);
}
else
{
value.Printf("\"%s\" %s %s %d %d %d %d\n",
client->GetClientName(),
client->GetNetworkIDString(),
client->GetNetChannel()->GetAddress(),
(int)(client->GetNetChannel()->GetAvgLatency(FLOW_OUTGOING) * 1000.0f),
(int)(client->GetNetChannel()->GetAvgLoss(FLOW_INCOMING)),
pl->frags,
(int)(client->GetNetChannel()->GetTimeConnected()));
}
}
value.PutChar(0);
}