2017-04-05 01:06:45 +00:00
|
|
|
#include <components/openmw-mp/NetworkMessages.hpp>
|
|
|
|
#include "PacketActorAuthority.hpp"
|
|
|
|
|
|
|
|
using namespace mwmp;
|
|
|
|
|
2017-04-09 05:51:28 +00:00
|
|
|
PacketActorAuthority::PacketActorAuthority(RakNet::RakPeerInterface *peer) : ActorPacket(peer)
|
2017-04-05 01:06:45 +00:00
|
|
|
{
|
|
|
|
packetID = ID_ACTOR_AUTHORITY;
|
|
|
|
}
|
|
|
|
|
|
|
|
void PacketActorAuthority::Packet(RakNet::BitStream *bs, bool send)
|
|
|
|
{
|
2017-04-09 05:51:28 +00:00
|
|
|
ActorPacket::Packet(bs, send);
|
2017-04-05 01:06:45 +00:00
|
|
|
|
|
|
|
if (!send)
|
2017-04-09 13:32:44 +00:00
|
|
|
actorList->baseActors.clear();
|
2017-04-05 01:06:45 +00:00
|
|
|
else
|
2017-04-09 13:32:44 +00:00
|
|
|
actorList->count = (unsigned int)(actorList->baseActors.size());
|
2017-04-05 01:06:45 +00:00
|
|
|
|
2017-04-09 13:32:44 +00:00
|
|
|
RW(actorList->count, send);
|
2017-04-05 01:06:45 +00:00
|
|
|
|
2017-04-09 13:32:44 +00:00
|
|
|
RW(actorList->cell.mData.mFlags, send);
|
|
|
|
RW(actorList->cell.mData.mX, send);
|
|
|
|
RW(actorList->cell.mData.mY, send);
|
|
|
|
RW(actorList->cell.mName, send);
|
2017-04-05 01:06:45 +00:00
|
|
|
}
|