mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 21:53:51 +00:00
PacketClass
This commit is contained in:
parent
2054baf7d3
commit
a661de2a84
4 changed files with 53 additions and 1 deletions
|
@ -150,7 +150,8 @@ add_component_dir (openmw-mp
|
||||||
PacketsController
|
PacketsController
|
||||||
Packets/BasePacket Packets/PacketBaseInfo Packets/PacketPosition Packets/PacketEquiped Packets/PacketAttributesAndStats
|
Packets/BasePacket Packets/PacketBaseInfo Packets/PacketPosition Packets/PacketEquiped Packets/PacketAttributesAndStats
|
||||||
Packets/PacketAttack Packets/PacketMainStats Packets/PacketCell Packets/PacketDrawState Packets/PacketChatMessage
|
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
|
add_component_dir (fallback
|
||||||
fallback validate
|
fallback validate
|
||||||
|
|
26
components/openmw-mp/Packets/PacketClass.cpp
Normal file
26
components/openmw-mp/Packets/PacketClass.cpp
Normal file
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
23
components/openmw-mp/Packets/PacketClass.hpp
Normal file
23
components/openmw-mp/Packets/PacketClass.hpp
Normal file
|
@ -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/foreach.hpp>
|
||||||
#include <boost/make_shared.hpp>
|
#include <boost/make_shared.hpp>
|
||||||
|
|
||||||
|
#include "Packets/PacketClass.hpp"
|
||||||
#include "Packets/PacketPosition.hpp"
|
#include "Packets/PacketPosition.hpp"
|
||||||
#include "Packets/PacketBaseInfo.hpp"
|
#include "Packets/PacketBaseInfo.hpp"
|
||||||
#include "components/openmw-mp/Packets/PacketEquiped.hpp"
|
#include "components/openmw-mp/Packets/PacketEquiped.hpp"
|
||||||
|
@ -59,6 +60,7 @@ mwmp::PacketsController::PacketsController(RakNet::RakPeerInterface *peer)
|
||||||
|
|
||||||
AddPacket<PacketHandshake>(&packets, peer);
|
AddPacket<PacketHandshake>(&packets, peer);
|
||||||
AddPacket<PacketGUIBoxes>(&packets, peer);
|
AddPacket<PacketGUIBoxes>(&packets, peer);
|
||||||
|
AddPacket<PacketClass>(&packets, peer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue