当前位置: 首页>>代码示例>>C++>>正文


C++ WriteBuffer::AppendBool方法代码示例

本文整理汇总了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());
}
开发者ID:SOLARIC,项目名称:world-opponent-network,代码行数:7,代码来源:StagingLogic.cpp

示例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);
}
开发者ID:SOLARIC,项目名称:world-opponent-network,代码行数:26,代码来源:LobbyGame.cpp

示例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);
}
开发者ID:SOLARIC,项目名称:world-opponent-network,代码行数:13,代码来源:StagingLogic.cpp

示例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();
}
开发者ID:SOLARIC,项目名称:world-opponent-network,代码行数:13,代码来源:MultiPingOp.cpp

示例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());
}
开发者ID:SOLARIC,项目名称:world-opponent-network,代码行数:15,代码来源:StagingLogic.cpp


注:本文中的WriteBuffer::AppendBool方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。