1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 07:49:56 +00:00
openmw-tes3mp/components/openmw-mp/Packets/PacketCell.cpp
2016-07-07 23:50:48 +08:00

29 lines
710 B
C++

//
// Created by koncord on 15.01.16.
//
#include <components/openmw-mp/NetworkMessages.hpp>
#include "PacketCell.hpp"
mwmp::PacketCell::PacketCell(RakNet::RakPeerInterface *peer) : BasePacket(peer)
{
packetID = ID_GAME_CELL;
priority = MEDIUM_PRIORITY;
reliability = UNRELIABLE_SEQUENCED;
}
void mwmp::PacketCell::Packet(RakNet::BitStream *bs, mwmp::BasePlayer *player, bool send)
{
BasePacket::Packet(bs, player, send);
RW(player->GetCell()->mData.mFlags, send);
if(player->GetCell()->isExterior())
{
RW(player->GetCell()->mCellId.mIndex.mX, send);
RW(player->GetCell()->mCellId.mIndex.mY, send);
}
else
RW(player->GetCell()->mName, send);
}