本文整理汇总了C++中C4PlayerInfo::SetJoinIssued方法的典型用法代码示例。如果您正苦于以下问题:C++ C4PlayerInfo::SetJoinIssued方法的具体用法?C++ C4PlayerInfo::SetJoinIssued怎么用?C++ C4PlayerInfo::SetJoinIssued使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类C4PlayerInfo
的用法示例。
在下文中一共展示了C4PlayerInfo::SetJoinIssued方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void C4Network2Players::JoinUnjoinedPlayersInControlQueue(C4ClientPlayerInfos *pNewPacket)
{
// only host may join any players to the queue
assert(::Network.isHost());
// check all players
int i=0; C4PlayerInfo *pInfo;
while ((pInfo = pNewPacket->GetPlayerInfo(i++)))
// not yet joined and no savegame assignment?
if (!pInfo->HasJoinIssued()) if (!pInfo->GetAssociatedSavegamePlayerID())
{
// join will be marked when queue is executed (C4Player::Join)
// but better mark join now already to prevent permanent sending overkill
pInfo->SetJoinIssued();
// do so!
C4Network2Res *pPlrRes = pInfo->GetRes();
C4Network2Client *pClient = ::Network.Clients.GetClientByID(pNewPacket->GetClientID());
if (!pPlrRes || (!pClient && pNewPacket->GetClientID() != ::Control.ClientID()))
if (pInfo->GetType() != C4PT_Script)
{
// failure: Non-script players must have a res to join from!
const char *szPlrName = pInfo->GetName(); if (!szPlrName) szPlrName="???";
LogF("Network: C4Network2Players::JoinUnjoinedPlayersInControlQueue failed to join player %s!", szPlrName);
continue;
}
if (pPlrRes)
{
// join with resource
Game.Input.Add(CID_JoinPlr,
new C4ControlJoinPlayer(pPlrRes->getFile(), pNewPacket->GetClientID(), pInfo->GetID(), pPlrRes->getCore()));
}
else
{
// join without resource (script player)
Game.Input.Add(CID_JoinPlr,
new C4ControlJoinPlayer(NULL, pNewPacket->GetClientID(), pInfo->GetID()));
}
}
}