2016-10-24 14:52:19 +00:00
|
|
|
#include <components/openmw-mp/NetworkMessages.hpp>
|
|
|
|
#include "PacketVideoPlay.hpp"
|
|
|
|
|
|
|
|
using namespace mwmp;
|
|
|
|
|
|
|
|
PacketVideoPlay::PacketVideoPlay(RakNet::RakPeerInterface *peer) : WorldPacket(peer)
|
|
|
|
{
|
2016-10-25 09:15:27 +00:00
|
|
|
packetID = ID_VIDEO_PLAY;
|
2016-10-24 14:52:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void PacketVideoPlay::Packet(RakNet::BitStream *bs, WorldEvent *event, bool send)
|
|
|
|
{
|
|
|
|
WorldPacket::Packet(bs, event, send);
|
|
|
|
|
2017-01-28 10:34:45 +00:00
|
|
|
if (!send)
|
|
|
|
event->objectChanges.objects.clear();
|
|
|
|
else
|
|
|
|
event->objectChanges.count = (unsigned int)(event->objectChanges.objects.size());
|
|
|
|
|
|
|
|
RW(event->objectChanges.count, send);
|
|
|
|
|
|
|
|
WorldObject worldObject;
|
|
|
|
|
|
|
|
for (unsigned int i = 0; i < event->objectChanges.count; i++)
|
|
|
|
{
|
|
|
|
if (send)
|
|
|
|
{
|
2017-02-05 17:01:06 +00:00
|
|
|
worldObject = event->objectChanges.objects.at(i);
|
2017-01-28 10:34:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
RW(worldObject.filename, send);
|
|
|
|
RW(worldObject.allowSkipping, send);
|
|
|
|
|
|
|
|
if (!send)
|
|
|
|
{
|
|
|
|
event->objectChanges.objects.push_back(worldObject);
|
|
|
|
}
|
|
|
|
}
|
2016-10-24 14:52:19 +00:00
|
|
|
}
|