forked from teamnwah/openmw-tes3coop
Add ContainsPacket method to packet controllers
This commit is contained in:
parent
f1ec01cc6b
commit
f0fa5e8771
4 changed files with 24 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
void SetStream(RakNet::BitStream *inStream, RakNet::BitStream *outStream);
|
||||
|
||||
bool ContainsPacket(RakNet::MessageID id);
|
||||
|
||||
typedef std::map<unsigned char, boost::shared_ptr<PlayerPacket> > packets_t;
|
||||
private:
|
||||
packets_t packets;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
void SetStream(RakNet::BitStream *inStream, RakNet::BitStream *outStream);
|
||||
|
||||
bool ContainsPacket(RakNet::MessageID id);
|
||||
|
||||
typedef std::map<unsigned char, boost::shared_ptr<WorldPacket> > packets_t;
|
||||
private:
|
||||
packets_t packets;
|
||||
|
|
Loading…
Reference in a new issue