From 1d2a6d90567a54b0c56411864858b270391745d0 Mon Sep 17 00:00:00 2001 From: Koncord Date: Mon, 3 Apr 2017 06:44:14 +0800 Subject: [PATCH] [Server] Rename dontRead to avoidReading --- apps/openmw-mp/PlayerProcessor.cpp | 2 +- apps/openmw-mp/WorldProcessor.cpp | 4 +++- apps/openmw-mp/processors/player/ProcessorPlayerDeath.hpp | 2 +- apps/openmw-mp/processors/player/ProcessorPlayerResurrect.hpp | 2 +- apps/openmw-mp/processors/player/ProcessorPlayerSpellbook.hpp | 2 +- components/openmw-mp/Base/BasePacketProcessor.hpp | 4 ++-- 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/apps/openmw-mp/PlayerProcessor.cpp b/apps/openmw-mp/PlayerProcessor.cpp index 61ab1e1e3..05885ea90 100644 --- a/apps/openmw-mp/PlayerProcessor.cpp +++ b/apps/openmw-mp/PlayerProcessor.cpp @@ -32,7 +32,7 @@ bool PlayerProcessor::Process(RakNet::Packet &packet) noexcept PlayerPacket *myPacket = Networking::get().getPlayerController()->GetPacket(packet.data[0]); myPacket->setPlayer(player); - if(!processor.second->dontRead) + if(!processor.second->avoidReading) myPacket->Read(); processor.second->Do(*myPacket, *player); diff --git a/apps/openmw-mp/WorldProcessor.cpp b/apps/openmw-mp/WorldProcessor.cpp index 7a289b79f..fdd60517d 100644 --- a/apps/openmw-mp/WorldProcessor.cpp +++ b/apps/openmw-mp/WorldProcessor.cpp @@ -41,8 +41,10 @@ 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); - if(!processor.second->dontRead) + + if(!processor.second->avoidReading) myPacket->Read(); + processor.second->Do(*myPacket, *player, baseEvent); return true; } diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerDeath.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerDeath.hpp index c804e5ec2..d40c7db6c 100644 --- a/apps/openmw-mp/processors/player/ProcessorPlayerDeath.hpp +++ b/apps/openmw-mp/processors/player/ProcessorPlayerDeath.hpp @@ -17,7 +17,7 @@ namespace mwmp ProcessorPlayerDeath() { BPP_INIT(ID_PLAYER_DEATH) - dontRead = true; + avoidReading = true; } void Do(PlayerPacket &packet, Player &player) override diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerResurrect.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerResurrect.hpp index d026e9dd5..88c2ba20e 100644 --- a/apps/openmw-mp/processors/player/ProcessorPlayerResurrect.hpp +++ b/apps/openmw-mp/processors/player/ProcessorPlayerResurrect.hpp @@ -16,7 +16,7 @@ namespace mwmp ProcessorPlayerResurrect() { BPP_INIT(ID_PLAYER_RESURRECT) - dontRead = true; + avoidReading = true; } void Do(PlayerPacket &packet, Player &player) override diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerSpellbook.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerSpellbook.hpp index 3a53bd0dc..a1860d408 100644 --- a/apps/openmw-mp/processors/player/ProcessorPlayerSpellbook.hpp +++ b/apps/openmw-mp/processors/player/ProcessorPlayerSpellbook.hpp @@ -20,7 +20,7 @@ namespace mwmp void Do(PlayerPacket &packet, Player &player) override { DEBUG_PRINTF(strPacketID.c_str()); - + Script::Call(player.getId()); } }; diff --git a/components/openmw-mp/Base/BasePacketProcessor.hpp b/components/openmw-mp/Base/BasePacketProcessor.hpp index b0e4ec8e4..8941ef32a 100644 --- a/components/openmw-mp/Base/BasePacketProcessor.hpp +++ b/components/openmw-mp/Base/BasePacketProcessor.hpp @@ -7,7 +7,7 @@ #include -#define BPP_INIT(packet_id) packetID = packet_id; strPacketID = #packet_id; className = typeid(this).name(); dontRead = false; +#define BPP_INIT(packet_id) packetID = packet_id; strPacketID = #packet_id; className = typeid(this).name(); avoidReading = false; class BasePacketProcessor { @@ -30,7 +30,7 @@ protected: unsigned char packetID; std::string strPacketID; std::string className; - bool dontRead; + bool avoidReading; };