91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

多人網(wǎng)絡(luò)開發(fā)技術(shù),有利于游戲開發(fā)的童鞋們了解多人網(wǎng)絡(luò)后臺開發(fā)技術(shù)

資源截圖

代碼片段和文件信息

#include?“RoboCatPCH.h“

shared_ptr?Command::StaticReadAndCreate(?InputMemoryBitStream&?inInputStream?)
{
CommandPtr?retVal;

int?type?=?CM_INVALID;
inInputStream.Read(?type?);
uint32_t?networkId?=?0;
inInputStream.Read(?networkId?);
uint64_t?playerId?=?0;
inInputStream.Read(?playerId?);

switch?(?type?)
{
case?CM_ATTACK:
retVal?=?std::make_shared();
retVal->mNetworkId?=?networkId;
retVal->mPlayerId?=?playerId;
retVal->Read(?inInputStream?);
break;
case?CM_MOVE:
retVal?=?std::make_shared();
retVal->mNetworkId?=?networkId;
retVal->mPlayerId?=?playerId;
retVal->Read(?inInputStream?);
break;
default:
LOG(?“Read?in?an?unknown?command?type??“?);
break;
}

return?retVal;
}

void?Command::Write(?OutputMemoryBitStream&?inOutputStream?)
{
inOutputStream.Write(?mCommandType?);
inOutputStream.Write(?mNetworkId?);
inOutputStream.Write(?mPlayerId?);
}

AttackCommandPtr?AttackCommand::StaticCreate(?uint32_t?inMyNetId?uint32_t?inTargetNetId?)
{
AttackCommandPtr?retVal;
GameobjectPtr?me?=?NetworkManager::sInstance->GetGameobject(?inMyNetId?);
GameobjectPtr?target?=?NetworkManager::sInstance->GetGameobject(?inTargetNetId?);
uint64_t?playerId?=?NetworkManager::sInstance->GetMyPlayerId();
//can?only?issue?commands?to?this?unit?if?I?own?it?and?it‘s?a?cat
//and?if?the?target?is?a?cat?that‘s?on?a?different?team
if?(?me?&&?me->GetClassId()?==?RoboCat::kClassId?&&
me->GetPlayerId()?==??playerId?&&
target?&&?target->GetClassId()?==?RoboCat::kClassId?&&
target->GetPlayerId()?!=?me->GetPlayerId()?)
{
retVal?=?std::make_shared();
retVal->mNetworkId?=?inMyNetId;
retVal->mPlayerId?=?playerId;
retVal->mTargetNetId?=?inTargetNetId;
}
return?retVal;
}

void?AttackCommand::Write(?OutputMemoryBitStream&?inOutputStream?)
{
Command::Write(?inOutputStream?);
inOutputStream.Write(?mTargetNetId?);
}

void?AttackCommand::Read(?InputMemoryBitStream&?inInputStream?)
{
inInputStream.Read(?mTargetNetId?);
}

void?AttackCommand::ProcessCommand()
{
GameobjectPtr?obj?=?NetworkManager::sInstance->GetGameobject(?mNetworkId?);
if?(?obj?&&?obj->GetClassId()?==?RoboCat::kClassId?&&
obj->GetPlayerId()?==?mPlayerId?)
{
RoboCat*?rc?=?obj->GetAsCat();
rc->EnterAttackState(?mTargetNetId?);
}
}

MoveCommandPtr?MoveCommand::StaticCreate(?uint32_t?inNetworkId?const?Vector3&?inTarget?)
{
MoveCommandPtr?retVal;
GameobjectPtr?go?=?NetworkManager::sInstance->GetGameobject(?inNetworkId?);
uint64_t?playerId?=?NetworkManager::sInstance->GetMyPlayerId();

//can?only?issue?commands?to?this?unit?if?I?own?it?and?it‘s?a?cat
if?(?go?&&?go->GetClassId()?==?RoboCat::kClassId?&&?
go->GetPlayerId()?==?playerId?)
{
retVal?=?std::make_shared();
retVal->mNetworkId?=?inNetworkId;
retVal->mPlayerId?=?playerId;
retVal->mTarget?=?inTarget;
}
return?retVal;
}

