openmw-tes3coop/components/openmw-mp/Packets/Player/PacketPlayerClass.cpp

25 lines
627 B
C++
Raw Normal View History

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