mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-28 07:32:00 -04:00
Add ContainsPacket method to packet controllers
This commit is contained in:
parent
f1ec01cc6b
commit
f0fa5e8771
@ -73,4 +73,13 @@ void mwmp::PlayerPacketController::SetStream(RakNet::BitStream *inStream, RakNet
|
|||||||
{
|
{
|
||||||
BOOST_FOREACH( packets_t::value_type &packet, packets )
|
BOOST_FOREACH( packets_t::value_type &packet, packets )
|
||||||
packet.second->SetStreams(inStream, outStream);
|
packet.second->SetStreams(inStream, outStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool mwmp::PlayerPacketController::ContainsPacket(RakNet::MessageID id)
|
||||||
|
{
|
||||||
|
BOOST_FOREACH(packets_t::value_type &packet, packets) {
|
||||||
|
if (packet.first == id)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
@ -16,6 +16,8 @@ namespace mwmp
|
|||||||
PlayerPacket *GetPacket(RakNet::MessageID id);
|
PlayerPacket *GetPacket(RakNet::MessageID id);
|
||||||
void SetStream(RakNet::BitStream *inStream, RakNet::BitStream *outStream);
|
void SetStream(RakNet::BitStream *inStream, RakNet::BitStream *outStream);
|
||||||
|
|
||||||
|
bool ContainsPacket(RakNet::MessageID id);
|
||||||
|
|
||||||
typedef std::map<unsigned char, boost::shared_ptr<PlayerPacket> > packets_t;
|
typedef std::map<unsigned char, boost::shared_ptr<PlayerPacket> > packets_t;
|
||||||
private:
|
private:
|
||||||
packets_t packets;
|
packets_t packets;
|
||||||
|
@ -29,4 +29,13 @@ void mwmp::WorldPacketController::SetStream(RakNet::BitStream *inStream, RakNet:
|
|||||||
{
|
{
|
||||||
BOOST_FOREACH( packets_t::value_type &packet, packets )
|
BOOST_FOREACH( packets_t::value_type &packet, packets )
|
||||||
packet.second->SetStreams(inStream, outStream);
|
packet.second->SetStreams(inStream, outStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool mwmp::WorldPacketController::ContainsPacket(RakNet::MessageID id)
|
||||||
|
{
|
||||||
|
BOOST_FOREACH(packets_t::value_type &packet, packets) {
|
||||||
|
if (packet.first == id)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
@ -16,6 +16,8 @@ namespace mwmp
|
|||||||
WorldPacket *GetPacket(RakNet::MessageID id);
|
WorldPacket *GetPacket(RakNet::MessageID id);
|
||||||
void SetStream(RakNet::BitStream *inStream, RakNet::BitStream *outStream);
|
void SetStream(RakNet::BitStream *inStream, RakNet::BitStream *outStream);
|
||||||
|
|
||||||
|
bool ContainsPacket(RakNet::MessageID id);
|
||||||
|
|
||||||
typedef std::map<unsigned char, boost::shared_ptr<WorldPacket> > packets_t;
|
typedef std::map<unsigned char, boost::shared_ptr<WorldPacket> > packets_t;
|
||||||
private:
|
private:
|
||||||
packets_t packets;
|
packets_t packets;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user