mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 22:23:51 +00:00
[Server] Rename dontRead to avoidReading
This commit is contained in:
parent
47924f5bb0
commit
1d2a6d9056
6 changed files with 9 additions and 7 deletions
|
@ -32,7 +32,7 @@ bool PlayerProcessor::Process(RakNet::Packet &packet) noexcept
|
||||||
PlayerPacket *myPacket = Networking::get().getPlayerController()->GetPacket(packet.data[0]);
|
PlayerPacket *myPacket = Networking::get().getPlayerController()->GetPacket(packet.data[0]);
|
||||||
myPacket->setPlayer(player);
|
myPacket->setPlayer(player);
|
||||||
|
|
||||||
if(!processor.second->dontRead)
|
if(!processor.second->avoidReading)
|
||||||
myPacket->Read();
|
myPacket->Read();
|
||||||
|
|
||||||
processor.second->Do(*myPacket, *player);
|
processor.second->Do(*myPacket, *player);
|
||||||
|
|
|
@ -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(),
|
LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Received %s from %s", processor.second->strPacketID.c_str(),
|
||||||
player->npc.mName.c_str());
|
player->npc.mName.c_str());
|
||||||
myPacket->setEvent(&baseEvent);
|
myPacket->setEvent(&baseEvent);
|
||||||
if(!processor.second->dontRead)
|
|
||||||
|
if(!processor.second->avoidReading)
|
||||||
myPacket->Read();
|
myPacket->Read();
|
||||||
|
|
||||||
processor.second->Do(*myPacket, *player, baseEvent);
|
processor.second->Do(*myPacket, *player, baseEvent);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ namespace mwmp
|
||||||
ProcessorPlayerDeath()
|
ProcessorPlayerDeath()
|
||||||
{
|
{
|
||||||
BPP_INIT(ID_PLAYER_DEATH)
|
BPP_INIT(ID_PLAYER_DEATH)
|
||||||
dontRead = true;
|
avoidReading = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Do(PlayerPacket &packet, Player &player) override
|
void Do(PlayerPacket &packet, Player &player) override
|
||||||
|
|
|
@ -16,7 +16,7 @@ namespace mwmp
|
||||||
ProcessorPlayerResurrect()
|
ProcessorPlayerResurrect()
|
||||||
{
|
{
|
||||||
BPP_INIT(ID_PLAYER_RESURRECT)
|
BPP_INIT(ID_PLAYER_RESURRECT)
|
||||||
dontRead = true;
|
avoidReading = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Do(PlayerPacket &packet, Player &player) override
|
void Do(PlayerPacket &packet, Player &player) override
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#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
|
class BasePacketProcessor
|
||||||
{
|
{
|
||||||
|
@ -30,7 +30,7 @@ protected:
|
||||||
unsigned char packetID;
|
unsigned char packetID;
|
||||||
std::string strPacketID;
|
std::string strPacketID;
|
||||||
std::string className;
|
std::string className;
|
||||||
bool dontRead;
|
bool avoidReading;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue