diff --git a/dGame/dBehaviors/BehaviorContext.cpp b/dGame/dBehaviors/BehaviorContext.cpp index 3e00ee9d..cac5d705 100644 --- a/dGame/dBehaviors/BehaviorContext.cpp +++ b/dGame/dBehaviors/BehaviorContext.cpp @@ -256,7 +256,7 @@ bool BehaviorContext::CalculateUpdate(const float deltaTime) { BitStreamUtils::WriteHeader(message, eConnectionType::CLIENT, eClientMessageType::GAME_MSG); message.Write(this->originator); - echo.Serialize(&message); + echo.Serialize(message); Game::server->Send(&message, UNASSIGNED_SYSTEM_ADDRESS, true); } diff --git a/dGame/dGameMessages/EchoSyncSkill.h b/dGame/dGameMessages/EchoSyncSkill.h index ab5a3f2b..f65daab7 100644 --- a/dGame/dGameMessages/EchoSyncSkill.h +++ b/dGame/dGameMessages/EchoSyncSkill.h @@ -21,40 +21,40 @@ public: uiSkillHandle = _uiSkillHandle; } - EchoSyncSkill(RakNet::BitStream* stream) : EchoSyncSkill() { + EchoSyncSkill(RakNet::BitStream& stream) : EchoSyncSkill() { Deserialize(stream); } ~EchoSyncSkill() { } - void Serialize(RakNet::BitStream* stream) { - stream->Write(eGameMessageType::ECHO_SYNC_SKILL); + void Serialize(RakNet::BitStream& stream) { + stream.Write(eGameMessageType::ECHO_SYNC_SKILL); - stream->Write(bDone); + stream.Write(bDone); uint32_t sBitStreamLength = sBitStream.length(); - stream->Write(sBitStreamLength); + stream.Write(sBitStreamLength); for (uint32_t k = 0; k < sBitStreamLength; k++) { - stream->Write(sBitStream[k]); + stream.Write(sBitStream[k]); } - stream->Write(uiBehaviorHandle); - stream->Write(uiSkillHandle); + stream.Write(uiBehaviorHandle); + stream.Write(uiSkillHandle); } - bool Deserialize(RakNet::BitStream* stream) { - stream->Read(bDone); + bool Deserialize(RakNet::BitStream& stream) { + stream.Read(bDone); uint32_t sBitStreamLength{}; - stream->Read(sBitStreamLength); + stream.Read(sBitStreamLength); for (unsigned int k = 0; k < sBitStreamLength; k++) { unsigned char character; - stream->Read(character); + stream.Read(character); sBitStream.push_back(character); } - stream->Read(uiBehaviorHandle); - stream->Read(uiSkillHandle); + stream.Read(uiBehaviorHandle); + stream.Read(uiSkillHandle); return true; } diff --git a/dGame/dGameMessages/GameMessageHandler.cpp b/dGame/dGameMessages/GameMessageHandler.cpp index 1ee9f694..2cd205d1 100644 --- a/dGame/dGameMessages/GameMessageHandler.cpp +++ b/dGame/dGameMessages/GameMessageHandler.cpp @@ -362,7 +362,7 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream* inStream, const System echo.uiBehaviorHandle = sync.uiBehaviorHandle; echo.uiSkillHandle = sync.uiSkillHandle; - echo.Serialize(&bitStreamLocal); + echo.Serialize(bitStreamLocal); Game::server->Send(&bitStreamLocal, sysAddr, true); } break;