#include #include "PacketPlayerCellState.hpp" mwmp::PacketPlayerCellState::PacketPlayerCellState(RakNet::RakPeerInterface *peer) : PlayerPacket(peer) { packetID = ID_PLAYER_CELL_STATE; priority = IMMEDIATE_PRIORITY; reliability = RELIABLE_ORDERED; } void mwmp::PacketPlayerCellState::Packet(RakNet::BitStream *bs, bool send) { PlayerPacket::Packet(bs, send); uint32_t count; if (send) count = static_cast(player->cellStateChanges.cellStates.size()); RW(count, send); if (!send) { player->cellStateChanges.cellStates.clear(); player->cellStateChanges.cellStates.resize(count); } for (auto &&cellState : player->cellStateChanges.cellStates) { RW(cellState.type, send); RW(cellState.cell.mData, send, true); RW(cellState.cell.mName, send, true); } }