[General] Rename WorldPackets into ObjectPackets for clarity

pull/422/head
David Cernat 7 years ago
parent 5458e09c8a
commit 6bf3a0be1e

@ -211,7 +211,7 @@ void Cell::sendToLoaded(mwmp::ActorPacket *actorPacket, mwmp::BaseActorList *bas
} }
} }
void Cell::sendToLoaded(mwmp::WorldPacket *worldPacket, mwmp::BaseEvent *baseEvent) const void Cell::sendToLoaded(mwmp::ObjectPacket *objectPacket, mwmp::BaseEvent *baseEvent) const
{ {
if (players.empty()) if (players.empty())
return; return;
@ -231,10 +231,10 @@ void Cell::sendToLoaded(mwmp::WorldPacket *worldPacket, mwmp::BaseEvent *baseEve
{ {
if (pl->guid == baseEvent->guid) continue; if (pl->guid == baseEvent->guid) continue;
worldPacket->setEvent(baseEvent); objectPacket->setEvent(baseEvent);
// Send the packet to this eligible guid // Send the packet to this eligible guid
worldPacket->Send(pl->guid); objectPacket->Send(pl->guid);
} }
} }

@ -11,7 +11,7 @@
#include <components/openmw-mp/Base/BaseActor.hpp> #include <components/openmw-mp/Base/BaseActor.hpp>
#include <components/openmw-mp/Base/BaseEvent.hpp> #include <components/openmw-mp/Base/BaseEvent.hpp>
#include <components/openmw-mp/Packets/Actor/ActorPacket.hpp> #include <components/openmw-mp/Packets/Actor/ActorPacket.hpp>
#include <components/openmw-mp/Packets/World/WorldPacket.hpp> #include <components/openmw-mp/Packets/Object/ObjectPacket.hpp>
class Player; class Player;
class Cell; class Cell;
@ -41,7 +41,7 @@ public:
TPlayers getPlayers() const; TPlayers getPlayers() const;
void sendToLoaded(mwmp::ActorPacket *actorPacket, mwmp::BaseActorList *baseActorList) const; void sendToLoaded(mwmp::ActorPacket *actorPacket, mwmp::BaseActorList *baseActorList) const;
void sendToLoaded(mwmp::WorldPacket *worldPacket, mwmp::BaseEvent *baseEvent) const; void sendToLoaded(mwmp::ObjectPacket *objectPacket, mwmp::BaseEvent *baseEvent) const;
std::string getDescription() const; std::string getDescription() const;

@ -6,7 +6,7 @@
#include <components/esm/records.hpp> #include <components/esm/records.hpp>
#include <components/openmw-mp/Base/BaseEvent.hpp> #include <components/openmw-mp/Base/BaseEvent.hpp>
#include <components/openmw-mp/Packets/Actor/ActorPacket.hpp> #include <components/openmw-mp/Packets/Actor/ActorPacket.hpp>
#include <components/openmw-mp/Packets/World/WorldPacket.hpp> #include <components/openmw-mp/Packets/Object/ObjectPacket.hpp>
class Player; class Player;
class Cell; class Cell;

@ -45,12 +45,12 @@ Networking::Networking(RakNet::RakPeerInterface *peer) : mclient(nullptr)
playerPacketController = new PlayerPacketController(peer); playerPacketController = new PlayerPacketController(peer);
actorPacketController = new ActorPacketController(peer); actorPacketController = new ActorPacketController(peer);
worldPacketController = new WorldPacketController(peer); objectPacketController = new ObjectPacketController(peer);
// Set send stream // Set send stream
playerPacketController->SetStream(0, &bsOut); playerPacketController->SetStream(0, &bsOut);
actorPacketController->SetStream(0, &bsOut); actorPacketController->SetStream(0, &bsOut);
worldPacketController->SetStream(0, &bsOut); objectPacketController->SetStream(0, &bsOut);
running = true; running = true;
exitCode = 0; exitCode = 0;
@ -71,7 +71,7 @@ Networking::~Networking()
sThis = 0; sThis = 0;
delete playerPacketController; delete playerPacketController;
delete actorPacketController; delete actorPacketController;
delete worldPacketController; delete objectPacketController;
} }
void Networking::setServerPassword(std::string passw) noexcept void Networking::setServerPassword(std::string passw) noexcept
@ -181,7 +181,7 @@ void Networking::processActorPacket(RakNet::Packet *packet)
} }
void Networking::processWorldPacket(RakNet::Packet *packet) void Networking::processObjectPacket(RakNet::Packet *packet)
{ {
Player *player = Players::getPlayer(packet->guid); Player *player = Players::getPlayer(packet->guid);
@ -189,7 +189,7 @@ void Networking::processWorldPacket(RakNet::Packet *packet)
return; return;
if (!WorldProcessor::Process(*packet, baseEvent)) if (!WorldProcessor::Process(*packet, baseEvent))
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Unhandled WorldPacket with identifier %i has arrived", packet->data[0]); LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Unhandled ObjectPacket with identifier %i has arrived", packet->data[0]);
} }
@ -275,10 +275,10 @@ void Networking::update(RakNet::Packet *packet)
actorPacketController->SetStream(&bsIn, 0); actorPacketController->SetStream(&bsIn, 0);
processActorPacket(packet); processActorPacket(packet);
} }
else if (worldPacketController->ContainsPacket(packet->data[0])) else if (objectPacketController->ContainsPacket(packet->data[0]))
{ {
worldPacketController->SetStream(&bsIn, 0); objectPacketController->SetStream(&bsIn, 0);
processWorldPacket(packet); processObjectPacket(packet);
} }
else else
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Unhandled RakNet packet with identifier %i has arrived", packet->data[0]); LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Unhandled RakNet packet with identifier %i has arrived", packet->data[0]);
@ -352,9 +352,9 @@ ActorPacketController *Networking::getActorPacketController() const
return actorPacketController; return actorPacketController;
} }
WorldPacketController *Networking::getWorldPacketController() const ObjectPacketController *Networking::getObjectPacketController() const
{ {
return worldPacketController; return objectPacketController;
} }
BaseActorList *Networking::getLastActorList() BaseActorList *Networking::getLastActorList()

@ -7,7 +7,7 @@
#include <components/openmw-mp/Controllers/PlayerPacketController.hpp> #include <components/openmw-mp/Controllers/PlayerPacketController.hpp>
#include <components/openmw-mp/Controllers/ActorPacketController.hpp> #include <components/openmw-mp/Controllers/ActorPacketController.hpp>
#include <components/openmw-mp/Controllers/WorldPacketController.hpp> #include <components/openmw-mp/Controllers/ObjectPacketController.hpp>
#include <components/openmw-mp/Packets/PacketPreInit.hpp> #include <components/openmw-mp/Packets/PacketPreInit.hpp>
#include "Player.hpp" #include "Player.hpp"
@ -30,7 +30,7 @@ namespace mwmp
void processPlayerPacket(RakNet::Packet *packet); void processPlayerPacket(RakNet::Packet *packet);
void processActorPacket(RakNet::Packet *packet); void processActorPacket(RakNet::Packet *packet);
void processWorldPacket(RakNet::Packet *packet); void processObjectPacket(RakNet::Packet *packet);
void update(RakNet::Packet *packet); void update(RakNet::Packet *packet);
unsigned short numberOfConnections() const; unsigned short numberOfConnections() const;
@ -43,7 +43,7 @@ namespace mwmp
PlayerPacketController *getPlayerPacketController() const; PlayerPacketController *getPlayerPacketController() const;
ActorPacketController *getActorPacketController() const; ActorPacketController *getActorPacketController() const;
WorldPacketController *getWorldPacketController() const; ObjectPacketController *getObjectPacketController() const;
BaseActorList *getLastActorList(); BaseActorList *getLastActorList();
BaseEvent *getLastEvent(); BaseEvent *getLastEvent();
@ -79,7 +79,7 @@ namespace mwmp
PlayerPacketController *playerPacketController; PlayerPacketController *playerPacketController;
ActorPacketController *actorPacketController; ActorPacketController *actorPacketController;
WorldPacketController *worldPacketController; ObjectPacketController *objectPacketController;
bool running; bool running;
int exitCode; int exitCode;

