openmw-tes3coop/components/openmw-mp/Packets/Player/PacketPlayerClass.cpp
Koncord 556bf18535 [General] Minor improvements for player packets
Add compression, remove useless loop iterations
2017-06-03 02:23:34 +08:00

24 lines
627 B
C++

//
// Created by koncord on 29.08.16.
//
#include <components/openmw-mp/NetworkMessages.hpp>
#include "PacketPlayerClass.hpp"
mwmp::PacketPlayerClass::PacketPlayerClass(RakNet::RakPeerInterface *peer) : PlayerPacket(peer)
{
packetID = ID_PLAYER_CHARCLASS;
}
void mwmp::PacketPlayerClass::Packet(RakNet::BitStream *bs, bool send)
{
PlayerPacket::Packet(bs, send);
RW(player->charClass.mId, send);
if (player->charClass.mId.empty()) // custom class
{
RW(player->charClass.mName, send, 1);
RW(player->charClass.mDescription, send, 1);
RW(player->charClass.mData, send, 1);
}
}