1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 04:49:54 +00:00
openmw-tes3mp/components/openmw-mp/Packets/World/WorldPacket.hpp
2016-10-20 14:28:19 +03:00

46 lines
1.1 KiB
C++

#ifndef OPENMW_WORLDPACKET_HPP
#define OPENMW_WORLDPACKET_HPP
#include <string>
#include <RakNetTypes.h>
#include <BitStream.h>
#include <PacketPriority.h>
#include <components/openmw-mp/Base/WorldEvent.hpp>
#include <components/openmw-mp/Packets/BasePacket.hpp>
namespace mwmp
{
class WorldPacket : public BasePacket
{
public:
WorldPacket(RakNet::RakPeerInterface *peer);
~WorldPacket();
virtual void Packet(RakNet::BitStream *bs, WorldEvent *event, bool send);
virtual void Send(WorldEvent *event, bool toOtherPlayers = true);
virtual void Send(WorldEvent *event, RakNet::AddressOrGUID destination);
virtual void Read(WorldEvent *event);
virtual void RequestData(RakNet::RakNetGUID guid);
static size_t headerSize()
{
return (size_t)(1 + RakNet::RakNetGUID::size()); // packetID + RakNetGUID (uint64_t)
}
unsigned char GetPacketID()
{
return packetID;
}
protected:
WorldEvent *event;
};
}
#endif //OPENMW_WORLDPACKET_HPP