PacketClass

coverity_scan^2
Koncord 8 years ago
parent 2054baf7d3
commit a661de2a84

@ -150,7 +150,8 @@ add_component_dir (openmw-mp
PacketsController
Packets/BasePacket Packets/PacketBaseInfo Packets/PacketPosition Packets/PacketEquiped Packets/PacketAttributesAndStats
Packets/PacketAttack Packets/PacketMainStats Packets/PacketCell Packets/PacketDrawState Packets/PacketChatMessage
Packets/PacketCharGen Packets/PacketAttribute Packets/PacketSkill Packets/PacketHandshake Packets/PacketGUIBoxes)
Packets/PacketCharGen Packets/PacketAttribute Packets/PacketSkill Packets/PacketHandshake Packets/PacketGUIBoxes
Packets/PacketClass)
add_component_dir (fallback
fallback validate

@ -0,0 +1,26 @@
//
// Created by koncord on 29.08.16.
//
#include <components/openmw-mp/NetworkMessages.hpp>
#include "PacketClass.hpp"
mwmp::PacketClass::PacketClass(RakNet::RakPeerInterface *peer) : BasePacket(peer)
{
packetID = ID_GAME_CHARCLASS;
}
void mwmp::PacketClass::Packet(RakNet::BitStream *bs, mwmp::BasePlayer *player, bool send)
{
BasePacket::Packet(bs, player, send);
RW(player->klass.mId, send);
RW(player->customClass, send);
if(player->customClass)
{
RW(player->klass.mName, send);
RW(player->klass.mDescription, send);
RW(player->klass.mData, send);
}
}

@ -0,0 +1,23 @@
//
// Created by koncord on 29.08.16.
//
#ifndef OPENMW_PACKETCLASS_HPP
#define OPENMW_PACKETCLASS_HPP
#include <components/openmw-mp/Packets/BasePacket.hpp>
namespace mwmp
{
class PacketClass : public BasePacket
{
public:
PacketClass(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, BasePlayer *player, bool send);
};
}
#endif //OPENMW_PACKETCLASS_HPP

@ -6,6 +6,7 @@
#include <boost/foreach.hpp>
#include <boost/make_shared.hpp>
#include "Packets/PacketClass.hpp"
#include "Packets/PacketPosition.hpp"
#include "Packets/PacketBaseInfo.hpp"
#include "components/openmw-mp/Packets/PacketEquiped.hpp"
@ -59,6 +60,7 @@ mwmp::PacketsController::PacketsController(RakNet::RakPeerInterface *peer)
AddPacket<PacketHandshake>(&packets, peer);
AddPacket<PacketGUIBoxes>(&packets, peer);
AddPacket<PacketClass>(&packets, peer);
}

Loading…
Cancel
Save