@ -337,7 +337,7 @@ void WorldFunctions::AddContainerItem() noexcept
void WorldFunctions::SendObjectPlace(bool broadcast) noexcept void WorldFunctions::SendObjectPlace(bool broadcast) noexcept
{ {
mwmp::WorldPacket *packet = mwmp::Networking::get().getWorldPacketController()->GetPacket(ID_OBJECT_PLACE); mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_OBJECT_PLACE);
packet->setEvent(&writeEvent); packet->setEvent(&writeEvent);
packet->Send(false); packet->Send(false);
@ -347,7 +347,7 @@ void WorldFunctions::SendObjectPlace(bool broadcast) noexcept
void WorldFunctions::SendObjectSpawn(bool broadcast) noexcept void WorldFunctions::SendObjectSpawn(bool broadcast) noexcept
{ {
mwmp::WorldPacket *packet = mwmp::Networking::get().getWorldPacketController()->GetPacket(ID_OBJECT_SPAWN); mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_OBJECT_SPAWN);
packet->setEvent(&writeEvent); packet->setEvent(&writeEvent);
packet->Send(false); packet->Send(false);
@ -357,7 +357,7 @@ void WorldFunctions::SendObjectSpawn(bool broadcast) noexcept
void WorldFunctions::SendObjectDelete(bool broadcast) noexcept void WorldFunctions::SendObjectDelete(bool broadcast) noexcept
{ {
mwmp::WorldPacket *packet = mwmp::Networking::get().getWorldPacketController()->GetPacket(ID_OBJECT_DELETE); mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_OBJECT_DELETE);
packet->setEvent(&writeEvent); packet->setEvent(&writeEvent);
packet->Send(false); packet->Send(false);
@ -367,7 +367,7 @@ void WorldFunctions::SendObjectDelete(bool broadcast) noexcept
void WorldFunctions::SendObjectLock(bool broadcast) noexcept void WorldFunctions::SendObjectLock(bool broadcast) noexcept
{ {
mwmp::WorldPacket *packet = mwmp::Networking::get().getWorldPacketController()->GetPacket(ID_OBJECT_LOCK); mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_OBJECT_LOCK);
packet->setEvent(&writeEvent); packet->setEvent(&writeEvent);
packet->Send(false); packet->Send(false);
@ -377,7 +377,7 @@ void WorldFunctions::SendObjectLock(bool broadcast) noexcept
void WorldFunctions::SendObjectTrap(bool broadcast) noexcept void WorldFunctions::SendObjectTrap(bool broadcast) noexcept
{ {
mwmp::WorldPacket *packet = mwmp::Networking::get().getWorldPacketController()->GetPacket(ID_OBJECT_TRAP); mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_OBJECT_TRAP);
packet->setEvent(&writeEvent); packet->setEvent(&writeEvent);
packet->Send(false); packet->Send(false);
@ -387,7 +387,7 @@ void WorldFunctions::SendObjectTrap(bool broadcast) noexcept
void WorldFunctions::SendObjectScale(bool broadcast) noexcept void WorldFunctions::SendObjectScale(bool broadcast) noexcept
{ {
mwmp::WorldPacket *packet = mwmp::Networking::get().getWorldPacketController()->GetPacket(ID_OBJECT_SCALE); mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_OBJECT_SCALE);
packet->setEvent(&writeEvent); packet->setEvent(&writeEvent);
packet->Send(false); packet->Send(false);
@ -397,7 +397,7 @@ void WorldFunctions::SendObjectScale(bool broadcast) noexcept
void WorldFunctions::SendObjectState(bool broadcast) noexcept void WorldFunctions::SendObjectState(bool broadcast) noexcept
{ {
mwmp::WorldPacket *packet = mwmp::Networking::get().getWorldPacketController()->GetPacket(ID_OBJECT_STATE); mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_OBJECT_STATE);
packet->setEvent(&writeEvent); packet->setEvent(&writeEvent);
packet->Send(false); packet->Send(false);
@ -407,7 +407,7 @@ void WorldFunctions::SendObjectState(bool broadcast) noexcept
void WorldFunctions::SendDoorState(bool broadcast) noexcept void WorldFunctions::SendDoorState(bool broadcast) noexcept
{ {
mwmp::WorldPacket *packet = mwmp::Networking::get().getWorldPacketController()->GetPacket(ID_DOOR_STATE); mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_DOOR_STATE);
packet->setEvent(&writeEvent); packet->setEvent(&writeEvent);
packet->Send(false); packet->Send(false);
@ -417,7 +417,7 @@ void WorldFunctions::SendDoorState(bool broadcast) noexcept
void WorldFunctions::SendDoorDestination(bool broadcast) noexcept void WorldFunctions::SendDoorDestination(bool broadcast) noexcept
{ {
mwmp::WorldPacket *packet = mwmp::Networking::get().getWorldPacketController()->GetPacket(ID_DOOR_DESTINATION); mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_DOOR_DESTINATION);
packet->setEvent(&writeEvent); packet->setEvent(&writeEvent);
packet->Send(false); packet->Send(false);
@ -427,7 +427,7 @@ void WorldFunctions::SendDoorDestination(bool broadcast) noexcept
void WorldFunctions::SendContainer(bool broadcast, bool useLastReadEvent) noexcept void WorldFunctions::SendContainer(bool broadcast, bool useLastReadEvent) noexcept
{ {
mwmp::WorldPacket *packet = mwmp::Networking::get().getWorldPacketController()->GetPacket(ID_CONTAINER); mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_CONTAINER);
if (useLastReadEvent) if (useLastReadEvent)
packet->setEvent(readEvent); packet->setEvent(readEvent);
@ -442,7 +442,7 @@ void WorldFunctions::SendContainer(bool broadcast, bool useLastReadEvent) noexce
void WorldFunctions::SendConsoleCommand(bool broadcast) noexcept void WorldFunctions::SendConsoleCommand(bool broadcast) noexcept
{ {
mwmp::WorldPacket *packet = mwmp::Networking::get().getWorldPacketController()->GetPacket(ID_CONSOLE_COMMAND); mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_CONSOLE_COMMAND);
packet->setEvent(&writeEvent); packet->setEvent(&writeEvent);
packet->Send(false); packet->Send(false);

@ -10,7 +10,7 @@ using namespace mwmp;
template<class T> template<class T>
typename BasePacketProcessor<T>::processors_t BasePacketProcessor<T>::processors; typename BasePacketProcessor<T>::processors_t BasePacketProcessor<T>::processors;
void WorldProcessor::Do(WorldPacket &packet, Player &player, BaseEvent &event) void WorldProcessor::Do(ObjectPacket &packet, Player &player, BaseEvent &event)
{ {
packet.Send(true); packet.Send(true);
} }
@ -27,7 +27,7 @@ bool WorldProcessor::Process(RakNet::Packet &packet, BaseEvent &event) noexcept
if (processor.first == packet.data[0]) if (processor.first == packet.data[0])
{ {
Player *player = Players::getPlayer(packet.guid); Player *player = Players::getPlayer(packet.guid);
WorldPacket *myPacket = Networking::get().getWorldPacketController()->GetPacket(packet.data[0]); ObjectPacket *myPacket = Networking::get().getObjectPacketController()->GetPacket(packet.data[0]);
myPacket->setEvent(&event); myPacket->setEvent(&event);
event.isValid = true; event.isValid = true;

@ -8,7 +8,7 @@
#include <components/openmw-mp/Base/BasePacketProcessor.hpp> #include <components/openmw-mp/Base/BasePacketProcessor.hpp>
#include <components/openmw-mp/Packets/BasePacket.hpp> #include <components/openmw-mp/Packets/BasePacket.hpp>
#include <components/openmw-mp/Packets/World/WorldPacket.hpp> #include <components/openmw-mp/Packets/Object/ObjectPacket.hpp>
#include <components/openmw-mp/NetworkMessages.hpp> #include <components/openmw-mp/NetworkMessages.hpp>
#include "Script/Script.hpp" #include "Script/Script.hpp"
#include "Player.hpp" #include "Player.hpp"
@ -19,7 +19,7 @@ namespace mwmp
{ {
public: public:
virtual void Do(WorldPacket &packet, Player &player, BaseEvent &event); virtual void Do(ObjectPacket &packet, Player &player, BaseEvent &event);
static bool Process(RakNet::Packet &packet, BaseEvent &event) noexcept; static bool Process(RakNet::Packet &packet, BaseEvent &event) noexcept;
}; };

@ -13,7 +13,7 @@ namespace mwmp
BPP_INIT(ID_CONTAINER) BPP_INIT(ID_CONTAINER)
} }
void Do(WorldPacket &packet, Player &player, BaseEvent &event) override void Do(ObjectPacket &packet, Player &player, BaseEvent &event) override
{ {
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player.npc.mName.c_str()); LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player.npc.mName.c_str());
LOG_APPEND(Log::LOG_INFO, "- action: %i", event.action); LOG_APPEND(Log::LOG_INFO, "- action: %i", event.action);

@ -13,7 +13,7 @@ namespace mwmp
BPP_INIT(ID_DOOR_STATE) BPP_INIT(ID_DOOR_STATE)
} }
void Do(WorldPacket &packet, Player &player, BaseEvent &event) override void Do(ObjectPacket &packet, Player &player, BaseEvent &event) override
{ {
packet.Send(true); packet.Send(true);

@ -13,7 +13,7 @@ namespace mwmp
BPP_INIT(ID_OBJECT_DELETE) BPP_INIT(ID_OBJECT_DELETE)
} }
void Do(WorldPacket &packet, Player &player, BaseEvent &event) override void Do(ObjectPacket &packet, Player &player, BaseEvent &event) override
{ {
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player.npc.mName.c_str()); LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player.npc.mName.c_str());

@ -13,7 +13,7 @@ namespace mwmp
BPP_INIT(ID_OBJECT_LOCK) BPP_INIT(ID_OBJECT_LOCK)
} }
void Do(WorldPacket &packet, Player &player, BaseEvent &event) override void Do(ObjectPacket &packet, Player &player, BaseEvent &event) override
{ {
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player.npc.mName.c_str()); LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player.npc.mName.c_str());

@ -14,7 +14,7 @@ namespace mwmp
BPP_INIT(ID_OBJECT_PLACE) BPP_INIT(ID_OBJECT_PLACE)
} }
void Do(WorldPacket &packet, Player &player, BaseEvent &event) override void Do(ObjectPacket &packet, Player &player, BaseEvent &event) override
{ {
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player.npc.mName.c_str()); LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player.npc.mName.c_str());

@ -13,7 +13,7 @@ namespace mwmp
BPP_INIT(ID_OBJECT_SCALE) BPP_INIT(ID_OBJECT_SCALE)
} }
void Do(WorldPacket &packet, Player &player, BaseEvent &event) override void Do(ObjectPacket &packet, Player &player, BaseEvent &event) override
{ {
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player.npc.mName.c_str()); LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player.npc.mName.c_str());

@ -14,7 +14,7 @@ namespace mwmp
BPP_INIT(ID_OBJECT_SPAWN) BPP_INIT(ID_OBJECT_SPAWN)
} }
void Do(WorldPacket &packet, Player &player, BaseEvent &event) override void Do(ObjectPacket &packet, Player &player, BaseEvent &event) override
{ {
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player.npc.mName.c_str()); LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player.npc.mName.c_str());

@ -13,7 +13,7 @@ namespace mwmp
BPP_INIT(ID_OBJECT_STATE) BPP_INIT(ID_OBJECT_STATE)
} }
void Do(WorldPacket &packet, Player &player, BaseEvent &event) override void Do(ObjectPacket &packet, Player &player, BaseEvent &event) override
{ {
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player.npc.mName.c_str()); LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player.npc.mName.c_str());

@ -13,7 +13,7 @@ namespace mwmp
BPP_INIT(ID_OBJECT_TRAP) BPP_INIT(ID_OBJECT_TRAP)
} }
void Do(WorldPacket &packet, Player &player, BaseEvent &event) override void Do(ObjectPacket &packet, Player &player, BaseEvent &event) override
{ {
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player.npc.mName.c_str()); LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player.npc.mName.c_str());

@ -123,8 +123,8 @@ namespace MWGui
worldEvent->addContainerItem(worldObject, itemPtr, count); worldEvent->addContainerItem(worldObject, itemPtr, count);
worldEvent->addObject(worldObject); worldEvent->addObject(worldObject);
mwmp::Main::get().getNetworking()->getWorldPacket(ID_CONTAINER)->setEvent(worldEvent); mwmp::Main::get().getNetworking()->getObjectPacket(ID_CONTAINER)->setEvent(worldEvent);
mwmp::Main::get().getNetworking()->getWorldPacket(ID_CONTAINER)->Send(); mwmp::Main::get().getNetworking()->getObjectPacket(ID_CONTAINER)->Send();
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Sending ID_CONTAINER about\n- Ptr cellRef: %s, %i\n- cell: %s\n- item: %s, %i", LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Sending ID_CONTAINER about\n- Ptr cellRef: %s, %i\n- cell: %s\n- item: %s, %i",
worldObject.refId.c_str(), worldObject.refNumIndex, worldEvent->cell.getDescription().c_str(), worldObject.refId.c_str(), worldObject.refNumIndex, worldEvent->cell.getDescription().c_str(),
@ -178,8 +178,8 @@ namespace MWGui
worldObject.containerItems.push_back(containerItem); worldObject.containerItems.push_back(containerItem);
worldEvent->addObject(worldObject); worldEvent->addObject(worldObject);
mwmp::Main::get().getNetworking()->getWorldPacket(ID_CONTAINER)->setEvent(worldEvent); mwmp::Main::get().getNetworking()->getObjectPacket(ID_CONTAINER)->setEvent(worldEvent);
mwmp::Main::get().getNetworking()->getWorldPacket(ID_CONTAINER)->Send(); mwmp::Main::get().getNetworking()->getObjectPacket(ID_CONTAINER)->Send();
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Sending ID_CONTAINER about\n- Ptr cellRef: %s, %i\n- cell: %s\n- item: %s, %i, %i", LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Sending ID_CONTAINER about\n- Ptr cellRef: %s, %i\n- cell: %s\n- item: %s, %i, %i",
worldObject.refId.c_str(), worldObject.refNumIndex, worldEvent->cell.getDescription().c_str(), worldObject.refId.c_str(), worldObject.refNumIndex, worldEvent->cell.getDescription().c_str(),
@ -305,8 +305,8 @@ namespace MWGui
worldEvent->containerSubAction = mwmp::BaseEvent::TAKE_ALL; worldEvent->containerSubAction = mwmp::BaseEvent::TAKE_ALL;
worldEvent->addEntireContainer(mPtr); worldEvent->addEntireContainer(mPtr);
mwmp::Main::get().getNetworking()->getWorldPacket(ID_CONTAINER)->setEvent(worldEvent); mwmp::Main::get().getNetworking()->getObjectPacket(ID_CONTAINER)->setEvent(worldEvent);
mwmp::Main::get().getNetworking()->getWorldPacket(ID_CONTAINER)->Send(); mwmp::Main::get().getNetworking()->getObjectPacket(ID_CONTAINER)->Send();
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Sending ID_CONTAINER about\n- Ptr cellRef: %s, %i-%i\n- cell: %s", LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Sending ID_CONTAINER about\n- Ptr cellRef: %s, %i-%i\n- cell: %s",
mPtr.getCellRef().getRefId().c_str(), mPtr.getCellRef().getRefNum().mIndex, mPtr.getCellRef().getMpNum(), mPtr.getCellRef().getRefId().c_str(), mPtr.getCellRef().getRefNum().mIndex, mPtr.getCellRef().getMpNum(),

@ -197,7 +197,7 @@ string listComparison(PacketPreInit::PluginContainer checksums, PacketPreInit::P
} }
Networking::Networking(): peer(RakNet::RakPeerInterface::GetInstance()), playerPacketController(peer), Networking::Networking(): peer(RakNet::RakPeerInterface::GetInstance()), playerPacketController(peer),
actorPacketController(peer), worldPacketController(peer) actorPacketController(peer), objectPacketController(peer)
{ {
RakNet::SocketDescriptor sd; RakNet::SocketDescriptor sd;
@ -207,7 +207,7 @@ Networking::Networking(): peer(RakNet::RakPeerInterface::GetInstance()), playerP
playerPacketController.SetStream(0, &bsOut); playerPacketController.SetStream(0, &bsOut);
actorPacketController.SetStream(0, &bsOut); actorPacketController.SetStream(0, &bsOut);
worldPacketController.SetStream(0, &bsOut); objectPacketController.SetStream(0, &bsOut);
connected = 0; connected = 0;
ProcessorInitializer(); ProcessorInitializer();
@ -428,10 +428,10 @@ void Networking::receiveMessage(RakNet::Packet *packet)
if (!ActorProcessor::Process(*packet, actorList)) if (!ActorProcessor::Process(*packet, actorList))
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Unhandled ActorPacket with identifier %i has arrived", packet->data[0]); LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Unhandled ActorPacket with identifier %i has arrived", packet->data[0]);
} }
else if (worldPacketController.ContainsPacket(packet->data[0])) else if (objectPacketController.ContainsPacket(packet->data[0]))
{ {
if (!WorldProcessor::Process(*packet, worldEvent)) if (!WorldProcessor::Process(*packet, worldEvent))
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Unhandled WorldPacket with identifier %i has arrived", packet->data[0]); LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Unhandled ObjectPacket with identifier %i has arrived", packet->data[0]);
} }
} }
@ -445,9 +445,9 @@ ActorPacket *Networking::getActorPacket(RakNet::MessageID id)
return actorPacketController.GetPacket(id); return actorPacketController.GetPacket(id);
} }
WorldPacket *Networking::getWorldPacket(RakNet::MessageID id) ObjectPacket *Networking::getObjectPacket(RakNet::MessageID id)
{ {
return worldPacketController.GetPacket(id); return objectPacketController.GetPacket(id);
} }
LocalPlayer *Networking::getLocalPlayer() LocalPlayer *Networking::getLocalPlayer()

