2016-10-19 13:31:07 +00:00
|
|
|
#ifndef OPENMW_PLAYERPACKETCONTROLLER_HPP
|
|
|
|
#define OPENMW_PLAYERPACKETCONTROLLER_HPP
|
2016-01-12 03:41:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
#include <RakPeerInterface.h>
|
2016-10-19 16:37:10 +00:00
|
|
|
#include "../Packets/Player/PlayerPacket.hpp"
|
2017-06-27 14:41:37 +00:00
|
|
|
#include <unordered_map>
|
|
|
|
#include <memory>
|
2016-01-12 03:41:44 +00:00
|
|
|
|
|
|
|
namespace mwmp
|
|
|
|
{
|
2016-10-19 13:31:07 +00:00
|
|
|
class PlayerPacketController
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
|
|
|
public:
|
2016-10-19 13:31:07 +00:00
|
|
|
PlayerPacketController(RakNet::RakPeerInterface *peer);
|
2016-10-17 12:54:36 +00:00
|
|
|
PlayerPacket *GetPacket(RakNet::MessageID id);
|
2016-01-12 03:41:44 +00:00
|
|
|
void SetStream(RakNet::BitStream *inStream, RakNet::BitStream *outStream);
|
|
|
|
|
2016-10-19 18:15:59 +00:00
|
|
|
bool ContainsPacket(RakNet::MessageID id);
|
|
|
|
|
2017-06-27 14:41:37 +00:00
|
|
|
typedef std::unordered_map<unsigned char, std::unique_ptr<PlayerPacket> > packets_t;
|
2016-01-12 03:41:44 +00:00
|
|
|
private:
|
2016-08-29 12:26:22 +00:00
|
|
|
packets_t packets;
|
2016-01-12 03:41:44 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2016-10-19 13:31:07 +00:00
|
|
|
#endif //OPENMW_PLAYERPACKETCONTROLLER_HPP
|