diff --git a/apps/openmw-mp/Cell.cpp b/apps/openmw-mp/Cell.cpp index 207b684a6..52c431a5e 100644 --- a/apps/openmw-mp/Cell.cpp +++ b/apps/openmw-mp/Cell.cpp @@ -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()) return; @@ -231,10 +231,10 @@ void Cell::sendToLoaded(mwmp::WorldPacket *worldPacket, mwmp::BaseEvent *baseEve { if (pl->guid == baseEvent->guid) continue; - worldPacket->setEvent(baseEvent); + objectPacket->setEvent(baseEvent); // Send the packet to this eligible guid - worldPacket->Send(pl->guid); + objectPacket->Send(pl->guid); } } diff --git a/apps/openmw-mp/Cell.hpp b/apps/openmw-mp/Cell.hpp index 4ad8eb428..50b0537f3 100644 --- a/apps/openmw-mp/Cell.hpp +++ b/apps/openmw-mp/Cell.hpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include class Player; class Cell; @@ -41,7 +41,7 @@ public: TPlayers getPlayers() 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; diff --git a/apps/openmw-mp/CellController.hpp b/apps/openmw-mp/CellController.hpp index b71064156..79a7336b5 100644 --- a/apps/openmw-mp/CellController.hpp +++ b/apps/openmw-mp/CellController.hpp @@ -6,7 +6,7 @@ #include #include #include -#include +#include class Player; class Cell; diff --git a/apps/openmw-mp/Networking.cpp b/apps/openmw-mp/Networking.cpp index 30c580f53..bd0b1324a 100644 --- a/apps/openmw-mp/Networking.cpp +++ b/apps/openmw-mp/Networking.cpp @@ -45,12 +45,12 @@ Networking::Networking(RakNet::RakPeerInterface *peer) : mclient(nullptr) playerPacketController = new PlayerPacketController(peer); actorPacketController = new ActorPacketController(peer); - worldPacketController = new WorldPacketController(peer); + objectPacketController = new ObjectPacketController(peer); // Set send stream playerPacketController->SetStream(0, &bsOut); actorPacketController->SetStream(0, &bsOut); - worldPacketController->SetStream(0, &bsOut); + objectPacketController->SetStream(0, &bsOut); running = true; exitCode = 0; @@ -71,7 +71,7 @@ Networking::~Networking() sThis = 0; delete playerPacketController; delete actorPacketController; - delete worldPacketController; + delete objectPacketController; } 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); @@ -189,7 +189,7 @@ void Networking::processWorldPacket(RakNet::Packet *packet) return; 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); processActorPacket(packet); } - else if (worldPacketController->ContainsPacket(packet->data[0])) + else if (objectPacketController->ContainsPacket(packet->data[0])) { - worldPacketController->SetStream(&bsIn, 0); - processWorldPacket(packet); + objectPacketController->SetStream(&bsIn, 0); + processObjectPacket(packet); } else 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; } -WorldPacketController *Networking::getWorldPacketController() const +ObjectPacketController *Networking::getObjectPacketController() const { - return worldPacketController; + return objectPacketController; } BaseActorList *Networking::getLastActorList() diff --git a/apps/openmw-mp/Networking.hpp b/apps/openmw-mp/Networking.hpp index 74f5090b7..36b2b05a5 100644 --- a/apps/openmw-mp/Networking.hpp +++ b/apps/openmw-mp/Networking.hpp @@ -7,7 +7,7 @@ #include #include -#include +#include #include #include "Player.hpp" @@ -30,7 +30,7 @@ namespace mwmp void processPlayerPacket(RakNet::Packet *packet); void processActorPacket(RakNet::Packet *packet); - void processWorldPacket(RakNet::Packet *packet); + void processObjectPacket(RakNet::Packet *packet); void update(RakNet::Packet *packet); unsigned short numberOfConnections() const; @@ -43,7 +43,7 @@ namespace mwmp PlayerPacketController *getPlayerPacketController() const; ActorPacketController *getActorPacketController() const; - WorldPacketController *getWorldPacketController() const; + ObjectPacketController *getObjectPacketController() const; BaseActorList *getLastActorList(); BaseEvent *getLastEvent(); @@ -79,7 +79,7 @@ namespace mwmp PlayerPacketController *playerPacketController; ActorPacketController *actorPacketController; - WorldPacketController *worldPacketController; + ObjectPacketController *objectPacketController; bool running; int exitCode; diff --git a/apps/openmw-mp/Script/Functions/World.cpp b/apps/openmw-mp/Script/Functions/World.cpp index 9147488b3..e28fe870f 100644 --- a/apps/openmw-mp/Script/Functions/World.cpp +++ b/apps/openmw-mp/Script/Functions/World.cpp @@ -337,7 +337,7 @@ void WorldFunctions::AddContainerItem() 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->Send(false); @@ -347,7 +347,7 @@ void WorldFunctions::SendObjectPlace(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->Send(false); @@ -357,7 +357,7 @@ void WorldFunctions::SendObjectSpawn(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->Send(false); @@ -367,7 +367,7 @@ void WorldFunctions::SendObjectDelete(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->Send(false); @@ -377,7 +377,7 @@ void WorldFunctions::SendObjectLock(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->Send(false); @@ -387,7 +387,7 @@ void WorldFunctions::SendObjectTrap(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->Send(false); @@ -397,7 +397,7 @@ void WorldFunctions::SendObjectScale(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->Send(false); @@ -407,7 +407,7 @@ void WorldFunctions::SendObjectState(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->Send(false); @@ -417,7 +417,7 @@ void WorldFunctions::SendDoorState(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->Send(false); @@ -427,7 +427,7 @@ void WorldFunctions::SendDoorDestination(bool broadcast) 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) packet->setEvent(readEvent); @@ -442,7 +442,7 @@ void WorldFunctions::SendContainer(bool broadcast, bool useLastReadEvent) noexce 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->Send(false); diff --git a/apps/openmw-mp/processors/WorldProcessor.cpp b/apps/openmw-mp/processors/WorldProcessor.cpp index 1dbebb5cd..ac8a79d2f 100644 --- a/apps/openmw-mp/processors/WorldProcessor.cpp +++ b/apps/openmw-mp/processors/WorldProcessor.cpp @@ -10,7 +10,7 @@ using namespace mwmp; template typename BasePacketProcessor::processors_t BasePacketProcessor::processors; -void WorldProcessor::Do(WorldPacket &packet, Player &player, BaseEvent &event) +void WorldProcessor::Do(ObjectPacket &packet, Player &player, BaseEvent &event) { packet.Send(true); } @@ -27,7 +27,7 @@ bool WorldProcessor::Process(RakNet::Packet &packet, BaseEvent &event) noexcept if (processor.first == packet.data[0]) { 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); event.isValid = true; diff --git a/apps/openmw-mp/processors/WorldProcessor.hpp b/apps/openmw-mp/processors/WorldProcessor.hpp index b4a70632b..30b2e7a52 100644 --- a/apps/openmw-mp/processors/WorldProcessor.hpp +++ b/apps/openmw-mp/processors/WorldProcessor.hpp @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include "Script/Script.hpp" #include "Player.hpp" @@ -19,7 +19,7 @@ namespace mwmp { 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; }; diff --git a/apps/openmw-mp/processors/world/ProcessorContainer.hpp b/apps/openmw-mp/processors/world/ProcessorContainer.hpp index d2ad90440..c6ef9ad09 100644 --- a/apps/openmw-mp/processors/world/ProcessorContainer.hpp +++ b/apps/openmw-mp/processors/world/ProcessorContainer.hpp @@ -13,7 +13,7 @@ namespace mwmp 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_APPEND(Log::LOG_INFO, "- action: %i", event.action); diff --git a/apps/openmw-mp/processors/world/ProcessorDoorState.hpp b/apps/openmw-mp/processors/world/ProcessorDoorState.hpp index 0167b66c9..221d69949 100644 --- a/apps/openmw-mp/processors/world/ProcessorDoorState.hpp +++ b/apps/openmw-mp/processors/world/ProcessorDoorState.hpp @@ -13,7 +13,7 @@ namespace mwmp 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); diff --git a/apps/openmw-mp/processors/world/ProcessorObjectDelete.hpp b/apps/openmw-mp/processors/world/ProcessorObjectDelete.hpp index 7c8a5e4fb..524524372 100644 --- a/apps/openmw-mp/processors/world/ProcessorObjectDelete.hpp +++ b/apps/openmw-mp/processors/world/ProcessorObjectDelete.hpp @@ -13,7 +13,7 @@ namespace mwmp 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()); diff --git a/apps/openmw-mp/processors/world/ProcessorObjectLock.hpp b/apps/openmw-mp/processors/world/ProcessorObjectLock.hpp index 0bc8ad7dd..9e9d5a004 100644 --- a/apps/openmw-mp/processors/world/ProcessorObjectLock.hpp +++ b/apps/openmw-mp/processors/world/ProcessorObjectLock.hpp @@ -13,7 +13,7 @@ namespace mwmp 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()); diff --git a/apps/openmw-mp/processors/world/ProcessorObjectPlace.hpp b/apps/openmw-mp/processors/world/ProcessorObjectPlace.hpp index 5ad4f3bb1..5f3cec4ec 100644 --- a/apps/openmw-mp/processors/world/ProcessorObjectPlace.hpp +++ b/apps/openmw-mp/processors/world/ProcessorObjectPlace.hpp @@ -14,7 +14,7 @@ namespace mwmp 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()); diff --git a/apps/openmw-mp/processors/world/ProcessorObjectScale.hpp b/apps/openmw-mp/processors/world/ProcessorObjectScale.hpp index b79cc9c6f..066ebacb1 100644 --- a/apps/openmw-mp/processors/world/ProcessorObjectScale.hpp +++ b/apps/openmw-mp/processors/world/ProcessorObjectScale.hpp @@ -13,7 +13,7 @@ namespace mwmp 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()); diff --git a/apps/openmw-mp/processors/world/ProcessorObjectSpawn.hpp b/apps/openmw-mp/processors/world/ProcessorObjectSpawn.hpp index 5924bc675..37327d4fa 100644 --- a/apps/openmw-mp/processors/world/ProcessorObjectSpawn.hpp +++ b/apps/openmw-mp/processors/world/ProcessorObjectSpawn.hpp @@ -14,7 +14,7 @@ namespace mwmp 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()); diff --git a/apps/openmw-mp/processors/world/ProcessorObjectState.hpp b/apps/openmw-mp/processors/world/ProcessorObjectState.hpp index 52b0e2687..296541bfd 100644 --- a/apps/openmw-mp/processors/world/ProcessorObjectState.hpp +++ b/apps/openmw-mp/processors/world/ProcessorObjectState.hpp @@ -13,7 +13,7 @@ namespace mwmp 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()); diff --git a/apps/openmw-mp/processors/world/ProcessorObjectTrap.hpp b/apps/openmw-mp/processors/world/ProcessorObjectTrap.hpp index bbd0a5b5e..b4b9638b1 100644 --- a/apps/openmw-mp/processors/world/ProcessorObjectTrap.hpp +++ b/apps/openmw-mp/processors/world/ProcessorObjectTrap.hpp @@ -13,7 +13,7 @@ namespace mwmp 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()); diff --git a/apps/openmw/mwgui/container.cpp b/apps/openmw/mwgui/container.cpp index c2d80b839..0d19f9f89 100644 --- a/apps/openmw/mwgui/container.cpp +++ b/apps/openmw/mwgui/container.cpp @@ -123,8 +123,8 @@ namespace MWGui worldEvent->addContainerItem(worldObject, itemPtr, count); worldEvent->addObject(worldObject); - mwmp::Main::get().getNetworking()->getWorldPacket(ID_CONTAINER)->setEvent(worldEvent); - mwmp::Main::get().getNetworking()->getWorldPacket(ID_CONTAINER)->Send(); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_CONTAINER)->setEvent(worldEvent); + 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", worldObject.refId.c_str(), worldObject.refNumIndex, worldEvent->cell.getDescription().c_str(), @@ -178,8 +178,8 @@ namespace MWGui worldObject.containerItems.push_back(containerItem); worldEvent->addObject(worldObject); - mwmp::Main::get().getNetworking()->getWorldPacket(ID_CONTAINER)->setEvent(worldEvent); - mwmp::Main::get().getNetworking()->getWorldPacket(ID_CONTAINER)->Send(); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_CONTAINER)->setEvent(worldEvent); + 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", worldObject.refId.c_str(), worldObject.refNumIndex, worldEvent->cell.getDescription().c_str(), @@ -305,8 +305,8 @@ namespace MWGui worldEvent->containerSubAction = mwmp::BaseEvent::TAKE_ALL; worldEvent->addEntireContainer(mPtr); - mwmp::Main::get().getNetworking()->getWorldPacket(ID_CONTAINER)->setEvent(worldEvent); - mwmp::Main::get().getNetworking()->getWorldPacket(ID_CONTAINER)->Send(); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_CONTAINER)->setEvent(worldEvent); + 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", mPtr.getCellRef().getRefId().c_str(), mPtr.getCellRef().getRefNum().mIndex, mPtr.getCellRef().getMpNum(), diff --git a/apps/openmw/mwmp/Networking.cpp b/apps/openmw/mwmp/Networking.cpp index b4714a922..2f401b976 100644 --- a/apps/openmw/mwmp/Networking.cpp +++ b/apps/openmw/mwmp/Networking.cpp @@ -197,7 +197,7 @@ string listComparison(PacketPreInit::PluginContainer checksums, PacketPreInit::P } Networking::Networking(): peer(RakNet::RakPeerInterface::GetInstance()), playerPacketController(peer), - actorPacketController(peer), worldPacketController(peer) + actorPacketController(peer), objectPacketController(peer) { RakNet::SocketDescriptor sd; @@ -207,7 +207,7 @@ Networking::Networking(): peer(RakNet::RakPeerInterface::GetInstance()), playerP playerPacketController.SetStream(0, &bsOut); actorPacketController.SetStream(0, &bsOut); - worldPacketController.SetStream(0, &bsOut); + objectPacketController.SetStream(0, &bsOut); connected = 0; ProcessorInitializer(); @@ -428,10 +428,10 @@ void Networking::receiveMessage(RakNet::Packet *packet) if (!ActorProcessor::Process(*packet, actorList)) 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)) - 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); } -WorldPacket *Networking::getWorldPacket(RakNet::MessageID id) +ObjectPacket *Networking::getObjectPacket(RakNet::MessageID id) { - return worldPacketController.GetPacket(id); + return objectPacketController.GetPacket(id); } LocalPlayer *Networking::getLocalPlayer() diff --git a/apps/openmw/mwmp/Networking.hpp b/apps/openmw/mwmp/Networking.hpp index 2041d28b7..946dd87a1 100644 --- a/apps/openmw/mwmp/Networking.hpp +++ b/apps/openmw/mwmp/Networking.hpp @@ -15,7 +15,7 @@ #include #include -#include +#include #include @@ -33,7 +33,7 @@ namespace mwmp PlayerPacket *getPlayerPacket(RakNet::MessageID id); ActorPacket *getActorPacket(RakNet::MessageID id); - WorldPacket *getWorldPacket(RakNet::MessageID id); + ObjectPacket *getObjectPacket(RakNet::MessageID id); RakNet::SystemAddress serverAddress() { @@ -54,7 +54,7 @@ namespace mwmp PlayerPacketController playerPacketController; ActorPacketController actorPacketController; - WorldPacketController worldPacketController; + ObjectPacketController objectPacketController; ActorList actorList; WorldEvent worldEvent; diff --git a/apps/openmw/mwmp/WorldEvent.cpp b/apps/openmw/mwmp/WorldEvent.cpp index 30443a244..db1f32b32 100644 --- a/apps/openmw/mwmp/WorldEvent.cpp +++ b/apps/openmw/mwmp/WorldEvent.cpp @@ -1034,8 +1034,8 @@ void WorldEvent::sendObjectPlace() for (const auto &worldObject : worldObjects) 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()->getWorldPacket(ID_OBJECT_PLACE)->Send(); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_PLACE)->setEvent(this); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_PLACE)->Send(); } void WorldEvent::sendObjectSpawn() @@ -1048,44 +1048,44 @@ void WorldEvent::sendObjectSpawn() for (const auto &worldObject : worldObjects) 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()->getWorldPacket(ID_OBJECT_SPAWN)->Send(); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_SPAWN)->setEvent(this); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_SPAWN)->Send(); } void WorldEvent::sendObjectDelete() { - mwmp::Main::get().getNetworking()->getWorldPacket(ID_OBJECT_DELETE)->setEvent(this); - mwmp::Main::get().getNetworking()->getWorldPacket(ID_OBJECT_DELETE)->Send(); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_DELETE)->setEvent(this); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_DELETE)->Send(); } void WorldEvent::sendObjectLock() { - mwmp::Main::get().getNetworking()->getWorldPacket(ID_OBJECT_LOCK)->setEvent(this); - mwmp::Main::get().getNetworking()->getWorldPacket(ID_OBJECT_LOCK)->Send(); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_LOCK)->setEvent(this); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_LOCK)->Send(); } void WorldEvent::sendObjectTrap() { - mwmp::Main::get().getNetworking()->getWorldPacket(ID_OBJECT_TRAP)->setEvent(this); - mwmp::Main::get().getNetworking()->getWorldPacket(ID_OBJECT_TRAP)->Send(); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_TRAP)->setEvent(this); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_TRAP)->Send(); } void WorldEvent::sendObjectScale() { - mwmp::Main::get().getNetworking()->getWorldPacket(ID_OBJECT_SCALE)->setEvent(this); - mwmp::Main::get().getNetworking()->getWorldPacket(ID_OBJECT_SCALE)->Send(); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_SCALE)->setEvent(this); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_SCALE)->Send(); } void WorldEvent::sendObjectState() { - mwmp::Main::get().getNetworking()->getWorldPacket(ID_OBJECT_STATE)->setEvent(this); - mwmp::Main::get().getNetworking()->getWorldPacket(ID_OBJECT_STATE)->Send(); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_STATE)->setEvent(this); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_STATE)->Send(); } void WorldEvent::sendObjectAnimPlay() { - mwmp::Main::get().getNetworking()->getWorldPacket(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)->setEvent(this); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_ANIM_PLAY)->Send(); } 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, worldObject.doorState ? "true" : "false"); - mwmp::Main::get().getNetworking()->getWorldPacket(ID_DOOR_STATE)->setEvent(this); - mwmp::Main::get().getNetworking()->getWorldPacket(ID_DOOR_STATE)->Send(); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_DOOR_STATE)->setEvent(this); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_DOOR_STATE)->Send(); } void WorldEvent::sendMusicPlay() { - mwmp::Main::get().getNetworking()->getWorldPacket(ID_MUSIC_PLAY)->setEvent(this); - mwmp::Main::get().getNetworking()->getWorldPacket(ID_MUSIC_PLAY)->Send(); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_MUSIC_PLAY)->setEvent(this); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_MUSIC_PLAY)->Send(); } void WorldEvent::sendVideoPlay() { - mwmp::Main::get().getNetworking()->getWorldPacket(ID_VIDEO_PLAY)->setEvent(this); - mwmp::Main::get().getNetworking()->getWorldPacket(ID_VIDEO_PLAY)->Send(); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_VIDEO_PLAY)->setEvent(this); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_VIDEO_PLAY)->Send(); } 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(), worldObject.refNumIndex, worldObject.index, worldObject.shortVal); - mwmp::Main::get().getNetworking()->getWorldPacket(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)->setEvent(this); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_SCRIPT_LOCAL_SHORT)->Send(); } 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(), worldObject.refNumIndex, worldObject.index, worldObject.floatVal); - mwmp::Main::get().getNetworking()->getWorldPacket(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)->setEvent(this); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_SCRIPT_LOCAL_FLOAT)->Send(); } 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(), worldObject.index, worldObject.shortVal); - mwmp::Main::get().getNetworking()->getWorldPacket(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)->setEvent(this); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_SCRIPT_MEMBER_SHORT)->Send(); } void WorldEvent::sendScriptGlobalShort() @@ -1155,14 +1155,14 @@ void WorldEvent::sendScriptGlobalShort() for (const auto &worldObject : worldObjects) 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()->getWorldPacket(ID_SCRIPT_GLOBAL_SHORT)->Send(); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_SCRIPT_GLOBAL_SHORT)->setEvent(this); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_SCRIPT_GLOBAL_SHORT)->Send(); } void WorldEvent::sendContainer() { LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Sending ID_CONTAINER"); - mwmp::Main::get().getNetworking()->getWorldPacket(ID_CONTAINER)->setEvent(this); - mwmp::Main::get().getNetworking()->getWorldPacket(ID_CONTAINER)->Send(); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_CONTAINER)->setEvent(this); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_CONTAINER)->Send(); } diff --git a/apps/openmw/mwmp/processors/WorldProcessor.cpp b/apps/openmw/mwmp/processors/WorldProcessor.cpp index 67689e55b..b21292649 100644 --- a/apps/openmw/mwmp/processors/WorldProcessor.cpp +++ b/apps/openmw/mwmp/processors/WorldProcessor.cpp @@ -17,7 +17,7 @@ bool WorldProcessor::Process(RakNet::Packet &packet, WorldEvent &event) bsIn.Read(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->SetReadStream(&bsIn); diff --git a/apps/openmw/mwmp/processors/WorldProcessor.hpp b/apps/openmw/mwmp/processors/WorldProcessor.hpp index 0e74ac70e..776db3da8 100644 --- a/apps/openmw/mwmp/processors/WorldProcessor.hpp +++ b/apps/openmw/mwmp/processors/WorldProcessor.hpp @@ -7,7 +7,7 @@ #include #include -#include +#include #include "../WorldEvent.hpp" #include "../LocalPlayer.hpp" #include "../DedicatedPlayer.hpp" @@ -18,7 +18,7 @@ namespace mwmp class WorldProcessor : public BasePacketProcessor, public BaseClientPacketProcessor { 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); }; diff --git a/apps/openmw/mwmp/processors/world/BaseObjectProcessor.hpp b/apps/openmw/mwmp/processors/world/BaseObjectProcessor.hpp index affd6b790..4b016b1a0 100644 --- a/apps/openmw/mwmp/processors/world/BaseObjectProcessor.hpp +++ b/apps/openmw/mwmp/processors/world/BaseObjectProcessor.hpp @@ -15,7 +15,7 @@ namespace mwmp class BaseObjectProcessor : public WorldProcessor { public: - virtual void Do(WorldPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, WorldEvent &event) { ptrCellStore = Main::get().getCellController()->getCellStore(event.cell); diff --git a/apps/openmw/mwmp/processors/world/ProcessorConsoleCommand.hpp b/apps/openmw/mwmp/processors/world/ProcessorConsoleCommand.hpp index bf8492733..6c838b9d8 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorConsoleCommand.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorConsoleCommand.hpp @@ -13,7 +13,7 @@ namespace mwmp BPP_INIT(ID_CONSOLE_COMMAND) } - virtual void Do(WorldPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, WorldEvent &event) { BaseObjectProcessor::Do(packet, event); diff --git a/apps/openmw/mwmp/processors/world/ProcessorContainer.hpp b/apps/openmw/mwmp/processors/world/ProcessorContainer.hpp index 02a2fb8db..31dc239e5 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorContainer.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorContainer.hpp @@ -13,7 +13,7 @@ namespace mwmp BPP_INIT(ID_CONTAINER) } - virtual void Do(WorldPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, WorldEvent &event) { BaseObjectProcessor::Do(packet, event); diff --git a/apps/openmw/mwmp/processors/world/ProcessorDoorDestination.hpp b/apps/openmw/mwmp/processors/world/ProcessorDoorDestination.hpp index 5ecb4fc53..baf1c3c5a 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorDoorDestination.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorDoorDestination.hpp @@ -13,7 +13,7 @@ namespace mwmp BPP_INIT(ID_DOOR_DESTINATION) } - virtual void Do(WorldPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, WorldEvent &event) { BaseObjectProcessor::Do(packet, event); diff --git a/apps/openmw/mwmp/processors/world/ProcessorDoorState.hpp b/apps/openmw/mwmp/processors/world/ProcessorDoorState.hpp index bae362aaa..12b4993bd 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorDoorState.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorDoorState.hpp @@ -13,7 +13,7 @@ namespace mwmp BPP_INIT(ID_DOOR_STATE) } - virtual void Do(WorldPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, WorldEvent &event) { BaseObjectProcessor::Do(packet, event); diff --git a/apps/openmw/mwmp/processors/world/ProcessorMusicPlay.hpp b/apps/openmw/mwmp/processors/world/ProcessorMusicPlay.hpp index 012c484d1..8f237d6c9 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorMusicPlay.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorMusicPlay.hpp @@ -13,7 +13,7 @@ namespace mwmp 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()); event.playMusic(); diff --git a/apps/openmw/mwmp/processors/world/ProcessorObjectAnimPlay.hpp b/apps/openmw/mwmp/processors/world/ProcessorObjectAnimPlay.hpp index 8f18885f5..a595a3862 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorObjectAnimPlay.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorObjectAnimPlay.hpp @@ -13,7 +13,7 @@ namespace mwmp BPP_INIT(ID_OBJECT_ANIM_PLAY) } - virtual void Do(WorldPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, WorldEvent &event) { BaseObjectProcessor::Do(packet, event); diff --git a/apps/openmw/mwmp/processors/world/ProcessorObjectAttach.hpp b/apps/openmw/mwmp/processors/world/ProcessorObjectAttach.hpp index 0554af1ee..95d8a0e7b 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorObjectAttach.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorObjectAttach.hpp @@ -13,7 +13,7 @@ namespace mwmp BPP_INIT(ID_OBJECT_ATTACH) } - virtual void Do(WorldPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, WorldEvent &event) { BaseObjectProcessor::Do(packet, event); diff --git a/apps/openmw/mwmp/processors/world/ProcessorObjectCollision.hpp b/apps/openmw/mwmp/processors/world/ProcessorObjectCollision.hpp index b14d83430..d8f69cbab 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorObjectCollision.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorObjectCollision.hpp @@ -13,7 +13,7 @@ namespace mwmp BPP_INIT(ID_OBJECT_COLLISION) } - virtual void Do(WorldPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, WorldEvent &event) { BaseObjectProcessor::Do(packet, event); diff --git a/apps/openmw/mwmp/processors/world/ProcessorObjectDelete.hpp b/apps/openmw/mwmp/processors/world/ProcessorObjectDelete.hpp index b42574d74..65a8d51d6 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorObjectDelete.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorObjectDelete.hpp @@ -13,7 +13,7 @@ namespace mwmp BPP_INIT(ID_OBJECT_DELETE) } - virtual void Do(WorldPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, WorldEvent &event) { BaseObjectProcessor::Do(packet, event); diff --git a/apps/openmw/mwmp/processors/world/ProcessorObjectLock.hpp b/apps/openmw/mwmp/processors/world/ProcessorObjectLock.hpp index bdda47f9f..bb2614708 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorObjectLock.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorObjectLock.hpp @@ -13,7 +13,7 @@ namespace mwmp BPP_INIT(ID_OBJECT_LOCK) } - virtual void Do(WorldPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, WorldEvent &event) { BaseObjectProcessor::Do(packet, event); diff --git a/apps/openmw/mwmp/processors/world/ProcessorObjectMove.hpp b/apps/openmw/mwmp/processors/world/ProcessorObjectMove.hpp index 97f16220b..baa9179fc 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorObjectMove.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorObjectMove.hpp @@ -13,7 +13,7 @@ namespace mwmp BPP_INIT(ID_OBJECT_MOVE) } - virtual void Do(WorldPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, WorldEvent &event) { BaseObjectProcessor::Do(packet, event); diff --git a/apps/openmw/mwmp/processors/world/ProcessorObjectPlace.hpp b/apps/openmw/mwmp/processors/world/ProcessorObjectPlace.hpp index 30fe3cfba..5ee9d41f1 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorObjectPlace.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorObjectPlace.hpp @@ -13,7 +13,7 @@ namespace mwmp BPP_INIT(ID_OBJECT_PLACE) } - virtual void Do(WorldPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, WorldEvent &event) { BaseObjectProcessor::Do(packet, event); diff --git a/apps/openmw/mwmp/processors/world/ProcessorObjectReset.hpp b/apps/openmw/mwmp/processors/world/ProcessorObjectReset.hpp index b5236c697..385e6b79c 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorObjectReset.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorObjectReset.hpp @@ -13,7 +13,7 @@ namespace mwmp BPP_INIT(ID_OBJECT_RESET) } - virtual void Do(WorldPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, WorldEvent &event) { BaseObjectProcessor::Do(packet, event); diff --git a/apps/openmw/mwmp/processors/world/ProcessorObjectRotate.hpp b/apps/openmw/mwmp/processors/world/ProcessorObjectRotate.hpp index 97cec92c3..6528d5b05 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorObjectRotate.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorObjectRotate.hpp @@ -13,7 +13,7 @@ namespace mwmp BPP_INIT(ID_OBJECT_ROTATE) } - virtual void Do(WorldPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, WorldEvent &event) { BaseObjectProcessor::Do(packet, event); diff --git a/apps/openmw/mwmp/processors/world/ProcessorObjectScale.hpp b/apps/openmw/mwmp/processors/world/ProcessorObjectScale.hpp index 2ea643a3f..65d3559a1 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorObjectScale.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorObjectScale.hpp @@ -13,7 +13,7 @@ namespace mwmp BPP_INIT(ID_OBJECT_SCALE) } - virtual void Do(WorldPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, WorldEvent &event) { BaseObjectProcessor::Do(packet, event); diff --git a/apps/openmw/mwmp/processors/world/ProcessorObjectSpawn.hpp b/apps/openmw/mwmp/processors/world/ProcessorObjectSpawn.hpp index bd00c2086..53fce90ca 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorObjectSpawn.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorObjectSpawn.hpp @@ -13,7 +13,7 @@ namespace mwmp BPP_INIT(ID_OBJECT_SPAWN) } - virtual void Do(WorldPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, WorldEvent &event) { BaseObjectProcessor::Do(packet, event); diff --git a/apps/openmw/mwmp/processors/world/ProcessorObjectState.hpp b/apps/openmw/mwmp/processors/world/ProcessorObjectState.hpp index 1619fce09..b2e7e0b2f 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorObjectState.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorObjectState.hpp @@ -13,7 +13,7 @@ namespace mwmp BPP_INIT(ID_OBJECT_STATE) } - virtual void Do(WorldPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, WorldEvent &event) { BaseObjectProcessor::Do(packet, event); diff --git a/apps/openmw/mwmp/processors/world/ProcessorObjectTrap.hpp b/apps/openmw/mwmp/processors/world/ProcessorObjectTrap.hpp index 96cf9096c..ff79e140e 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorObjectTrap.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorObjectTrap.hpp @@ -13,7 +13,7 @@ namespace mwmp BPP_INIT(ID_OBJECT_TRAP) } - virtual void Do(WorldPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, WorldEvent &event) { BaseObjectProcessor::Do(packet, event); diff --git a/apps/openmw/mwmp/processors/world/ProcessorScriptGlobalFloat.hpp b/apps/openmw/mwmp/processors/world/ProcessorScriptGlobalFloat.hpp index ae936720b..010b0d2e8 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorScriptGlobalFloat.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorScriptGlobalFloat.hpp @@ -13,7 +13,7 @@ namespace mwmp 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()); //event.setGlobalFloats(); diff --git a/apps/openmw/mwmp/processors/world/ProcessorScriptGlobalShort.hpp b/apps/openmw/mwmp/processors/world/ProcessorScriptGlobalShort.hpp index dbffc55d0..3c80157c6 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorScriptGlobalShort.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorScriptGlobalShort.hpp @@ -13,7 +13,7 @@ namespace mwmp 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()); event.setGlobalShorts(); diff --git a/apps/openmw/mwmp/processors/world/ProcessorScriptLocalFloat.hpp b/apps/openmw/mwmp/processors/world/ProcessorScriptLocalFloat.hpp index f900268ef..e03ee122d 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorScriptLocalFloat.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorScriptLocalFloat.hpp @@ -13,7 +13,7 @@ namespace mwmp BPP_INIT(ID_SCRIPT_LOCAL_FLOAT) } - virtual void Do(WorldPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, WorldEvent &event) { BaseObjectProcessor::Do(packet, event); diff --git a/apps/openmw/mwmp/processors/world/ProcessorScriptLocalShort.hpp b/apps/openmw/mwmp/processors/world/ProcessorScriptLocalShort.hpp index 13b3008b5..4e97b9252 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorScriptLocalShort.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorScriptLocalShort.hpp @@ -13,7 +13,7 @@ namespace mwmp BPP_INIT(ID_SCRIPT_LOCAL_SHORT) } - virtual void Do(WorldPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, WorldEvent &event) { BaseObjectProcessor::Do(packet, event); diff --git a/apps/openmw/mwmp/processors/world/ProcessorScriptMemberFloat.hpp b/apps/openmw/mwmp/processors/world/ProcessorScriptMemberFloat.hpp index 9599432d8..150377cc7 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorScriptMemberFloat.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorScriptMemberFloat.hpp @@ -13,7 +13,7 @@ namespace mwmp 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()); //event.setMemberFloats(); diff --git a/apps/openmw/mwmp/processors/world/ProcessorScriptMemberShort.hpp b/apps/openmw/mwmp/processors/world/ProcessorScriptMemberShort.hpp index 75ebf37a3..e7ee13e27 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorScriptMemberShort.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorScriptMemberShort.hpp @@ -13,7 +13,7 @@ namespace mwmp 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()); event.setMemberShorts(); diff --git a/apps/openmw/mwmp/processors/world/ProcessorVideoPlay.hpp b/apps/openmw/mwmp/processors/world/ProcessorVideoPlay.hpp index 788d9c8ee..429ad0d0b 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorVideoPlay.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorVideoPlay.hpp @@ -13,7 +13,7 @@ namespace mwmp 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()); event.playVideo(); diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index 2c087aec3..55409a7cf 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -154,7 +154,7 @@ add_component_dir (openmw-mp/Base ) add_component_dir (openmw-mp/Controllers - PlayerPacketController ActorPacketController WorldPacketController + PlayerPacketController ActorPacketController ObjectPacketController ) add_component_dir(openmw-mp/Master @@ -187,8 +187,8 @@ add_component_dir (openmw-mp/Packets/Player PacketPlayerResurrect PacketPlayerShapeshift PacketPlayerSkill PacketPlayerSpeech PacketPlayerSpellbook PacketPlayerStatsDynamic PacketPlayerTopic ) -add_component_dir (openmw-mp/Packets/World - WorldPacket +add_component_dir (openmw-mp/Packets/Object + ObjectPacket PacketConsoleCommand PacketContainer PacketObjectAnimPlay PacketObjectAttach PacketObjectCollision PacketObjectDelete PacketDoorDestination PacketDoorState PacketObjectLock PacketObjectMove PacketObjectPlace PacketObjectReset PacketObjectRotate PacketObjectScale PacketObjectSpawn PacketObjectState PacketObjectTrap diff --git a/components/openmw-mp/Controllers/ObjectPacketController.cpp b/components/openmw-mp/Controllers/ObjectPacketController.cpp new file mode 100644 index 000000000..60159b7bb --- /dev/null +++ b/components/openmw-mp/Controllers/ObjectPacketController.cpp @@ -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 +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(&packets, peer); + AddPacket(&packets, peer); + AddPacket(&packets, peer); + AddPacket(&packets, peer); + AddPacket(&packets, peer); + AddPacket(&packets, peer); + AddPacket(&packets, peer); + AddPacket(&packets, peer); + AddPacket(&packets, peer); + AddPacket(&packets, peer); + AddPacket(&packets, peer); + AddPacket(&packets, peer); + AddPacket(&packets, peer); + + AddPacket(&packets, peer); + AddPacket(&packets, peer); + AddPacket(&packets, peer); + AddPacket(&packets, peer); + AddPacket(&packets, peer); + + AddPacket(&packets, peer); + AddPacket(&packets, peer); + AddPacket(&packets, peer); + AddPacket(&packets, peer); + AddPacket(&packets, peer); + AddPacket(&packets, peer); + AddPacket(&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; +} diff --git a/components/openmw-mp/Controllers/WorldPacketController.hpp b/components/openmw-mp/Controllers/ObjectPacketController.hpp similarity index 68% rename from components/openmw-mp/Controllers/WorldPacketController.hpp rename to components/openmw-mp/Controllers/ObjectPacketController.hpp index a542a397b..230f270ea 100644 --- a/components/openmw-mp/Controllers/WorldPacketController.hpp +++ b/components/openmw-mp/Controllers/ObjectPacketController.hpp @@ -3,22 +3,22 @@ #include -#include "../Packets/World/WorldPacket.hpp" +#include "../Packets/Object/ObjectPacket.hpp" #include #include namespace mwmp { - class WorldPacketController + class ObjectPacketController { public: - WorldPacketController(RakNet::RakPeerInterface *peer); - WorldPacket *GetPacket(RakNet::MessageID id); + ObjectPacketController(RakNet::RakPeerInterface *peer); + ObjectPacket *GetPacket(RakNet::MessageID id); void SetStream(RakNet::BitStream *inStream, RakNet::BitStream *outStream); bool ContainsPacket(RakNet::MessageID id); - typedef std::unordered_map > packets_t; + typedef std::unordered_map > packets_t; private: packets_t packets; }; diff --git a/components/openmw-mp/Controllers/WorldPacketController.cpp b/components/openmw-mp/Controllers/WorldPacketController.cpp deleted file mode 100644 index 0d11f8de4..000000000 --- a/components/openmw-mp/Controllers/WorldPacketController.cpp +++ /dev/null @@ -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 -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(&packets, peer); - AddPacket(&packets, peer); - AddPacket(&packets, peer); - AddPacket(&packets, peer); - AddPacket(&packets, peer); - AddPacket(&packets, peer); - AddPacket(&packets, peer); - AddPacket(&packets, peer); - AddPacket(&packets, peer); - AddPacket(&packets, peer); - AddPacket(&packets, peer); - AddPacket(&packets, peer); - AddPacket(&packets, peer); - - AddPacket(&packets, peer); - AddPacket(&packets, peer); - AddPacket(&packets, peer); - AddPacket(&packets, peer); - AddPacket(&packets, peer); - - AddPacket(&packets, peer); - AddPacket(&packets, peer); - AddPacket(&packets, peer); - AddPacket(&packets, peer); - AddPacket(&packets, peer); - AddPacket(&packets, peer); - AddPacket(&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; -} diff --git a/components/openmw-mp/Packets/World/WorldPacket.cpp b/components/openmw-mp/Packets/Object/ObjectPacket.cpp similarity index 77% rename from components/openmw-mp/Packets/World/WorldPacket.cpp rename to components/openmw-mp/Packets/Object/ObjectPacket.cpp index 7a3c96663..563cc7a71 100644 --- a/components/openmw-mp/Packets/World/WorldPacket.cpp +++ b/components/openmw-mp/Packets/Object/ObjectPacket.cpp @@ -1,11 +1,11 @@ #include #include #include -#include "WorldPacket.hpp" +#include "ObjectPacket.hpp" using namespace mwmp; -WorldPacket::WorldPacket(RakNet::RakPeerInterface *peer) : BasePacket(peer) +ObjectPacket::ObjectPacket(RakNet::RakPeerInterface *peer) : BasePacket(peer) { hasCellData = false; packetID = 0; @@ -15,18 +15,18 @@ WorldPacket::WorldPacket(RakNet::RakPeerInterface *peer) : BasePacket(peer) this->peer = peer; } -WorldPacket::~WorldPacket() +ObjectPacket::~ObjectPacket() { } -void WorldPacket::setEvent(BaseEvent *event) +void ObjectPacket::setEvent(BaseEvent *event) { this->event = event; guid = event->guid; } -void WorldPacket::Packet(RakNet::BitStream *bs, bool send) +void ObjectPacket::Packet(RakNet::BitStream *bs, bool send) { if (!PacketHeader(bs, send)) 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); @@ -70,7 +70,7 @@ bool WorldPacket::PacketHeader(RakNet::BitStream *bs, bool send) return true; } -void WorldPacket::Object(WorldObject &worldObject, bool send) +void ObjectPacket::Object(WorldObject &worldObject, bool send) { RW(worldObject.refId, send); RW(worldObject.refNumIndex, send); diff --git a/components/openmw-mp/Packets/World/WorldPacket.hpp b/components/openmw-mp/Packets/Object/ObjectPacket.hpp similarity index 84% rename from components/openmw-mp/Packets/World/WorldPacket.hpp rename to components/openmw-mp/Packets/Object/ObjectPacket.hpp index 4f67b9631..9c1cf40dd 100644 --- a/components/openmw-mp/Packets/World/WorldPacket.hpp +++ b/components/openmw-mp/Packets/Object/ObjectPacket.hpp @@ -12,12 +12,12 @@ namespace mwmp { - class WorldPacket : public BasePacket + class ObjectPacket : public BasePacket { public: - WorldPacket(RakNet::RakPeerInterface *peer); + ObjectPacket(RakNet::RakPeerInterface *peer); - ~WorldPacket(); + ~ObjectPacket(); void setEvent(BaseEvent *event); diff --git a/components/openmw-mp/Packets/World/PacketConsoleCommand.cpp b/components/openmw-mp/Packets/Object/PacketConsoleCommand.cpp similarity index 96% rename from components/openmw-mp/Packets/World/PacketConsoleCommand.cpp rename to components/openmw-mp/Packets/Object/PacketConsoleCommand.cpp index a4f9f8517..33e7ab535 100644 --- a/components/openmw-mp/Packets/World/PacketConsoleCommand.cpp +++ b/components/openmw-mp/Packets/Object/PacketConsoleCommand.cpp @@ -3,7 +3,7 @@ using namespace mwmp; -PacketConsoleCommand::PacketConsoleCommand(RakNet::RakPeerInterface *peer) : WorldPacket(peer) +PacketConsoleCommand::PacketConsoleCommand(RakNet::RakPeerInterface *peer) : ObjectPacket(peer) { packetID = ID_CONSOLE_COMMAND; } diff --git a/components/openmw-mp/Packets/World/PacketConsoleCommand.hpp b/components/openmw-mp/Packets/Object/PacketConsoleCommand.hpp similarity index 71% rename from components/openmw-mp/Packets/World/PacketConsoleCommand.hpp rename to components/openmw-mp/Packets/Object/PacketConsoleCommand.hpp index 52f6c6943..33cb0e7a6 100644 --- a/components/openmw-mp/Packets/World/PacketConsoleCommand.hpp +++ b/components/openmw-mp/Packets/Object/PacketConsoleCommand.hpp @@ -1,11 +1,11 @@ #ifndef OPENMW_PACKETCONSOLECOMMAND_HPP #define OPENMW_PACKETCONSOLECOMMAND_HPP -#include +#include namespace mwmp { - class PacketConsoleCommand : public WorldPacket + class PacketConsoleCommand : public ObjectPacket { public: PacketConsoleCommand(RakNet::RakPeerInterface *peer); diff --git a/components/openmw-mp/Packets/World/PacketContainer.cpp b/components/openmw-mp/Packets/Object/PacketContainer.cpp similarity index 98% rename from components/openmw-mp/Packets/World/PacketContainer.cpp rename to components/openmw-mp/Packets/Object/PacketContainer.cpp index 54f7a68c4..a33df6f75 100644 --- a/components/openmw-mp/Packets/World/PacketContainer.cpp +++ b/components/openmw-mp/Packets/Object/PacketContainer.cpp @@ -4,7 +4,7 @@ using namespace mwmp; -PacketContainer::PacketContainer(RakNet::RakPeerInterface *peer) : WorldPacket(peer) +PacketContainer::PacketContainer(RakNet::RakPeerInterface *peer) : ObjectPacket(peer) { packetID = ID_CONTAINER; hasCellData = true; diff --git a/components/openmw-mp/Packets/World/PacketContainer.hpp b/components/openmw-mp/Packets/Object/PacketContainer.hpp similarity index 70% rename from components/openmw-mp/Packets/World/PacketContainer.hpp rename to components/openmw-mp/Packets/Object/PacketContainer.hpp index 28a885283..54813bc88 100644 --- a/components/openmw-mp/Packets/World/PacketContainer.hpp +++ b/components/openmw-mp/Packets/Object/PacketContainer.hpp @@ -1,11 +1,11 @@ #ifndef OPENMW_PACKETCONTAINER_HPP #define OPENMW_PACKETCONTAINER_HPP -#include +#include namespace mwmp { - class PacketContainer : public WorldPacket + class PacketContainer : public ObjectPacket { public: PacketContainer(RakNet::RakPeerInterface *peer); diff --git a/components/openmw-mp/Packets/World/PacketDoorDestination.cpp b/components/openmw-mp/Packets/Object/PacketDoorDestination.cpp similarity index 89% rename from components/openmw-mp/Packets/World/PacketDoorDestination.cpp rename to components/openmw-mp/Packets/Object/PacketDoorDestination.cpp index 827d65e40..45717075b 100644 --- a/components/openmw-mp/Packets/World/PacketDoorDestination.cpp +++ b/components/openmw-mp/Packets/Object/PacketDoorDestination.cpp @@ -3,7 +3,7 @@ using namespace mwmp; -PacketDoorDestination::PacketDoorDestination(RakNet::RakPeerInterface *peer) : WorldPacket(peer) +PacketDoorDestination::PacketDoorDestination(RakNet::RakPeerInterface *peer) : ObjectPacket(peer) { packetID = ID_DOOR_DESTINATION; hasCellData = true; @@ -11,7 +11,7 @@ PacketDoorDestination::PacketDoorDestination(RakNet::RakPeerInterface *peer) : W void PacketDoorDestination::Object(WorldObject &worldObject, bool send) { - WorldPacket::Object(worldObject, send); + ObjectPacket::Object(worldObject, send); RW(worldObject.teleportState, send); diff --git a/components/openmw-mp/Packets/World/PacketDoorDestination.hpp b/components/openmw-mp/Packets/Object/PacketDoorDestination.hpp similarity index 71% rename from components/openmw-mp/Packets/World/PacketDoorDestination.hpp rename to components/openmw-mp/Packets/Object/PacketDoorDestination.hpp index 329476259..64d23cfae 100644 --- a/components/openmw-mp/Packets/World/PacketDoorDestination.hpp +++ b/components/openmw-mp/Packets/Object/PacketDoorDestination.hpp @@ -1,11 +1,11 @@ #ifndef OPENMW_PACKETDOORDESTINATION_HPP #define OPENMW_PACKETDOORDESTINATION_HPP -#include +#include namespace mwmp { - class PacketDoorDestination : public WorldPacket + class PacketDoorDestination : public ObjectPacket { public: PacketDoorDestination(RakNet::RakPeerInterface *peer); diff --git a/components/openmw-mp/Packets/World/PacketDoorState.cpp b/components/openmw-mp/Packets/Object/PacketDoorState.cpp similarity index 83% rename from components/openmw-mp/Packets/World/PacketDoorState.cpp rename to components/openmw-mp/Packets/Object/PacketDoorState.cpp index 448bc2025..51bc92c6a 100644 --- a/components/openmw-mp/Packets/World/PacketDoorState.cpp +++ b/components/openmw-mp/Packets/Object/PacketDoorState.cpp @@ -3,7 +3,7 @@ using namespace mwmp; -PacketDoorState::PacketDoorState(RakNet::RakPeerInterface *peer) : WorldPacket(peer) +PacketDoorState::PacketDoorState(RakNet::RakPeerInterface *peer) : ObjectPacket(peer) { packetID = ID_DOOR_STATE; hasCellData = true; @@ -11,6 +11,6 @@ PacketDoorState::PacketDoorState(RakNet::RakPeerInterface *peer) : WorldPacket(p void PacketDoorState::Object(WorldObject &worldObject, bool send) { - WorldPacket::Object(worldObject, send); + ObjectPacket::Object(worldObject, send); RW(worldObject.doorState, send); } diff --git a/components/openmw-mp/Packets/World/PacketDoorState.hpp b/components/openmw-mp/Packets/Object/PacketDoorState.hpp similarity index 71% rename from components/openmw-mp/Packets/World/PacketDoorState.hpp rename to components/openmw-mp/Packets/Object/PacketDoorState.hpp index 91f38f033..11f0e7bd9 100644 --- a/components/openmw-mp/Packets/World/PacketDoorState.hpp +++ b/components/openmw-mp/Packets/Object/PacketDoorState.hpp @@ -1,11 +1,11 @@ #ifndef OPENMW_PACKETDOORSTATE_HPP #define OPENMW_PACKETDOORSTATE_HPP -#include +#include namespace mwmp { - class PacketDoorState : public WorldPacket + class PacketDoorState : public ObjectPacket { public: PacketDoorState(RakNet::RakPeerInterface *peer); diff --git a/components/openmw-mp/Packets/World/PacketMusicPlay.cpp b/components/openmw-mp/Packets/Object/PacketMusicPlay.cpp similarity index 93% rename from components/openmw-mp/Packets/World/PacketMusicPlay.cpp rename to components/openmw-mp/Packets/Object/PacketMusicPlay.cpp index 45b6b2bee..3c5263697 100644 --- a/components/openmw-mp/Packets/World/PacketMusicPlay.cpp +++ b/components/openmw-mp/Packets/Object/PacketMusicPlay.cpp @@ -3,7 +3,7 @@ using namespace mwmp; -PacketMusicPlay::PacketMusicPlay(RakNet::RakPeerInterface *peer) : WorldPacket(peer) +PacketMusicPlay::PacketMusicPlay(RakNet::RakPeerInterface *peer) : ObjectPacket(peer) { packetID = ID_MUSIC_PLAY; } diff --git a/components/openmw-mp/Packets/World/PacketMusicPlay.hpp b/components/openmw-mp/Packets/Object/PacketMusicPlay.hpp similarity index 71% rename from components/openmw-mp/Packets/World/PacketMusicPlay.hpp rename to components/openmw-mp/Packets/Object/PacketMusicPlay.hpp index 748b0d1d2..cd465ffdc 100644 --- a/components/openmw-mp/Packets/World/PacketMusicPlay.hpp +++ b/components/openmw-mp/Packets/Object/PacketMusicPlay.hpp @@ -1,11 +1,11 @@ #ifndef OPENMW_PACKETMUSICPLAY_HPP #define OPENMW_PACKETMUSICPLAY_HPP -#include +#include namespace mwmp { - class PacketMusicPlay : public WorldPacket + class PacketMusicPlay : public ObjectPacket { public: PacketMusicPlay(RakNet::RakPeerInterface *peer); diff --git a/components/openmw-mp/Packets/World/PacketObjectAnimPlay.cpp b/components/openmw-mp/Packets/Object/PacketObjectAnimPlay.cpp similarity index 83% rename from components/openmw-mp/Packets/World/PacketObjectAnimPlay.cpp rename to components/openmw-mp/Packets/Object/PacketObjectAnimPlay.cpp index af0c355ee..5d641d940 100644 --- a/components/openmw-mp/Packets/World/PacketObjectAnimPlay.cpp +++ b/components/openmw-mp/Packets/Object/PacketObjectAnimPlay.cpp @@ -3,7 +3,7 @@ using namespace mwmp; -PacketObjectAnimPlay::PacketObjectAnimPlay(RakNet::RakPeerInterface *peer) : WorldPacket(peer) +PacketObjectAnimPlay::PacketObjectAnimPlay(RakNet::RakPeerInterface *peer) : ObjectPacket(peer) { packetID = ID_OBJECT_ANIM_PLAY; hasCellData = true; @@ -11,7 +11,7 @@ PacketObjectAnimPlay::PacketObjectAnimPlay(RakNet::RakPeerInterface *peer) : Wor void PacketObjectAnimPlay::Object(WorldObject &worldObject, bool send) { - WorldPacket::Object(worldObject, send); + ObjectPacket::Object(worldObject, send); RW(worldObject.animGroup, send); RW(worldObject.animMode, send); } diff --git a/components/openmw-mp/Packets/World/PacketObjectAnimPlay.hpp b/components/openmw-mp/Packets/Object/PacketObjectAnimPlay.hpp similarity index 71% rename from components/openmw-mp/Packets/World/PacketObjectAnimPlay.hpp rename to components/openmw-mp/Packets/Object/PacketObjectAnimPlay.hpp index c6443bad4..c7e4d4e6c 100644 --- a/components/openmw-mp/Packets/World/PacketObjectAnimPlay.hpp +++ b/components/openmw-mp/Packets/Object/PacketObjectAnimPlay.hpp @@ -1,11 +1,11 @@ #ifndef OPENMW_PACKETOBJECTANIMPLAY_HPP #define OPENMW_PACKETOBJECTANIMPLAY_HPP -#include +#include namespace mwmp { - class PacketObjectAnimPlay : public WorldPacket + class PacketObjectAnimPlay : public ObjectPacket { public: PacketObjectAnimPlay(RakNet::RakPeerInterface *peer); diff --git a/components/openmw-mp/Packets/World/PacketObjectAttach.cpp b/components/openmw-mp/Packets/Object/PacketObjectAttach.cpp similarity index 81% rename from components/openmw-mp/Packets/World/PacketObjectAttach.cpp rename to components/openmw-mp/Packets/Object/PacketObjectAttach.cpp index 7404e72f0..b96a4cf8f 100644 --- a/components/openmw-mp/Packets/World/PacketObjectAttach.cpp +++ b/components/openmw-mp/Packets/Object/PacketObjectAttach.cpp @@ -3,7 +3,7 @@ using namespace mwmp; -PacketObjectAttach::PacketObjectAttach(RakNet::RakPeerInterface *peer) : WorldPacket(peer) +PacketObjectAttach::PacketObjectAttach(RakNet::RakPeerInterface *peer) : ObjectPacket(peer) { packetID = ID_OBJECT_ATTACH; hasCellData = true; @@ -11,6 +11,6 @@ PacketObjectAttach::PacketObjectAttach(RakNet::RakPeerInterface *peer) : WorldPa void PacketObjectAttach::Object(WorldObject &worldObject, bool send) { - WorldPacket::Object(worldObject, send); + ObjectPacket::Object(worldObject, send); // Placeholder } diff --git a/components/openmw-mp/Packets/World/PacketObjectAttach.hpp b/components/openmw-mp/Packets/Object/PacketObjectAttach.hpp similarity index 71% rename from components/openmw-mp/Packets/World/PacketObjectAttach.hpp rename to components/openmw-mp/Packets/Object/PacketObjectAttach.hpp index 98e1b53d2..680dc57f7 100644 --- a/components/openmw-mp/Packets/World/PacketObjectAttach.hpp +++ b/components/openmw-mp/Packets/Object/PacketObjectAttach.hpp @@ -1,11 +1,11 @@ #ifndef OPENMW_PACKETOBJECTATTACH_HPP #define OPENMW_PACKETOBJECTATTACH_HPP -#include +#include namespace mwmp { - class PacketObjectAttach : public WorldPacket + class PacketObjectAttach : public ObjectPacket { public: PacketObjectAttach(RakNet::RakPeerInterface *peer); diff --git a/components/openmw-mp/Packets/World/PacketObjectCollision.cpp b/components/openmw-mp/Packets/Object/PacketObjectCollision.cpp similarity index 81% rename from components/openmw-mp/Packets/World/PacketObjectCollision.cpp rename to components/openmw-mp/Packets/Object/PacketObjectCollision.cpp index deeb6b5a6..50d72e298 100644 --- a/components/openmw-mp/Packets/World/PacketObjectCollision.cpp +++ b/components/openmw-mp/Packets/Object/PacketObjectCollision.cpp @@ -3,7 +3,7 @@ using namespace mwmp; -PacketObjectCollision::PacketObjectCollision(RakNet::RakPeerInterface *peer) : WorldPacket(peer) +PacketObjectCollision::PacketObjectCollision(RakNet::RakPeerInterface *peer) : ObjectPacket(peer) { packetID = ID_OBJECT_COLLISION; hasCellData = true; @@ -11,6 +11,6 @@ PacketObjectCollision::PacketObjectCollision(RakNet::RakPeerInterface *peer) : W void PacketObjectCollision::Object(WorldObject &worldObject, bool send) { - WorldPacket::Object(worldObject, send); + ObjectPacket::Object(worldObject, send); // Placeholder } diff --git a/components/openmw-mp/Packets/World/PacketObjectCollision.hpp b/components/openmw-mp/Packets/Object/PacketObjectCollision.hpp similarity index 71% rename from components/openmw-mp/Packets/World/PacketObjectCollision.hpp rename to components/openmw-mp/Packets/Object/PacketObjectCollision.hpp index 63c6a9129..74bd1a085 100644 --- a/components/openmw-mp/Packets/World/PacketObjectCollision.hpp +++ b/components/openmw-mp/Packets/Object/PacketObjectCollision.hpp @@ -1,11 +1,11 @@ #ifndef OPENMW_PACKETOBJECTCOLLISION_HPP #define OPENMW_PACKETOBJECTCOLLISION_HPP -#include +#include namespace mwmp { - class PacketObjectCollision : public WorldPacket + class PacketObjectCollision : public ObjectPacket { public: PacketObjectCollision(RakNet::RakPeerInterface *peer); diff --git a/components/openmw-mp/Packets/World/PacketObjectDelete.cpp b/components/openmw-mp/Packets/Object/PacketObjectDelete.cpp similarity index 89% rename from components/openmw-mp/Packets/World/PacketObjectDelete.cpp rename to components/openmw-mp/Packets/Object/PacketObjectDelete.cpp index c999d7072..6187abcd9 100644 --- a/components/openmw-mp/Packets/World/PacketObjectDelete.cpp +++ b/components/openmw-mp/Packets/Object/PacketObjectDelete.cpp @@ -3,7 +3,7 @@ using namespace mwmp; -PacketObjectDelete::PacketObjectDelete(RakNet::RakPeerInterface *peer) : WorldPacket(peer) +PacketObjectDelete::PacketObjectDelete(RakNet::RakPeerInterface *peer) : ObjectPacket(peer) { packetID = ID_OBJECT_DELETE; hasCellData = true; diff --git a/components/openmw-mp/Packets/World/PacketObjectDelete.hpp b/components/openmw-mp/Packets/Object/PacketObjectDelete.hpp similarity index 65% rename from components/openmw-mp/Packets/World/PacketObjectDelete.hpp rename to components/openmw-mp/Packets/Object/PacketObjectDelete.hpp index 4b91d348e..8bda6c243 100644 --- a/components/openmw-mp/Packets/World/PacketObjectDelete.hpp +++ b/components/openmw-mp/Packets/Object/PacketObjectDelete.hpp @@ -1,11 +1,11 @@ #ifndef OPENMW_PACKETOBJECTDELETE_HPP #define OPENMW_PACKETOBJECTDELETE_HPP -#include +#include namespace mwmp { - class PacketObjectDelete : public WorldPacket + class PacketObjectDelete : public ObjectPacket { public: PacketObjectDelete(RakNet::RakPeerInterface *peer); diff --git a/components/openmw-mp/Packets/World/PacketObjectLock.cpp b/components/openmw-mp/Packets/Object/PacketObjectLock.cpp similarity index 83% rename from components/openmw-mp/Packets/World/PacketObjectLock.cpp rename to components/openmw-mp/Packets/Object/PacketObjectLock.cpp index 83b8ec5ac..9daf1d098 100644 --- a/components/openmw-mp/Packets/World/PacketObjectLock.cpp +++ b/components/openmw-mp/Packets/Object/PacketObjectLock.cpp @@ -3,7 +3,7 @@ using namespace mwmp; -PacketObjectLock::PacketObjectLock(RakNet::RakPeerInterface *peer) : WorldPacket(peer) +PacketObjectLock::PacketObjectLock(RakNet::RakPeerInterface *peer) : ObjectPacket(peer) { packetID = ID_OBJECT_LOCK; hasCellData = true; @@ -11,6 +11,6 @@ PacketObjectLock::PacketObjectLock(RakNet::RakPeerInterface *peer) : WorldPacket void PacketObjectLock::Object(WorldObject &worldObject, bool send) { - WorldPacket::Object(worldObject, send); + ObjectPacket::Object(worldObject, send); RW(worldObject.lockLevel, send); } diff --git a/components/openmw-mp/Packets/World/PacketObjectLock.hpp b/components/openmw-mp/Packets/Object/PacketObjectLock.hpp similarity index 71% rename from components/openmw-mp/Packets/World/PacketObjectLock.hpp rename to components/openmw-mp/Packets/Object/PacketObjectLock.hpp index 691b3bf84..d02426aa4 100644 --- a/components/openmw-mp/Packets/World/PacketObjectLock.hpp +++ b/components/openmw-mp/Packets/Object/PacketObjectLock.hpp @@ -1,11 +1,11 @@ #ifndef OPENMW_PACKETOBJECTLOCK_HPP #define OPENMW_PACKETOBJECTLOCK_HPP -#include +#include namespace mwmp { - class PacketObjectLock : public WorldPacket + class PacketObjectLock : public ObjectPacket { public: PacketObjectLock(RakNet::RakPeerInterface *peer); diff --git a/components/openmw-mp/Packets/World/PacketObjectMove.cpp b/components/openmw-mp/Packets/Object/PacketObjectMove.cpp similarity index 83% rename from components/openmw-mp/Packets/World/PacketObjectMove.cpp rename to components/openmw-mp/Packets/Object/PacketObjectMove.cpp index 35fb22bfc..4c043ebbf 100644 --- a/components/openmw-mp/Packets/World/PacketObjectMove.cpp +++ b/components/openmw-mp/Packets/Object/PacketObjectMove.cpp @@ -3,7 +3,7 @@ using namespace mwmp; -PacketObjectMove::PacketObjectMove(RakNet::RakPeerInterface *peer) : WorldPacket(peer) +PacketObjectMove::PacketObjectMove(RakNet::RakPeerInterface *peer) : ObjectPacket(peer) { packetID = ID_OBJECT_MOVE; hasCellData = true; @@ -11,6 +11,6 @@ PacketObjectMove::PacketObjectMove(RakNet::RakPeerInterface *peer) : WorldPacket void PacketObjectMove::Object(WorldObject &worldObject, bool send) { - WorldPacket::Object(worldObject, send); + ObjectPacket::Object(worldObject, send); RW(worldObject.position.pos, send); } diff --git a/components/openmw-mp/Packets/World/PacketObjectMove.hpp b/components/openmw-mp/Packets/Object/PacketObjectMove.hpp similarity index 71% rename from components/openmw-mp/Packets/World/PacketObjectMove.hpp rename to components/openmw-mp/Packets/Object/PacketObjectMove.hpp index f92487212..d45183b50 100644 --- a/components/openmw-mp/Packets/World/PacketObjectMove.hpp +++ b/components/openmw-mp/Packets/Object/PacketObjectMove.hpp @@ -1,11 +1,11 @@ #ifndef OPENMW_PacketObjectMove_HPP #define OPENMW_PacketObjectMove_HPP -#include +#include namespace mwmp { - class PacketObjectMove : public WorldPacket + class PacketObjectMove : public ObjectPacket { public: PacketObjectMove(RakNet::RakPeerInterface *peer); diff --git a/components/openmw-mp/Packets/World/PacketObjectPlace.cpp b/components/openmw-mp/Packets/Object/PacketObjectPlace.cpp similarity index 88% rename from components/openmw-mp/Packets/World/PacketObjectPlace.cpp rename to components/openmw-mp/Packets/Object/PacketObjectPlace.cpp index 17657dfb6..2bc4682c3 100644 --- a/components/openmw-mp/Packets/World/PacketObjectPlace.cpp +++ b/components/openmw-mp/Packets/Object/PacketObjectPlace.cpp @@ -3,7 +3,7 @@ using namespace mwmp; -PacketObjectPlace::PacketObjectPlace(RakNet::RakPeerInterface *peer) : WorldPacket(peer) +PacketObjectPlace::PacketObjectPlace(RakNet::RakPeerInterface *peer) : ObjectPacket(peer) { packetID = ID_OBJECT_PLACE; hasCellData = true; @@ -11,7 +11,7 @@ PacketObjectPlace::PacketObjectPlace(RakNet::RakPeerInterface *peer) : WorldPack void PacketObjectPlace::Object(WorldObject &worldObject, bool send) { - WorldPacket::Object(worldObject, send); + ObjectPacket::Object(worldObject, send); RW(worldObject.count, send); RW(worldObject.charge, send); RW(worldObject.enchantmentCharge, send); diff --git a/components/openmw-mp/Packets/World/PacketObjectPlace.hpp b/components/openmw-mp/Packets/Object/PacketObjectPlace.hpp similarity index 71% rename from components/openmw-mp/Packets/World/PacketObjectPlace.hpp rename to components/openmw-mp/Packets/Object/PacketObjectPlace.hpp index d50c881df..d3ac45119 100644 --- a/components/openmw-mp/Packets/World/PacketObjectPlace.hpp +++ b/components/openmw-mp/Packets/Object/PacketObjectPlace.hpp @@ -1,11 +1,11 @@ #ifndef OPENMW_PACKETOBJECTPLACE_HPP #define OPENMW_PACKETOBJECTPLACE_HPP -#include +#include namespace mwmp { - class PacketObjectPlace : public WorldPacket + class PacketObjectPlace : public ObjectPacket { public: PacketObjectPlace(RakNet::RakPeerInterface *peer); diff --git a/components/openmw-mp/Packets/World/PacketObjectReset.cpp b/components/openmw-mp/Packets/Object/PacketObjectReset.cpp similarity index 82% rename from components/openmw-mp/Packets/World/PacketObjectReset.cpp rename to components/openmw-mp/Packets/Object/PacketObjectReset.cpp index 7fcce2e39..1d9b81635 100644 --- a/components/openmw-mp/Packets/World/PacketObjectReset.cpp +++ b/components/openmw-mp/Packets/Object/PacketObjectReset.cpp @@ -3,7 +3,7 @@ using namespace mwmp; -PacketObjectReset::PacketObjectReset(RakNet::RakPeerInterface *peer) : WorldPacket(peer) +PacketObjectReset::PacketObjectReset(RakNet::RakPeerInterface *peer) : ObjectPacket(peer) { packetID = ID_OBJECT_RESET; hasCellData = true; @@ -11,6 +11,6 @@ PacketObjectReset::PacketObjectReset(RakNet::RakPeerInterface *peer) : WorldPack void PacketObjectReset::Object(WorldObject &worldObject, bool send) { - WorldPacket::Object(worldObject, send); + ObjectPacket::Object(worldObject, send); // Placeholder } diff --git a/components/openmw-mp/Packets/World/PacketObjectReset.hpp b/components/openmw-mp/Packets/Object/PacketObjectReset.hpp similarity index 71% rename from components/openmw-mp/Packets/World/PacketObjectReset.hpp rename to components/openmw-mp/Packets/Object/PacketObjectReset.hpp index 58df1e6fb..32c0deb5f 100644 --- a/components/openmw-mp/Packets/World/PacketObjectReset.hpp +++ b/components/openmw-mp/Packets/Object/PacketObjectReset.hpp @@ -1,11 +1,11 @@ #ifndef OPENMW_PACKETOBJECTRESET_HPP #define OPENMW_PACKETOBJECTRESET_HPP -#include +#include namespace mwmp { - class PacketObjectReset : public WorldPacket + class PacketObjectReset : public ObjectPacket { public: PacketObjectReset(RakNet::RakPeerInterface *peer); diff --git a/components/openmw-mp/Packets/World/PacketObjectRotate.cpp b/components/openmw-mp/Packets/Object/PacketObjectRotate.cpp similarity index 85% rename from components/openmw-mp/Packets/World/PacketObjectRotate.cpp rename to components/openmw-mp/Packets/Object/PacketObjectRotate.cpp index 07c614654..c7665ab4e 100644 --- a/components/openmw-mp/Packets/World/PacketObjectRotate.cpp +++ b/components/openmw-mp/Packets/Object/PacketObjectRotate.cpp @@ -3,7 +3,7 @@ using namespace mwmp; -PacketObjectRotate::PacketObjectRotate(RakNet::RakPeerInterface *peer) : WorldPacket(peer) +PacketObjectRotate::PacketObjectRotate(RakNet::RakPeerInterface *peer) : ObjectPacket(peer) { packetID = ID_OBJECT_ROTATE; hasCellData = true; @@ -11,7 +11,7 @@ PacketObjectRotate::PacketObjectRotate(RakNet::RakPeerInterface *peer) : WorldPa 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[1], send); RW(worldObject.position.rot[2], send); diff --git a/components/openmw-mp/Packets/World/PacketObjectRotate.hpp b/components/openmw-mp/Packets/Object/PacketObjectRotate.hpp similarity index 71% rename from components/openmw-mp/Packets/World/PacketObjectRotate.hpp rename to components/openmw-mp/Packets/Object/PacketObjectRotate.hpp index b438a8372..4134e6ab5 100644 --- a/components/openmw-mp/Packets/World/PacketObjectRotate.hpp +++ b/components/openmw-mp/Packets/Object/PacketObjectRotate.hpp @@ -1,11 +1,11 @@ #ifndef OPENMW_PACKETOBJECTROTATE_HPP #define OPENMW_PACKETOBJECTROTATE_HPP -#include +#include namespace mwmp { - class PacketObjectRotate : public WorldPacket + class PacketObjectRotate : public ObjectPacket { public: PacketObjectRotate(RakNet::RakPeerInterface *peer); diff --git a/components/openmw-mp/Packets/World/PacketObjectScale.cpp b/components/openmw-mp/Packets/Object/PacketObjectScale.cpp similarity index 82% rename from components/openmw-mp/Packets/World/PacketObjectScale.cpp rename to components/openmw-mp/Packets/Object/PacketObjectScale.cpp index 8e468059d..5483e39c5 100644 --- a/components/openmw-mp/Packets/World/PacketObjectScale.cpp +++ b/components/openmw-mp/Packets/Object/PacketObjectScale.cpp @@ -3,7 +3,7 @@ using namespace mwmp; -PacketObjectScale::PacketObjectScale(RakNet::RakPeerInterface *peer) : WorldPacket(peer) +PacketObjectScale::PacketObjectScale(RakNet::RakPeerInterface *peer) : ObjectPacket(peer) { packetID = ID_OBJECT_SCALE; hasCellData = true; @@ -11,6 +11,6 @@ PacketObjectScale::PacketObjectScale(RakNet::RakPeerInterface *peer) : WorldPack void PacketObjectScale::Object(WorldObject &worldObject, bool send) { - WorldPacket::Object(worldObject, send); + ObjectPacket::Object(worldObject, send); RW(worldObject.scale, send); } diff --git a/components/openmw-mp/Packets/World/PacketObjectScale.hpp b/components/openmw-mp/Packets/Object/PacketObjectScale.hpp similarity index 71% rename from components/openmw-mp/Packets/World/PacketObjectScale.hpp rename to components/openmw-mp/Packets/Object/PacketObjectScale.hpp index 8e5d2b431..93548ebfc 100644 --- a/components/openmw-mp/Packets/World/PacketObjectScale.hpp +++ b/components/openmw-mp/Packets/Object/PacketObjectScale.hpp @@ -1,11 +1,11 @@ #ifndef OPENMW_PACKETOBJECTSCALE_HPP #define OPENMW_PACKETOBJECTSCALE_HPP -#include +#include namespace mwmp { - class PacketObjectScale : public WorldPacket + class PacketObjectScale : public ObjectPacket { public: PacketObjectScale(RakNet::RakPeerInterface *peer); diff --git a/components/openmw-mp/Packets/World/PacketObjectSpawn.cpp b/components/openmw-mp/Packets/Object/PacketObjectSpawn.cpp similarity index 91% rename from components/openmw-mp/Packets/World/PacketObjectSpawn.cpp rename to components/openmw-mp/Packets/Object/PacketObjectSpawn.cpp index 6d26990f3..00e686e13 100644 --- a/components/openmw-mp/Packets/World/PacketObjectSpawn.cpp +++ b/components/openmw-mp/Packets/Object/PacketObjectSpawn.cpp @@ -3,7 +3,7 @@ using namespace mwmp; -PacketObjectSpawn::PacketObjectSpawn(RakNet::RakPeerInterface *peer) : WorldPacket(peer) +PacketObjectSpawn::PacketObjectSpawn(RakNet::RakPeerInterface *peer) : ObjectPacket(peer) { packetID = ID_OBJECT_SPAWN; hasCellData = true; @@ -11,7 +11,7 @@ PacketObjectSpawn::PacketObjectSpawn(RakNet::RakPeerInterface *peer) : WorldPack void PacketObjectSpawn::Object(WorldObject &worldObject, bool send) { - WorldPacket::Object(worldObject, send); + ObjectPacket::Object(worldObject, send); RW(worldObject.position, send); RW(worldObject.hasMaster, send); diff --git a/components/openmw-mp/Packets/World/PacketObjectSpawn.hpp b/components/openmw-mp/Packets/Object/PacketObjectSpawn.hpp similarity index 71% rename from components/openmw-mp/Packets/World/PacketObjectSpawn.hpp rename to components/openmw-mp/Packets/Object/PacketObjectSpawn.hpp index 1f6973268..2fb5d2c32 100644 --- a/components/openmw-mp/Packets/World/PacketObjectSpawn.hpp +++ b/components/openmw-mp/Packets/Object/PacketObjectSpawn.hpp @@ -1,11 +1,11 @@ #ifndef OPENMW_PACKETOBJECTSPAWN_HPP #define OPENMW_PACKETOBJECTSPAWN_HPP -#include +#include namespace mwmp { - class PacketObjectSpawn : public WorldPacket + class PacketObjectSpawn : public ObjectPacket { public: PacketObjectSpawn(RakNet::RakPeerInterface *peer); diff --git a/components/openmw-mp/Packets/World/PacketObjectState.cpp b/components/openmw-mp/Packets/Object/PacketObjectState.cpp similarity index 82% rename from components/openmw-mp/Packets/World/PacketObjectState.cpp rename to components/openmw-mp/Packets/Object/PacketObjectState.cpp index 499acb506..1ca4dc338 100644 --- a/components/openmw-mp/Packets/World/PacketObjectState.cpp +++ b/components/openmw-mp/Packets/Object/PacketObjectState.cpp @@ -3,7 +3,7 @@ using namespace mwmp; -PacketObjectState::PacketObjectState(RakNet::RakPeerInterface *peer) : WorldPacket(peer) +PacketObjectState::PacketObjectState(RakNet::RakPeerInterface *peer) : ObjectPacket(peer) { packetID = ID_OBJECT_STATE; hasCellData = true; @@ -11,6 +11,6 @@ PacketObjectState::PacketObjectState(RakNet::RakPeerInterface *peer) : WorldPack void PacketObjectState::Object(WorldObject &worldObject, bool send) { - WorldPacket::Object(worldObject, send); + ObjectPacket::Object(worldObject, send); RW(worldObject.objectState, send); } diff --git a/components/openmw-mp/Packets/World/PacketObjectState.hpp b/components/openmw-mp/Packets/Object/PacketObjectState.hpp similarity index 71% rename from components/openmw-mp/Packets/World/PacketObjectState.hpp rename to components/openmw-mp/Packets/Object/PacketObjectState.hpp index 1fb2f2c90..8daa07de3 100644 --- a/components/openmw-mp/Packets/World/PacketObjectState.hpp +++ b/components/openmw-mp/Packets/Object/PacketObjectState.hpp @@ -1,11 +1,11 @@ #ifndef OPENMW_PACKETOBJECTSTATE_HPP #define OPENMW_PACKETOBJECTSTATE_HPP -#include +#include namespace mwmp { - class PacketObjectState : public WorldPacket + class PacketObjectState : public ObjectPacket { public: PacketObjectState(RakNet::RakPeerInterface *peer); diff --git a/components/openmw-mp/Packets/World/PacketObjectTrap.cpp b/components/openmw-mp/Packets/Object/PacketObjectTrap.cpp similarity index 85% rename from components/openmw-mp/Packets/World/PacketObjectTrap.cpp rename to components/openmw-mp/Packets/Object/PacketObjectTrap.cpp index 4442f3cd2..832618c91 100644 --- a/components/openmw-mp/Packets/World/PacketObjectTrap.cpp +++ b/components/openmw-mp/Packets/Object/PacketObjectTrap.cpp @@ -3,7 +3,7 @@ using namespace mwmp; -PacketObjectTrap::PacketObjectTrap(RakNet::RakPeerInterface *peer) : WorldPacket(peer) +PacketObjectTrap::PacketObjectTrap(RakNet::RakPeerInterface *peer) : ObjectPacket(peer) { packetID = ID_OBJECT_TRAP; hasCellData = true; @@ -11,7 +11,7 @@ PacketObjectTrap::PacketObjectTrap(RakNet::RakPeerInterface *peer) : WorldPacket void PacketObjectTrap::Object(WorldObject &worldObject, bool send) { - WorldPacket::Object(worldObject, send); + ObjectPacket::Object(worldObject, send); RW(worldObject.isDisarmed, send); if (!worldObject.isDisarmed) diff --git a/components/openmw-mp/Packets/World/PacketObjectTrap.hpp b/components/openmw-mp/Packets/Object/PacketObjectTrap.hpp similarity index 71% rename from components/openmw-mp/Packets/World/PacketObjectTrap.hpp rename to components/openmw-mp/Packets/Object/PacketObjectTrap.hpp index aadbd037d..c9a9505d7 100644 --- a/components/openmw-mp/Packets/World/PacketObjectTrap.hpp +++ b/components/openmw-mp/Packets/Object/PacketObjectTrap.hpp @@ -1,11 +1,11 @@ #ifndef OPENMW_PACKETOBJECTTRAP_HPP #define OPENMW_PACKETOBJECTTRAP_HPP -#include +#include namespace mwmp { - class PacketObjectTrap : public WorldPacket + class PacketObjectTrap : public ObjectPacket { public: PacketObjectTrap(RakNet::RakPeerInterface *peer); diff --git a/components/openmw-mp/Packets/World/PacketScriptGlobalFloat.cpp b/components/openmw-mp/Packets/Object/PacketScriptGlobalFloat.cpp similarity index 90% rename from components/openmw-mp/Packets/World/PacketScriptGlobalFloat.cpp rename to components/openmw-mp/Packets/Object/PacketScriptGlobalFloat.cpp index c4a65a267..5c6c39756 100644 --- a/components/openmw-mp/Packets/World/PacketScriptGlobalFloat.cpp +++ b/components/openmw-mp/Packets/Object/PacketScriptGlobalFloat.cpp @@ -3,7 +3,7 @@ using namespace mwmp; -PacketScriptGlobalFloat::PacketScriptGlobalFloat(RakNet::RakPeerInterface *peer) : WorldPacket(peer) +PacketScriptGlobalFloat::PacketScriptGlobalFloat(RakNet::RakPeerInterface *peer) : ObjectPacket(peer) { packetID = ID_SCRIPT_GLOBAL_FLOAT; } diff --git a/components/openmw-mp/Packets/World/PacketScriptGlobalFloat.hpp b/components/openmw-mp/Packets/Object/PacketScriptGlobalFloat.hpp similarity index 72% rename from components/openmw-mp/Packets/World/PacketScriptGlobalFloat.hpp rename to components/openmw-mp/Packets/Object/PacketScriptGlobalFloat.hpp index a457ff7dc..9c59099b8 100644 --- a/components/openmw-mp/Packets/World/PacketScriptGlobalFloat.hpp +++ b/components/openmw-mp/Packets/Object/PacketScriptGlobalFloat.hpp @@ -1,11 +1,11 @@ #ifndef OPENMW_PACKETSCRIPTGLOBALFLOAT_HPP #define OPENMW_PACKETSCRIPTGLOBALFLOAT_HPP -#include +#include namespace mwmp { - class PacketScriptGlobalFloat : public WorldPacket + class PacketScriptGlobalFloat : public ObjectPacket { public: PacketScriptGlobalFloat(RakNet::RakPeerInterface *peer); diff --git a/components/openmw-mp/Packets/World/PacketScriptGlobalShort.cpp b/components/openmw-mp/Packets/Object/PacketScriptGlobalShort.cpp similarity index 90% rename from components/openmw-mp/Packets/World/PacketScriptGlobalShort.cpp rename to components/openmw-mp/Packets/Object/PacketScriptGlobalShort.cpp index 0ebd3ff7f..f30f49bba 100644 --- a/components/openmw-mp/Packets/World/PacketScriptGlobalShort.cpp +++ b/components/openmw-mp/Packets/Object/PacketScriptGlobalShort.cpp @@ -3,7 +3,7 @@ using namespace mwmp; -PacketScriptGlobalShort::PacketScriptGlobalShort(RakNet::RakPeerInterface *peer) : WorldPacket(peer) +PacketScriptGlobalShort::PacketScriptGlobalShort(RakNet::RakPeerInterface *peer) : ObjectPacket(peer) { packetID = ID_SCRIPT_GLOBAL_SHORT; } diff --git a/components/openmw-mp/Packets/World/PacketScriptGlobalShort.hpp b/components/openmw-mp/Packets/Object/PacketScriptGlobalShort.hpp similarity index 72% rename from components/openmw-mp/Packets/World/PacketScriptGlobalShort.hpp rename to components/openmw-mp/Packets/Object/PacketScriptGlobalShort.hpp index ea2a3034f..af89cf21d 100644 --- a/components/openmw-mp/Packets/World/PacketScriptGlobalShort.hpp +++ b/components/openmw-mp/Packets/Object/PacketScriptGlobalShort.hpp @@ -1,11 +1,11 @@ #ifndef OPENMW_PACKETSCRIPTGLOBALSHORT_HPP #define OPENMW_PACKETSCRIPTGLOBALSHORT_HPP -#include +#include namespace mwmp { - class PacketScriptGlobalShort : public WorldPacket + class PacketScriptGlobalShort : public ObjectPacket { public: PacketScriptGlobalShort(RakNet::RakPeerInterface *peer); diff --git a/components/openmw-mp/Packets/World/PacketScriptLocalFloat.cpp b/components/openmw-mp/Packets/Object/PacketScriptLocalFloat.cpp similarity index 82% rename from components/openmw-mp/Packets/World/PacketScriptLocalFloat.cpp rename to components/openmw-mp/Packets/Object/PacketScriptLocalFloat.cpp index c7109b185..32eb34d21 100644 --- a/components/openmw-mp/Packets/World/PacketScriptLocalFloat.cpp +++ b/components/openmw-mp/Packets/Object/PacketScriptLocalFloat.cpp @@ -3,7 +3,7 @@ using namespace mwmp; -PacketScriptLocalFloat::PacketScriptLocalFloat(RakNet::RakPeerInterface *peer) : WorldPacket(peer) +PacketScriptLocalFloat::PacketScriptLocalFloat(RakNet::RakPeerInterface *peer) : ObjectPacket(peer) { packetID = ID_SCRIPT_LOCAL_FLOAT; hasCellData = true; @@ -11,7 +11,7 @@ PacketScriptLocalFloat::PacketScriptLocalFloat(RakNet::RakPeerInterface *peer) : void PacketScriptLocalFloat::Object(WorldObject &worldObject, bool send) { - WorldPacket::Object(worldObject, send); + ObjectPacket::Object(worldObject, send); RW(worldObject.index, send); RW(worldObject.floatVal, send); } diff --git a/components/openmw-mp/Packets/World/PacketScriptLocalFloat.hpp b/components/openmw-mp/Packets/Object/PacketScriptLocalFloat.hpp similarity index 71% rename from components/openmw-mp/Packets/World/PacketScriptLocalFloat.hpp rename to components/openmw-mp/Packets/Object/PacketScriptLocalFloat.hpp index adf57eda3..40497430d 100644 --- a/components/openmw-mp/Packets/World/PacketScriptLocalFloat.hpp +++ b/components/openmw-mp/Packets/Object/PacketScriptLocalFloat.hpp @@ -1,11 +1,11 @@ #ifndef OPENMW_PACKETSCRIPTLOCALFLOAT_HPP #define OPENMW_PACKETSCRIPTLOCALFLOAT_HPP -#include +#include namespace mwmp { - class PacketScriptLocalFloat : public WorldPacket + class PacketScriptLocalFloat : public ObjectPacket { public: PacketScriptLocalFloat(RakNet::RakPeerInterface *peer); diff --git a/components/openmw-mp/Packets/World/PacketScriptLocalShort.cpp b/components/openmw-mp/Packets/Object/PacketScriptLocalShort.cpp similarity index 82% rename from components/openmw-mp/Packets/World/PacketScriptLocalShort.cpp rename to components/openmw-mp/Packets/Object/PacketScriptLocalShort.cpp index fb739dc45..ae6b7caca 100644 --- a/components/openmw-mp/Packets/World/PacketScriptLocalShort.cpp +++ b/components/openmw-mp/Packets/Object/PacketScriptLocalShort.cpp @@ -3,7 +3,7 @@ using namespace mwmp; -PacketScriptLocalShort::PacketScriptLocalShort(RakNet::RakPeerInterface *peer) : WorldPacket(peer) +PacketScriptLocalShort::PacketScriptLocalShort(RakNet::RakPeerInterface *peer) : ObjectPacket(peer) { packetID = ID_SCRIPT_LOCAL_SHORT; hasCellData = true; @@ -11,7 +11,7 @@ PacketScriptLocalShort::PacketScriptLocalShort(RakNet::RakPeerInterface *peer) : void PacketScriptLocalShort::Object(WorldObject &worldObject, bool send) { - WorldPacket::Object(worldObject, send); + ObjectPacket::Object(worldObject, send); RW(worldObject.index, send); RW(worldObject.shortVal, send); } diff --git a/components/openmw-mp/Packets/World/PacketScriptLocalShort.hpp b/components/openmw-mp/Packets/Object/PacketScriptLocalShort.hpp similarity index 71% rename from components/openmw-mp/Packets/World/PacketScriptLocalShort.hpp rename to components/openmw-mp/Packets/Object/PacketScriptLocalShort.hpp index 3c767b850..b0b1fa35b 100644 --- a/components/openmw-mp/Packets/World/PacketScriptLocalShort.hpp +++ b/components/openmw-mp/Packets/Object/PacketScriptLocalShort.hpp @@ -1,11 +1,11 @@ #ifndef OPENMW_PACKETSCRIPTLOCALSHORT_HPP #define OPENMW_PACKETSCRIPTLOCALSHORT_HPP -#include +#include namespace mwmp { - class PacketScriptLocalShort : public WorldPacket + class PacketScriptLocalShort : public ObjectPacket { public: PacketScriptLocalShort(RakNet::RakPeerInterface *peer); diff --git a/components/openmw-mp/Packets/World/PacketScriptMemberFloat.cpp b/components/openmw-mp/Packets/Object/PacketScriptMemberFloat.cpp similarity index 91% rename from components/openmw-mp/Packets/World/PacketScriptMemberFloat.cpp rename to components/openmw-mp/Packets/Object/PacketScriptMemberFloat.cpp index 61161054d..187ff9d3f 100644 --- a/components/openmw-mp/Packets/World/PacketScriptMemberFloat.cpp +++ b/components/openmw-mp/Packets/Object/PacketScriptMemberFloat.cpp @@ -3,7 +3,7 @@ using namespace mwmp; -PacketScriptMemberFloat::PacketScriptMemberFloat(RakNet::RakPeerInterface *peer) : WorldPacket(peer) +PacketScriptMemberFloat::PacketScriptMemberFloat(RakNet::RakPeerInterface *peer) : ObjectPacket(peer) { packetID = ID_SCRIPT_MEMBER_FLOAT; } diff --git a/components/openmw-mp/Packets/World/PacketScriptMemberFloat.hpp b/components/openmw-mp/Packets/Object/PacketScriptMemberFloat.hpp similarity index 71% rename from components/openmw-mp/Packets/World/PacketScriptMemberFloat.hpp rename to components/openmw-mp/Packets/Object/PacketScriptMemberFloat.hpp index 2b6f9ae2a..ccd7a49be 100644 --- a/components/openmw-mp/Packets/World/PacketScriptMemberFloat.hpp +++ b/components/openmw-mp/Packets/Object/PacketScriptMemberFloat.hpp @@ -1,11 +1,11 @@ #ifndef OPENMW_PACKETSCRIPTMEMBERFLOAT_HPP #define OPENMW_PACKETSCRIPTMEMBERFLOAT_HPP -#include +#include namespace mwmp { - class PacketScriptMemberFloat : public WorldPacket + class PacketScriptMemberFloat : public ObjectPacket { public: PacketScriptMemberFloat(RakNet::RakPeerInterface *peer); diff --git a/components/openmw-mp/Packets/World/PacketScriptMemberShort.cpp b/components/openmw-mp/Packets/Object/PacketScriptMemberShort.cpp similarity index 91% rename from components/openmw-mp/Packets/World/PacketScriptMemberShort.cpp rename to components/openmw-mp/Packets/Object/PacketScriptMemberShort.cpp index c2b1c34d6..e7d038a7e 100644 --- a/components/openmw-mp/Packets/World/PacketScriptMemberShort.cpp +++ b/components/openmw-mp/Packets/Object/PacketScriptMemberShort.cpp @@ -3,7 +3,7 @@ using namespace mwmp; -PacketScriptMemberShort::PacketScriptMemberShort(RakNet::RakPeerInterface *peer) : WorldPacket(peer) +PacketScriptMemberShort::PacketScriptMemberShort(RakNet::RakPeerInterface *peer) : ObjectPacket(peer) { packetID = ID_SCRIPT_MEMBER_SHORT; } diff --git a/components/openmw-mp/Packets/World/PacketScriptMemberShort.hpp b/components/openmw-mp/Packets/Object/PacketScriptMemberShort.hpp similarity index 71% rename from components/openmw-mp/Packets/World/PacketScriptMemberShort.hpp rename to components/openmw-mp/Packets/Object/PacketScriptMemberShort.hpp index 61e99b9c0..155e85165 100644 --- a/components/openmw-mp/Packets/World/PacketScriptMemberShort.hpp +++ b/components/openmw-mp/Packets/Object/PacketScriptMemberShort.hpp @@ -1,11 +1,11 @@ #ifndef OPENMW_PACKETSCRIPTMEMBERSHORT_HPP #define OPENMW_PACKETSCRIPTMEMBERSHORT_HPP -#include +#include namespace mwmp { - class PacketScriptMemberShort : public WorldPacket + class PacketScriptMemberShort : public ObjectPacket { public: PacketScriptMemberShort(RakNet::RakPeerInterface *peer); diff --git a/components/openmw-mp/Packets/World/PacketVideoPlay.cpp b/components/openmw-mp/Packets/Object/PacketVideoPlay.cpp similarity index 94% rename from components/openmw-mp/Packets/World/PacketVideoPlay.cpp rename to components/openmw-mp/Packets/Object/PacketVideoPlay.cpp index bc5146ce8..d0cae224b 100644 --- a/components/openmw-mp/Packets/World/PacketVideoPlay.cpp +++ b/components/openmw-mp/Packets/Object/PacketVideoPlay.cpp @@ -3,7 +3,7 @@ using namespace mwmp; -PacketVideoPlay::PacketVideoPlay(RakNet::RakPeerInterface *peer) : WorldPacket(peer) +PacketVideoPlay::PacketVideoPlay(RakNet::RakPeerInterface *peer) : ObjectPacket(peer) { packetID = ID_VIDEO_PLAY; } diff --git a/components/openmw-mp/Packets/World/PacketVideoPlay.hpp b/components/openmw-mp/Packets/Object/PacketVideoPlay.hpp similarity index 70% rename from components/openmw-mp/Packets/World/PacketVideoPlay.hpp rename to components/openmw-mp/Packets/Object/PacketVideoPlay.hpp index 9af2def65..8d751efd1 100644 --- a/components/openmw-mp/Packets/World/PacketVideoPlay.hpp +++ b/components/openmw-mp/Packets/Object/PacketVideoPlay.hpp @@ -1,11 +1,11 @@ #ifndef OPENMW_PACKETVIDEOPLAY_HPP #define OPENMW_PACKETVIDEOPLAY_HPP -#include +#include namespace mwmp { - class PacketVideoPlay : public WorldPacket + class PacketVideoPlay : public ObjectPacket { public: PacketVideoPlay(RakNet::RakPeerInterface *peer);