@ -15,7 +15,7 @@
#include <components/openmw-mp/Controllers/PlayerPacketController.hpp> #include <components/openmw-mp/Controllers/PlayerPacketController.hpp>
#include <components/openmw-mp/Controllers/ActorPacketController.hpp> #include <components/openmw-mp/Controllers/ActorPacketController.hpp>
#include <components/openmw-mp/Controllers/WorldPacketController.hpp> #include <components/openmw-mp/Controllers/ObjectPacketController.hpp>
#include <components/files/collections.hpp> #include <components/files/collections.hpp>
@ -33,7 +33,7 @@ namespace mwmp
PlayerPacket *getPlayerPacket(RakNet::MessageID id); PlayerPacket *getPlayerPacket(RakNet::MessageID id);
ActorPacket *getActorPacket(RakNet::MessageID id); ActorPacket *getActorPacket(RakNet::MessageID id);
WorldPacket *getWorldPacket(RakNet::MessageID id); ObjectPacket *getObjectPacket(RakNet::MessageID id);
RakNet::SystemAddress serverAddress() RakNet::SystemAddress serverAddress()
{ {
@ -54,7 +54,7 @@ namespace mwmp
PlayerPacketController playerPacketController; PlayerPacketController playerPacketController;
ActorPacketController actorPacketController; ActorPacketController actorPacketController;
WorldPacketController worldPacketController; ObjectPacketController objectPacketController;
ActorList actorList; ActorList actorList;
WorldEvent worldEvent; WorldEvent worldEvent;

@ -1034,8 +1034,8 @@ void WorldEvent::sendObjectPlace()
for (const auto &worldObject : worldObjects) for (const auto &worldObject : worldObjects)
LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, count: %i", worldObject.refId.c_str(), worldObject.count); LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, count: %i", worldObject.refId.c_str(), worldObject.count);
mwmp::Main::get().getNetworking()->getWorldPacket(ID_OBJECT_PLACE)->setEvent(this); mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_PLACE)->setEvent(this);
mwmp::Main::get().getNetworking()->getWorldPacket(ID_OBJECT_PLACE)->Send(); mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_PLACE)->Send();
} }
void WorldEvent::sendObjectSpawn() void WorldEvent::sendObjectSpawn()
@ -1048,44 +1048,44 @@ void WorldEvent::sendObjectSpawn()
for (const auto &worldObject : worldObjects) for (const auto &worldObject : worldObjects)
LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s-%i", worldObject.refId.c_str(), worldObject.refNumIndex); LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s-%i", worldObject.refId.c_str(), worldObject.refNumIndex);
mwmp::Main::get().getNetworking()->getWorldPacket(ID_OBJECT_SPAWN)->setEvent(this); mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_SPAWN)->setEvent(this);
mwmp::Main::get().getNetworking()->getWorldPacket(ID_OBJECT_SPAWN)->Send(); mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_SPAWN)->Send();
} }
void WorldEvent::sendObjectDelete() void WorldEvent::sendObjectDelete()
{ {
mwmp::Main::get().getNetworking()->getWorldPacket(ID_OBJECT_DELETE)->setEvent(this); mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_DELETE)->setEvent(this);
mwmp::Main::get().getNetworking()->getWorldPacket(ID_OBJECT_DELETE)->Send(); mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_DELETE)->Send();
} }
void WorldEvent::sendObjectLock() void WorldEvent::sendObjectLock()
{ {
mwmp::Main::get().getNetworking()->getWorldPacket(ID_OBJECT_LOCK)->setEvent(this); mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_LOCK)->setEvent(this);
mwmp::Main::get().getNetworking()->getWorldPacket(ID_OBJECT_LOCK)->Send(); mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_LOCK)->Send();
} }
void WorldEvent::sendObjectTrap() void WorldEvent::sendObjectTrap()
{ {
mwmp::Main::get().getNetworking()->getWorldPacket(ID_OBJECT_TRAP)->setEvent(this); mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_TRAP)->setEvent(this);
mwmp::Main::get().getNetworking()->getWorldPacket(ID_OBJECT_TRAP)->Send(); mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_TRAP)->Send();
} }
void WorldEvent::sendObjectScale() void WorldEvent::sendObjectScale()
{ {
mwmp::Main::get().getNetworking()->getWorldPacket(ID_OBJECT_SCALE)->setEvent(this); mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_SCALE)->setEvent(this);
mwmp::Main::get().getNetworking()->getWorldPacket(ID_OBJECT_SCALE)->Send(); mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_SCALE)->Send();
} }
void WorldEvent::sendObjectState() void WorldEvent::sendObjectState()
{ {
mwmp::Main::get().getNetworking()->getWorldPacket(ID_OBJECT_STATE)->setEvent(this); mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_STATE)->setEvent(this);
mwmp::Main::get().getNetworking()->getWorldPacket(ID_OBJECT_STATE)->Send(); mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_STATE)->Send();
} }
void WorldEvent::sendObjectAnimPlay() void WorldEvent::sendObjectAnimPlay()
{ {
mwmp::Main::get().getNetworking()->getWorldPacket(ID_OBJECT_ANIM_PLAY)->setEvent(this); mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_ANIM_PLAY)->setEvent(this);
mwmp::Main::get().getNetworking()->getWorldPacket(ID_OBJECT_ANIM_PLAY)->Send(); mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_ANIM_PLAY)->Send();
} }
void WorldEvent::sendDoorState() void WorldEvent::sendDoorState()
@ -1096,20 +1096,20 @@ void WorldEvent::sendDoorState()
LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s-%i, state: %s", worldObject.refId.c_str(), worldObject.refNumIndex, LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s-%i, state: %s", worldObject.refId.c_str(), worldObject.refNumIndex,
worldObject.doorState ? "true" : "false"); worldObject.doorState ? "true" : "false");
mwmp::Main::get().getNetworking()->getWorldPacket(ID_DOOR_STATE)->setEvent(this); mwmp::Main::get().getNetworking()->getObjectPacket(ID_DOOR_STATE)->setEvent(this);
mwmp::Main::get().getNetworking()->getWorldPacket(ID_DOOR_STATE)->Send(); mwmp::Main::get().getNetworking()->getObjectPacket(ID_DOOR_STATE)->Send();
} }
void WorldEvent::sendMusicPlay() void WorldEvent::sendMusicPlay()
{ {
mwmp::Main::get().getNetworking()->getWorldPacket(ID_MUSIC_PLAY)->setEvent(this); mwmp::Main::get().getNetworking()->getObjectPacket(ID_MUSIC_PLAY)->setEvent(this);
mwmp::Main::get().getNetworking()->getWorldPacket(ID_MUSIC_PLAY)->Send(); mwmp::Main::get().getNetworking()->getObjectPacket(ID_MUSIC_PLAY)->Send();
} }
void WorldEvent::sendVideoPlay() void WorldEvent::sendVideoPlay()
{ {
mwmp::Main::get().getNetworking()->getWorldPacket(ID_VIDEO_PLAY)->setEvent(this); mwmp::Main::get().getNetworking()->getObjectPacket(ID_VIDEO_PLAY)->setEvent(this);
mwmp::Main::get().getNetworking()->getWorldPacket(ID_VIDEO_PLAY)->Send(); mwmp::Main::get().getNetworking()->getObjectPacket(ID_VIDEO_PLAY)->Send();
} }
void WorldEvent::sendScriptLocalShort() void WorldEvent::sendScriptLocalShort()
@ -1120,8 +1120,8 @@ void WorldEvent::sendScriptLocalShort()
LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s-%i, index: %i, shortVal: %i", worldObject.refId.c_str(), LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s-%i, index: %i, shortVal: %i", worldObject.refId.c_str(),
worldObject.refNumIndex, worldObject.index, worldObject.shortVal); worldObject.refNumIndex, worldObject.index, worldObject.shortVal);
mwmp::Main::get().getNetworking()->getWorldPacket(ID_SCRIPT_LOCAL_SHORT)->setEvent(this); mwmp::Main::get().getNetworking()->getObjectPacket(ID_SCRIPT_LOCAL_SHORT)->setEvent(this);
mwmp::Main::get().getNetworking()->getWorldPacket(ID_SCRIPT_LOCAL_SHORT)->Send(); mwmp::Main::get().getNetworking()->getObjectPacket(ID_SCRIPT_LOCAL_SHORT)->Send();
} }
void WorldEvent::sendScriptLocalFloat() void WorldEvent::sendScriptLocalFloat()
@ -1132,8 +1132,8 @@ void WorldEvent::sendScriptLocalFloat()
LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s-%i, index: %i, floatVal: %f", worldObject.refId.c_str(), LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s-%i, index: %i, floatVal: %f", worldObject.refId.c_str(),
worldObject.refNumIndex, worldObject.index, worldObject.floatVal); worldObject.refNumIndex, worldObject.index, worldObject.floatVal);
mwmp::Main::get().getNetworking()->getWorldPacket(ID_SCRIPT_LOCAL_FLOAT)->setEvent(this); mwmp::Main::get().getNetworking()->getObjectPacket(ID_SCRIPT_LOCAL_FLOAT)->setEvent(this);
mwmp::Main::get().getNetworking()->getWorldPacket(ID_SCRIPT_LOCAL_FLOAT)->Send(); mwmp::Main::get().getNetworking()->getObjectPacket(ID_SCRIPT_LOCAL_FLOAT)->Send();
} }
void WorldEvent::sendScriptMemberShort() void WorldEvent::sendScriptMemberShort()
@ -1144,8 +1144,8 @@ void WorldEvent::sendScriptMemberShort()
LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, index: %i, shortVal: %i", worldObject.refId.c_str(), LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, index: %i, shortVal: %i", worldObject.refId.c_str(),
worldObject.index, worldObject.shortVal); worldObject.index, worldObject.shortVal);
mwmp::Main::get().getNetworking()->getWorldPacket(ID_SCRIPT_MEMBER_SHORT)->setEvent(this); mwmp::Main::get().getNetworking()->getObjectPacket(ID_SCRIPT_MEMBER_SHORT)->setEvent(this);
mwmp::Main::get().getNetworking()->getWorldPacket(ID_SCRIPT_MEMBER_SHORT)->Send(); mwmp::Main::get().getNetworking()->getObjectPacket(ID_SCRIPT_MEMBER_SHORT)->Send();
} }
void WorldEvent::sendScriptGlobalShort() void WorldEvent::sendScriptGlobalShort()
@ -1155,14 +1155,14 @@ void WorldEvent::sendScriptGlobalShort()
for (const auto &worldObject : worldObjects) for (const auto &worldObject : worldObjects)
LOG_APPEND(Log::LOG_VERBOSE, "- varName: %s, shortVal: %i", worldObject.varName.c_str(), worldObject.shortVal); LOG_APPEND(Log::LOG_VERBOSE, "- varName: %s, shortVal: %i", worldObject.varName.c_str(), worldObject.shortVal);
mwmp::Main::get().getNetworking()->getWorldPacket(ID_SCRIPT_GLOBAL_SHORT)->setEvent(this); mwmp::Main::get().getNetworking()->getObjectPacket(ID_SCRIPT_GLOBAL_SHORT)->setEvent(this);
mwmp::Main::get().getNetworking()->getWorldPacket(ID_SCRIPT_GLOBAL_SHORT)->Send(); mwmp::Main::get().getNetworking()->getObjectPacket(ID_SCRIPT_GLOBAL_SHORT)->Send();
} }
void WorldEvent::sendContainer() void WorldEvent::sendContainer()
{ {
LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Sending ID_CONTAINER"); LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Sending ID_CONTAINER");
mwmp::Main::get().getNetworking()->getWorldPacket(ID_CONTAINER)->setEvent(this); mwmp::Main::get().getNetworking()->getObjectPacket(ID_CONTAINER)->setEvent(this);
mwmp::Main::get().getNetworking()->getWorldPacket(ID_CONTAINER)->Send(); mwmp::Main::get().getNetworking()->getObjectPacket(ID_CONTAINER)->Send();
} }

