diff --git a/apps/openmw-mp/PlayerProcessor.cpp b/apps/openmw-mp/PlayerProcessor.cpp index 8ff803d54..61ab1e1e3 100644 --- a/apps/openmw-mp/PlayerProcessor.cpp +++ b/apps/openmw-mp/PlayerProcessor.cpp @@ -32,6 +32,9 @@ bool PlayerProcessor::Process(RakNet::Packet &packet) noexcept PlayerPacket *myPacket = Networking::get().getPlayerController()->GetPacket(packet.data[0]); myPacket->setPlayer(player); + if(!processor.second->dontRead) + myPacket->Read(); + processor.second->Do(*myPacket, *player); return true; } diff --git a/apps/openmw-mp/WorldProcessor.cpp b/apps/openmw-mp/WorldProcessor.cpp index 9709858be..7a289b79f 100644 --- a/apps/openmw-mp/WorldProcessor.cpp +++ b/apps/openmw-mp/WorldProcessor.cpp @@ -41,7 +41,8 @@ bool WorldProcessor::Process(RakNet::Packet &packet) noexcept LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Received %s from %s", processor.second->strPacketID.c_str(), player->npc.mName.c_str()); myPacket->setEvent(&baseEvent); - myPacket->Read(); + if(!processor.second->dontRead) + myPacket->Read(); processor.second->Do(*myPacket, *player, baseEvent); return true; } diff --git a/apps/openmw-mp/processors/player/ProcessorChatMsg.hpp b/apps/openmw-mp/processors/player/ProcessorChatMsg.hpp index f146113f7..6a82bc314 100644 --- a/apps/openmw-mp/processors/player/ProcessorChatMsg.hpp +++ b/apps/openmw-mp/processors/player/ProcessorChatMsg.hpp @@ -22,7 +22,6 @@ namespace mwmp { DEBUG_PRINTF(strPacketID.c_str()); - packet.Read(); Script::CallBackReturn result = true; Script::Call(result, player.getId(), player.chatMessage.c_str()); diff --git a/apps/openmw-mp/processors/player/ProcessorGUIMessageBox.hpp b/apps/openmw-mp/processors/player/ProcessorGUIMessageBox.hpp index c3684d1ce..61a1f7253 100644 --- a/apps/openmw-mp/processors/player/ProcessorGUIMessageBox.hpp +++ b/apps/openmw-mp/processors/player/ProcessorGUIMessageBox.hpp @@ -22,8 +22,6 @@ namespace mwmp { DEBUG_PRINTF(strPacketID.c_str()); - packet.Read(); - Script::Call(player.getId(), (int)player.guiMessageBox.id, player.guiMessageBox.data.c_str()); } diff --git a/apps/openmw-mp/processors/player/ProcessorLevel.hpp b/apps/openmw-mp/processors/player/ProcessorLevel.hpp index 6886ef697..0742d0e28 100644 --- a/apps/openmw-mp/processors/player/ProcessorLevel.hpp +++ b/apps/openmw-mp/processors/player/ProcessorLevel.hpp @@ -22,9 +22,6 @@ namespace mwmp { if (!player.creatureStats.mDead) { - packet.Read(); - //packet.Send(&player, true); - Script::Call(player.getId()); } } diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerAttack.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerAttack.hpp index e120f2002..e4d26a72a 100644 --- a/apps/openmw-mp/processors/player/ProcessorPlayerAttack.hpp +++ b/apps/openmw-mp/processors/player/ProcessorPlayerAttack.hpp @@ -26,8 +26,6 @@ namespace mwmp if (!player.creatureStats.mDead) { - packet.Read(); - Player *target = Players::getPlayer(player.attack.target); if (target == nullptr) diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerAttribute.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerAttribute.hpp index 8a9111c3a..298fbb912 100644 --- a/apps/openmw-mp/processors/player/ProcessorPlayerAttribute.hpp +++ b/apps/openmw-mp/processors/player/ProcessorPlayerAttribute.hpp @@ -22,7 +22,6 @@ namespace mwmp { if (!player.creatureStats.mDead) { - packet.Read(); //myPacket->Send(player, true); player.sendToLoaded(&packet); diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerCellChange.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerCellChange.hpp index 38a6ef6a3..b2c058400 100644 --- a/apps/openmw-mp/processors/player/ProcessorPlayerCellChange.hpp +++ b/apps/openmw-mp/processors/player/ProcessorPlayerCellChange.hpp @@ -28,8 +28,6 @@ namespace mwmp if (!player.creatureStats.mDead) { - packet.Read(); - LOG_APPEND(Log::LOG_INFO, "- Moved to %s", player.cell.getDescription().c_str()); player.forEachLoaded([this](Player *pl, Player *other) { diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerCellState.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerCellState.hpp index c658405a7..ff1339a1c 100644 --- a/apps/openmw-mp/processors/player/ProcessorPlayerCellState.hpp +++ b/apps/openmw-mp/processors/player/ProcessorPlayerCellState.hpp @@ -27,8 +27,6 @@ namespace mwmp { LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID, player.npc.mName.c_str()); - packet.Read(); - CellController::get()->update(&player); Script::Call(player.getId()); diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerCharClass.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerCharClass.hpp index 2c9caf4c2..4b17446eb 100644 --- a/apps/openmw-mp/processors/player/ProcessorPlayerCharClass.hpp +++ b/apps/openmw-mp/processors/player/ProcessorPlayerCharClass.hpp @@ -21,8 +21,6 @@ namespace mwmp void Do(PlayerPacket &packet, Player &player) override { DEBUG_PRINTF(strPacketID.c_str()); - - packet.Read(); } }; } diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerCharGen.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerCharGen.hpp index fd24f9b08..04b056086 100644 --- a/apps/openmw-mp/processors/player/ProcessorPlayerCharGen.hpp +++ b/apps/openmw-mp/processors/player/ProcessorPlayerCharGen.hpp @@ -22,8 +22,6 @@ namespace mwmp { DEBUG_PRINTF(strPacketID.c_str()); - packet.Read(); - if (player.charGenStage.current == player.charGenStage.end && player.charGenStage.current != 0) Script::Call(player.getId()); } diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerDeath.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerDeath.hpp index 18c2bb136..c804e5ec2 100644 --- a/apps/openmw-mp/processors/player/ProcessorPlayerDeath.hpp +++ b/apps/openmw-mp/processors/player/ProcessorPlayerDeath.hpp @@ -17,6 +17,7 @@ namespace mwmp ProcessorPlayerDeath() { BPP_INIT(ID_PLAYER_DEATH) + dontRead = true; } void Do(PlayerPacket &packet, Player &player) override diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerDrawState.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerDrawState.hpp index 7580b53e3..eff03f0d4 100644 --- a/apps/openmw-mp/processors/player/ProcessorPlayerDrawState.hpp +++ b/apps/openmw-mp/processors/player/ProcessorPlayerDrawState.hpp @@ -22,9 +22,6 @@ namespace mwmp { DEBUG_PRINTF(strPacketID.c_str()); - packet.Read(); - //packet.Send(&player, true); - player.sendToLoaded(&packet); } }; diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerDynamicStats.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerDynamicStats.hpp index fd7193a55..3a3e6c58d 100644 --- a/apps/openmw-mp/processors/player/ProcessorPlayerDynamicStats.hpp +++ b/apps/openmw-mp/processors/player/ProcessorPlayerDynamicStats.hpp @@ -22,8 +22,6 @@ namespace mwmp { DEBUG_PRINTF(strPacketID.c_str()); - packet.Read(); - player.sendToLoaded(&packet); } }; diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerEquipment.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerEquipment.hpp index edb052eb9..a3c8530ff 100644 --- a/apps/openmw-mp/processors/player/ProcessorPlayerEquipment.hpp +++ b/apps/openmw-mp/processors/player/ProcessorPlayerEquipment.hpp @@ -22,9 +22,6 @@ namespace mwmp { DEBUG_PRINTF(strPacketID.c_str()); - packet.Read(); - //myPacket->Send(player, true); - player.sendToLoaded(&packet); Script::Call(player.getId()); diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerInventory.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerInventory.hpp index df33e2079..165411244 100644 --- a/apps/openmw-mp/processors/player/ProcessorPlayerInventory.hpp +++ b/apps/openmw-mp/processors/player/ProcessorPlayerInventory.hpp @@ -21,8 +21,6 @@ namespace mwmp { DEBUG_PRINTF(strPacketID.c_str()); - packet.Read(); - Script::Call(player.getId()); } }; diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerJournal.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerJournal.hpp index e299da204..addcb45bd 100644 --- a/apps/openmw-mp/processors/player/ProcessorPlayerJournal.hpp +++ b/apps/openmw-mp/processors/player/ProcessorPlayerJournal.hpp @@ -22,8 +22,6 @@ namespace mwmp { DEBUG_PRINTF(strPacketID.c_str()); - packet.Read(); - Script::Call(player.getId()); } }; diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerPos.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerPos.hpp index 861f34db4..a941735e4 100644 --- a/apps/openmw-mp/processors/player/ProcessorPlayerPos.hpp +++ b/apps/openmw-mp/processors/player/ProcessorPlayerPos.hpp @@ -22,9 +22,6 @@ namespace mwmp //DEBUG_PRINTF(strPacketID); if (!player.creatureStats.mDead) { - packet.Read(); - //myPacket.Send(player, true); //send to other clients - player.sendToLoaded(&packet); } } diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerResurrect.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerResurrect.hpp index 05c312866..d026e9dd5 100644 --- a/apps/openmw-mp/processors/player/ProcessorPlayerResurrect.hpp +++ b/apps/openmw-mp/processors/player/ProcessorPlayerResurrect.hpp @@ -16,6 +16,7 @@ namespace mwmp ProcessorPlayerResurrect() { BPP_INIT(ID_PLAYER_RESURRECT) + dontRead = true; } void Do(PlayerPacket &packet, Player &player) override diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerSkill.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerSkill.hpp index 4c0024ab6..a67189af4 100644 --- a/apps/openmw-mp/processors/player/ProcessorPlayerSkill.hpp +++ b/apps/openmw-mp/processors/player/ProcessorPlayerSkill.hpp @@ -21,7 +21,6 @@ namespace mwmp { if (!player.creatureStats.mDead) { - packet.Read(); //myPacket->Send(player, true); player.sendToLoaded(&packet); diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerSpellbook.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerSpellbook.hpp index 24b869c92..3a53bd0dc 100644 --- a/apps/openmw-mp/processors/player/ProcessorPlayerSpellbook.hpp +++ b/apps/openmw-mp/processors/player/ProcessorPlayerSpellbook.hpp @@ -21,8 +21,6 @@ namespace mwmp { DEBUG_PRINTF(strPacketID.c_str()); - packet.Read(); - Script::Call(player.getId()); } };