[General] Add placeholder ActorList, ActorAuthority & ActorFrame packets
parent
316720e710
commit
8c2469bf6d
@ -0,0 +1,23 @@
|
||||
#ifndef OPENMW_PROCESSORACTORAUTHORITY_HPP
|
||||
#define OPENMW_PROCESSORACTORAUTHORITY_HPP
|
||||
|
||||
#include "apps/openmw-mp/WorldProcessor.hpp"
|
||||
|
||||
namespace mwmp
|
||||
{
|
||||
class ProcessorActorAuthority : public WorldProcessor
|
||||
{
|
||||
public:
|
||||
ProcessorActorAuthority()
|
||||
{
|
||||
BPP_INIT(ID_ACTOR_AUTHORITY)
|
||||
}
|
||||
|
||||
void Do(WorldPacket &packet, Player &player, BaseEvent &event) override
|
||||
{
|
||||
packet.Send(true);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif //OPENMW_PROCESSORACTORAUTHORITY_HPP
|
@ -0,0 +1,25 @@
|
||||
#ifndef OPENMW_PROCESSORACTORFRAME_HPP
|
||||
#define OPENMW_PROCESSORACTORFRAME_HPP
|
||||
|
||||
#include "apps/openmw-mp/WorldProcessor.hpp"
|
||||
|
||||
namespace mwmp
|
||||
{
|
||||
class ProcessorActorFrame : public WorldProcessor
|
||||
{
|
||||
public:
|
||||
ProcessorActorFrame()
|
||||
{
|
||||
BPP_INIT(ID_ACTOR_FRAME)
|
||||
}
|
||||
|
||||
void Do(WorldPacket &packet, Player &player, BaseEvent &event) override
|
||||
{
|
||||
packet.Send(true);
|
||||
|
||||
Script::Call<Script::CallbackIdentity("OnActorFrame")>(player.getId(), event.cell.getDescription().c_str());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif //OPENMW_PROCESSORACTORFRAME_HPP
|
@ -0,0 +1,25 @@
|
||||
#ifndef OPENMW_PROCESSORACTORLIST_HPP
|
||||
#define OPENMW_PROCESSORACTORLIST_HPP
|
||||
|
||||
#include "apps/openmw-mp/WorldProcessor.hpp"
|
||||
|
||||
namespace mwmp
|
||||
{
|
||||
class ProcessorActorList : public WorldProcessor
|
||||
{
|
||||
public:
|
||||
ProcessorActorList()
|
||||
{
|
||||
BPP_INIT(ID_ACTOR_LIST)
|
||||
}
|
||||
|
||||
void Do(WorldPacket &packet, Player &player, BaseEvent &event) override
|
||||
{
|
||||
packet.Send(true);
|
||||
|
||||
Script::Call<Script::CallbackIdentity("OnActorList")>(player.getId(), event.cell.getDescription().c_str());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif //OPENMW_PROCESSORACTORLIST_HPP
|
@ -0,0 +1,45 @@
|
||||
#include <components/openmw-mp/NetworkMessages.hpp>
|
||||
#include "PacketActorAuthority.hpp"
|
||||
|
||||
using namespace mwmp;
|
||||
|
||||
PacketActorAuthority::PacketActorAuthority(RakNet::RakPeerInterface *peer) : WorldPacket(peer)
|
||||
{
|
||||
packetID = ID_ACTOR_AUTHORITY;
|
||||
}
|
||||
|
||||
void PacketActorAuthority::Packet(RakNet::BitStream *bs, bool send)
|
||||
{
|
||||
WorldPacket::Packet(bs, send);
|
||||
|
||||
if (!send)
|
||||
event->objectChanges.objects.clear();
|
||||
else
|
||||
event->objectChanges.count = (unsigned int)(event->objectChanges.objects.size());
|
||||
|
||||
RW(event->objectChanges.count, send);
|
||||
|
||||
RW(event->cell.mData.mFlags, send);
|
||||
RW(event->cell.mData.mX, send);
|
||||
RW(event->cell.mData.mY, send);
|
||||
RW(event->cell.mName, send);
|
||||
|
||||
WorldObject worldObject;
|
||||
|
||||
for (unsigned int i = 0; i < event->objectChanges.count; i++)
|
||||
{
|
||||
if (send)
|
||||
{
|
||||
worldObject = event->objectChanges.objects.at(i);
|
||||
}
|
||||
|
||||
RW(worldObject.refId, send);
|
||||
RW(worldObject.refNumIndex, send);
|
||||
RW(worldObject.mpNum, send);
|
||||
|
||||
if (!send)
|
||||
{
|
||||
event->objectChanges.objects.push_back(worldObject);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
#ifndef OPENMW_PACKETACTORAUTHORITY_HPP
|
||||
#define OPENMW_PACKETACTORAUTHORITY_HPP
|
||||
|
||||
#include <components/openmw-mp/Packets/World/WorldPacket.hpp>
|
||||
|
||||
namespace mwmp
|
||||
{
|
||||
class PacketActorAuthority : public WorldPacket
|
||||
{
|
||||
public:
|
||||
PacketActorAuthority(RakNet::RakPeerInterface *peer);
|
||||
|
||||
virtual void Packet(RakNet::BitStream *bs, bool send);
|
||||
};
|
||||
}
|
||||
|
||||
#endif //OPENMW_PACKETACTORAUTHORITY_HPP
|
@ -0,0 +1,46 @@
|
||||
#include <components/openmw-mp/NetworkMessages.hpp>
|
||||
#include "PacketActorFrame.hpp"
|
||||
|
||||
using namespace mwmp;
|
||||
|
||||
PacketActorFrame::PacketActorFrame(RakNet::RakPeerInterface *peer) : WorldPacket(peer)
|
||||
{
|
||||
packetID = ID_ACTOR_FRAME;
|
||||
}
|
||||
|
||||
void PacketActorFrame::Packet(RakNet::BitStream *bs, bool send)
|
||||
{
|
||||
WorldPacket::Packet(bs, send);
|
||||
|
||||
if (!send)
|
||||
event->objectChanges.objects.clear();
|
||||
else
|
||||
event->objectChanges.count = (unsigned int)(event->objectChanges.objects.size());
|
||||
|
||||
RW(event->objectChanges.count, send);
|
||||
|
||||
RW(event->cell.mData.mFlags, send);
|
||||
RW(event->cell.mData.mX, send);
|
||||
RW(event->cell.mData.mY, send);
|
||||
RW(event->cell.mName, send);
|
||||
|
||||
WorldObject worldObject;
|
||||
|
||||
for (unsigned int i = 0; i < event->objectChanges.count; i++)
|
||||
{
|
||||
if (send)
|
||||
{
|
||||
worldObject = event->objectChanges.objects.at(i);
|
||||
}
|
||||
|
||||
RW(worldObject.refId, send);
|
||||
RW(worldObject.refNumIndex, send);
|
||||
RW(worldObject.mpNum, send);
|
||||
RW(worldObject.pos, send);
|
||||
|
||||
if (!send)
|
||||
{
|
||||
event->objectChanges.objects.push_back(worldObject);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
#ifndef OPENMW_PACKETACTORFRAME_HPP
|
||||
#define OPENMW_PACKETACTORFRAME_HPP
|
||||
|
||||
#include <components/openmw-mp/Packets/World/WorldPacket.hpp>
|
||||
|
||||
namespace mwmp
|
||||
{
|
||||
class PacketActorFrame : public WorldPacket
|
||||
{
|
||||
public:
|
||||
PacketActorFrame(RakNet::RakPeerInterface *peer);
|
||||
|
||||
virtual void Packet(RakNet::BitStream *bs, bool send);
|
||||
};
|
||||
}
|
||||
|
||||
#endif //OPENMW_PACKETACTORFRAME_HPP
|
@ -0,0 +1,45 @@
|
||||
#include <components/openmw-mp/NetworkMessages.hpp>
|
||||
#include "PacketActorList.hpp"
|
||||
|
||||
using namespace mwmp;
|
||||
|
||||
PacketActorList::PacketActorList(RakNet::RakPeerInterface *peer) : WorldPacket(peer)
|
||||
{
|
||||
packetID = ID_ACTOR_LIST;
|
||||
}
|
||||
|
||||
void PacketActorList::Packet(RakNet::BitStream *bs, bool send)
|
||||
{
|
||||
WorldPacket::Packet(bs, send);
|
||||
|
||||
if (!send)
|
||||
event->objectChanges.objects.clear();
|
||||
else
|
||||
event->objectChanges.count = (unsigned int)(event->objectChanges.objects.size());
|
||||
|
||||
RW(event->objectChanges.count, send);
|
||||
|
||||
RW(event->cell.mData.mFlags, send);
|
||||
RW(event->cell.mData.mX, send);
|
||||
RW(event->cell.mData.mY, send);
|
||||
RW(event->cell.mName, send);
|
||||
|
||||
WorldObject worldObject;
|
||||
|
||||
for (unsigned int i = 0; i < event->objectChanges.count; i++)
|
||||
{
|
||||
if (send)
|
||||
{
|
||||
worldObject = event->objectChanges.objects.at(i);
|
||||
}
|
||||
|
||||
RW(worldObject.refId, send);
|
||||
RW(worldObject.refNumIndex, send);
|
||||
RW(worldObject.mpNum, send);
|
||||
|
||||
if (!send)
|
||||
{
|
||||
event->objectChanges.objects.push_back(worldObject);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
#ifndef OPENMW_PACKETACTORLIST_HPP
|
||||
#define OPENMW_PACKETACTORLIST_HPP
|
||||
|
||||
#include <components/openmw-mp/Packets/World/WorldPacket.hpp>
|
||||
|
||||
namespace mwmp
|
||||
{
|
||||
class PacketActorList : public WorldPacket
|
||||
{
|
||||
public:
|
||||
PacketActorList(RakNet::RakPeerInterface *peer);
|
||||
|
||||
virtual void Packet(RakNet::BitStream *bs, bool send);
|
||||
};
|
||||
}
|
||||
|
||||
#endif //OPENMW_PACKETACTORLIST_HPP
|
Loading…
Reference in New Issue