@ -17,7 +17,7 @@ bool WorldProcessor::Process(RakNet::Packet &packet, WorldEvent &event)
bsIn.Read(guid); bsIn.Read(guid);
event.guid = guid; event.guid = guid;
WorldPacket *myPacket = Main::get().getNetworking()->getWorldPacket(packet.data[0]); ObjectPacket *myPacket = Main::get().getNetworking()->getObjectPacket(packet.data[0]);
myPacket->setEvent(&event); myPacket->setEvent(&event);
myPacket->SetReadStream(&bsIn); myPacket->SetReadStream(&bsIn);

@ -7,7 +7,7 @@
#include <components/openmw-mp/Log.hpp> #include <components/openmw-mp/Log.hpp>
#include <components/openmw-mp/NetworkMessages.hpp> #include <components/openmw-mp/NetworkMessages.hpp>
#include <components/openmw-mp/Packets/World/WorldPacket.hpp> #include <components/openmw-mp/Packets/Object/ObjectPacket.hpp>
#include "../WorldEvent.hpp" #include "../WorldEvent.hpp"
#include "../LocalPlayer.hpp" #include "../LocalPlayer.hpp"
#include "../DedicatedPlayer.hpp" #include "../DedicatedPlayer.hpp"
@ -18,7 +18,7 @@ namespace mwmp
class WorldProcessor : public BasePacketProcessor<WorldProcessor>, public BaseClientPacketProcessor class WorldProcessor : public BasePacketProcessor<WorldProcessor>, public BaseClientPacketProcessor
{ {
public: public:
virtual void Do(WorldPacket &packet, WorldEvent &event) = 0; virtual void Do(ObjectPacket &packet, WorldEvent &event) = 0;
static bool Process(RakNet::Packet &packet, WorldEvent &event); static bool Process(RakNet::Packet &packet, WorldEvent &event);
}; };

