2018-05-16 21:08:37 +00:00
|
|
|
#ifndef OPENMW_OBJECTPACKETCONTROLLER_HPP
|
|
|
|
#define OPENMW_OBJECTPACKETCONTROLLER_HPP
|
2016-10-19 17:36:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
#include <RakPeerInterface.h>
|
2018-05-12 16:40:00 +00:00
|
|
|
#include "../Packets/Object/ObjectPacket.hpp"
|
2017-06-27 14:41:37 +00:00
|
|
|
#include <unordered_map>
|
|
|
|
#include <memory>
|
2016-10-19 17:36:11 +00:00
|
|
|
|
|
|
|
namespace mwmp
|
|
|
|
{
|
2018-05-12 16:40:00 +00:00
|
|
|
class ObjectPacketController
|
2016-10-19 17:36:11 +00:00
|
|
|
{
|
|
|
|
public:
|
2018-05-12 16:40:00 +00:00
|
|
|
ObjectPacketController(RakNet::RakPeerInterface *peer);
|
|
|
|
ObjectPacket *GetPacket(RakNet::MessageID id);
|
2016-10-19 17:36:11 +00:00
|
|
|
void SetStream(RakNet::BitStream *inStream, RakNet::BitStream *outStream);
|
|
|
|
|
2016-10-19 18:15:59 +00:00
|
|
|
bool ContainsPacket(RakNet::MessageID id);
|
|
|
|
|
2018-05-12 16:40:00 +00:00
|
|
|
typedef std::unordered_map<unsigned char, std::unique_ptr<ObjectPacket> > packets_t;
|
2016-10-19 17:36:11 +00:00
|
|
|
private:
|
|
|
|
packets_t packets;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2018-05-16 21:08:37 +00:00
|
|
|
#endif //OPENMW_OBJECTPACKETCONTROLLER_HPP
|