1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 05:49:56 +00:00
openmw-tes3mp/components/openmw-mp/Packets/Player/PlayerPacket.hpp

45 lines
1 KiB
C++
Raw Normal View History

2016-10-17 12:54:36 +00:00
#ifndef OPENMW_PLAYERPACKET_HPP
#define OPENMW_PLAYERPACKET_HPP
#include <string>
#include <RakNetTypes.h>
#include <BitStream.h>
#include <PacketPriority.h>
#include <components/openmw-mp/Base/BasePlayer.hpp>
#include <components/openmw-mp/Packets/BasePacket.hpp>
namespace mwmp
{
class PlayerPacket : public BasePacket
{
public:
2016-10-17 12:54:36 +00:00
PlayerPacket(RakNet::RakPeerInterface *peer);
2016-10-17 12:54:36 +00:00
~PlayerPacket();
virtual void Packet(RakNet::BitStream *bs, BasePlayer *player, bool send);
virtual void Send(BasePlayer *player, bool toOtherPlayers = true);
virtual void Send(BasePlayer *player, RakNet::AddressOrGUID destination);
virtual void Read(BasePlayer *player);
static size_t headerSize()
{
2016-09-04 10:38:49 +00:00
return (size_t)(1 + RakNet::RakNetGUID::size()); // packetID + RakNetGUID (uint64_t)
}
2016-08-29 13:03:04 +00:00
unsigned char GetPacketID()
{
return packetID;
}
protected:
BasePlayer *player;
};
}
2016-10-17 12:54:36 +00:00
#endif //OPENMW_PLAYERPACKET_HPP