@ -15,7 +15,7 @@ namespace mwmp
class BaseObjectProcessor : public WorldProcessor class BaseObjectProcessor : public WorldProcessor
{ {
public: public:
virtual void Do(WorldPacket &packet, WorldEvent &event) virtual void Do(ObjectPacket &packet, WorldEvent &event)
{ {
ptrCellStore = Main::get().getCellController()->getCellStore(event.cell); ptrCellStore = Main::get().getCellController()->getCellStore(event.cell);

@ -13,7 +13,7 @@ namespace mwmp
BPP_INIT(ID_CONSOLE_COMMAND) BPP_INIT(ID_CONSOLE_COMMAND)
} }
virtual void Do(WorldPacket &packet, WorldEvent &event) virtual void Do(ObjectPacket &packet, WorldEvent &event)
{ {
BaseObjectProcessor::Do(packet, event); BaseObjectProcessor::Do(packet, event);

@ -13,7 +13,7 @@ namespace mwmp
BPP_INIT(ID_CONTAINER) BPP_INIT(ID_CONTAINER)
} }
virtual void Do(WorldPacket &packet, WorldEvent &event) virtual void Do(ObjectPacket &packet, WorldEvent &event)
{ {
BaseObjectProcessor::Do(packet, event); BaseObjectProcessor::Do(packet, event);

@ -13,7 +13,7 @@ namespace mwmp
BPP_INIT(ID_DOOR_DESTINATION) BPP_INIT(ID_DOOR_DESTINATION)
} }
virtual void Do(WorldPacket &packet, WorldEvent &event) virtual void Do(ObjectPacket &packet, WorldEvent &event)
{ {
BaseObjectProcessor::Do(packet, event); BaseObjectProcessor::Do(packet, event);

@ -13,7 +13,7 @@ namespace mwmp
BPP_INIT(ID_DOOR_STATE) BPP_INIT(ID_DOOR_STATE)
} }
virtual void Do(WorldPacket &packet, WorldEvent &event) virtual void Do(ObjectPacket &packet, WorldEvent &event)
{ {
BaseObjectProcessor::Do(packet, event); BaseObjectProcessor::Do(packet, event);

@ -13,7 +13,7 @@ namespace mwmp
BPP_INIT(ID_MUSIC_PLAY) BPP_INIT(ID_MUSIC_PLAY)
} }
virtual void Do(WorldPacket &packet, WorldEvent &event) virtual void Do(ObjectPacket &packet, WorldEvent &event)
{ {
LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Received %s", strPacketID.c_str()); LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Received %s", strPacketID.c_str());
event.playMusic(); event.playMusic();

@ -13,7 +13,7 @@ namespace mwmp
BPP_INIT(ID_OBJECT_ANIM_PLAY) BPP_INIT(ID_OBJECT_ANIM_PLAY)
} }
virtual void Do(WorldPacket &packet, WorldEvent &event) virtual void Do(ObjectPacket &packet, WorldEvent &event)
{ {
BaseObjectProcessor::Do(packet, event); BaseObjectProcessor::Do(packet, event);

@ -13,7 +13,7 @@ namespace mwmp
BPP_INIT(ID_OBJECT_ATTACH) BPP_INIT(ID_OBJECT_ATTACH)
} }
virtual void Do(WorldPacket &packet, WorldEvent &event) virtual void Do(ObjectPacket &packet, WorldEvent &event)
{ {
BaseObjectProcessor::Do(packet, event); BaseObjectProcessor::Do(packet, event);

@ -13,7 +13,7 @@ namespace mwmp
BPP_INIT(ID_OBJECT_COLLISION) BPP_INIT(ID_OBJECT_COLLISION)
} }
virtual void Do(WorldPacket &packet, WorldEvent &event) virtual void Do(ObjectPacket &packet, WorldEvent &event)
{ {
BaseObjectProcessor::Do(packet, event); BaseObjectProcessor::Do(packet, event);

@ -13,7 +13,7 @@ namespace mwmp
BPP_INIT(ID_OBJECT_DELETE) BPP_INIT(ID_OBJECT_DELETE)
} }
virtual void Do(WorldPacket &packet, WorldEvent &event) virtual void Do(ObjectPacket &packet, WorldEvent &event)
{ {
BaseObjectProcessor::Do(packet, event); BaseObjectProcessor::Do(packet, event);

@ -13,7 +13,7 @@ namespace mwmp
BPP_INIT(ID_OBJECT_LOCK) BPP_INIT(ID_OBJECT_LOCK)
} }
virtual void Do(WorldPacket &packet, WorldEvent &event) virtual void Do(ObjectPacket &packet, WorldEvent &event)
{ {
BaseObjectProcessor::Do(packet, event); BaseObjectProcessor::Do(packet, event);

@ -13,7 +13,7 @@ namespace mwmp
BPP_INIT(ID_OBJECT_MOVE) BPP_INIT(ID_OBJECT_MOVE)
} }
virtual void Do(WorldPacket &packet, WorldEvent &event) virtual void Do(ObjectPacket &packet, WorldEvent &event)
{ {
BaseObjectProcessor::Do(packet, event); BaseObjectProcessor::Do(packet, event);

@ -13,7 +13,7 @@ namespace mwmp
BPP_INIT(ID_OBJECT_PLACE) BPP_INIT(ID_OBJECT_PLACE)
} }
virtual void Do(WorldPacket &packet, WorldEvent &event) virtual void Do(ObjectPacket &packet, WorldEvent &event)
{ {
BaseObjectProcessor::Do(packet, event); BaseObjectProcessor::Do(packet, event);

@ -13,7 +13,7 @@ namespace mwmp
BPP_INIT(ID_OBJECT_RESET) BPP_INIT(ID_OBJECT_RESET)
} }
virtual void Do(WorldPacket &packet, WorldEvent &event) virtual void Do(ObjectPacket &packet, WorldEvent &event)
{ {
BaseObjectProcessor::Do(packet, event); BaseObjectProcessor::Do(packet, event);

@ -13,7 +13,7 @@ namespace mwmp
BPP_INIT(ID_OBJECT_ROTATE) BPP_INIT(ID_OBJECT_ROTATE)
} }
virtual void Do(WorldPacket &packet, WorldEvent &event) virtual void Do(ObjectPacket &packet, WorldEvent &event)
{ {
BaseObjectProcessor::Do(packet, event); BaseObjectProcessor::Do(packet, event);

@ -13,7 +13,7 @@ namespace mwmp
BPP_INIT(ID_OBJECT_SCALE) BPP_INIT(ID_OBJECT_SCALE)
} }
virtual void Do(WorldPacket &packet, WorldEvent &event) virtual void Do(ObjectPacket &packet, WorldEvent &event)
{ {
BaseObjectProcessor::Do(packet, event); BaseObjectProcessor::Do(packet, event);

@ -13,7 +13,7 @@ namespace mwmp
BPP_INIT(ID_OBJECT_SPAWN) BPP_INIT(ID_OBJECT_SPAWN)
} }
virtual void Do(WorldPacket &packet, WorldEvent &event) virtual void Do(ObjectPacket &packet, WorldEvent &event)
{ {
BaseObjectProcessor::Do(packet, event); BaseObjectProcessor::Do(packet, event);

@ -13,7 +13,7 @@ namespace mwmp
BPP_INIT(ID_OBJECT_STATE) BPP_INIT(ID_OBJECT_STATE)
} }
virtual void Do(WorldPacket &packet, WorldEvent &event) virtual void Do(ObjectPacket &packet, WorldEvent &event)
{ {
BaseObjectProcessor::Do(packet, event); BaseObjectProcessor::Do(packet, event);

@ -13,7 +13,7 @@ namespace mwmp
BPP_INIT(ID_OBJECT_TRAP) BPP_INIT(ID_OBJECT_TRAP)
} }
virtual void Do(WorldPacket &packet, WorldEvent &event) virtual void Do(ObjectPacket &packet, WorldEvent &event)
{ {
BaseObjectProcessor::Do(packet, event); BaseObjectProcessor::Do(packet, event);

@ -13,7 +13,7 @@ namespace mwmp
BPP_INIT(ID_SCRIPT_GLOBAL_FLOAT) BPP_INIT(ID_SCRIPT_GLOBAL_FLOAT)
} }
virtual void Do(WorldPacket &packet, WorldEvent &event) virtual void Do(ObjectPacket &packet, WorldEvent &event)
{ {
LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Received %s", strPacketID.c_str()); LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Received %s", strPacketID.c_str());
//event.setGlobalFloats(); //event.setGlobalFloats();

@ -13,7 +13,7 @@ namespace mwmp
BPP_INIT(ID_SCRIPT_GLOBAL_SHORT) BPP_INIT(ID_SCRIPT_GLOBAL_SHORT)
} }
virtual void Do(WorldPacket &packet, WorldEvent &event) virtual void Do(ObjectPacket &packet, WorldEvent &event)
{ {
LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Received %s", strPacketID.c_str()); LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Received %s", strPacketID.c_str());
event.setGlobalShorts(); event.setGlobalShorts();

@ -13,7 +13,7 @@ namespace mwmp
BPP_INIT(ID_SCRIPT_LOCAL_FLOAT) BPP_INIT(ID_SCRIPT_LOCAL_FLOAT)
} }
virtual void Do(WorldPacket &packet, WorldEvent &event) virtual void Do(ObjectPacket &packet, WorldEvent &event)
{ {
BaseObjectProcessor::Do(packet, event); BaseObjectProcessor::Do(packet, event);

@ -13,7 +13,7 @@ namespace mwmp
BPP_INIT(ID_SCRIPT_LOCAL_SHORT) BPP_INIT(ID_SCRIPT_LOCAL_SHORT)
} }
virtual void Do(WorldPacket &packet, WorldEvent &event) virtual void Do(ObjectPacket &packet, WorldEvent &event)
{ {
BaseObjectProcessor::Do(packet, event); BaseObjectProcessor::Do(packet, event);

@ -13,7 +13,7 @@ namespace mwmp
BPP_INIT(ID_SCRIPT_MEMBER_FLOAT) BPP_INIT(ID_SCRIPT_MEMBER_FLOAT)
} }
virtual void Do(WorldPacket &packet, WorldEvent &event) virtual void Do(ObjectPacket &packet, WorldEvent &event)
{ {
LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Received %s", strPacketID.c_str()); LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Received %s", strPacketID.c_str());
//event.setMemberFloats(); //event.setMemberFloats();

@ -13,7 +13,7 @@ namespace mwmp
BPP_INIT(ID_SCRIPT_MEMBER_SHORT) BPP_INIT(ID_SCRIPT_MEMBER_SHORT)
} }
virtual void Do(WorldPacket &packet, WorldEvent &event) virtual void Do(ObjectPacket &packet, WorldEvent &event)
{ {
LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Received %s", strPacketID.c_str()); LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Received %s", strPacketID.c_str());
event.setMemberShorts(); event.setMemberShorts();

@ -13,7 +13,7 @@ namespace mwmp
BPP_INIT(ID_VIDEO_PLAY) BPP_INIT(ID_VIDEO_PLAY)
} }
virtual void Do(WorldPacket &packet, WorldEvent &event) virtual void Do(ObjectPacket &packet, WorldEvent &event)
{ {
LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Received %s", strPacketID.c_str()); LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Received %s", strPacketID.c_str());
event.playVideo(); event.playVideo();

@ -154,7 +154,7 @@ add_component_dir (openmw-mp/Base
) )
add_component_dir (openmw-mp/Controllers add_component_dir (openmw-mp/Controllers
PlayerPacketController ActorPacketController WorldPacketController PlayerPacketController ActorPacketController ObjectPacketController
) )
add_component_dir(openmw-mp/Master add_component_dir(openmw-mp/Master
@ -187,8 +187,8 @@ add_component_dir (openmw-mp/Packets/Player
PacketPlayerResurrect PacketPlayerShapeshift PacketPlayerSkill PacketPlayerSpeech PacketPlayerSpellbook PacketPlayerStatsDynamic PacketPlayerTopic PacketPlayerResurrect PacketPlayerShapeshift PacketPlayerSkill PacketPlayerSpeech PacketPlayerSpellbook PacketPlayerStatsDynamic PacketPlayerTopic
) )
add_component_dir (openmw-mp/Packets/World add_component_dir (openmw-mp/Packets/Object
WorldPacket ObjectPacket
PacketConsoleCommand PacketContainer PacketObjectAnimPlay PacketObjectAttach PacketObjectCollision PacketConsoleCommand PacketContainer PacketObjectAnimPlay PacketObjectAttach PacketObjectCollision
PacketObjectDelete PacketDoorDestination PacketDoorState PacketObjectLock PacketObjectMove PacketObjectPlace PacketObjectDelete PacketDoorDestination PacketDoorState PacketObjectLock PacketObjectMove PacketObjectPlace
PacketObjectReset PacketObjectRotate PacketObjectScale PacketObjectSpawn PacketObjectState PacketObjectTrap PacketObjectReset PacketObjectRotate PacketObjectScale PacketObjectSpawn PacketObjectState PacketObjectTrap

@ -0,0 +1,90 @@
#include "../Packets/Object/PacketObjectAnimPlay.hpp"
#include "../Packets/Object/PacketObjectAttach.hpp"
#include "../Packets/Object/PacketObjectCollision.hpp"
#include "../Packets/Object/PacketObjectDelete.hpp"
#include "../Packets/Object/PacketObjectLock.hpp"
#include "../Packets/Object/PacketObjectMove.hpp"
#include "../Packets/Object/PacketObjectPlace.hpp"
#include "../Packets/Object/PacketObjectReset.hpp"
#include "../Packets/Object/PacketObjectRotate.hpp"
#include "../Packets/Object/PacketObjectScale.hpp"
#include "../Packets/Object/PacketObjectSpawn.hpp"
#include "../Packets/Object/PacketObjectState.hpp"
#include "../Packets/Object/PacketObjectTrap.hpp"
#include "../Packets/Object/PacketContainer.hpp"
#include "../Packets/Object/PacketDoorDestination.hpp"
#include "../Packets/Object/PacketDoorState.hpp"
#include "../Packets/Object/PacketMusicPlay.hpp"
#include "../Packets/Object/PacketVideoPlay.hpp"
#include "../Packets/Object/PacketConsoleCommand.hpp"
#include "../Packets/Object/PacketScriptLocalShort.hpp"
#include "../Packets/Object/PacketScriptLocalFloat.hpp"
#include "../Packets/Object/PacketScriptMemberShort.hpp"
#include "../Packets/Object/PacketScriptMemberFloat.hpp"
#include "../Packets/Object/PacketScriptGlobalShort.hpp"
#include "../Packets/Object/PacketScriptGlobalFloat.hpp"
#include "ObjectPacketController.hpp"
template <typename T>
inline void AddPacket(mwmp::ObjectPacketController::packets_t *packets, RakNet::RakPeerInterface *peer)
{
T *packet = new T(peer);
typedef mwmp::ObjectPacketController::packets_t::value_type value_t;
packets->insert(value_t(packet->GetPacketID(), value_t::second_type(packet)));
}
mwmp::ObjectPacketController::ObjectPacketController(RakNet::RakPeerInterface *peer)
{
AddPacket<PacketObjectAnimPlay>(&packets, peer);
AddPacket<PacketObjectAttach>(&packets, peer);
AddPacket<PacketObjectCollision>(&packets, peer);
AddPacket<PacketObjectDelete>(&packets, peer);
AddPacket<PacketObjectLock>(&packets, peer);
AddPacket<PacketObjectMove>(&packets, peer);
AddPacket<PacketObjectPlace>(&packets, peer);
AddPacket<PacketObjectReset>(&packets, peer);
AddPacket<PacketObjectRotate>(&packets, peer);
AddPacket<PacketObjectScale>(&packets, peer);
AddPacket<PacketObjectSpawn>(&packets, peer);
AddPacket<PacketObjectState>(&packets, peer);
AddPacket<PacketObjectTrap>(&packets, peer);
AddPacket<PacketContainer>(&packets, peer);
AddPacket<PacketDoorDestination>(&packets, peer);
AddPacket<PacketDoorState>(&packets, peer);
AddPacket<PacketMusicPlay>(&packets, peer);
AddPacket<PacketVideoPlay>(&packets, peer);
AddPacket<PacketConsoleCommand>(&packets, peer);
AddPacket<PacketScriptLocalShort>(&packets, peer);
AddPacket<PacketScriptLocalFloat>(&packets, peer);
AddPacket<PacketScriptMemberShort>(&packets, peer);
AddPacket<PacketScriptMemberFloat>(&packets, peer);
AddPacket<PacketScriptGlobalShort>(&packets, peer);
AddPacket<PacketScriptGlobalFloat>(&packets, peer);
}
mwmp::ObjectPacket *mwmp::ObjectPacketController::GetPacket(RakNet::MessageID id)
{
return packets[(unsigned char)id].get();
}
void mwmp::ObjectPacketController::SetStream(RakNet::BitStream *inStream, RakNet::BitStream *outStream)
{
for(const auto &packet : packets)
packet.second->SetStreams(inStream, outStream);
}
bool mwmp::ObjectPacketController::ContainsPacket(RakNet::MessageID id)
{
for(const auto &packet : packets)
{
if (packet.first == id)
return true;
}
return false;
}

@ -3,22 +3,22 @@
#include <RakPeerInterface.h> #include <RakPeerInterface.h>
#include "../Packets/World/WorldPacket.hpp" #include "../Packets/Object/ObjectPacket.hpp"
#include <unordered_map> #include <unordered_map>
#include <memory> #include <memory>
namespace mwmp namespace mwmp
{ {
class WorldPacketController class ObjectPacketController
{ {
public: public:
WorldPacketController(RakNet::RakPeerInterface *peer); ObjectPacketController(RakNet::RakPeerInterface *peer);
WorldPacket *GetPacket(RakNet::MessageID id); ObjectPacket *GetPacket(RakNet::MessageID id);
void SetStream(RakNet::BitStream *inStream, RakNet::BitStream *outStream); void SetStream(RakNet::BitStream *inStream, RakNet::BitStream *outStream);
bool ContainsPacket(RakNet::MessageID id); bool ContainsPacket(RakNet::MessageID id);
typedef std::unordered_map<unsigned char, std::unique_ptr<WorldPacket> > packets_t; typedef std::unordered_map<unsigned char, std::unique_ptr<ObjectPacket> > packets_t;
private: private:
packets_t packets; packets_t packets;
}; };

@ -1,90 +0,0 @@
#include "../Packets/World/PacketObjectAnimPlay.hpp"
#include "../Packets/World/PacketObjectAttach.hpp"
#include "../Packets/World/PacketObjectCollision.hpp"
#include "../Packets/World/PacketObjectDelete.hpp"
#include "../Packets/World/PacketObjectLock.hpp"
#include "../Packets/World/PacketObjectMove.hpp"
#include "../Packets/World/PacketObjectPlace.hpp"
#include "../Packets/World/PacketObjectReset.hpp"
#include "../Packets/World/PacketObjectRotate.hpp"
#include "../Packets/World/PacketObjectScale.hpp"
#include "../Packets/World/PacketObjectSpawn.hpp"
#include "../Packets/World/PacketObjectState.hpp"
#include "../Packets/World/PacketObjectTrap.hpp"
#include "../Packets/World/PacketContainer.hpp"
#include "../Packets/World/PacketDoorDestination.hpp"
#include "../Packets/World/PacketDoorState.hpp"
#include "../Packets/World/PacketMusicPlay.hpp"
#include "../Packets/World/PacketVideoPlay.hpp"
#include "../Packets/World/PacketConsoleCommand.hpp"
#include "../Packets/World/PacketScriptLocalShort.hpp"
#include "../Packets/World/PacketScriptLocalFloat.hpp"
#include "../Packets/World/PacketScriptMemberShort.hpp"
#include "../Packets/World/PacketScriptMemberFloat.hpp"
#include "../Packets/World/PacketScriptGlobalShort.hpp"
#include "../Packets/World/PacketScriptGlobalFloat.hpp"
#include "WorldPacketController.hpp"
template <typename T>
inline void AddPacket(mwmp::WorldPacketController::packets_t *packets, RakNet::RakPeerInterface *peer)
{
T *packet = new T(peer);
typedef mwmp::WorldPacketController::packets_t::value_type value_t;
packets->insert(value_t(packet->GetPacketID(), value_t::second_type(packet)));
}
mwmp::WorldPacketController::WorldPacketController(RakNet::RakPeerInterface *peer)
{
AddPacket<PacketObjectAnimPlay>(&packets, peer);
AddPacket<PacketObjectAttach>(&packets, peer);
AddPacket<PacketObjectCollision>(&packets, peer);
AddPacket<PacketObjectDelete>(&packets, peer);
AddPacket<PacketObjectLock>(&packets, peer);
AddPacket<PacketObjectMove>(&packets, peer);
AddPacket<PacketObjectPlace>(&packets, peer);
AddPacket<PacketObjectReset>(&packets, peer);
AddPacket<PacketObjectRotate>(&packets, peer);
AddPacket<PacketObjectScale>(&packets, peer);
AddPacket<PacketObjectSpawn>(&packets, peer);
AddPacket<PacketObjectState>(&packets, peer);
AddPacket<PacketObjectTrap>(&packets, peer);
AddPacket<PacketContainer>(&packets, peer);
AddPacket<PacketDoorDestination>(&packets, peer);
AddPacket<PacketDoorState>(&packets, peer);
AddPacket<PacketMusicPlay>(&packets, peer);
AddPacket<PacketVideoPlay>(&packets, peer);
AddPacket<PacketConsoleCommand>(&packets, peer);
AddPacket<PacketScriptLocalShort>(&packets, peer);
AddPacket<PacketScriptLocalFloat>(&packets, peer);
AddPacket<PacketScriptMemberShort>(&packets, peer);
AddPacket<PacketScriptMemberFloat>(&packets, peer);
AddPacket<PacketScriptGlobalShort>(&packets, peer);
AddPacket<PacketScriptGlobalFloat>(&packets, peer);
}
mwmp::WorldPacket *mwmp::WorldPacketController::GetPacket(RakNet::MessageID id)
{
return packets[(unsigned char)id].get();
}
void mwmp::WorldPacketController::SetStream(RakNet::BitStream *inStream, RakNet::BitStream *outStream)
{
for(const auto &packet : packets)
packet.second->SetStreams(inStream, outStream);
}
bool mwmp::WorldPacketController::ContainsPacket(RakNet::MessageID id)
{
for(const auto &packet : packets)
{
if (packet.first == id)
return true;
}
return false;
}

@ -1,11 +1,11 @@
#include <components/openmw-mp/NetworkMessages.hpp> #include <components/openmw-mp/NetworkMessages.hpp>
#include <PacketPriority.h> #include <PacketPriority.h>
#include <RakPeer.h> #include <RakPeer.h>
#include "WorldPacket.hpp" #include "ObjectPacket.hpp"
using namespace mwmp; using namespace mwmp;
WorldPacket::WorldPacket(RakNet::RakPeerInterface *peer) : BasePacket(peer) ObjectPacket::ObjectPacket(RakNet::RakPeerInterface *peer) : BasePacket(peer)
{ {
hasCellData = false; hasCellData = false;
packetID = 0; packetID = 0;
@ -15,18 +15,18 @@ WorldPacket::WorldPacket(RakNet::RakPeerInterface *peer) : BasePacket(peer)
this->peer = peer; this->peer = peer;
} }
WorldPacket::~WorldPacket() ObjectPacket::~ObjectPacket()
{ {
} }
void WorldPacket::setEvent(BaseEvent *event) void ObjectPacket::setEvent(BaseEvent *event)
{ {
this->event = event; this->event = event;
guid = event->guid; guid = event->guid;
} }
void WorldPacket::Packet(RakNet::BitStream *bs, bool send) void ObjectPacket::Packet(RakNet::BitStream *bs, bool send)
{ {
if (!PacketHeader(bs, send)) if (!PacketHeader(bs, send))
return; return;
@ -44,7 +44,7 @@ void WorldPacket::Packet(RakNet::BitStream *bs, bool send)
} }
} }
bool WorldPacket::PacketHeader(RakNet::BitStream *bs, bool send) bool ObjectPacket::PacketHeader(RakNet::BitStream *bs, bool send)
{ {
BasePacket::Packet(bs, send); BasePacket::Packet(bs, send);
@ -70,7 +70,7 @@ bool WorldPacket::PacketHeader(RakNet::BitStream *bs, bool send)
return true; return true;
} }
void WorldPacket::Object(WorldObject &worldObject, bool send) void ObjectPacket::Object(WorldObject &worldObject, bool send)
{ {
RW(worldObject.refId, send); RW(worldObject.refId, send);
RW(worldObject.refNumIndex, send); RW(worldObject.refNumIndex, send);

@ -12,12 +12,12 @@
namespace mwmp namespace mwmp
{ {
class WorldPacket : public BasePacket class ObjectPacket : public BasePacket
{ {
public: public:
WorldPacket(RakNet::RakPeerInterface *peer); ObjectPacket(RakNet::RakPeerInterface *peer);
~WorldPacket(); ~ObjectPacket();
void setEvent(BaseEvent *event); void setEvent(BaseEvent *event);

@ -3,7 +3,7 @@
using namespace mwmp; using namespace mwmp;
PacketConsoleCommand::PacketConsoleCommand(RakNet::RakPeerInterface *peer) : WorldPacket(peer) PacketConsoleCommand::PacketConsoleCommand(RakNet::RakPeerInterface *peer) : ObjectPacket(peer)
{ {
packetID = ID_CONSOLE_COMMAND; packetID = ID_CONSOLE_COMMAND;
} }

@ -1,11 +1,11 @@
#ifndef OPENMW_PACKETCONSOLECOMMAND_HPP #ifndef OPENMW_PACKETCONSOLECOMMAND_HPP
#define OPENMW_PACKETCONSOLECOMMAND_HPP #define OPENMW_PACKETCONSOLECOMMAND_HPP
#include <components/openmw-mp/Packets/World/WorldPacket.hpp> #include <components/openmw-mp/Packets/Object/ObjectPacket.hpp>
namespace mwmp namespace mwmp
{ {
class PacketConsoleCommand : public WorldPacket class PacketConsoleCommand : public ObjectPacket
{ {
public: public:
PacketConsoleCommand(RakNet::RakPeerInterface *peer); PacketConsoleCommand(RakNet::RakPeerInterface *peer);

@ -4,7 +4,7 @@
using namespace mwmp; using namespace mwmp;
PacketContainer::PacketContainer(RakNet::RakPeerInterface *peer) : WorldPacket(peer) PacketContainer::PacketContainer(RakNet::RakPeerInterface *peer) : ObjectPacket(peer)
{ {
packetID = ID_CONTAINER; packetID = ID_CONTAINER;
hasCellData = true; hasCellData = true;

@ -1,11 +1,11 @@
#ifndef OPENMW_PACKETCONTAINER_HPP #ifndef OPENMW_PACKETCONTAINER_HPP
#define OPENMW_PACKETCONTAINER_HPP #define OPENMW_PACKETCONTAINER_HPP
#include <components/openmw-mp/Packets/World/WorldPacket.hpp> #include <components/openmw-mp/Packets/Object/ObjectPacket.hpp>
namespace mwmp namespace mwmp
{ {
class PacketContainer : public WorldPacket class PacketContainer : public ObjectPacket
{ {
public: public:
PacketContainer(RakNet::RakPeerInterface *peer); PacketContainer(RakNet::RakPeerInterface *peer);

@ -3,7 +3,7 @@
using namespace mwmp; using namespace mwmp;
PacketDoorDestination::PacketDoorDestination(RakNet::RakPeerInterface *peer) : WorldPacket(peer) PacketDoorDestination::PacketDoorDestination(RakNet::RakPeerInterface *peer) : ObjectPacket(peer)
{ {
packetID = ID_DOOR_DESTINATION; packetID = ID_DOOR_DESTINATION;
hasCellData = true; hasCellData = true;
@ -11,7 +11,7 @@ PacketDoorDestination::PacketDoorDestination(RakNet::RakPeerInterface *peer) : W
void PacketDoorDestination::Object(WorldObject &worldObject, bool send) void PacketDoorDestination::Object(WorldObject &worldObject, bool send)
{ {
WorldPacket::Object(worldObject, send); ObjectPacket::Object(worldObject, send);
RW(worldObject.teleportState, send); RW(worldObject.teleportState, send);

@ -1,11 +1,11 @@
#ifndef OPENMW_PACKETDOORDESTINATION_HPP #ifndef OPENMW_PACKETDOORDESTINATION_HPP
#define OPENMW_PACKETDOORDESTINATION_HPP #define OPENMW_PACKETDOORDESTINATION_HPP
#include <components/openmw-mp/Packets/World/WorldPacket.hpp> #include <components/openmw-mp/Packets/Object/ObjectPacket.hpp>
namespace mwmp namespace mwmp
{ {
class PacketDoorDestination : public WorldPacket class PacketDoorDestination : public ObjectPacket
{ {
public: public:
PacketDoorDestination(RakNet::RakPeerInterface *peer); PacketDoorDestination(RakNet::RakPeerInterface *peer);

@ -3,7 +3,7 @@
using namespace mwmp; using namespace mwmp;
PacketDoorState::PacketDoorState(RakNet::RakPeerInterface *peer) : WorldPacket(peer) PacketDoorState::PacketDoorState(RakNet::RakPeerInterface *peer) : ObjectPacket(peer)
{ {
packetID = ID_DOOR_STATE; packetID = ID_DOOR_STATE;
hasCellData = true; hasCellData = true;
@ -11,6 +11,6 @@ PacketDoorState::PacketDoorState(RakNet::RakPeerInterface *peer) : WorldPacket(p
void PacketDoorState::Object(WorldObject &worldObject, bool send) void PacketDoorState::Object(WorldObject &worldObject, bool send)
{ {
WorldPacket::Object(worldObject, send); ObjectPacket::Object(worldObject, send);
RW(worldObject.doorState, send); RW(worldObject.doorState, send);
} }

@ -1,11 +1,11 @@
#ifndef OPENMW_PACKETDOORSTATE_HPP #ifndef OPENMW_PACKETDOORSTATE_HPP
#define OPENMW_PACKETDOORSTATE_HPP #define OPENMW_PACKETDOORSTATE_HPP
#include <components/openmw-mp/Packets/World/WorldPacket.hpp> #include <components/openmw-mp/Packets/Object/ObjectPacket.hpp>
namespace mwmp namespace mwmp
{ {
class PacketDoorState : public WorldPacket class PacketDoorState : public ObjectPacket
{ {
public: public:
PacketDoorState(RakNet::RakPeerInterface *peer); PacketDoorState(RakNet::RakPeerInterface *peer);

@ -3,7 +3,7 @@
using namespace mwmp; using namespace mwmp;
PacketMusicPlay::PacketMusicPlay(RakNet::RakPeerInterface *peer) : WorldPacket(peer) PacketMusicPlay::PacketMusicPlay(RakNet::RakPeerInterface *peer) : ObjectPacket(peer)
{ {
packetID = ID_MUSIC_PLAY; packetID = ID_MUSIC_PLAY;
} }

@ -1,11 +1,11 @@
#ifndef OPENMW_PACKETMUSICPLAY_HPP #ifndef OPENMW_PACKETMUSICPLAY_HPP
#define OPENMW_PACKETMUSICPLAY_HPP #define OPENMW_PACKETMUSICPLAY_HPP
#include <components/openmw-mp/Packets/World/WorldPacket.hpp> #include <components/openmw-mp/Packets/Object/ObjectPacket.hpp>
namespace mwmp namespace mwmp
{ {
class PacketMusicPlay : public WorldPacket class PacketMusicPlay : public ObjectPacket
{ {
public: public:
PacketMusicPlay(RakNet::RakPeerInterface *peer); PacketMusicPlay(RakNet::RakPeerInterface *peer);

@ -3,7 +3,7 @@
using namespace mwmp; using namespace mwmp;
PacketObjectAnimPlay::PacketObjectAnimPlay(RakNet::RakPeerInterface *peer) : WorldPacket(peer) PacketObjectAnimPlay::PacketObjectAnimPlay(RakNet::RakPeerInterface *peer) : ObjectPacket(peer)
{ {
packetID = ID_OBJECT_ANIM_PLAY; packetID = ID_OBJECT_ANIM_PLAY;
hasCellData = true; hasCellData = true;
@ -11,7 +11,7 @@ PacketObjectAnimPlay::PacketObjectAnimPlay(RakNet::RakPeerInterface *peer) : Wor
void PacketObjectAnimPlay::Object(WorldObject &worldObject, bool send) void PacketObjectAnimPlay::Object(WorldObject &worldObject, bool send)
{ {
WorldPacket::Object(worldObject, send); ObjectPacket::Object(worldObject, send);
RW(worldObject.animGroup, send); RW(worldObject.animGroup, send);
RW(worldObject.animMode, send); RW(worldObject.animMode, send);
} }

@ -1,11 +1,11 @@
#ifndef OPENMW_PACKETOBJECTANIMPLAY_HPP #ifndef OPENMW_PACKETOBJECTANIMPLAY_HPP
#define OPENMW_PACKETOBJECTANIMPLAY_HPP #define OPENMW_PACKETOBJECTANIMPLAY_HPP
#include <components/openmw-mp/Packets/World/WorldPacket.hpp> #include <components/openmw-mp/Packets/Object/ObjectPacket.hpp>
namespace mwmp namespace mwmp
{ {
class PacketObjectAnimPlay : public WorldPacket class PacketObjectAnimPlay : public ObjectPacket
{ {
public: public:
PacketObjectAnimPlay(RakNet::RakPeerInterface *peer); PacketObjectAnimPlay(RakNet::RakPeerInterface *peer);

@ -3,7 +3,7 @@
using namespace mwmp; using namespace mwmp;
PacketObjectAttach::PacketObjectAttach(RakNet::RakPeerInterface *peer) : WorldPacket(peer) PacketObjectAttach::PacketObjectAttach(RakNet::RakPeerInterface *peer) : ObjectPacket(peer)
{ {
packetID = ID_OBJECT_ATTACH; packetID = ID_OBJECT_ATTACH;
hasCellData = true; hasCellData = true;
@ -11,6 +11,6 @@ PacketObjectAttach::PacketObjectAttach(RakNet::RakPeerInterface *peer) : WorldPa
void PacketObjectAttach::Object(WorldObject &worldObject, bool send) void PacketObjectAttach::Object(WorldObject &worldObject, bool send)
{ {
WorldPacket::Object(worldObject, send); ObjectPacket::Object(worldObject, send);
// Placeholder // Placeholder
} }

@ -1,11 +1,11 @@
#ifndef OPENMW_PACKETOBJECTATTACH_HPP #ifndef OPENMW_PACKETOBJECTATTACH_HPP
#define OPENMW_PACKETOBJECTATTACH_HPP #define OPENMW_PACKETOBJECTATTACH_HPP
#include <components/openmw-mp/Packets/World/WorldPacket.hpp> #include <components/openmw-mp/Packets/Object/ObjectPacket.hpp>
namespace mwmp namespace mwmp
{ {
class PacketObjectAttach : public WorldPacket class PacketObjectAttach : public ObjectPacket
{ {
public: public:
PacketObjectAttach(RakNet::RakPeerInterface *peer); PacketObjectAttach(RakNet::RakPeerInterface *peer);

@ -3,7 +3,7 @@
using namespace mwmp; using namespace mwmp;
PacketObjectCollision::PacketObjectCollision(RakNet::RakPeerInterface *peer) : WorldPacket(peer) PacketObjectCollision::PacketObjectCollision(RakNet::RakPeerInterface *peer) : ObjectPacket(peer)
{ {
packetID = ID_OBJECT_COLLISION; packetID = ID_OBJECT_COLLISION;
hasCellData = true; hasCellData = true;
@ -11,6 +11,6 @@ PacketObjectCollision::PacketObjectCollision(RakNet::RakPeerInterface *peer) : W
void PacketObjectCollision::Object(WorldObject &worldObject, bool send) void PacketObjectCollision::Object(WorldObject &worldObject, bool send)
{ {
WorldPacket::Object(worldObject, send); ObjectPacket::Object(worldObject, send);
// Placeholder // Placeholder
} }

@ -1,11 +1,11 @@
#ifndef OPENMW_PACKETOBJECTCOLLISION_HPP #ifndef OPENMW_PACKETOBJECTCOLLISION_HPP
#define OPENMW_PACKETOBJECTCOLLISION_HPP #define OPENMW_PACKETOBJECTCOLLISION_HPP
#include <components/openmw-mp/Packets/World/WorldPacket.hpp> #include <components/openmw-mp/Packets/Object/ObjectPacket.hpp>
namespace mwmp namespace mwmp
{ {
class PacketObjectCollision : public WorldPacket class PacketObjectCollision : public ObjectPacket
{ {
public: public:
PacketObjectCollision(RakNet::RakPeerInterface *peer); PacketObjectCollision(RakNet::RakPeerInterface *peer);

@ -3,7 +3,7 @@
using namespace mwmp; using namespace mwmp;
PacketObjectDelete::PacketObjectDelete(RakNet::RakPeerInterface *peer) : WorldPacket(peer) PacketObjectDelete::PacketObjectDelete(RakNet::RakPeerInterface *peer) : ObjectPacket(peer)
{ {
packetID = ID_OBJECT_DELETE; packetID = ID_OBJECT_DELETE;
hasCellData = true; hasCellData = true;

@ -1,11 +1,11 @@
#ifndef OPENMW_PACKETOBJECTDELETE_HPP #ifndef OPENMW_PACKETOBJECTDELETE_HPP
#define OPENMW_PACKETOBJECTDELETE_HPP #define OPENMW_PACKETOBJECTDELETE_HPP
#include <components/openmw-mp/Packets/World/WorldPacket.hpp> #include <components/openmw-mp/Packets/Object/ObjectPacket.hpp>
namespace mwmp namespace mwmp
{ {
class PacketObjectDelete : public WorldPacket class PacketObjectDelete : public ObjectPacket
{ {
public: public:
PacketObjectDelete(RakNet::RakPeerInterface *peer); PacketObjectDelete(RakNet::RakPeerInterface *peer);

@ -3,7 +3,7 @@
using namespace mwmp; using namespace mwmp;
PacketObjectLock::PacketObjectLock(RakNet::RakPeerInterface *peer) : WorldPacket(peer) PacketObjectLock::PacketObjectLock(RakNet::RakPeerInterface *peer) : ObjectPacket(peer)
{ {
packetID = ID_OBJECT_LOCK; packetID = ID_OBJECT_LOCK;
hasCellData = true; hasCellData = true;
@ -11,6 +11,6 @@ PacketObjectLock::PacketObjectLock(RakNet::RakPeerInterface *peer) : WorldPacket
void PacketObjectLock::Object(WorldObject &worldObject, bool send) void PacketObjectLock::Object(WorldObject &worldObject, bool send)
{ {
WorldPacket::Object(worldObject, send); ObjectPacket::Object(worldObject, send);
RW(worldObject.lockLevel, send); RW(worldObject.lockLevel, send);
} }

@ -1,11 +1,11 @@
#ifndef OPENMW_PACKETOBJECTLOCK_HPP #ifndef OPENMW_PACKETOBJECTLOCK_HPP
#define OPENMW_PACKETOBJECTLOCK_HPP #define OPENMW_PACKETOBJECTLOCK_HPP
#include <components/openmw-mp/Packets/World/WorldPacket.hpp> #include <components/openmw-mp/Packets/Object/ObjectPacket.hpp>
namespace mwmp namespace mwmp
{ {
class PacketObjectLock : public WorldPacket class PacketObjectLock : public ObjectPacket
{ {
public: public:
PacketObjectLock(RakNet::RakPeerInterface *peer); PacketObjectLock(RakNet::RakPeerInterface *peer);

@ -3,7 +3,7 @@
using namespace mwmp; using namespace mwmp;
PacketObjectMove::PacketObjectMove(RakNet::RakPeerInterface *peer) : WorldPacket(peer) PacketObjectMove::PacketObjectMove(RakNet::RakPeerInterface *peer) : ObjectPacket(peer)
{ {
packetID = ID_OBJECT_MOVE; packetID = ID_OBJECT_MOVE;
hasCellData = true; hasCellData = true;
@ -11,6 +11,6 @@ PacketObjectMove::PacketObjectMove(RakNet::RakPeerInterface *peer) : WorldPacket
void PacketObjectMove::Object(WorldObject &worldObject, bool send) void PacketObjectMove::Object(WorldObject &worldObject, bool send)
{ {
WorldPacket::Object(worldObject, send); ObjectPacket::Object(worldObject, send);
RW(worldObject.position.pos, send); RW(worldObject.position.pos, send);
} }

@ -1,11 +1,11 @@
#ifndef OPENMW_PacketObjectMove_HPP #ifndef OPENMW_PacketObjectMove_HPP
#define OPENMW_PacketObjectMove_HPP #define OPENMW_PacketObjectMove_HPP
#include <components/openmw-mp/Packets/World/WorldPacket.hpp> #include <components/openmw-mp/Packets/Object/ObjectPacket.hpp>
namespace mwmp namespace mwmp
{ {
class PacketObjectMove : public WorldPacket class PacketObjectMove : public ObjectPacket
{ {
public: public:
PacketObjectMove(RakNet::RakPeerInterface *peer); PacketObjectMove(RakNet::RakPeerInterface *peer);

@ -3,7 +3,7 @@
using namespace mwmp; using namespace mwmp;
PacketObjectPlace::PacketObjectPlace(RakNet::RakPeerInterface *peer) : WorldPacket(peer) PacketObjectPlace::PacketObjectPlace(RakNet::RakPeerInterface *peer) : ObjectPacket(peer)
{ {
packetID = ID_OBJECT_PLACE; packetID = ID_OBJECT_PLACE;
hasCellData = true; hasCellData = true;
@ -11,7 +11,7 @@ PacketObjectPlace::PacketObjectPlace(RakNet::RakPeerInterface *peer) : WorldPack
void PacketObjectPlace::Object(WorldObject &worldObject, bool send) void PacketObjectPlace::Object(WorldObject &worldObject, bool send)
{ {
WorldPacket::Object(worldObject, send); ObjectPacket::Object(worldObject, send);
RW(worldObject.count, send); RW(worldObject.count, send);
RW(worldObject.charge, send); RW(worldObject.charge, send);
RW(worldObject.enchantmentCharge, send); RW(worldObject.enchantmentCharge, send);

@ -1,11 +1,11 @@
#ifndef OPENMW_PACKETOBJECTPLACE_HPP #ifndef OPENMW_PACKETOBJECTPLACE_HPP
#define OPENMW_PACKETOBJECTPLACE_HPP #define OPENMW_PACKETOBJECTPLACE_HPP
#include <components/openmw-mp/Packets/World/WorldPacket.hpp> #include <components/openmw-mp/Packets/Object/ObjectPacket.hpp>
namespace mwmp namespace mwmp
{ {
class PacketObjectPlace : public WorldPacket class PacketObjectPlace : public ObjectPacket
{ {
public: public:
PacketObjectPlace(RakNet::RakPeerInterface *peer); PacketObjectPlace(RakNet::RakPeerInterface *peer);

@ -3,7 +3,7 @@
using namespace mwmp; using namespace mwmp;
PacketObjectReset::PacketObjectReset(RakNet::RakPeerInterface *peer) : WorldPacket(peer) PacketObjectReset::PacketObjectReset(RakNet::RakPeerInterface *peer) : ObjectPacket(peer)
{ {
packetID = ID_OBJECT_RESET; packetID = ID_OBJECT_RESET;
hasCellData = true; hasCellData = true;
@ -11,6 +11,6 @@ PacketObjectReset::PacketObjectReset(RakNet::RakPeerInterface *peer) : WorldPack
void PacketObjectReset::Object(WorldObject &worldObject, bool send) void PacketObjectReset::Object(WorldObject &worldObject, bool send)
{ {
WorldPacket::Object(worldObject, send); ObjectPacket::Object(worldObject, send);
// Placeholder // Placeholder
} }

@ -1,11 +1,11 @@
#ifndef OPENMW_PACKETOBJECTRESET_HPP #ifndef OPENMW_PACKETOBJECTRESET_HPP
#define OPENMW_PACKETOBJECTRESET_HPP #define OPENMW_PACKETOBJECTRESET_HPP
#include <components/openmw-mp/Packets/World/WorldPacket.hpp> #include <components/openmw-mp/Packets/Object/ObjectPacket.hpp>
namespace mwmp namespace mwmp
{ {
class PacketObjectReset : public WorldPacket class PacketObjectReset : public ObjectPacket
{ {
public: public:
PacketObjectReset(RakNet::RakPeerInterface *peer); PacketObjectReset(RakNet::RakPeerInterface *peer);

@ -3,7 +3,7 @@
using namespace mwmp; using namespace mwmp;
PacketObjectRotate::PacketObjectRotate(RakNet::RakPeerInterface *peer) : WorldPacket(peer) PacketObjectRotate::PacketObjectRotate(RakNet::RakPeerInterface *peer) : ObjectPacket(peer)
{ {
packetID = ID_OBJECT_ROTATE; packetID = ID_OBJECT_ROTATE;
hasCellData = true; hasCellData = true;
@ -11,7 +11,7 @@ PacketObjectRotate::PacketObjectRotate(RakNet::RakPeerInterface *peer) : WorldPa
void PacketObjectRotate::Object(WorldObject &worldObject, bool send) void PacketObjectRotate::Object(WorldObject &worldObject, bool send)
{ {
WorldPacket::Object(worldObject, send); ObjectPacket::Object(worldObject, send);
RW(worldObject.position.rot[0], send); RW(worldObject.position.rot[0], send);
RW(worldObject.position.rot[1], send); RW(worldObject.position.rot[1], send);
RW(worldObject.position.rot[2], send); RW(worldObject.position.rot[2], send);

@ -1,11 +1,11 @@
#ifndef OPENMW_PACKETOBJECTROTATE_HPP #ifndef OPENMW_PACKETOBJECTROTATE_HPP
#define OPENMW_PACKETOBJECTROTATE_HPP #define OPENMW_PACKETOBJECTROTATE_HPP
#include <components/openmw-mp/Packets/World/WorldPacket.hpp> #include <components/openmw-mp/Packets/Object/ObjectPacket.hpp>
namespace mwmp namespace mwmp
{ {
class PacketObjectRotate : public WorldPacket class PacketObjectRotate : public ObjectPacket
{ {
public: public:
PacketObjectRotate(RakNet::RakPeerInterface *peer); PacketObjectRotate(RakNet::RakPeerInterface *peer);

@ -3,7 +3,7 @@
using namespace mwmp; using namespace mwmp;
PacketObjectScale::PacketObjectScale(RakNet::RakPeerInterface *peer) : WorldPacket(peer) PacketObjectScale::PacketObjectScale(RakNet::RakPeerInterface *peer) : ObjectPacket(peer)
{ {
packetID = ID_OBJECT_SCALE; packetID = ID_OBJECT_SCALE;
hasCellData = true; hasCellData = true;
@ -11,6 +11,6 @@ PacketObjectScale::PacketObjectScale(RakNet::RakPeerInterface *peer) : WorldPack
void PacketObjectScale::Object(WorldObject &worldObject, bool send) void PacketObjectScale::Object(WorldObject &worldObject, bool send)
{ {
WorldPacket::Object(worldObject, send); ObjectPacket::Object(worldObject, send);
RW(worldObject.scale, send); RW(worldObject.scale, send);
} }

@ -1,11 +1,11 @@
#ifndef OPENMW_PACKETOBJECTSCALE_HPP #ifndef OPENMW_PACKETOBJECTSCALE_HPP
#define OPENMW_PACKETOBJECTSCALE_HPP #define OPENMW_PACKETOBJECTSCALE_HPP
#include <components/openmw-mp/Packets/World/WorldPacket.hpp> #include <components/openmw-mp/Packets/Object/ObjectPacket.hpp>
namespace mwmp namespace mwmp
{ {
class PacketObjectScale : public WorldPacket class PacketObjectScale : public ObjectPacket
{ {
public: public:
PacketObjectScale(RakNet::RakPeerInterface *peer); PacketObjectScale(RakNet::RakPeerInterface *peer);

@ -3,7 +3,7 @@
using namespace mwmp; using namespace mwmp;
PacketObjectSpawn::PacketObjectSpawn(RakNet::RakPeerInterface *peer) : WorldPacket(peer) PacketObjectSpawn::PacketObjectSpawn(RakNet::RakPeerInterface *peer) : ObjectPacket(peer)
{ {
packetID = ID_OBJECT_SPAWN; packetID = ID_OBJECT_SPAWN;
hasCellData = true; hasCellData = true;
@ -11,7 +11,7 @@ PacketObjectSpawn::PacketObjectSpawn(RakNet::RakPeerInterface *peer) : WorldPack
void PacketObjectSpawn::Object(WorldObject &worldObject, bool send) void PacketObjectSpawn::Object(WorldObject &worldObject, bool send)
{ {
WorldPacket::Object(worldObject, send); ObjectPacket::Object(worldObject, send);
RW(worldObject.position, send); RW(worldObject.position, send);
RW(worldObject.hasMaster, send); RW(worldObject.hasMaster, send);

@ -1,11 +1,11 @@
#ifndef OPENMW_PACKETOBJECTSPAWN_HPP #ifndef OPENMW_PACKETOBJECTSPAWN_HPP
#define OPENMW_PACKETOBJECTSPAWN_HPP #define OPENMW_PACKETOBJECTSPAWN_HPP
#include <components/openmw-mp/Packets/World/WorldPacket.hpp> #include <components/openmw-mp/Packets/Object/ObjectPacket.hpp>
namespace mwmp namespace mwmp
{ {
class PacketObjectSpawn : public WorldPacket class PacketObjectSpawn : public ObjectPacket
{ {
public: public:
PacketObjectSpawn(RakNet::RakPeerInterface *peer); PacketObjectSpawn(RakNet::RakPeerInterface *peer);

@ -3,7 +3,7 @@
using namespace mwmp; using namespace mwmp;
PacketObjectState::PacketObjectState(RakNet::RakPeerInterface *peer) : WorldPacket(peer) PacketObjectState::PacketObjectState(RakNet::RakPeerInterface *peer) : ObjectPacket(peer)
{ {
packetID = ID_OBJECT_STATE; packetID = ID_OBJECT_STATE;
hasCellData = true; hasCellData = true;
@ -11,6 +11,6 @@ PacketObjectState::PacketObjectState(RakNet::RakPeerInterface *peer) : WorldPack
void PacketObjectState::Object(WorldObject &worldObject, bool send) void PacketObjectState::Object(WorldObject &worldObject, bool send)
{ {
WorldPacket::Object(worldObject, send); ObjectPacket::Object(worldObject, send);
RW(worldObject.objectState, send); RW(worldObject.objectState, send);
} }

@ -1,11 +1,11 @@
#ifndef OPENMW_PACKETOBJECTSTATE_HPP #ifndef OPENMW_PACKETOBJECTSTATE_HPP
#define OPENMW_PACKETOBJECTSTATE_HPP #define OPENMW_PACKETOBJECTSTATE_HPP
#include <components/openmw-mp/Packets/World/WorldPacket.hpp> #include <components/openmw-mp/Packets/Object/ObjectPacket.hpp>
namespace mwmp namespace mwmp
{ {
class PacketObjectState : public WorldPacket class PacketObjectState : public ObjectPacket
{ {
public: public:
PacketObjectState(RakNet::RakPeerInterface *peer); PacketObjectState(RakNet::RakPeerInterface *peer);

@ -3,7 +3,7 @@
using namespace mwmp; using namespace mwmp;
PacketObjectTrap::PacketObjectTrap(RakNet::RakPeerInterface *peer) : WorldPacket(peer) PacketObjectTrap::PacketObjectTrap(RakNet::RakPeerInterface *peer) : ObjectPacket(peer)
{ {
packetID = ID_OBJECT_TRAP; packetID = ID_OBJECT_TRAP;
hasCellData = true; hasCellData = true;
@ -11,7 +11,7 @@ PacketObjectTrap::PacketObjectTrap(RakNet::RakPeerInterface *peer) : WorldPacket
void PacketObjectTrap::Object(WorldObject &worldObject, bool send) void PacketObjectTrap::Object(WorldObject &worldObject, bool send)
{ {
WorldPacket::Object(worldObject, send); ObjectPacket::Object(worldObject, send);
RW(worldObject.isDisarmed, send); RW(worldObject.isDisarmed, send);
if (!worldObject.isDisarmed) if (!worldObject.isDisarmed)

@ -1,11 +1,11 @@
#ifndef OPENMW_PACKETOBJECTTRAP_HPP #ifndef OPENMW_PACKETOBJECTTRAP_HPP
#define OPENMW_PACKETOBJECTTRAP_HPP #define OPENMW_PACKETOBJECTTRAP_HPP
#include <components/openmw-mp/Packets/World/WorldPacket.hpp> #include <components/openmw-mp/Packets/Object/ObjectPacket.hpp>
namespace mwmp namespace mwmp
{ {
class PacketObjectTrap : public WorldPacket class PacketObjectTrap : public ObjectPacket
{ {
public: public:
PacketObjectTrap(RakNet::RakPeerInterface *peer); PacketObjectTrap(RakNet::RakPeerInterface *peer);

@ -3,7 +3,7 @@
using namespace mwmp; using namespace mwmp;
PacketScriptGlobalFloat::PacketScriptGlobalFloat(RakNet::RakPeerInterface *peer) : WorldPacket(peer) PacketScriptGlobalFloat::PacketScriptGlobalFloat(RakNet::RakPeerInterface *peer) : ObjectPacket(peer)
{ {
packetID = ID_SCRIPT_GLOBAL_FLOAT; packetID = ID_SCRIPT_GLOBAL_FLOAT;
} }

@ -1,11 +1,11 @@
#ifndef OPENMW_PACKETSCRIPTGLOBALFLOAT_HPP #ifndef OPENMW_PACKETSCRIPTGLOBALFLOAT_HPP
#define OPENMW_PACKETSCRIPTGLOBALFLOAT_HPP #define OPENMW_PACKETSCRIPTGLOBALFLOAT_HPP
#include <components/openmw-mp/Packets/World/WorldPacket.hpp> #include <components/openmw-mp/Packets/Object/ObjectPacket.hpp>
namespace mwmp namespace mwmp
{ {
class PacketScriptGlobalFloat : public WorldPacket class PacketScriptGlobalFloat : public ObjectPacket
{ {
public: public:
PacketScriptGlobalFloat(RakNet::RakPeerInterface *peer); PacketScriptGlobalFloat(RakNet::RakPeerInterface *peer);

@ -3,7 +3,7 @@
using namespace mwmp; using namespace mwmp;
PacketScriptGlobalShort::PacketScriptGlobalShort(RakNet::RakPeerInterface *peer) : WorldPacket(peer) PacketScriptGlobalShort::PacketScriptGlobalShort(RakNet::RakPeerInterface *peer) : ObjectPacket(peer)
{ {
packetID = ID_SCRIPT_GLOBAL_SHORT; packetID = ID_SCRIPT_GLOBAL_SHORT;
} }

@ -1,11 +1,11 @@
#ifndef OPENMW_PACKETSCRIPTGLOBALSHORT_HPP #ifndef OPENMW_PACKETSCRIPTGLOBALSHORT_HPP
#define OPENMW_PACKETSCRIPTGLOBALSHORT_HPP #define OPENMW_PACKETSCRIPTGLOBALSHORT_HPP
#include <components/openmw-mp/Packets/World/WorldPacket.hpp> #include <components/openmw-mp/Packets/Object/ObjectPacket.hpp>
namespace mwmp namespace mwmp
{ {
class PacketScriptGlobalShort : public WorldPacket class PacketScriptGlobalShort : public ObjectPacket
{ {
public: public:
PacketScriptGlobalShort(RakNet::RakPeerInterface *peer); PacketScriptGlobalShort(RakNet::RakPeerInterface *peer);

@ -3,7 +3,7 @@
using namespace mwmp; using namespace mwmp;
PacketScriptLocalFloat::PacketScriptLocalFloat(RakNet::RakPeerInterface *peer) : WorldPacket(peer) PacketScriptLocalFloat::PacketScriptLocalFloat(RakNet::RakPeerInterface *peer) : ObjectPacket(peer)
{ {
packetID = ID_SCRIPT_LOCAL_FLOAT; packetID = ID_SCRIPT_LOCAL_FLOAT;
hasCellData = true; hasCellData = true;
@ -11,7 +11,7 @@ PacketScriptLocalFloat::PacketScriptLocalFloat(RakNet::RakPeerInterface *peer) :
void PacketScriptLocalFloat::Object(WorldObject &worldObject, bool send) void PacketScriptLocalFloat::Object(WorldObject &worldObject, bool send)
{ {
WorldPacket::Object(worldObject, send); ObjectPacket::Object(worldObject, send);
RW(worldObject.index, send); RW(worldObject.index, send);
RW(worldObject.floatVal, send); RW(worldObject.floatVal, send);
} }

@ -1,11 +1,11 @@
#ifndef OPENMW_PACKETSCRIPTLOCALFLOAT_HPP #ifndef OPENMW_PACKETSCRIPTLOCALFLOAT_HPP
#define OPENMW_PACKETSCRIPTLOCALFLOAT_HPP #define OPENMW_PACKETSCRIPTLOCALFLOAT_HPP
#include <components/openmw-mp/Packets/World/WorldPacket.hpp> #include <components/openmw-mp/Packets/Object/ObjectPacket.hpp>
namespace mwmp namespace mwmp
{ {
class PacketScriptLocalFloat : public WorldPacket class PacketScriptLocalFloat : public ObjectPacket
{ {
public: public:
PacketScriptLocalFloat(RakNet::RakPeerInterface *peer); PacketScriptLocalFloat(RakNet::RakPeerInterface *peer);

@ -3,7 +3,7 @@
using namespace mwmp; using namespace mwmp;
PacketScriptLocalShort::PacketScriptLocalShort(RakNet::RakPeerInterface *peer) : WorldPacket(peer) PacketScriptLocalShort::PacketScriptLocalShort(RakNet::RakPeerInterface *peer) : ObjectPacket(peer)
{ {
packetID = ID_SCRIPT_LOCAL_SHORT; packetID = ID_SCRIPT_LOCAL_SHORT;
hasCellData = true; hasCellData = true;
@ -11,7 +11,7 @@ PacketScriptLocalShort::PacketScriptLocalShort(RakNet::RakPeerInterface *peer) :
void PacketScriptLocalShort::Object(WorldObject &worldObject, bool send) void PacketScriptLocalShort::Object(WorldObject &worldObject, bool send)
{ {
WorldPacket::Object(worldObject, send); ObjectPacket::Object(worldObject, send);
RW(worldObject.index, send); RW(worldObject.index, send);
RW(worldObject.shortVal, send); RW(worldObject.shortVal, send);
} }

@ -1,11 +1,11 @@
#ifndef OPENMW_PACKETSCRIPTLOCALSHORT_HPP #ifndef OPENMW_PACKETSCRIPTLOCALSHORT_HPP
#define OPENMW_PACKETSCRIPTLOCALSHORT_HPP #define OPENMW_PACKETSCRIPTLOCALSHORT_HPP
#include <components/openmw-mp/Packets/World/WorldPacket.hpp> #include <components/openmw-mp/Packets/Object/ObjectPacket.hpp>
namespace mwmp namespace mwmp
{ {
class PacketScriptLocalShort : public WorldPacket class PacketScriptLocalShort : public ObjectPacket
{ {
public: public:
PacketScriptLocalShort(RakNet::RakPeerInterface *peer); PacketScriptLocalShort(RakNet::RakPeerInterface *peer);

@ -3,7 +3,7 @@
using namespace mwmp; using namespace mwmp;
PacketScriptMemberFloat::PacketScriptMemberFloat(RakNet::RakPeerInterface *peer) : WorldPacket(peer) PacketScriptMemberFloat::PacketScriptMemberFloat(RakNet::RakPeerInterface *peer) : ObjectPacket(peer)
{ {
packetID = ID_SCRIPT_MEMBER_FLOAT; packetID = ID_SCRIPT_MEMBER_FLOAT;
} }

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save