forked from mirror/openmw-tes3mp
Add and implement 3 new WorldPackets for ingame script variable values
parent
e7ebeb8eec
commit
97468980af
@ -0,0 +1,17 @@
|
||||
#include <components/openmw-mp/NetworkMessages.hpp>
|
||||
#include "PacketScriptGlobalShort.hpp"
|
||||
|
||||
using namespace mwmp;
|
||||
|
||||
PacketScriptGlobalShort::PacketScriptGlobalShort(RakNet::RakPeerInterface *peer) : WorldPacket(peer)
|
||||
{
|
||||
packetID = ID_SCRIPT_GLOBAL_SHORT;
|
||||
}
|
||||
|
||||
void PacketScriptGlobalShort::Packet(RakNet::BitStream *bs, WorldEvent *event, bool send)
|
||||
{
|
||||
WorldPacket::Packet(bs, event, send);
|
||||
|
||||
RW(event->globalName, send);
|
||||
RW(event->shortVal, send);
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
#ifndef OPENMW_PACKETSCRIPTGLOBALSHORT_HPP
|
||||
#define OPENMW_PACKETSCRIPTGLOBALSHORT_HPP
|
||||
|
||||
#include <components/openmw-mp/Packets/World/WorldPacket.hpp>
|
||||
|
||||
namespace mwmp
|
||||
{
|
||||
class PacketScriptGlobalShort : public WorldPacket
|
||||
{
|
||||
public:
|
||||
PacketScriptGlobalShort(RakNet::RakPeerInterface *peer);
|
||||
|
||||
virtual void Packet(RakNet::BitStream *bs, WorldEvent *event, bool send);
|
||||
};
|
||||
}
|
||||
|
||||
#endif //OPENMW_PACKETSCRIPTGLOBALSHORT_HPP
|
@ -0,0 +1,25 @@
|
||||
#include <components/openmw-mp/NetworkMessages.hpp>
|
||||
#include "PacketScriptLocalFloat.hpp"
|
||||
|
||||
using namespace mwmp;
|
||||
|
||||
PacketScriptLocalFloat::PacketScriptLocalFloat(RakNet::RakPeerInterface *peer) : WorldPacket(peer)
|
||||
{
|
||||
packetID = ID_SCRIPT_LOCAL_FLOAT;
|
||||
}
|
||||
|
||||
void PacketScriptLocalFloat::Packet(RakNet::BitStream *bs, WorldEvent *event, bool send)
|
||||
{
|
||||
WorldPacket::Packet(bs, event, send);
|
||||
|
||||
RW(event->cellRef.mRefID, send);
|
||||
RW(event->cellRef.mRefNum.mIndex, send);
|
||||
|
||||
RW(event->cell.mData.mFlags, send);
|
||||
RW(event->cell.mData.mX, send);
|
||||
RW(event->cell.mData.mY, send);
|
||||
RW(event->cell.mName, send);
|
||||
|
||||
RW(event->index, send);
|
||||
RW(event->floatVal, send);
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
#ifndef OPENMW_PACKETSCRIPTLOCALFLOAT_HPP
|
||||
#define OPENMW_PACKETSCRIPTLOCALFLOAT_HPP
|
||||
|
||||
#include <components/openmw-mp/Packets/World/WorldPacket.hpp>
|
||||
|
||||
namespace mwmp
|
||||
{
|
||||
class PacketScriptLocalFloat : public WorldPacket
|
||||
{
|
||||
public:
|
||||
PacketScriptLocalFloat(RakNet::RakPeerInterface *peer);
|
||||
|
||||
virtual void Packet(RakNet::BitStream *bs, WorldEvent *event, bool send);
|
||||
};
|
||||
}
|
||||
|
||||
#endif //OPENMW_PACKETSCRIPTLOCALFLOAT_HPP
|
@ -0,0 +1,25 @@
|
||||
#include <components/openmw-mp/NetworkMessages.hpp>
|
||||
#include "PacketScriptLocalShort.hpp"
|
||||
|
||||
using namespace mwmp;
|
||||
|
||||
PacketScriptLocalShort::PacketScriptLocalShort(RakNet::RakPeerInterface *peer) : WorldPacket(peer)
|
||||
{
|
||||
packetID = ID_SCRIPT_LOCAL_SHORT;
|
||||
}
|
||||
|
||||
void PacketScriptLocalShort::Packet(RakNet::BitStream *bs, WorldEvent *event, bool send)
|
||||
{
|
||||
WorldPacket::Packet(bs, event, send);
|
||||
|
||||
RW(event->cellRef.mRefID, send);
|
||||
RW(event->cellRef.mRefNum.mIndex, send);
|
||||
|
||||
RW(event->cell.mData.mFlags, send);
|
||||
RW(event->cell.mData.mX, send);
|
||||
RW(event->cell.mData.mY, send);
|
||||
RW(event->cell.mName, send);
|
||||
|
||||
RW(event->index, send);
|
||||
RW(event->shortVal, send);
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
#ifndef OPENMW_PACKETSCRIPTLOCALSHORT_HPP
|
||||
#define OPENMW_PACKETSCRIPTLOCALSHORT_HPP
|
||||
|
||||
#include <components/openmw-mp/Packets/World/WorldPacket.hpp>
|
||||
|
||||
namespace mwmp
|
||||
{
|
||||
class PacketScriptLocalShort : public WorldPacket
|
||||
{
|
||||
public:
|
||||
PacketScriptLocalShort(RakNet::RakPeerInterface *peer);
|
||||
|
||||
virtual void Packet(RakNet::BitStream *bs, WorldEvent *event, bool send);
|
||||
};
|
||||
}
|
||||
|
||||
#endif //OPENMW_PACKETSCRIPTLOCALSHORT_HPP
|
Loading…
Reference in New Issue