void?MoveCommand::Write(?OutputMemoryBitStream&?inOutputStream?)
{
Command::Write(?inOutputStream

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件????????129??2017-08-19?21:31??多人網(wǎng)絡(luò)\MultiplayerBook-master\.gitignore

?????文件??????14328??2017-08-19?21:31??多人網(wǎng)絡(luò)\MultiplayerBook-master\Chapter?12\RoboCatRTS\Assets\8-BIT?WONDER.TTF

?????文件???????2244??2017-08-19?21:31??多人網(wǎng)絡(luò)\MultiplayerBook-master\Chapter?12\RoboCatRTS\Assets\8-BITWONDER-README.TXT

?????文件????????270??2017-08-19?21:31??多人網(wǎng)絡(luò)\MultiplayerBook-master\Chapter?12\RoboCatRTS\Assets\Art-README.txt

?????文件???????4250??2017-08-19?21:31??多人網(wǎng)絡(luò)\MultiplayerBook-master\Chapter?12\RoboCatRTS\Assets\Carlito-Regular-README.TXT

?????文件?????635996??2017-08-19?21:31??多人網(wǎng)絡(luò)\MultiplayerBook-master\Chapter?12\RoboCatRTS\Assets\Carlito-Regular.ttf

?????文件??????22829??2017-08-19?21:31??多人網(wǎng)絡(luò)\MultiplayerBook-master\Chapter?12\RoboCatRTS\Assets\cat.png

?????文件???????8669??2017-08-19?21:31??多人網(wǎng)絡(luò)\MultiplayerBook-master\Chapter?12\RoboCatRTS\Assets\mouse.png

?????文件??????????3??2017-08-19?21:31??多人網(wǎng)絡(luò)\MultiplayerBook-master\Chapter?12\RoboCatRTS\Assets\steam_appid.txt

?????文件??????13543??2017-08-19?21:31??多人網(wǎng)絡(luò)\MultiplayerBook-master\Chapter?12\RoboCatRTS\Assets\yarn.png

?????文件??????????3??2017-08-19?21:31??多人網(wǎng)絡(luò)\MultiplayerBook-master\Chapter?12\RoboCatRTS\Debug\steam_appid.txt

?????文件??????????3??2017-08-19?21:31??多人網(wǎng)絡(luò)\MultiplayerBook-master\Chapter?12\RoboCatRTS\Release\steam_appid.txt

?????文件????????215??2017-08-19?21:31??多人網(wǎng)絡(luò)\MultiplayerBook-master\Chapter?12\RoboCatRTS\RoboCatRTS\Inc\Achieve.def

?????文件???????1786??2017-08-19?21:31??多人網(wǎng)絡(luò)\MultiplayerBook-master\Chapter?12\RoboCatRTS\RoboCatRTS\Inc\Command.h

?????文件????????424??2017-08-19?21:31??多人網(wǎng)絡(luò)\MultiplayerBook-master\Chapter?12\RoboCatRTS\RoboCatRTS\Inc\CommandList.h

?????文件????????434??2017-08-19?21:31??多人網(wǎng)絡(luò)\MultiplayerBook-master\Chapter?12\RoboCatRTS\RoboCatRTS\Inc\Engine.h

?????文件???????2418??2017-08-19?21:31??多人網(wǎng)絡(luò)\MultiplayerBook-master\Chapter?12\RoboCatRTS\RoboCatRTS\Inc\Gameobject.h

?????文件????????465??2017-08-19?21:31??多人網(wǎng)絡(luò)\MultiplayerBook-master\Chapter?12\RoboCatRTS\RoboCatRTS\Inc\GameobjectRegistry.h

?????文件???????2352??2017-08-19?21:31??多人網(wǎng)絡(luò)\MultiplayerBook-master\Chapter?12\RoboCatRTS\RoboCatRTS\Inc\GamerServices.h

?????文件????????383??2017-08-19?21:31??多人網(wǎng)絡(luò)\MultiplayerBook-master\Chapter?12\RoboCatRTS\RoboCatRTS\Inc\GraphicsDriver.h

?????文件????????761??2017-08-19?21:31??多人網(wǎng)絡(luò)\MultiplayerBook-master\Chapter?12\RoboCatRTS\RoboCatRTS\Inc\HUD.h

?????文件?????????65??2017-08-19?21:31??多人網(wǎng)絡(luò)\MultiplayerBook-master\Chapter?12\RoboCatRTS\RoboCatRTS\Inc\InputAction.h

?????文件????????578??2017-08-19?21:31??多人網(wǎng)絡(luò)\MultiplayerBook-master\Chapter?12\RoboCatRTS\RoboCatRTS\Inc\InputManager.h

?????文件????????271??2017-08-19?21:31??多人網(wǎng)絡(luò)\MultiplayerBook-master\Chapter?12\RoboCatRTS\RoboCatRTS\Inc\Leaderboards.def

?????文件???????4617??2017-08-19?21:31??多人網(wǎng)絡(luò)\MultiplayerBook-master\Chapter?12\RoboCatRTS\RoboCatRTS\Inc\MemoryBitStream.h

?????文件???????5136??2017-08-19?21:31??多人網(wǎng)絡(luò)\MultiplayerBook-master\Chapter?12\RoboCatRTS\RoboCatRTS\Inc\NetworkManager.h

?????文件????????504??2017-08-19?21:31??多人網(wǎng)絡(luò)\MultiplayerBook-master\Chapter?12\RoboCatRTS\RoboCatRTS\Inc\RandGen.h

?????文件????????628??2017-08-19?21:31??多人網(wǎng)絡(luò)\MultiplayerBook-master\Chapter?12\RoboCatRTS\RoboCatRTS\Inc\RenderManager.h

?????文件???????1231??2017-08-19?21:31??多人網(wǎng)絡(luò)\MultiplayerBook-master\Chapter?12\RoboCatRTS\RoboCatRTS\Inc\RoboCat.h

?????文件???????1485??2017-08-19?21:31??多人網(wǎng)絡(luò)\MultiplayerBook-master\Chapter?12\RoboCatRTS\RoboCatRTS\Inc\RoboCatPCH.h

............此處省略1364個文件信息

評論

共有 條評論