diff --git a/components/openmw-mp/Controllers/PlayerPacketController.cpp b/components/openmw-mp/Controllers/PlayerPacketController.cpp index ed232d985..5817069fe 100644 --- a/components/openmw-mp/Controllers/PlayerPacketController.cpp +++ b/components/openmw-mp/Controllers/PlayerPacketController.cpp @@ -73,4 +73,13 @@ void mwmp::PlayerPacketController::SetStream(RakNet::BitStream *inStream, RakNet { BOOST_FOREACH( packets_t::value_type &packet, packets ) packet.second->SetStreams(inStream, outStream); -} \ No newline at end of file +} + +bool mwmp::PlayerPacketController::ContainsPacket(RakNet::MessageID id) +{ + BOOST_FOREACH(packets_t::value_type &packet, packets) { + if (packet.first == id) + return true; + } + return false; +} diff --git a/components/openmw-mp/Controllers/PlayerPacketController.hpp b/components/openmw-mp/Controllers/PlayerPacketController.hpp index 1938edb50..fc2927c65 100644 --- a/components/openmw-mp/Controllers/PlayerPacketController.hpp +++ b/components/openmw-mp/Controllers/PlayerPacketController.hpp @@ -16,6 +16,8 @@ namespace mwmp PlayerPacket *GetPacket(RakNet::MessageID id); void SetStream(RakNet::BitStream *inStream, RakNet::BitStream *outStream); + bool ContainsPacket(RakNet::MessageID id); + typedef std::map > packets_t; private: packets_t packets; diff --git a/components/openmw-mp/Controllers/WorldPacketController.cpp b/components/openmw-mp/Controllers/WorldPacketController.cpp index 3a077892e..b3295ceb8 100644 --- a/components/openmw-mp/Controllers/WorldPacketController.cpp +++ b/components/openmw-mp/Controllers/WorldPacketController.cpp @@ -29,4 +29,13 @@ void mwmp::WorldPacketController::SetStream(RakNet::BitStream *inStream, RakNet: { BOOST_FOREACH( packets_t::value_type &packet, packets ) packet.second->SetStreams(inStream, outStream); -} \ No newline at end of file +} + +bool mwmp::WorldPacketController::ContainsPacket(RakNet::MessageID id) +{ + BOOST_FOREACH(packets_t::value_type &packet, packets) { + if (packet.first == id) + return true; + } + return false; +} diff --git a/components/openmw-mp/Controllers/WorldPacketController.hpp b/components/openmw-mp/Controllers/WorldPacketController.hpp index 8831a2e66..d96a8c886 100644 --- a/components/openmw-mp/Controllers/WorldPacketController.hpp +++ b/components/openmw-mp/Controllers/WorldPacketController.hpp @@ -16,6 +16,8 @@ namespace mwmp WorldPacket *GetPacket(RakNet::MessageID id); void SetStream(RakNet::BitStream *inStream, RakNet::BitStream *outStream); + bool ContainsPacket(RakNet::MessageID id); + typedef std::map > packets_t; private: packets_t packets;