2019-08-25 06:35:23 +00:00
|
|
|
#include <components/openmw-mp/NetworkMessages.hpp>
|
|
|
|
#include "PacketPlayerCast.hpp"
|
|
|
|
|
|
|
|
#include <components/openmw-mp/TimedLog.hpp>
|
|
|
|
|
|
|
|
using namespace mwmp;
|
|
|
|
|
|
|
|
PacketPlayerCast::PacketPlayerCast(RakNet::RakPeerInterface *peer) : PlayerPacket(peer)
|
|
|
|
{
|
|
|
|
packetID = ID_PLAYER_CAST;
|
|
|
|
}
|
|
|
|
|
2019-12-04 08:17:33 +00:00
|
|
|
void PacketPlayerCast::Packet(RakNet::BitStream *newBitstream, bool send)
|
2019-08-25 06:35:23 +00:00
|
|
|
{
|
2019-12-04 08:17:33 +00:00
|
|
|
PlayerPacket::Packet(newBitstream, send);
|
2019-08-25 06:35:23 +00:00
|
|
|
|
|
|
|
RW(player->cast.target.isPlayer, send);
|
|
|
|
|
|
|
|
if (player->cast.target.isPlayer)
|
|
|
|
{
|
|
|
|
RW(player->cast.target.guid, send);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
RW(player->cast.target.refId, send, true);
|
|
|
|
RW(player->cast.target.refNum, send);
|
|
|
|
RW(player->cast.target.mpNum, send);
|
|
|
|
}
|
|
|
|
|
|
|
|
RW(player->cast.type, send);
|
|
|
|
|
|
|
|
if (player->cast.type == mwmp::Cast::ITEM)
|
|
|
|
RW(player->cast.itemId, send, true);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
RW(player->cast.pressed, send);
|
|
|
|
RW(player->cast.success, send);
|
|
|
|
|
|
|
|
RW(player->cast.instant, send);
|
|
|
|
RW(player->cast.spellId, send, true);
|
|
|
|
}
|
|
|
|
}
|