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

25 lines
625 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 "PacketClass.hpp"
2016-10-17 12:54:36 +00:00
mwmp::PacketClass::PacketClass(RakNet::RakPeerInterface *peer) : PlayerPacket(peer)
2016-08-29 13:00:19 +00:00
{
packetID = ID_GAME_CHARCLASS;
}
void mwmp::PacketClass::Packet(RakNet::BitStream *bs, mwmp::BasePlayer *player, bool send)
{
2016-10-17 12:54:36 +00:00
PlayerPacket::Packet(bs, player, 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);
RW(player->charClass.mDescription, send);
RW(player->charClass.mData, send);
2016-08-29 13:00:19 +00:00
}
}