diff --git a/dChatServer/ChatIgnoreList.cpp b/dChatServer/ChatIgnoreList.cpp index d77eeeed..f0c55eb0 100644 --- a/dChatServer/ChatIgnoreList.cpp +++ b/dChatServer/ChatIgnoreList.cpp @@ -59,7 +59,7 @@ void ChatIgnoreList::GetIgnoreList(Packet* packet) { bitStream.Write(LUWString(ignoredPlayer.playerName, 36)); } - Game::server->Send(&bitStream, packet->systemAddress, false); + Game::server->Send(bitStream, packet->systemAddress, false); } void ChatIgnoreList::AddIgnore(Packet* packet) { @@ -131,7 +131,7 @@ void ChatIgnoreList::AddIgnore(Packet* packet) { bitStream.Write(playerNameSend); bitStream.Write(ignoredPlayerId); - Game::server->Send(&bitStream, packet->systemAddress, false); + Game::server->Send(bitStream, packet->systemAddress, false); } void ChatIgnoreList::RemoveIgnore(Packet* packet) { @@ -167,5 +167,5 @@ void ChatIgnoreList::RemoveIgnore(Packet* packet) { LUWString playerNameSend(removedIgnoreStr, 33); bitStream.Write(playerNameSend); - Game::server->Send(&bitStream, packet->systemAddress, false); + Game::server->Send(bitStream, packet->systemAddress, false); } diff --git a/dChatServer/ChatServer.cpp b/dChatServer/ChatServer.cpp index 44957042..9ba70026 100644 --- a/dChatServer/ChatServer.cpp +++ b/dChatServer/ChatServer.cpp @@ -211,7 +211,7 @@ void HandlePacket(Packet* packet) { case eChatInternalMessageType::ANNOUNCEMENT: { //we just forward this packet to every connected server CINSTREAM; - Game::server->Send(&inStream, packet->systemAddress, true); //send to everyone except origin + Game::server->Send(inStream, packet->systemAddress, true); //send to everyone except origin break; } diff --git a/dChatServer/PlayerContainer.cpp b/dChatServer/PlayerContainer.cpp index dbbaeb9e..4e4d1be5 100644 --- a/dChatServer/PlayerContainer.cpp +++ b/dChatServer/PlayerContainer.cpp @@ -150,7 +150,7 @@ void PlayerContainer::BroadcastMuteUpdate(LWOOBJID player, time_t time) { bitStream.Write(player); bitStream.Write(time); - Game::server->Send(&bitStream, UNASSIGNED_SYSTEM_ADDRESS, true); + Game::server->Send(bitStream, UNASSIGNED_SYSTEM_ADDRESS, true); } TeamData* PlayerContainer::CreateLocalTeam(std::vector members) { @@ -365,7 +365,7 @@ void PlayerContainer::UpdateTeamsOnWorld(TeamData* team, bool deleteTeam) { } } - Game::server->Send(&bitStream, UNASSIGNED_SYSTEM_ADDRESS, true); + Game::server->Send(bitStream, UNASSIGNED_SYSTEM_ADDRESS, true); } std::u16string PlayerContainer::GetName(LWOOBJID playerID) { diff --git a/dCommon/dEnums/dCommonVars.h b/dCommon/dEnums/dCommonVars.h index d871e267..7cdbfdb6 100644 --- a/dCommon/dEnums/dCommonVars.h +++ b/dCommon/dEnums/dCommonVars.h @@ -34,8 +34,8 @@ constexpr uint32_t lowFrameDelta = FRAMES_TO_MS(lowFramerate); #define CINSTREAM RakNet::BitStream inStream(packet->data, packet->length, false); #define CINSTREAM_SKIP_HEADER CINSTREAM if (inStream.GetNumberOfUnreadBits() >= BYTES_TO_BITS(HEADER_SIZE)) inStream.IgnoreBytes(HEADER_SIZE); else inStream.IgnoreBits(inStream.GetNumberOfUnreadBits()); #define CMSGHEADER BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, eClientMessageType::GAME_MSG); -#define SEND_PACKET Game::server->Send(&bitStream, sysAddr, false); -#define SEND_PACKET_BROADCAST Game::server->Send(&bitStream, UNASSIGNED_SYSTEM_ADDRESS, true); +#define SEND_PACKET Game::server->Send(bitStream, sysAddr, false); +#define SEND_PACKET_BROADCAST Game::server->Send(bitStream, UNASSIGNED_SYSTEM_ADDRESS, true); //=========== TYPEDEFS ========== diff --git a/dGame/EntityManager.cpp b/dGame/EntityManager.cpp index 9cd9df43..78e85a8f 100644 --- a/dGame/EntityManager.cpp +++ b/dGame/EntityManager.cpp @@ -185,11 +185,11 @@ void EntityManager::SerializeEntities() { for (auto* player : PlayerManager::GetAllPlayers()) { auto* ghostComponent = player->GetComponent(); if (ghostComponent && ghostComponent->IsObserved(toSerialize)) { - Game::server->Send(&stream, player->GetSystemAddress(), false); + Game::server->Send(stream, player->GetSystemAddress(), false); } } } else { - Game::server->Send(&stream, UNASSIGNED_SYSTEM_ADDRESS, true); + Game::server->Send(stream, UNASSIGNED_SYSTEM_ADDRESS, true); } } m_EntitiesToSerialize.clear(); @@ -364,11 +364,11 @@ void EntityManager::ConstructEntity(Entity* entity, const SystemAddress& sysAddr if (sysAddr == UNASSIGNED_SYSTEM_ADDRESS) { if (skipChecks) { - Game::server->Send(&stream, UNASSIGNED_SYSTEM_ADDRESS, true); + Game::server->Send(stream, UNASSIGNED_SYSTEM_ADDRESS, true); } else { for (auto* player : PlayerManager::GetAllPlayers()) { if (player->GetPlayerReadyForUpdates()) { - Game::server->Send(&stream, player->GetSystemAddress(), false); + Game::server->Send(stream, player->GetSystemAddress(), false); } else { auto* ghostComponent = player->GetComponent(); if (ghostComponent) ghostComponent->AddLimboConstruction(entity->GetObjectID()); @@ -376,7 +376,7 @@ void EntityManager::ConstructEntity(Entity* entity, const SystemAddress& sysAddr } } } else { - Game::server->Send(&stream, sysAddr, false); + Game::server->Send(stream, sysAddr, false); } if (entity->IsPlayer()) { @@ -407,7 +407,7 @@ void EntityManager::DestructEntity(Entity* entity, const SystemAddress& sysAddr) stream.Write(ID_REPLICA_MANAGER_DESTRUCTION); stream.Write(entity->GetNetworkId()); - Game::server->Send(&stream, sysAddr, sysAddr == UNASSIGNED_SYSTEM_ADDRESS); + Game::server->Send(stream, sysAddr, sysAddr == UNASSIGNED_SYSTEM_ADDRESS); for (auto* player : PlayerManager::GetAllPlayers()) { if (!player->GetPlayerReadyForUpdates()) { diff --git a/dGame/dBehaviors/BehaviorContext.cpp b/dGame/dBehaviors/BehaviorContext.cpp index cac5d705..1357f54b 100644 --- a/dGame/dBehaviors/BehaviorContext.cpp +++ b/dGame/dBehaviors/BehaviorContext.cpp @@ -258,7 +258,7 @@ bool BehaviorContext::CalculateUpdate(const float deltaTime) { message.Write(this->originator); echo.Serialize(message); - Game::server->Send(&message, UNASSIGNED_SYSTEM_ADDRESS, true); + Game::server->Send(message, UNASSIGNED_SYSTEM_ADDRESS, true); } ExecuteUpdates(); diff --git a/dGame/dComponents/RocketLaunchpadControlComponent.cpp b/dGame/dComponents/RocketLaunchpadControlComponent.cpp index 5a385546..2bc4deec 100644 --- a/dGame/dComponents/RocketLaunchpadControlComponent.cpp +++ b/dGame/dComponents/RocketLaunchpadControlComponent.cpp @@ -139,7 +139,7 @@ void RocketLaunchpadControlComponent::TellMasterToPrepZone(int zoneID) { CBITSTREAM; BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, eMasterMessageType::PREP_ZONE); bitStream.Write(zoneID); - Game::server->SendToMaster(&bitStream); + Game::server->SendToMaster(bitStream); } diff --git a/dGame/dComponents/SkillComponent.cpp b/dGame/dComponents/SkillComponent.cpp index f8957535..d74bb75b 100644 --- a/dGame/dComponents/SkillComponent.cpp +++ b/dGame/dComponents/SkillComponent.cpp @@ -307,7 +307,7 @@ SkillExecutionResult SkillComponent::CalculateBehavior(const uint32_t skillId, c message.Write(this->m_Parent->GetObjectID()); start.Serialize(message); - Game::server->Send(&message, UNASSIGNED_SYSTEM_ADDRESS, true); + Game::server->Send(message, UNASSIGNED_SYSTEM_ADDRESS, true); } context->ExecuteUpdates(); @@ -438,7 +438,7 @@ void SkillComponent::SyncProjectileCalculation(const ProjectileSyncEntry& entry) message.Write(this->m_Parent->GetObjectID()); projectileImpact.Serialize(message); - Game::server->Send(&message, UNASSIGNED_SYSTEM_ADDRESS, true); + Game::server->Send(message, UNASSIGNED_SYSTEM_ADDRESS, true); entry.context->ExecuteUpdates(); } diff --git a/dGame/dGameMessages/GameMessageHandler.cpp b/dGame/dGameMessages/GameMessageHandler.cpp index 3220e230..70b06293 100644 --- a/dGame/dGameMessages/GameMessageHandler.cpp +++ b/dGame/dGameMessages/GameMessageHandler.cpp @@ -329,7 +329,7 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream& inStream, const System echoStartSkill.uiSkillHandle = startSkill.uiSkillHandle; echoStartSkill.Serialize(bitStreamLocal); - Game::server->Send(&bitStreamLocal, entity->GetSystemAddress(), true); + Game::server->Send(bitStreamLocal, entity->GetSystemAddress(), true); } } break; @@ -364,7 +364,7 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream& inStream, const System echo.Serialize(bitStreamLocal); - Game::server->Send(&bitStreamLocal, sysAddr, true); + Game::server->Send(bitStreamLocal, sysAddr, true); } break; case eGameMessageType::REQUEST_SMASH_PLAYER: diff --git a/dGame/dUtilities/Mail.cpp b/dGame/dUtilities/Mail.cpp index b9f4750b..a610c3a7 100644 --- a/dGame/dUtilities/Mail.cpp +++ b/dGame/dUtilities/Mail.cpp @@ -303,7 +303,7 @@ void Mail::HandleDataRequest(RakNet::BitStream& packet, const SystemAddress& sys bitStream.Write(uint32_t(0)); } - Game::server->Send(&bitStream, sysAddr, false); + Game::server->Send(bitStream, sysAddr, false); } void Mail::HandleAttachmentCollect(RakNet::BitStream& packet, const SystemAddress& sysAddr, Entity* player) { @@ -367,7 +367,7 @@ void Mail::SendSendResponse(const SystemAddress& sysAddr, MailSendResponse respo BitStreamUtils::WriteHeader(bitStream, eConnectionType::CLIENT, eClientMessageType::MAIL); bitStream.Write(int(MailMessageID::SendResponse)); bitStream.Write(int(response)); - Game::server->Send(&bitStream, sysAddr, false); + Game::server->Send(bitStream, sysAddr, false); } void Mail::SendNotification(const SystemAddress& sysAddr, int mailCount) { @@ -386,7 +386,7 @@ void Mail::SendNotification(const SystemAddress& sysAddr, int mailCount) { bitStream.Write(s4); bitStream.Write(mailCount); bitStream.Write(int(0)); //Unknown - Game::server->Send(&bitStream, sysAddr, false); + Game::server->Send(bitStream, sysAddr, false); } void Mail::SendAttachmentRemoveConfirm(const SystemAddress& sysAddr, uint64_t mailID) { @@ -395,7 +395,7 @@ void Mail::SendAttachmentRemoveConfirm(const SystemAddress& sysAddr, uint64_t ma bitStream.Write(int(MailMessageID::AttachmentCollectConfirm)); bitStream.Write(int(0)); //unknown bitStream.Write(mailID); - Game::server->Send(&bitStream, sysAddr, false); + Game::server->Send(bitStream, sysAddr, false); } void Mail::SendDeleteConfirm(const SystemAddress& sysAddr, uint64_t mailID, LWOOBJID playerID) { @@ -404,7 +404,7 @@ void Mail::SendDeleteConfirm(const SystemAddress& sysAddr, uint64_t mailID, LWOO bitStream.Write(int(MailMessageID::MailDeleteConfirm)); bitStream.Write(int(0)); //unknown bitStream.Write(mailID); - Game::server->Send(&bitStream, sysAddr, false); + Game::server->Send(bitStream, sysAddr, false); Database::Get()->DeleteMail(mailID); } @@ -415,7 +415,7 @@ void Mail::SendReadConfirm(const SystemAddress& sysAddr, uint64_t mailID) { bitStream.Write(int(MailMessageID::MailReadConfirm)); bitStream.Write(int(0)); //unknown bitStream.Write(mailID); - Game::server->Send(&bitStream, sysAddr, false); + Game::server->Send(bitStream, sysAddr, false); Database::Get()->MarkMailRead(mailID); } diff --git a/dGame/dUtilities/SlashCommandHandler.cpp b/dGame/dUtilities/SlashCommandHandler.cpp index cd938bab..d0620121 100644 --- a/dGame/dUtilities/SlashCommandHandler.cpp +++ b/dGame/dUtilities/SlashCommandHandler.cpp @@ -757,7 +757,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit //Tell the master server that we're going to be shutting down whole "universe": CBITSTREAM; BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, eMasterMessageType::SHUTDOWN_UNIVERSE); - Game::server->SendToMaster(&bitStream); + Game::server->SendToMaster(bitStream); ChatPackets::SendSystemMessage(sysAddr, u"Sent universe shutdown notification to master."); //Tell chat to send an announcement to all servers diff --git a/dMasterServer/InstanceManager.cpp b/dMasterServer/InstanceManager.cpp index 9ae9930c..3ec42634 100644 --- a/dMasterServer/InstanceManager.cpp +++ b/dMasterServer/InstanceManager.cpp @@ -181,7 +181,7 @@ void InstanceManager::RequestAffirmation(Instance* instance, const PendingInstan bitStream.Write(request.id); - Game::server->Send(&bitStream, instance->GetSysAddr(), false); + Game::server->Send(bitStream, instance->GetSysAddr(), false); LOG("Sent affirmation request %llu to %i/%i", request.id, static_cast(instance->GetZoneID().GetMapID()), @@ -361,7 +361,7 @@ void Instance::Shutdown() { BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, eMasterMessageType::SHUTDOWN); - Game::server->Send(&bitStream, this->m_SysAddr, false); + Game::server->Send(bitStream, this->m_SysAddr, false); LOG("Triggered world shutdown for zone/clone/instance %i/%i/%i", GetMapID(), GetCloneID(), GetInstanceID()); } diff --git a/dMasterServer/MasterServer.cpp b/dMasterServer/MasterServer.cpp index 1fade06e..4104f5ea 100644 --- a/dMasterServer/MasterServer.cpp +++ b/dMasterServer/MasterServer.cpp @@ -576,7 +576,7 @@ void HandlePacket(Packet* packet) { BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, eMasterMessageType::SESSION_KEY_RESPONSE); bitStream.Write(key.first); bitStream.Write(username); - Game::server->Send(&bitStream, packet->systemAddress, false); + Game::server->Send(bitStream, packet->systemAddress, false); break; } } @@ -786,7 +786,7 @@ int ShutdownSequence(int32_t signal) { { CBITSTREAM; BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, eMasterMessageType::SHUTDOWN); - Game::server->Send(&bitStream, UNASSIGNED_SYSTEM_ADDRESS, true); + Game::server->Send(bitStream, UNASSIGNED_SYSTEM_ADDRESS, true); LOG("Triggered master shutdown"); } diff --git a/dNet/AuthPackets.cpp b/dNet/AuthPackets.cpp index 266ee610..2ba33ab5 100644 --- a/dNet/AuthPackets.cpp +++ b/dNet/AuthPackets.cpp @@ -84,7 +84,7 @@ void AuthPackets::SendHandshake(dServer* server, const SystemAddress& sysAddr, c else bitStream.Write(ServiceId::General); bitStream.Write(215523405360); - server->Send(&bitStream, sysAddr, false); + server->Send(bitStream, sysAddr, false); } void AuthPackets::HandleLoginRequest(dServer* server, Packet* packet) { @@ -293,14 +293,14 @@ void AuthPackets::SendLoginResponse(dServer* server, const SystemAddress& sysAdd loginResponse.Write((sizeof(Stamp) * stamps.size()) + sizeof(uint32_t)); for (auto& stamp : stamps) stamp.Serialize(loginResponse); - server->Send(&loginResponse, sysAddr, false); + server->Send(loginResponse, sysAddr, false); //Inform the master server that we've created a session for this user: if (responseCode == eLoginResponse::SUCCESS) { CBITSTREAM; BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, eMasterMessageType::SET_SESSION_KEY); bitStream.Write(sessionKey); bitStream.Write(LUString(username)); - server->SendToMaster(&bitStream); + server->SendToMaster(bitStream); LOG("Set sessionKey: %i for user %s", sessionKey, username.c_str()); } diff --git a/dNet/MasterPackets.cpp b/dNet/MasterPackets.cpp index 6d70fedb..7bd8f4a5 100644 --- a/dNet/MasterPackets.cpp +++ b/dNet/MasterPackets.cpp @@ -12,7 +12,7 @@ void MasterPackets::SendPersistentIDRequest(dServer* server, uint64_t requestID) CBITSTREAM; BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, eMasterMessageType::REQUEST_PERSISTENT_ID); bitStream.Write(requestID); - server->SendToMaster(&bitStream); + server->SendToMaster(bitStream); } void MasterPackets::SendPersistentIDResponse(dServer* server, const SystemAddress& sysAddr, uint64_t requestID, uint32_t objID) { @@ -22,7 +22,7 @@ void MasterPackets::SendPersistentIDResponse(dServer* server, const SystemAddres bitStream.Write(requestID); bitStream.Write(objID); - server->Send(&bitStream, sysAddr, false); + server->Send(bitStream, sysAddr, false); } void MasterPackets::SendZoneTransferRequest(dServer* server, uint64_t requestID, bool mythranShift, uint32_t zoneID, uint32_t cloneID) { @@ -34,7 +34,7 @@ void MasterPackets::SendZoneTransferRequest(dServer* server, uint64_t requestID, bitStream.Write(zoneID); bitStream.Write(cloneID); - server->SendToMaster(&bitStream); + server->SendToMaster(bitStream); } void MasterPackets::SendZoneCreatePrivate(dServer* server, uint32_t zoneID, uint32_t cloneID, const std::string& password) { @@ -49,7 +49,7 @@ void MasterPackets::SendZoneCreatePrivate(dServer* server, uint32_t zoneID, uint bitStream.Write(character); } - server->SendToMaster(&bitStream); + server->SendToMaster(bitStream); } void MasterPackets::SendZoneRequestPrivate(dServer* server, uint64_t requestID, bool mythranShift, const std::string& password) { @@ -64,7 +64,7 @@ void MasterPackets::SendZoneRequestPrivate(dServer* server, uint64_t requestID, bitStream.Write(character); } - server->SendToMaster(&bitStream); + server->SendToMaster(bitStream); } void MasterPackets::SendWorldReady(dServer* server, LWOMAPID zoneId, LWOINSTANCEID instanceId) { @@ -74,7 +74,7 @@ void MasterPackets::SendWorldReady(dServer* server, LWOMAPID zoneId, LWOINSTANCE bitStream.Write(zoneId); bitStream.Write(instanceId); - server->SendToMaster(&bitStream); + server->SendToMaster(bitStream); } void MasterPackets::SendZoneTransferResponse(dServer* server, const SystemAddress& sysAddr, uint64_t requestID, bool mythranShift, uint32_t zoneID, uint32_t zoneInstance, uint32_t zoneClone, const std::string& serverIP, uint32_t serverPort) { @@ -89,7 +89,7 @@ void MasterPackets::SendZoneTransferResponse(dServer* server, const SystemAddres bitStream.Write(serverPort); bitStream.Write(LUString(serverIP, 255)); - server->Send(&bitStream, sysAddr, false); + server->Send(bitStream, sysAddr, false); } void MasterPackets::HandleServerInfo(Packet* packet) { @@ -119,5 +119,5 @@ void MasterPackets::SendServerInfo(dServer* server, Packet* packet) { bitStream.Write(server->GetServerType()); bitStream.Write(LUString(server->GetIP())); - server->SendToMaster(&bitStream); + server->SendToMaster(bitStream); } diff --git a/dNet/dServer.cpp b/dNet/dServer.cpp index ed66b42c..e504a985 100644 --- a/dNet/dServer.cpp +++ b/dNet/dServer.cpp @@ -159,13 +159,13 @@ void dServer::DeallocateMasterPacket(Packet* packet) { mMasterPeer->DeallocatePacket(packet); } -void dServer::Send(RakNet::BitStream* bitStream, const SystemAddress& sysAddr, bool broadcast) { - mPeer->Send(bitStream, SYSTEM_PRIORITY, RELIABLE_ORDERED, 0, sysAddr, broadcast); +void dServer::Send(RakNet::BitStream& bitStream, const SystemAddress& sysAddr, bool broadcast) { + mPeer->Send(&bitStream, SYSTEM_PRIORITY, RELIABLE_ORDERED, 0, sysAddr, broadcast); } -void dServer::SendToMaster(RakNet::BitStream* bitStream) { +void dServer::SendToMaster(RakNet::BitStream& bitStream) { if (!mMasterConnectionActive) ConnectToMaster(); - mMasterPeer->Send(bitStream, SYSTEM_PRIORITY, RELIABLE_ORDERED, 0, mMasterSystemAddress, false); + mMasterPeer->Send(&bitStream, SYSTEM_PRIORITY, RELIABLE_ORDERED, 0, mMasterSystemAddress, false); } void dServer::Disconnect(const SystemAddress& sysAddr, eServerDisconnectIdentifiers disconNotifyID) { diff --git a/dNet/dServer.h b/dNet/dServer.h index ef47eea4..40f606f1 100644 --- a/dNet/dServer.h +++ b/dNet/dServer.h @@ -52,8 +52,8 @@ public: Packet* Receive(); void DeallocatePacket(Packet* packet); void DeallocateMasterPacket(Packet* packet); - virtual void Send(RakNet::BitStream* bitStream, const SystemAddress& sysAddr, bool broadcast); - void SendToMaster(RakNet::BitStream* bitStream); + virtual void Send(RakNet::BitStream& bitStream, const SystemAddress& sysAddr, bool broadcast); + void SendToMaster(RakNet::BitStream& bitStream); void Disconnect(const SystemAddress& sysAddr, eServerDisconnectIdentifiers disconNotifyID); diff --git a/dWorldServer/WorldServer.cpp b/dWorldServer/WorldServer.cpp index af282587..fde5a2a6 100644 --- a/dWorldServer/WorldServer.cpp +++ b/dWorldServer/WorldServer.cpp @@ -730,7 +730,7 @@ void HandleMasterPacket(Packet* packet) { BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, eMasterMessageType::PLAYER_ADDED); bitStream.Write((LWOMAPID)Game::server->GetZoneID()); bitStream.Write((LWOINSTANCEID)instanceID); - Game::server->SendToMaster(&bitStream); + Game::server->SendToMaster(bitStream); } } @@ -746,7 +746,7 @@ void HandleMasterPacket(Packet* packet) { BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, eMasterMessageType::AFFIRM_TRANSFER_RESPONSE); bitStream.Write(requestID); - Game::server->SendToMaster(&bitStream); + Game::server->SendToMaster(bitStream); break; } @@ -832,7 +832,7 @@ void HandlePacket(Packet* packet) { BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, eMasterMessageType::PLAYER_REMOVED); bitStream.Write((LWOMAPID)Game::server->GetZoneID()); bitStream.Write((LWOINSTANCEID)instanceID); - Game::server->SendToMaster(&bitStream); + Game::server->SendToMaster(bitStream); } if (packet->data[0] != ID_USER_PACKET_ENUM || packet->length < 4) return; @@ -895,7 +895,7 @@ void HandlePacket(Packet* packet) { CBITSTREAM; BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, eMasterMessageType::REQUEST_SESSION_KEY); bitStream.Write(username); - Game::server->SendToMaster(&bitStream); + Game::server->SendToMaster(bitStream); //Insert info into our pending list tempSessionInfo info; @@ -1461,5 +1461,5 @@ void FinalizeShutdown() { void SendShutdownMessageToMaster() { CBITSTREAM; BitStreamUtils::WriteHeader(bitStream, eConnectionType::MASTER, eMasterMessageType::SHUTDOWN_RESPONSE); - Game::server->SendToMaster(&bitStream); + Game::server->SendToMaster(bitStream); } diff --git a/tests/dGameTests/GameDependencies.h b/tests/dGameTests/GameDependencies.h index 5d9c99bf..52e3919a 100644 --- a/tests/dGameTests/GameDependencies.h +++ b/tests/dGameTests/GameDependencies.h @@ -19,7 +19,7 @@ public: dServerMock() {}; ~dServerMock() {}; RakNet::BitStream* GetMostRecentBitStream() { return sentBitStream; }; - void Send(RakNet::BitStream* bitStream, const SystemAddress& sysAddr, bool broadcast) override { sentBitStream = bitStream; }; + void Send(RakNet::BitStream& bitStream, const SystemAddress& sysAddr, bool broadcast) override { sentBitStream = &bitStream; }; }; class GameDependenciesTest : public ::testing::Test {