diff --git a/apps/openmw/mwmp/Networking.cpp b/apps/openmw/mwmp/Networking.cpp index 1628c06a4..7fdbed316 100644 --- a/apps/openmw/mwmp/Networking.cpp +++ b/apps/openmw/mwmp/Networking.cpp @@ -249,24 +249,6 @@ void Networking::preInit(std::vector &content, Files::Collections & } } -void Networking::processPlayerPacket(RakNet::Packet *packet) -{ - if(!PlayerProcessor::Process(*packet)) - LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Unhandled PlayerPacket with identifier %i has arrived", packet->data[0]); -} - -void Networking::processActorPacket(RakNet::Packet *packet) -{ - if (!ActorProcessor::Process(*packet, actorList)) - LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Unhandled ActorPacket with identifier %i has arrived", packet->data[0]); -} - -void Networking::processWorldPacket(RakNet::Packet *packet) -{ - if (!WorldProcessor::Process(*packet, worldEvent)) - LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Unhandled WorldPacket with identifier %i has arrived", packet->data[0]); -} - void Networking::receiveMessage(RakNet::Packet *packet) { if (packet->length < 2) @@ -274,15 +256,18 @@ void Networking::receiveMessage(RakNet::Packet *packet) if (playerPacketController.ContainsPacket(packet->data[0])) { - processPlayerPacket(packet); + if(!PlayerProcessor::Process(*packet)) + LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Unhandled PlayerPacket with identifier %i has arrived", packet->data[0]); } else if (actorPacketController.ContainsPacket(packet->data[0])) { - processActorPacket(packet); + if (!ActorProcessor::Process(*packet, actorList)) + LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Unhandled ActorPacket with identifier %i has arrived", packet->data[0]); } else if (worldPacketController.ContainsPacket(packet->data[0])) { - processWorldPacket(packet); + if (!WorldProcessor::Process(*packet, worldEvent)) + LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Unhandled WorldPacket with identifier %i has arrived", packet->data[0]); } } diff --git a/apps/openmw/mwmp/Networking.hpp b/apps/openmw/mwmp/Networking.hpp index e82b024e7..49f256669 100644 --- a/apps/openmw/mwmp/Networking.hpp +++ b/apps/openmw/mwmp/Networking.hpp @@ -62,10 +62,6 @@ namespace mwmp ActorList actorList; WorldEvent worldEvent; - void processPlayerPacket(RakNet::Packet *packet); - void processActorPacket(RakNet::Packet *packet); - void processWorldPacket(RakNet::Packet *packet); - void receiveMessage(RakNet::Packet *packet); void preInit(std::vector &content, Files::Collections &collections);