本文整理汇总了C++中WriteBuffer::AppendBool方法的典型用法代码示例。如果您正苦于以下问题:C++ WriteBuffer::AppendBool方法的具体用法?C++ WriteBuffer::AppendBool怎么用?C++ WriteBuffer::AppendBool使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WriteBuffer
的用法示例。
在下文中一共展示了WriteBuffer::AppendBool方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SendReadyRequest
void StagingLogic::SendReadyRequest(bool isReady)
{
WriteBuffer aMsg;
aMsg.AppendByte(LobbyGameMsg_ReadyRequest);
aMsg.AppendBool(isReady);
SendGameMessageToCaptain(aMsg.ToByteBuffer());
}
示例2: WriteSummary
void LobbyGame::WriteSummary(WriteBuffer &theMsg)
{
if(mGameType==LobbyGameType_Internet)
theMsg.AppendBytes(mIPAddr.GetSixByte(),6);
else
theMsg.AppendShort(LobbyMisc::GetLanProductId());
theMsg.AppendBool(mInProgress);
if(mGameType!=LobbyGameType_Internet)
theMsg.AppendWString(mName);
theMsg.AppendByte(mSkillLevel);
if(mGameType!=LobbyGameType_Internet)
{
unsigned char aProtectionFlags = 0;
if(!mPassword.empty()) aProtectionFlags |= 0x01;
if(mInviteOnly) aProtectionFlags |= 0x02;
if(mAskToJoin) aProtectionFlags |= 0x04;
theMsg.AppendByte(aProtectionFlags);
}
theMsg.AppendShort(mNumPlayers);
theMsg.AppendShort(mMaxPlayers);
WriteSummaryHook(theMsg);
}
示例3: KickClient
void StagingLogic::KickClient(LobbyClient *theClient, bool isBan)
{
if(theClient==NULL || mGame.get()==NULL || !IAmCaptain())
return;
WriteBuffer aMsg;
aMsg.AppendByte(LobbyGameMsg_ClientKicked);
aMsg.AppendShort(theClient->GetClientId());
aMsg.AppendBool(isBan);
BroadcastGameMessage(aMsg.ToByteBuffer());
LobbyStagingPrv::NetKickClient(theClient,isBan);
}
示例4: GetRequest
ByteBufferPtr MultiPingOp::GetRequest(MultiPingStruct *theStruct)
{
theStruct->mPingId = rand();
theStruct->mStartPingTick = GetTickCount();
WriteBuffer aBuf;
aBuf.AppendByte(3);
aBuf.AppendByte(1);
aBuf.AppendByte(5);
aBuf.AppendLong(theStruct->mPingId);
aBuf.AppendBool(false);
return aBuf.ToByteBuffer();
}
示例5: HandleReadyRequest
void StagingLogic::HandleReadyRequest(ReadBuffer &theMsg, LobbyClient *theSender)
{
if(!IAmCaptain() || !theSender->IsPlayer())
return;
bool isReady = theMsg.ReadBool();
if(theSender->IsPlayerReady()==isReady) // no change needed
return;
WriteBuffer aMsg;
aMsg.AppendByte(LobbyGameMsg_PlayerReady);
aMsg.AppendShort(theSender->GetClientId());
aMsg.AppendBool(isReady);
BroadcastGameMessage(aMsg.ToByteBuffer());
}