diff --git a/apps/openmw-mp/Cell.cpp b/apps/openmw-mp/Cell.cpp index 90335695f..831d77f81 100644 --- a/apps/openmw-mp/Cell.cpp +++ b/apps/openmw-mp/Cell.cpp @@ -202,7 +202,7 @@ void Cell::sendToLoaded(mwmp::ActorPacket *actorPacket, mwmp::BaseActorList *bas } } -void Cell::sendToLoaded(mwmp::ObjectPacket *objectPacket, mwmp::BaseEvent *baseEvent) const +void Cell::sendToLoaded(mwmp::ObjectPacket *objectPacket, mwmp::BaseObjectList *baseObjectList) const { if (players.empty()) return; @@ -220,9 +220,9 @@ void Cell::sendToLoaded(mwmp::ObjectPacket *objectPacket, mwmp::BaseEvent *baseE for (auto &pl : plList) { - if (pl->guid == baseEvent->guid) continue; + if (pl->guid == baseObjectList->guid) continue; - objectPacket->setEvent(baseEvent); + objectPacket->setObjectList(baseObjectList); // Send the packet to this eligible guid objectPacket->Send(pl->guid); diff --git a/apps/openmw-mp/Cell.hpp b/apps/openmw-mp/Cell.hpp index 599d03627..a46b6e5bc 100644 --- a/apps/openmw-mp/Cell.hpp +++ b/apps/openmw-mp/Cell.hpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include @@ -41,7 +41,7 @@ public: TPlayers getPlayers() const; void sendToLoaded(mwmp::ActorPacket *actorPacket, mwmp::BaseActorList *baseActorList) const; - void sendToLoaded(mwmp::ObjectPacket *objectPacket, mwmp::BaseEvent *baseEvent) const; + void sendToLoaded(mwmp::ObjectPacket *objectPacket, mwmp::BaseObjectList *baseObjectList) const; std::string getDescription() const; diff --git a/apps/openmw-mp/CellController.hpp b/apps/openmw-mp/CellController.hpp index f15227d68..0a09556bd 100644 --- a/apps/openmw-mp/CellController.hpp +++ b/apps/openmw-mp/CellController.hpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include #include diff --git a/apps/openmw-mp/Networking.cpp b/apps/openmw-mp/Networking.cpp index 5453c6a41..29e284847 100644 --- a/apps/openmw-mp/Networking.cpp +++ b/apps/openmw-mp/Networking.cpp @@ -178,7 +178,7 @@ void Networking::processObjectPacket(RakNet::Packet *packet) if (!player->isHandshaked() || player->getLoadState() != Player::POSTLOADED) return; - if (!WorldProcessor::Process(*packet, baseEvent)) + if (!WorldProcessor::Process(*packet, baseObjectList)) LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Unhandled ObjectPacket with identifier %i has arrived", (int) packet->data[0]); } @@ -353,9 +353,9 @@ BaseActorList *Networking::getLastActorList() return &baseActorList; } -BaseEvent *Networking::getLastEvent() +BaseObjectList *Networking::getLastObjectList() { - return &baseEvent; + return &baseObjectList; } int Networking::getCurrentMpNum() diff --git a/apps/openmw-mp/Networking.hpp b/apps/openmw-mp/Networking.hpp index e09a80e6f..a6e1623e9 100644 --- a/apps/openmw-mp/Networking.hpp +++ b/apps/openmw-mp/Networking.hpp @@ -56,7 +56,7 @@ namespace mwmp LuaState &getState() {return luaState;} BaseActorList *getLastActorList(); - BaseEvent *getLastEvent(); + BaseObjectList *getLastObjectList(); int getCurrentMpNum(); void setCurrentMpNum(int value); @@ -90,7 +90,7 @@ namespace mwmp std::unique_ptr mclient; BaseActorList baseActorList; - BaseEvent baseEvent; + BaseObjectList baseObjectList; std::unique_ptr playerPacketController; std::unique_ptr actorPacketController; diff --git a/apps/openmw-mp/Object.cpp b/apps/openmw-mp/Object.cpp index 0f8739108..d207bc01c 100644 --- a/apps/openmw-mp/Object.cpp +++ b/apps/openmw-mp/Object.cpp @@ -331,11 +331,11 @@ void ObjectController::Init(LuaState &lua) } -shared_ptr>> ObjectController::copyObjects(mwmp::BaseEvent &event) +shared_ptr>> ObjectController::copyObjects(mwmp::BaseObjectList &objectList) { auto objects = make_shared>>(); - for (auto &obj : event.worldObjects) + for (auto &obj : objectList.baseObjects) { auto object = new Object; object->copied = true; @@ -345,11 +345,11 @@ shared_ptr>> ObjectController::copyObjects(mwmp::BaseE return objects; } -shared_ptr>> ObjectController::copyContainers(mwmp::BaseEvent &event) +shared_ptr>> ObjectController::copyContainers(mwmp::BaseObjectList &objectList) { auto containers = make_shared>>(); - for (auto &obj : event.worldObjects) + for (auto &obj : objectList.baseObjects) { auto container = new Container; container->copied = true; @@ -374,14 +374,14 @@ void ObjectController::sendObjects(shared_ptr player, shared_ptrguid; - e.cell = cell; + objectList.action = mwmp::BaseObjectList::Action::Set; + objectList.guid = player->guid; + objectList.cell = cell; } @@ -394,47 +394,47 @@ void ObjectController::sendObjects(shared_ptr player, shared_ptrchangedDoorState && validNewObjOrCopy) { changed[Type::DOOR_STATE] = true; - events[Type::DOOR_STATE].worldObjects.push_back(object->object); + objectLists[Type::DOOR_STATE].baseObjects.push_back(object->object); } if (object->changedDoorDestination && validNewObjOrCopy) { changed[Type::DOOR_DESTINATION] = true; - events[Type::DOOR_DESTINATION].worldObjects.push_back(object->object); + objectLists[Type::DOOR_DESTINATION].baseObjects.push_back(object->object); } if (object->changedObjectState && validNewObjOrCopy) { changed[Type::OBJECT_STATE] = true; - events[Type::OBJECT_STATE].worldObjects.push_back(object->object); + objectLists[Type::OBJECT_STATE].baseObjects.push_back(object->object); } if (object->changedObjectScale && validNewObjOrCopy) { changed[Type::OBJECT_SCALE] = true; - events[Type::OBJECT_SCALE].worldObjects.push_back(object->object); + objectLists[Type::OBJECT_SCALE].baseObjects.push_back(object->object); } if (object->changedObjectTrap && validNewObjOrCopy) { changed[Type::OBJECT_TRAP] = true; - events[Type::OBJECT_TRAP].worldObjects.push_back(object->object); + objectLists[Type::OBJECT_TRAP].baseObjects.push_back(object->object); } if (object->changedObjectLock && validNewObjOrCopy) { changed[Type::OBJECT_LOCK] = true; - events[Type::OBJECT_LOCK].worldObjects.push_back(object->object); + objectLists[Type::OBJECT_LOCK].baseObjects.push_back(object->object); } if (object->changedObjectDelete && validNewObjOrCopy) { changed[Type::OBJECT_DELETE] = true; - events[Type::OBJECT_DELETE].worldObjects.push_back(object->object); + objectLists[Type::OBJECT_DELETE].baseObjects.push_back(object->object); } if (object->changedObjectSpawn && validNewObjOrCopy) { changed[Type::OBJECT_SPAWN] = true; - events[Type::OBJECT_SPAWN].worldObjects.push_back(object->object); + objectLists[Type::OBJECT_SPAWN].baseObjects.push_back(object->object); } if (object->changedObjectPlace && validNewObjOrCopy) { changed[Type::OBJECT_PLACE] = true; - events[Type::OBJECT_PLACE].worldObjects.push_back(object->object); + objectLists[Type::OBJECT_PLACE].baseObjects.push_back(object->object); } } @@ -443,8 +443,8 @@ void ObjectController::sendObjects(shared_ptr player, shared_ptrGetPacket(ID_DOOR_STATE); - auto &event = events[Type::DOOR_STATE]; - packet->setEvent(&event); + auto &objectList = objectLists[Type::DOOR_STATE]; + packet->setObjectList(&objectList); packet->Send(false); if (broadcast) @@ -453,8 +453,8 @@ void ObjectController::sendObjects(shared_ptr player, shared_ptrGetPacket(ID_DOOR_DESTINATION); - auto &event = events[Type::DOOR_DESTINATION]; - packet->setEvent(&event); + auto &objectList = objectLists[Type::DOOR_DESTINATION]; + packet->setObjectList(&objectList); packet->Send(false); if (broadcast) @@ -463,8 +463,8 @@ void ObjectController::sendObjects(shared_ptr player, shared_ptrGetPacket(ID_OBJECT_STATE); - auto &event = events[Type::OBJECT_STATE]; - packet->setEvent(&event); + auto &objectList = objectLists[Type::OBJECT_STATE]; + packet->setObjectList(&objectList); packet->Send(false); if (broadcast) @@ -473,8 +473,8 @@ void ObjectController::sendObjects(shared_ptr player, shared_ptrGetPacket(ID_OBJECT_SCALE); - auto &event = events[Type::OBJECT_SCALE]; - packet->setEvent(&event); + auto &objectList = objectLists[Type::OBJECT_SCALE]; + packet->setObjectList(&objectList); packet->Send(false); if (broadcast) @@ -483,8 +483,8 @@ void ObjectController::sendObjects(shared_ptr player, shared_ptrGetPacket(ID_OBJECT_TRAP); - auto &event = events[Type::OBJECT_TRAP]; - packet->setEvent(&event); + auto &objectList = objectLists[Type::OBJECT_TRAP]; + packet->setObjectList(&objectList); packet->Send(false); if (broadcast) @@ -493,8 +493,8 @@ void ObjectController::sendObjects(shared_ptr player, shared_ptrGetPacket(ID_OBJECT_LOCK); - auto &event = events[Type::OBJECT_LOCK]; - packet->setEvent(&event); + auto &objectList = objectLists[Type::OBJECT_LOCK]; + packet->setObjectList(&objectList); packet->Send(false); if (broadcast) @@ -503,8 +503,8 @@ void ObjectController::sendObjects(shared_ptr player, shared_ptrGetPacket(ID_OBJECT_DELETE); - auto &event = events[Type::OBJECT_DELETE]; - packet->setEvent(&event); + auto &objectList = objectLists[Type::OBJECT_DELETE]; + packet->setObjectList(&objectList); packet->Send(false); if (broadcast) @@ -513,8 +513,8 @@ void ObjectController::sendObjects(shared_ptr player, shared_ptrGetPacket(ID_OBJECT_SPAWN); - auto &event = events[Type::OBJECT_SCALE]; - packet->setEvent(&event); + auto &objectList = objectLists[Type::OBJECT_SCALE]; + packet->setObjectList(&objectList); packet->Send(false); if (broadcast) @@ -523,8 +523,8 @@ void ObjectController::sendObjects(shared_ptr player, shared_ptrGetPacket(ID_OBJECT_PLACE); - auto &event = events[Type::OBJECT_PLACE]; - packet->setEvent(&event); + auto &objectList = objectLists[Type::OBJECT_PLACE]; + packet->setObjectList(&objectList); packet->Send(false); if (broadcast) @@ -536,16 +536,16 @@ void ObjectController::sendConsoleCommand(shared_ptr player, shared_ptr< const ESM::Cell &cell, const std::string &consoleCommand, bool broadcast) { - mwmp::BaseEvent event; - event.cell = cell; - event.consoleCommand = consoleCommand; - event.guid = player->guid; + mwmp::BaseObjectList objectList; + objectList.cell = cell; + objectList.consoleCommand = consoleCommand; + objectList.guid = player->guid; for (auto &object : *objects) - event.worldObjects.push_back(object->object); + objectList.baseObjects.push_back(object->object); auto packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_CONSOLE_COMMAND); - packet->setEvent(&event); + packet->setObjectList(&objectList); packet->Send(false); if (broadcast) @@ -556,20 +556,20 @@ void ObjectController::sendContainers(shared_ptr player, shared_ptrguid; + mwmp::BaseObjectList objectList; + objectList.cell = cell; + objectList.action = mwmp::BaseObjectList::Action::Set; + objectList.guid = player->guid; for (auto &object : *objects) { bool validNewObjOrCopy = (!object->copied && object->changedBase) || object->copied; if (object->changed && validNewObjOrCopy) - event.worldObjects.push_back(object->object); + objectList.baseObjects.push_back(object->object); } auto packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_CONTAINER); - packet->setEvent(&event); + packet->setObjectList(&objectList); packet->Send(false); if (broadcast) @@ -578,12 +578,12 @@ void ObjectController::sendContainers(shared_ptr player, shared_ptr player) { - mwmp::BaseEvent event; - event.action = mwmp::BaseEvent::Action::Request; - event.guid = player->guid; - event.cell = player->cell; + mwmp::BaseObjectList objectList; + objectList.action = mwmp::BaseObjectList::Action::Request; + objectList.guid = player->guid; + objectList.cell = player->cell; auto packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_CONTAINER); - packet->setEvent(&event); - packet->Send(event.guid); + packet->setObjectList(&objectList); + packet->Send(objectList.guid); } diff --git a/apps/openmw-mp/Object.hpp b/apps/openmw-mp/Object.hpp index bd5c29b8c..eda71483e 100644 --- a/apps/openmw-mp/Object.hpp +++ b/apps/openmw-mp/Object.hpp @@ -1,11 +1,7 @@ -// -// Created by koncord on 26.08.17. -// - #pragma once #include -#include +#include #include class LuaState; @@ -30,7 +26,7 @@ public: //void setEventCell(const std::string &cellDescription); - mwmp::WorldObject object; + mwmp::BaseObject object; bool changedBase; bool copied; }; @@ -118,8 +114,8 @@ public: static void Init(LuaState &lua); public: - std::shared_ptr>> copyObjects(mwmp::BaseEvent &event); - std::shared_ptr>> copyContainers(mwmp::BaseEvent &event); + std::shared_ptr>> copyObjects(mwmp::BaseObjectList &objectList); + std::shared_ptr>> copyContainers(mwmp::BaseObjectList &objectList); void sendObjects(std::shared_ptr player, std::shared_ptr>> objects, const ESM::Cell &cell, bool broadcast = false); diff --git a/apps/openmw-mp/processors/WorldProcessor.cpp b/apps/openmw-mp/processors/WorldProcessor.cpp index 4e431afc8..4d8180636 100644 --- a/apps/openmw-mp/processors/WorldProcessor.cpp +++ b/apps/openmw-mp/processors/WorldProcessor.cpp @@ -10,17 +10,17 @@ using namespace mwmp; template typename BasePacketProcessor::processors_t BasePacketProcessor::processors; -void WorldProcessor::Do(ObjectPacket &packet, const std::shared_ptr &player, BaseEvent &event) +void WorldProcessor::Do(ObjectPacket &packet, const std::shared_ptr &player, BaseObjectList &objectList) { packet.Send(true); } -bool WorldProcessor::Process(RakNet::Packet &packet, BaseEvent &event) noexcept +bool WorldProcessor::Process(RakNet::Packet &packet, BaseObjectList &objectList) noexcept { - // Clear our BaseEvent before loading new data in it - event.cell.blank(); - event.worldObjects.clear(); - event.guid = packet.guid; + // Clear our BaseObjectList before loading new data in it + objectList.cell.blank(); + objectList.baseObjects.clear(); + objectList.guid = packet.guid; for (auto &processor : processors) { @@ -29,14 +29,14 @@ bool WorldProcessor::Process(RakNet::Packet &packet, BaseEvent &event) noexcept auto player = Players::getPlayerByGUID(packet.guid); ObjectPacket *myPacket = Networking::get().getObjectPacketController()->GetPacket(packet.data[0]); - myPacket->setEvent(&event); - event.isValid = true; + myPacket->setObjectList(&objectList); + objectList.isValid = true; if (!processor.second->avoidReading) myPacket->Read(); - if (event.isValid) - processor.second->Do(*myPacket, player, event); + if (objectList.isValid) + processor.second->Do(*myPacket, player, objectList); else LOG_MESSAGE_SIMPLE(Log::LOG_ERROR, "Received %s that failed integrity check and was ignored!", processor.second->strPacketID.c_str()); diff --git a/apps/openmw-mp/processors/WorldProcessor.hpp b/apps/openmw-mp/processors/WorldProcessor.hpp index 8071f6061..7540c864c 100644 --- a/apps/openmw-mp/processors/WorldProcessor.hpp +++ b/apps/openmw-mp/processors/WorldProcessor.hpp @@ -18,9 +18,9 @@ namespace mwmp { public: - virtual void Do(ObjectPacket &packet, const std::shared_ptr &player, BaseEvent &event); + virtual void Do(ObjectPacket &packet, const std::shared_ptr &player, BaseObjectList &objectList); - static bool Process(RakNet::Packet &packet, BaseEvent &event) noexcept; + static bool Process(RakNet::Packet &packet, BaseObjectList &objectList) noexcept; }; } diff --git a/apps/openmw-mp/processors/world/ProcessorContainer.hpp b/apps/openmw-mp/processors/world/ProcessorContainer.hpp index 944c19be7..68aab8765 100644 --- a/apps/openmw-mp/processors/world/ProcessorContainer.hpp +++ b/apps/openmw-mp/processors/world/ProcessorContainer.hpp @@ -15,17 +15,17 @@ namespace mwmp BPP_INIT(ID_CONTAINER) } - void Do(ObjectPacket &packet, const std::shared_ptr &player, BaseEvent &event) override + void Do(ObjectPacket &packet, const std::shared_ptr &player, BaseObjectList &objectList) 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", (int) event.action); + LOG_APPEND(Log::LOG_INFO, "- action: %i", (int) objectList.action); // Don't have any hardcoded sync, and instead expect Lua scripts to forward // container packets to ensure their integrity based on what exists in the // server data auto objCtrl = Networking::get().getState().getObjectCtrl(); - auto containers = objCtrl.copyContainers(event); + auto containers = objCtrl.copyContainers(objectList); Networking::get().getState().getEventCtrl().Call(player, containers); diff --git a/apps/openmw-mp/processors/world/ProcessorDoorState.hpp b/apps/openmw-mp/processors/world/ProcessorDoorState.hpp index cf2fa7043..e8dc9d11c 100644 --- a/apps/openmw-mp/processors/world/ProcessorDoorState.hpp +++ b/apps/openmw-mp/processors/world/ProcessorDoorState.hpp @@ -13,16 +13,16 @@ namespace mwmp BPP_INIT(ID_DOOR_STATE) } - void Do(ObjectPacket &packet, const std::shared_ptr &player, BaseEvent &event) override + void Do(ObjectPacket &packet, const std::shared_ptr &player, BaseObjectList &objectList) override { packet.Send(true); auto objCtrl = Networking::get().getState().getObjectCtrl(); - auto objects = objCtrl.copyObjects(event); + auto objects = objCtrl.copyObjects(objectList); Networking::get().getState().getEventCtrl().Call(player, objects); - objCtrl.sendObjects(player, objects, event.cell); + objCtrl.sendObjects(player, objects, objectList.cell); } }; } diff --git a/apps/openmw-mp/processors/world/ProcessorObjectDelete.hpp b/apps/openmw-mp/processors/world/ProcessorObjectDelete.hpp index dc8e83ac1..a72463b6c 100644 --- a/apps/openmw-mp/processors/world/ProcessorObjectDelete.hpp +++ b/apps/openmw-mp/processors/world/ProcessorObjectDelete.hpp @@ -13,18 +13,18 @@ namespace mwmp BPP_INIT(ID_OBJECT_DELETE) } - void Do(ObjectPacket &packet, const std::shared_ptr &player, BaseEvent &event) override + void Do(ObjectPacket &packet, const std::shared_ptr &player, BaseObjectList &objectList) override { LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player->npc.mName.c_str()); packet.Send(true); auto objCtrl = Networking::get().getState().getObjectCtrl(); - auto objects = objCtrl.copyObjects(event); + auto objects = objCtrl.copyObjects(objectList); Networking::get().getState().getEventCtrl().Call(player.get(), objects); - objCtrl.sendObjects(player, objects, event.cell); + objCtrl.sendObjects(player, objects, objectList.cell); } }; } diff --git a/apps/openmw-mp/processors/world/ProcessorObjectLock.hpp b/apps/openmw-mp/processors/world/ProcessorObjectLock.hpp index f10740244..fe49add99 100644 --- a/apps/openmw-mp/processors/world/ProcessorObjectLock.hpp +++ b/apps/openmw-mp/processors/world/ProcessorObjectLock.hpp @@ -13,18 +13,18 @@ namespace mwmp BPP_INIT(ID_OBJECT_LOCK) } - void Do(ObjectPacket &packet, const std::shared_ptr &player, BaseEvent &event) override + void Do(ObjectPacket &packet, const std::shared_ptr &player, BaseObjectList &objectList) override { LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player->npc.mName.c_str()); packet.Send(true); auto objCtrl = Networking::get().getState().getObjectCtrl(); - auto objects = objCtrl.copyObjects(event); + auto objects = objCtrl.copyObjects(objectList); Networking::get().getState().getEventCtrl().Call(player.get(), objects); - objCtrl.sendObjects(player, objects, event.cell); + objCtrl.sendObjects(player, objects, objectList.cell); } }; } diff --git a/apps/openmw-mp/processors/world/ProcessorObjectPlace.hpp b/apps/openmw-mp/processors/world/ProcessorObjectPlace.hpp index 22b39edbf..a537f3d0f 100644 --- a/apps/openmw-mp/processors/world/ProcessorObjectPlace.hpp +++ b/apps/openmw-mp/processors/world/ProcessorObjectPlace.hpp @@ -14,11 +14,11 @@ namespace mwmp BPP_INIT(ID_OBJECT_PLACE) } - void Do(ObjectPacket &packet, const std::shared_ptr &player, BaseEvent &event) override + void Do(ObjectPacket &packet, const std::shared_ptr &player, BaseObjectList &objectList) override { LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player->npc.mName.c_str()); - for (auto & object : event.worldObjects) + for (auto & object : objectList.baseObjects) object.mpNum = mwmp::Networking::getPtr()->incrementMpNum(); // Send this packet back to the original sender with the mpNum generation from above, @@ -27,11 +27,11 @@ namespace mwmp packet.Send(true); auto objCtrl = Networking::get().getState().getObjectCtrl(); - auto objects = objCtrl.copyObjects(event); + auto objects = objCtrl.copyObjects(objectList); Networking::get().getState().getEventCtrl().Call(player.get(), objects); - objCtrl.sendObjects(player, objects, event.cell); + objCtrl.sendObjects(player, objects, objectList.cell); } }; } diff --git a/apps/openmw-mp/processors/world/ProcessorObjectScale.hpp b/apps/openmw-mp/processors/world/ProcessorObjectScale.hpp index cf5fa21ce..a3fc17fde 100644 --- a/apps/openmw-mp/processors/world/ProcessorObjectScale.hpp +++ b/apps/openmw-mp/processors/world/ProcessorObjectScale.hpp @@ -13,18 +13,18 @@ namespace mwmp BPP_INIT(ID_OBJECT_SCALE) } - void Do(ObjectPacket &packet, const std::shared_ptr &player, BaseEvent &event) override + void Do(ObjectPacket &packet, const std::shared_ptr &player, BaseObjectList &objectList) override { LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player->npc.mName.c_str()); packet.Send(true); auto objCtrl = Networking::get().getState().getObjectCtrl(); - auto objects = objCtrl.copyObjects(event); + auto objects = objCtrl.copyObjects(objectList); Networking::get().getState().getEventCtrl().Call(player.get(), objects); - objCtrl.sendObjects(player, objects, event.cell); + objCtrl.sendObjects(player, objects, objectList.cell); } }; } diff --git a/apps/openmw-mp/processors/world/ProcessorObjectSpawn.hpp b/apps/openmw-mp/processors/world/ProcessorObjectSpawn.hpp index c49234dfa..d618d9f8c 100644 --- a/apps/openmw-mp/processors/world/ProcessorObjectSpawn.hpp +++ b/apps/openmw-mp/processors/world/ProcessorObjectSpawn.hpp @@ -14,11 +14,11 @@ namespace mwmp BPP_INIT(ID_OBJECT_SPAWN) } - void Do(ObjectPacket &packet, const std::shared_ptr &player, BaseEvent &event) override + void Do(ObjectPacket &packet, const std::shared_ptr &player, BaseObjectList &objectList) override { LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player->npc.mName.c_str()); - for (auto & object : event.worldObjects) + for (auto & object : objectList.baseObjects) object.mpNum = mwmp::Networking::getPtr()->incrementMpNum(); // Send this packet back to the original sender with the mpNum generation from above, @@ -27,11 +27,11 @@ namespace mwmp packet.Send(true); auto objCtrl = Networking::get().getState().getObjectCtrl(); - auto objects = objCtrl.copyObjects(event); + auto objects = objCtrl.copyObjects(objectList); Networking::get().getState().getEventCtrl().Call(player.get(), objects); - objCtrl.sendObjects(player, objects, event.cell); + objCtrl.sendObjects(player, objects, objectList.cell); } }; } diff --git a/apps/openmw-mp/processors/world/ProcessorObjectState.hpp b/apps/openmw-mp/processors/world/ProcessorObjectState.hpp index c8a6dbe9f..95e7c7fcf 100644 --- a/apps/openmw-mp/processors/world/ProcessorObjectState.hpp +++ b/apps/openmw-mp/processors/world/ProcessorObjectState.hpp @@ -13,18 +13,18 @@ namespace mwmp BPP_INIT(ID_OBJECT_STATE) } - void Do(ObjectPacket &packet, const std::shared_ptr &player, BaseEvent &event) override + void Do(ObjectPacket &packet, const std::shared_ptr &player, BaseObjectList &objectList) override { LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player->npc.mName.c_str()); packet.Send(true); auto objCtrl = Networking::get().getState().getObjectCtrl(); - auto objects = objCtrl.copyObjects(event); + auto objects = objCtrl.copyObjects(objectList); Networking::get().getState().getEventCtrl().Call(player.get(), objects); - objCtrl.sendObjects(player, objects, event.cell); + objCtrl.sendObjects(player, objects, objectList.cell); } }; } diff --git a/apps/openmw-mp/processors/world/ProcessorObjectTrap.hpp b/apps/openmw-mp/processors/world/ProcessorObjectTrap.hpp index 062ca296b..cd4b95350 100644 --- a/apps/openmw-mp/processors/world/ProcessorObjectTrap.hpp +++ b/apps/openmw-mp/processors/world/ProcessorObjectTrap.hpp @@ -13,18 +13,18 @@ namespace mwmp BPP_INIT(ID_OBJECT_TRAP) } - void Do(ObjectPacket &packet, const std::shared_ptr &player, BaseEvent &event) override + void Do(ObjectPacket &packet, const std::shared_ptr &player, BaseObjectList &objectList) override { LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player->npc.mName.c_str()); packet.Send(true); auto objCtrl = Networking::get().getState().getObjectCtrl(); - auto objects = objCtrl.copyObjects(event); + auto objects = objCtrl.copyObjects(objectList); Networking::get().getState().getEventCtrl().Call(player.get(), objects); - objCtrl.sendObjects(player, objects, event.cell); + objCtrl.sendObjects(player, objects, objectList.cell); } }; } diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index 03a13b72c..e4d49c73e 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -97,7 +97,7 @@ add_openmw_dir (mwbase inputmanager windowmanager statemanager ) -add_openmw_dir (mwmp Main Networking LocalPlayer DedicatedPlayer PlayerList LocalActor DedicatedActor ActorList WorldEvent +add_openmw_dir (mwmp Main Networking LocalPlayer DedicatedPlayer PlayerList LocalActor DedicatedActor ActorList ObjectList Cell CellController MechanicsHelper RecordHelper GUIController ) diff --git a/apps/openmw/mwclass/container.cpp b/apps/openmw/mwclass/container.cpp index ecae30083..78482b9f3 100644 --- a/apps/openmw/mwclass/container.cpp +++ b/apps/openmw/mwclass/container.cpp @@ -7,7 +7,7 @@ */ #include "../mwmp/Main.hpp" #include "../mwmp/Networking.hpp" -#include "../mwmp/WorldEvent.hpp" +#include "../mwmp/ObjectList.hpp" /* End of tes3mp addition */ @@ -189,10 +189,10 @@ namespace MWClass Send an ID_OBJECT_TRAP packet every time a trap is disarmed */ - mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); - worldEvent->reset(); - worldEvent->addObjectTrap(ptr, ptr.getRefData().getPosition(), true); - worldEvent->sendObjectTrap(); + mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); + objectList->reset(); + objectList->addObjectTrap(ptr, ptr.getRefData().getPosition(), true); + objectList->sendObjectTrap(); /* End of tes3mp addition */ @@ -205,10 +205,10 @@ namespace MWClass */ if (isLocked) { - mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); - worldEvent->reset(); - worldEvent->addObjectLock(ptr, 0); - worldEvent->sendObjectLock(); + mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); + objectList->reset(); + objectList->addObjectLock(ptr, 0); + objectList->sendObjectLock(); } /* End of tes3mp addition diff --git a/apps/openmw/mwclass/door.cpp b/apps/openmw/mwclass/door.cpp index 2b4e47b78..69c06aae9 100644 --- a/apps/openmw/mwclass/door.cpp +++ b/apps/openmw/mwclass/door.cpp @@ -7,7 +7,7 @@ */ #include "../mwmp/Main.hpp" #include "../mwmp/Networking.hpp" -#include "../mwmp/WorldEvent.hpp" +#include "../mwmp/ObjectList.hpp" /* End of tes3mp addition */ @@ -183,10 +183,10 @@ namespace MWClass Send an ID_OBJECT_TRAP packet every time a trap is disarmed */ - mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); - worldEvent->reset(); - worldEvent->addObjectTrap(ptr, ptr.getRefData().getPosition(), true); - worldEvent->sendObjectTrap(); + mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); + objectList->reset(); + objectList->addObjectTrap(ptr, ptr.getRefData().getPosition(), true); + objectList->sendObjectTrap(); /* End of tes3mp addition */ @@ -199,10 +199,10 @@ namespace MWClass */ if (isLocked) { - mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); - worldEvent->reset(); - worldEvent->addObjectLock(ptr, 0); - worldEvent->sendObjectLock(); + mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); + objectList->reset(); + objectList->addObjectLock(ptr, 0); + objectList->sendObjectLock(); } /* End of tes3mp addition diff --git a/apps/openmw/mwgui/container.cpp b/apps/openmw/mwgui/container.cpp index 5ec9dd1b3..8f7a301b8 100644 --- a/apps/openmw/mwgui/container.cpp +++ b/apps/openmw/mwgui/container.cpp @@ -12,7 +12,7 @@ #include "../mwmp/Main.hpp" #include "../mwmp/Networking.hpp" #include "../mwmp/LocalPlayer.hpp" -#include "../mwmp/WorldEvent.hpp" +#include "../mwmp/ObjectList.hpp" #include "../mwmp/CellController.hpp" /* End of tes3mp addition @@ -112,23 +112,23 @@ namespace MWGui Send an ID_CONTAINER packet every time an item starts being dragged from a container */ - mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); - worldEvent->reset(); - worldEvent->cell = *mPtr.getCell()->getCell(); - worldEvent->action = mwmp::BaseEvent::Action::Remove; - worldEvent->containerSubAction = mwmp::BaseEvent::ContainerSubAction::Drag; + mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); + objectList->reset(); + objectList->cell = *mPtr.getCell()->getCell(); + objectList->action = mwmp::BaseObjectList::Action::Remove; + objectList->containerSubAction = mwmp::BaseObjectList::ContainerSubAction::Drag; - mwmp::WorldObject worldObject = worldEvent->getWorldObject(mPtr); + mwmp::BaseObject baseObject = objectList->getBaseObject(mPtr); MWWorld::Ptr itemPtr = mModel->getItem(mSelectedItem).mBase; - worldEvent->addContainerItem(worldObject, itemPtr, count); - worldEvent->worldObjects.push_back(std::move(worldObject)); + objectList->addContainerItem(baseObject, itemPtr, count); + objectList->baseObjects.push_back(std::move(baseObject)); - mwmp::Main::get().getNetworking()->getObjectPacket(ID_CONTAINER)->setEvent(worldEvent); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_CONTAINER)->setObjectList(objectList); 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(), + baseObject.refId.c_str(), baseObject.refNumIndex, objectList->cell.getDescription().c_str(), itemPtr.getCellRef().getRefId().c_str(), itemPtr.getRefData().getCount()); /* End of tes3mp addition @@ -159,13 +159,13 @@ namespace MWGui */ if (success) { - mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); - worldEvent->reset(); - worldEvent->cell = *mPtr.getCell()->getCell(); - worldEvent->action = mwmp::BaseEvent::Action::Add; - worldEvent->containerSubAction = mwmp::BaseEvent::ContainerSubAction::Drop; + mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); + objectList->reset(); + objectList->cell = *mPtr.getCell()->getCell(); + objectList->action = mwmp::BaseObjectList::Action::Add; + objectList->containerSubAction = mwmp::BaseObjectList::ContainerSubAction::Drop; - mwmp::WorldObject worldObject = worldEvent->getWorldObject(mPtr); + mwmp::BaseObject baseObject = objectList->getBaseObject(mPtr); MWWorld::Ptr itemPtr = mDragAndDrop->mItem.mBase; mwmp::ContainerItem containerItem; containerItem.refId = itemPtr.getCellRef().getRefId(); @@ -176,14 +176,14 @@ namespace MWGui containerItem.charge = itemPtr.getCellRef().getCharge(); containerItem.enchantmentCharge = itemPtr.getCellRef().getEnchantmentCharge(); - worldObject.containerItems.push_back(std::move(containerItem)); - worldEvent->worldObjects.push_back(std::move(worldObject)); + baseObject.containerItems.push_back(std::move(containerItem)); + objectList->baseObjects.push_back(std::move(baseObject)); - mwmp::Main::get().getNetworking()->getObjectPacket(ID_CONTAINER)->setEvent(worldEvent); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_CONTAINER)->setObjectList(objectList); 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(), + baseObject.refId.c_str(), baseObject.refNumIndex, objectList->cell.getDescription().c_str(), containerItem.refId.c_str(), containerItem.count, containerItem.charge); } /* @@ -299,19 +299,19 @@ namespace MWGui Send an ID_CONTAINER packet every time the Take All button is used on a container */ - mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); - worldEvent->reset(); - worldEvent->cell = *mPtr.getCell()->getCell(); - worldEvent->action = mwmp::BaseEvent::Action::Remove; - worldEvent->containerSubAction = mwmp::BaseEvent::ContainerSubAction::TakeAll; - worldEvent->addEntireContainer(mPtr); - - mwmp::Main::get().getNetworking()->getObjectPacket(ID_CONTAINER)->setEvent(worldEvent); + mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); + objectList->reset(); + objectList->cell = *mPtr.getCell()->getCell(); + objectList->action = mwmp::BaseObjectList::Action::Remove; + objectList->containerSubAction = mwmp::BaseObjectList::ContainerSubAction::TakeAll; + objectList->addEntireContainer(mPtr); + + mwmp::Main::get().getNetworking()->getObjectPacket(ID_CONTAINER)->setObjectList(objectList); 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(), - worldEvent->cell.getDescription().c_str()); + objectList->cell.getDescription().c_str()); /* End of tes3mp addition */ @@ -381,10 +381,10 @@ namespace MWGui */ if (!mPtr.getClass().isPersistent(mPtr)) { - mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); - worldEvent->reset(); - worldEvent->addObjectDelete(mPtr); - worldEvent->sendObjectDelete(); + mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); + objectList->reset(); + objectList->addObjectDelete(mPtr); + objectList->sendObjectDelete(); } /* End of tes3mp addition diff --git a/apps/openmw/mwgui/hud.cpp b/apps/openmw/mwgui/hud.cpp index 1bf0b7984..d38fe87da 100644 --- a/apps/openmw/mwgui/hud.cpp +++ b/apps/openmw/mwgui/hud.cpp @@ -14,7 +14,7 @@ */ #include "../mwmp/Main.hpp" #include "../mwmp/Networking.hpp" -#include "../mwmp/WorldEvent.hpp" +#include "../mwmp/ObjectList.hpp" #include "../mwmp/LocalPlayer.hpp" #include "../mwworld/cellstore.hpp" /* @@ -72,10 +72,10 @@ namespace MWGui Send an ID_OBJECT_PLACE packet every time an object is dropped into the world from the inventory screen */ - mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); - worldEvent->reset(); - worldEvent->addObjectPlace(dropped, true); - worldEvent->sendObjectPlace(); + mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); + objectList->reset(); + objectList->addObjectPlace(dropped, true); + objectList->sendObjectPlace(); /* End of tes3mp addition */ diff --git a/apps/openmw/mwgui/inventorywindow.cpp b/apps/openmw/mwgui/inventorywindow.cpp index e91cf5a12..0ff317e09 100644 --- a/apps/openmw/mwgui/inventorywindow.cpp +++ b/apps/openmw/mwgui/inventorywindow.cpp @@ -24,7 +24,7 @@ */ #include "../mwmp/Main.hpp" #include "../mwmp/Networking.hpp" -#include "../mwmp/WorldEvent.hpp" +#include "../mwmp/ObjectList.hpp" #include "../mwmp/LocalPlayer.hpp" #include "../mwworld/cellstore.hpp" /* @@ -697,10 +697,10 @@ namespace MWGui Send an ID_PLAYER_INVENTORY packet as well because of the item thus gained by the player */ - mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); - worldEvent->reset(); - worldEvent->addObjectDelete(object); - worldEvent->sendObjectDelete(); + mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); + objectList->reset(); + objectList->addObjectDelete(object); + objectList->sendObjectDelete(); mwmp::Main::get().getLocalPlayer()->sendInventory(); /* End of tes3mp addition diff --git a/apps/openmw/mwmechanics/actors.cpp b/apps/openmw/mwmechanics/actors.cpp index c3db5a48f..a7f4507e4 100644 --- a/apps/openmw/mwmechanics/actors.cpp +++ b/apps/openmw/mwmechanics/actors.cpp @@ -23,7 +23,7 @@ #include "../mwmp/PlayerList.hpp" #include "../mwmp/CellController.hpp" #include "../mwmp/MechanicsHelper.hpp" -#include "../mwmp/WorldEvent.hpp" +#include "../mwmp/ObjectList.hpp" /* End of tes3mp addition */ @@ -1726,10 +1726,10 @@ namespace MWMechanics Send an ID_OBJECT_DELETE packet every time a summoned creature despawns */ - mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); - worldEvent->reset(); - worldEvent->addObjectDelete(ptr); - worldEvent->sendObjectDelete(); + mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); + objectList->reset(); + objectList->addObjectDelete(ptr); + objectList->sendObjectDelete(); /* End of tes3mp addition */ diff --git a/apps/openmw/mwmechanics/security.cpp b/apps/openmw/mwmechanics/security.cpp index d54ffa518..ca40cdd4c 100644 --- a/apps/openmw/mwmechanics/security.cpp +++ b/apps/openmw/mwmechanics/security.cpp @@ -7,7 +7,7 @@ */ #include "../mwmp/Main.hpp" #include "../mwmp/Networking.hpp" -#include "../mwmp/WorldEvent.hpp" +#include "../mwmp/ObjectList.hpp" /* End of tes3mp addition */ @@ -73,10 +73,10 @@ namespace MWMechanics Send an ID_OBJECT_LOCK packet every time an object is unlocked here */ - mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); - worldEvent->reset(); - worldEvent->addObjectLock(lock, 0); - worldEvent->sendObjectLock(); + mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); + objectList->reset(); + objectList->addObjectLock(lock, 0); + objectList->sendObjectLock(); /* End of tes3mp addition */ @@ -132,10 +132,10 @@ namespace MWMechanics Send an ID_OBJECT_TRAP packet every time a trap is disarmed */ - mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); - worldEvent->reset(); - worldEvent->addObjectTrap(trap, trap.getRefData().getPosition(), true); - worldEvent->sendObjectTrap(); + mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); + objectList->reset(); + objectList->addObjectTrap(trap, trap.getRefData().getPosition(), true); + objectList->sendObjectTrap(); /* End of tes3mp addition */ diff --git a/apps/openmw/mwmechanics/spellcasting.cpp b/apps/openmw/mwmechanics/spellcasting.cpp index 190776cb0..202394d8f 100644 --- a/apps/openmw/mwmechanics/spellcasting.cpp +++ b/apps/openmw/mwmechanics/spellcasting.cpp @@ -19,7 +19,7 @@ #include "../mwmp/Networking.hpp" #include "../mwmp/PlayerList.hpp" #include "../mwmp/LocalPlayer.hpp" -#include "../mwmp/WorldEvent.hpp" +#include "../mwmp/ObjectList.hpp" #include "../mwmp/MechanicsHelper.hpp" /* End of tes3mp addition @@ -680,10 +680,10 @@ namespace MWMechanics Send an ID_OBJECT_LOCK packet every time an object is locked here */ - mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); - worldEvent->reset(); - worldEvent->addObjectLock(target, static_cast(magnitude)); - worldEvent->sendObjectLock(); + mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); + objectList->reset(); + objectList->addObjectLock(target, static_cast(magnitude)); + objectList->sendObjectLock(); /* End of tes3mp addition */ @@ -714,10 +714,10 @@ namespace MWMechanics Send an ID_OBJECT_LOCK packet every time an object is unlocked here */ - mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); - worldEvent->reset(); - worldEvent->addObjectLock(target, 0); - worldEvent->sendObjectLock(); + mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); + objectList->reset(); + objectList->addObjectLock(target, 0); + objectList->sendObjectLock(); /* End of tes3mp addition */ diff --git a/apps/openmw/mwmechanics/summoning.cpp b/apps/openmw/mwmechanics/summoning.cpp index 14890f83f..0657b25ce 100644 --- a/apps/openmw/mwmechanics/summoning.cpp +++ b/apps/openmw/mwmechanics/summoning.cpp @@ -11,7 +11,7 @@ #include "../mwmp/Main.hpp" #include "../mwmp/Networking.hpp" #include "../mwmp/CellController.hpp" -#include "../mwmp/WorldEvent.hpp" +#include "../mwmp/ObjectList.hpp" /* End of tes3mp addition */ @@ -105,10 +105,10 @@ namespace MWMechanics if (mwmp::Main::get().getCellController()->hasLocalAuthority(*placed.getCell()->getCell())) { - mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); - worldEvent->reset(); - worldEvent->addObjectSpawn(placed, mActor); - worldEvent->sendObjectSpawn(); + mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); + objectList->reset(); + objectList->addObjectSpawn(placed, mActor); + objectList->sendObjectSpawn(); } MWBase::Environment::get().getWorld()->deleteObject(placed); @@ -162,10 +162,10 @@ namespace MWMechanics Send an ID_OBJECT_DELETE packet every time a summoned creature despawns */ - mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); - worldEvent->reset(); - worldEvent->addObjectDelete(ptr); - worldEvent->sendObjectDelete(); + mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); + objectList->reset(); + objectList->addObjectDelete(ptr); + objectList->sendObjectDelete(); /* End of tes3mp addition */ diff --git a/apps/openmw/mwmp/MechanicsHelper.cpp b/apps/openmw/mwmp/MechanicsHelper.cpp index cc07dcec9..d9608cbf4 100644 --- a/apps/openmw/mwmp/MechanicsHelper.cpp +++ b/apps/openmw/mwmp/MechanicsHelper.cpp @@ -19,7 +19,7 @@ #include "LocalPlayer.hpp" #include "DedicatedPlayer.hpp" #include "PlayerList.hpp" -#include "WorldEvent.hpp" +#include "ObjectList.hpp" #include "CellController.hpp" using namespace mwmp; @@ -35,8 +35,8 @@ osg::Vec3f MechanicsHelper::getLinearInterpolation(osg::Vec3f start, osg::Vec3f void MechanicsHelper::spawnLeveledCreatures(MWWorld::CellStore* cellStore) { MWWorld::CellRefList *creatureLevList = cellStore->getCreatureLists(); - mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); - worldEvent->reset(); + mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); + objectList->reset(); int spawnCount = 0; @@ -53,7 +53,7 @@ void MechanicsHelper::spawnLeveledCreatures(MWWorld::CellStore* cellStore) manualRef.getPtr().getCellRef().setPosition(ptr.getCellRef().getPosition()); MWWorld::Ptr placed = MWBase::Environment::get().getWorld()->placeObject(manualRef.getPtr(), ptr.getCell(), ptr.getCellRef().getPosition()); - worldEvent->addObjectSpawn(placed); + objectList->addObjectSpawn(placed); MWBase::Environment::get().getWorld()->deleteObject(placed); spawnCount++; @@ -61,7 +61,7 @@ void MechanicsHelper::spawnLeveledCreatures(MWWorld::CellStore* cellStore) } if (spawnCount > 0) - worldEvent->sendObjectSpawn(); + objectList->sendObjectSpawn(); } Attack *MechanicsHelper::getLocalAttack(const MWWorld::Ptr& ptr) diff --git a/apps/openmw/mwmp/Networking.cpp b/apps/openmw/mwmp/Networking.cpp index 833fc33ea..e8620cdf6 100644 --- a/apps/openmw/mwmp/Networking.cpp +++ b/apps/openmw/mwmp/Networking.cpp @@ -432,7 +432,7 @@ void Networking::receiveMessage(RakNet::Packet *packet) } else if (objectPacketController.ContainsPacket(packet->data[0])) { - if (!WorldProcessor::Process(*packet, worldEvent)) + if (!WorldProcessor::Process(*packet, objectList)) LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Unhandled ObjectPacket with identifier %i has arrived", (int) packet->data[0]); } } @@ -462,9 +462,9 @@ ActorList *Networking::getActorList() return &actorList; } -WorldEvent *Networking::getWorldEvent() +ObjectList *Networking::getObjectList() { - return &worldEvent; + return &objectList; } bool Networking::isConnected() diff --git a/apps/openmw/mwmp/Networking.hpp b/apps/openmw/mwmp/Networking.hpp index 5a06b027d..b59bc555d 100644 --- a/apps/openmw/mwmp/Networking.hpp +++ b/apps/openmw/mwmp/Networking.hpp @@ -10,7 +10,7 @@ #include #include "ActorList.hpp" -#include "WorldEvent.hpp" +#include "ObjectList.hpp" #include #include @@ -44,7 +44,7 @@ namespace mwmp LocalPlayer *getLocalPlayer(); ActorList *getActorList(); - WorldEvent *getWorldEvent(); + ObjectList *getObjectList(); std::string getNetworkStatistics(); @@ -59,7 +59,7 @@ namespace mwmp ObjectPacketController objectPacketController; ActorList actorList; - WorldEvent worldEvent; + ObjectList objectList; void receiveMessage(RakNet::Packet *packet); diff --git a/apps/openmw/mwmp/WorldEvent.cpp b/apps/openmw/mwmp/ObjectList.cpp similarity index 57% rename from apps/openmw/mwmp/WorldEvent.cpp rename to apps/openmw/mwmp/ObjectList.cpp index dab4af091..a0b925166 100644 --- a/apps/openmw/mwmp/WorldEvent.cpp +++ b/apps/openmw/mwmp/ObjectList.cpp @@ -1,4 +1,4 @@ -#include "WorldEvent.hpp" +#include "ObjectList.hpp" #include "Main.hpp" #include "Networking.hpp" #include "MechanicsHelper.hpp" @@ -32,41 +32,41 @@ using namespace mwmp; using namespace std; -WorldEvent::WorldEvent() +ObjectList::ObjectList() { } -WorldEvent::~WorldEvent() +ObjectList::~ObjectList() { } -Networking *WorldEvent::getNetworking() +Networking *ObjectList::getNetworking() { return mwmp::Main::get().getNetworking(); } -void WorldEvent::reset() +void ObjectList::reset() { cell.blank(); - worldObjects.clear(); + baseObjects.clear(); guid = mwmp::Main::get().getNetworking()->getLocalPlayer()->guid; - action = BaseEvent::Action::Request; - containerSubAction = BaseEvent::ContainerSubAction::None; + action = BaseObjectList::Action::Request; + containerSubAction = BaseObjectList::ContainerSubAction::None; } -WorldObject WorldEvent::getWorldObject(const MWWorld::Ptr& ptr) +BaseObject ObjectList::getBaseObject(const MWWorld::Ptr& ptr) { - mwmp::WorldObject worldObject; - worldObject.refId = ptr.getCellRef().getRefId(); - worldObject.refNumIndex = ptr.getCellRef().getRefNum().mIndex; - worldObject.mpNum = ptr.getCellRef().getMpNum(); - return worldObject; + mwmp::BaseObject baseObject; + baseObject.refId = ptr.getCellRef().getRefId(); + baseObject.refNumIndex = ptr.getCellRef().getRefNum().mIndex; + baseObject.mpNum = ptr.getCellRef().getMpNum(); + return baseObject; } -void WorldEvent::addContainerItem(mwmp::WorldObject& worldObject, const MWWorld::Ptr& itemPtr, int actionCount) +void ObjectList::addContainerItem(mwmp::BaseObject& baseObject, const MWWorld::Ptr& itemPtr, int actionCount) { mwmp::ContainerItem containerItem; containerItem.refId = itemPtr.getCellRef().getRefId(); @@ -77,34 +77,34 @@ void WorldEvent::addContainerItem(mwmp::WorldObject& worldObject, const MWWorld: LOG_APPEND(Log::LOG_INFO, "-- Adding container item %s", containerItem.refId.c_str()); - worldObject.containerItems.push_back(containerItem); + baseObject.containerItems.push_back(containerItem); } -void WorldEvent::addEntireContainer(const MWWorld::Ptr& ptr) +void ObjectList::addEntireContainer(const MWWorld::Ptr& ptr) { MWWorld::ContainerStore& containerStore = ptr.getClass().getContainerStore(ptr); - mwmp::WorldObject worldObject = getWorldObject(ptr); + mwmp::BaseObject baseObject = getBaseObject(ptr); for (const auto itemPtr : containerStore) { - addContainerItem(worldObject, itemPtr, itemPtr.getRefData().getCount()); + addContainerItem(baseObject, itemPtr, itemPtr.getRefData().getCount()); } - worldObjects.push_back(move(worldObject)); + baseObjects.push_back(move(baseObject)); } -void WorldEvent::editContainers(MWWorld::CellStore* cellStore) +void ObjectList::editContainers(MWWorld::CellStore* cellStore) { bool isLocalEvent = guid == Main::get().getLocalPlayer()->guid; LOG_APPEND(Log::LOG_VERBOSE, "- isLocalEvent? %s", isLocalEvent ? "true" : "false"); - for (const auto &worldObject : worldObjects) + for (const auto &baseObject : baseObjects) { - //LOG_APPEND(Log::LOG_VERBOSE, "- container cellRef: %s %i-%i", worldObject.refId.c_str(), worldObject.refNumIndex, worldObject.mpNum); + //LOG_APPEND(Log::LOG_VERBOSE, "- container cellRef: %s %i-%i", baseObject.refId.c_str(), baseObject.refNumIndex, baseObject.mpNum); - MWWorld::Ptr ptrFound = cellStore->searchExact(worldObject.refNumIndex, worldObject.mpNum); + MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNumIndex, baseObject.mpNum); if (ptrFound) { @@ -129,16 +129,16 @@ void WorldEvent::editContainers(MWWorld::CellStore* cellStore) MWWorld::ContainerStore& containerStore = ptrFound.getClass().getContainerStore(ptrFound); // If we are setting the entire contents, clear the current ones - if (action == BaseEvent::Action::Set) + if (action == BaseObjectList::Action::Set) containerStore.clear(); - bool isLocalDrop = isLocalEvent && containerSubAction == BaseEvent::ContainerSubAction::Drop; - bool isLocalDrag = isLocalEvent && containerSubAction == BaseEvent::ContainerSubAction::Drag; - bool isLocalTakeAll = isLocalEvent && containerSubAction == BaseEvent::ContainerSubAction::TakeAll; + bool isLocalDrop = isLocalEvent && containerSubAction == BaseObjectList::ContainerSubAction::Drop; + bool isLocalDrag = isLocalEvent && containerSubAction == BaseObjectList::ContainerSubAction::Drag; + bool isLocalTakeAll = isLocalEvent && containerSubAction == BaseObjectList::ContainerSubAction::TakeAll; std::string takeAllSound = ""; MWWorld::Ptr ownerPtr = MWBase::Environment::get().getWorld()->getPlayerPtr(); - for (const auto &containerItem : worldObject.containerItems) + for (const auto &containerItem : baseObject.containerItems) { //LOG_APPEND(Log::LOG_VERBOSE, "-- containerItem cellRef: %s, count: %i, actionCount: %i", // containerItem.refId.c_str(), containerItem.count, containerItem.actionCount); @@ -146,7 +146,7 @@ void WorldEvent::editContainers(MWWorld::CellStore* cellStore) if (containerItem.refId.find("$dynamic") != string::npos) continue; - if (action == BaseEvent::Action::Set || action == BaseEvent::Action::Add) + if (action == BaseObjectList::Action::Set || action == BaseObjectList::Action::Add) { // Create a ManualRef to be able to set item charge MWWorld::ManualRef ref(MWBase::Environment::get().getWorld()->getStore(), containerItem.refId, 1); @@ -164,7 +164,7 @@ void WorldEvent::editContainers(MWWorld::CellStore* cellStore) containerStore.add(newPtr, containerItem.count, ownerPtr, true); } - else if (action == BaseEvent::Action::Remove && containerItem.actionCount > 0) + else if (action == BaseObjectList::Action::Remove && containerItem.actionCount > 0) { // We have to find the right item ourselves because ContainerStore has no method // accounting for charge @@ -219,7 +219,7 @@ void WorldEvent::editContainers(MWWorld::CellStore* cellStore) // Was this a SET or ADD action on an actor's container, and are we the authority // over the actor? If so, autoequip the actor - if ((action == BaseEvent::Action::Add || action == BaseEvent::Action::Set) && hasActorEquipment && + if ((action == BaseObjectList::Action::Add || action == BaseObjectList::Action::Set) && hasActorEquipment && mwmp::Main::get().getCellController()->isLocalActor(ptrFound)) { MWWorld::InventoryStore& invStore = ptrFound.getClass().getInventoryStore(ptrFound); @@ -249,46 +249,46 @@ void WorldEvent::editContainers(MWWorld::CellStore* cellStore) } } -void WorldEvent::placeObjects(MWWorld::CellStore* cellStore) +void ObjectList::placeObjects(MWWorld::CellStore* cellStore) { MWBase::World *world = MWBase::Environment::get().getWorld(); - for (const auto &worldObject : worldObjects) + for (const auto &baseObject : baseObjects) { - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i, %i, count: %i, charge: %i, enchantmentCharge: %i", worldObject.refId.c_str(), - worldObject.refNumIndex, worldObject.mpNum, worldObject.count, worldObject.charge, worldObject.enchantmentCharge); + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i, %i, count: %i, charge: %i, enchantmentCharge: %i", baseObject.refId.c_str(), + baseObject.refNumIndex, baseObject.mpNum, baseObject.count, baseObject.charge, baseObject.enchantmentCharge); // Ignore generic dynamic refIds because they could be anything on other clients - if (worldObject.refId.find("$dynamic") != string::npos) + if (baseObject.refId.find("$dynamic") != string::npos) continue; - MWWorld::Ptr ptrFound = cellStore->searchExact(0, worldObject.mpNum); + MWWorld::Ptr ptrFound = cellStore->searchExact(0, baseObject.mpNum); // Only create this object if it doesn't already exist if (!ptrFound) { try { - MWWorld::ManualRef ref(world->getStore(), worldObject.refId, 1); + MWWorld::ManualRef ref(world->getStore(), baseObject.refId, 1); MWWorld::Ptr newPtr = ref.getPtr(); - if (worldObject.count > 1) - newPtr.getRefData().setCount(worldObject.count); + if (baseObject.count > 1) + newPtr.getRefData().setCount(baseObject.count); - if (worldObject.charge > -1) - newPtr.getCellRef().setCharge(worldObject.charge); + if (baseObject.charge > -1) + newPtr.getCellRef().setCharge(baseObject.charge); - if (worldObject.enchantmentCharge > -1.0f) - newPtr.getCellRef().setEnchantmentCharge(worldObject.enchantmentCharge); + if (baseObject.enchantmentCharge > -1.0f) + newPtr.getCellRef().setEnchantmentCharge(baseObject.enchantmentCharge); - newPtr.getCellRef().setGoldValue(worldObject.goldValue); - newPtr = world->placeObject(newPtr, cellStore, worldObject.position); + newPtr.getCellRef().setGoldValue(baseObject.goldValue); + newPtr = world->placeObject(newPtr, cellStore, baseObject.position); // Because gold automatically gets replaced with a new object, make sure we set the mpNum at the end - newPtr.getCellRef().setMpNum(worldObject.mpNum); + newPtr.getCellRef().setMpNum(baseObject.mpNum); - if (guid == Main::get().getLocalPlayer()->guid && worldObject.droppedByPlayer) + if (guid == Main::get().getLocalPlayer()->guid && baseObject.droppedByPlayer) world->PCDropped(newPtr); } @@ -302,37 +302,37 @@ void WorldEvent::placeObjects(MWWorld::CellStore* cellStore) } } -void WorldEvent::spawnObjects(MWWorld::CellStore* cellStore) +void ObjectList::spawnObjects(MWWorld::CellStore* cellStore) { - for (const auto &worldObject : worldObjects) + for (const auto &baseObject : baseObjects) { - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i, %i", worldObject.refId.c_str(), - worldObject.refNumIndex, worldObject.mpNum); + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i, %i", baseObject.refId.c_str(), + baseObject.refNumIndex, baseObject.mpNum); // Ignore generic dynamic refIds because they could be anything on other clients - if (worldObject.refId.find("$dynamic") != string::npos) + if (baseObject.refId.find("$dynamic") != string::npos) continue; - MWWorld::Ptr ptrFound = cellStore->searchExact(0, worldObject.mpNum); + MWWorld::Ptr ptrFound = cellStore->searchExact(0, baseObject.mpNum); // Only create this object if it doesn't already exist if (!ptrFound) { - MWWorld::ManualRef ref(MWBase::Environment::get().getWorld()->getStore(), worldObject.refId, 1); + MWWorld::ManualRef ref(MWBase::Environment::get().getWorld()->getStore(), baseObject.refId, 1); MWWorld::Ptr newPtr = ref.getPtr(); - newPtr.getCellRef().setMpNum(worldObject.mpNum); + newPtr.getCellRef().setMpNum(baseObject.mpNum); - newPtr = MWBase::Environment::get().getWorld()->placeObject(newPtr, cellStore, worldObject.position); + newPtr = MWBase::Environment::get().getWorld()->placeObject(newPtr, cellStore, baseObject.position); - if (worldObject.hasMaster) + if (baseObject.hasMaster) { MWWorld::Ptr masterPtr; - if (worldObject.master.isPlayer) - masterPtr = MechanicsHelper::getPlayerPtr(worldObject.master); + if (baseObject.master.isPlayer) + masterPtr = MechanicsHelper::getPlayerPtr(baseObject.master); else - masterPtr = cellStore->searchExact(worldObject.master.refNumIndex, worldObject.master.mpNum); + masterPtr = cellStore->searchExact(baseObject.master.refNumIndex, baseObject.master.mpNum); if (masterPtr) { @@ -353,7 +353,7 @@ void WorldEvent::spawnObjects(MWWorld::CellStore* cellStore) int creatureActorId = newPtr.getClass().getCreatureStats(newPtr).getActorId(); MWMechanics::CreatureStats& masterCreatureStats = masterPtr.getClass().getCreatureStats(masterPtr); - masterCreatureStats.setSummonedCreatureActorId(worldObject.refId, creatureActorId); + masterCreatureStats.setSummonedCreatureActorId(baseObject.refId, creatureActorId); } } } @@ -362,13 +362,13 @@ void WorldEvent::spawnObjects(MWWorld::CellStore* cellStore) } } -void WorldEvent::deleteObjects(MWWorld::CellStore* cellStore) +void ObjectList::deleteObjects(MWWorld::CellStore* cellStore) { - for (const auto &worldObject : worldObjects) + for (const auto &baseObject : baseObjects) { - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i, %i", worldObject.refId.c_str(), worldObject.refNumIndex, worldObject.mpNum); + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i, %i", baseObject.refId.c_str(), baseObject.refNumIndex, baseObject.mpNum); - MWWorld::Ptr ptrFound = cellStore->searchExact(worldObject.refNumIndex, worldObject.mpNum); + MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNumIndex, baseObject.mpNum); if (ptrFound) { @@ -393,44 +393,44 @@ void WorldEvent::deleteObjects(MWWorld::CellStore* cellStore) } } -void WorldEvent::lockObjects(MWWorld::CellStore* cellStore) +void ObjectList::lockObjects(MWWorld::CellStore* cellStore) { - for (const auto &worldObject : worldObjects) + for (const auto &baseObject : baseObjects) { - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i, %i", worldObject.refId.c_str(), worldObject.refNumIndex, worldObject.mpNum); + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i, %i", baseObject.refId.c_str(), baseObject.refNumIndex, baseObject.mpNum); - MWWorld::Ptr ptrFound = cellStore->searchExact(worldObject.refNumIndex, worldObject.mpNum); + MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNumIndex, baseObject.mpNum); if (ptrFound) { LOG_APPEND(Log::LOG_VERBOSE, "-- Found %s, %i, %i", ptrFound.getCellRef().getRefId().c_str(), ptrFound.getCellRef().getRefNum().mIndex, ptrFound.getCellRef().getMpNum()); - if (worldObject.lockLevel > 0) - ptrFound.getClass().lock(ptrFound, worldObject.lockLevel); + if (baseObject.lockLevel > 0) + ptrFound.getClass().lock(ptrFound, baseObject.lockLevel); else ptrFound.getClass().unlock(ptrFound); } } } -void WorldEvent::triggerTrapObjects(MWWorld::CellStore* cellStore) +void ObjectList::triggerTrapObjects(MWWorld::CellStore* cellStore) { - for (const auto &worldObject : worldObjects) + for (const auto &baseObject : baseObjects) { - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i, %i", worldObject.refId.c_str(), worldObject.refNumIndex, worldObject.mpNum); + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i, %i", baseObject.refId.c_str(), baseObject.refNumIndex, baseObject.mpNum); - MWWorld::Ptr ptrFound = cellStore->searchExact(worldObject.refNumIndex, worldObject.mpNum); + MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNumIndex, baseObject.mpNum); if (ptrFound) { LOG_APPEND(Log::LOG_VERBOSE, "-- Found %s, %i, %i", ptrFound.getCellRef().getRefId().c_str(), ptrFound.getCellRef().getRefNum().mIndex, ptrFound.getCellRef().getMpNum()); - if (!worldObject.isDisarmed) + if (!baseObject.isDisarmed) { MWMechanics::CastSpell cast(ptrFound, ptrFound); - cast.mHitPosition = worldObject.position.asVec3(); + cast.mHitPosition = baseObject.position.asVec3(); cast.cast(ptrFound.getCellRef().getTrap()); } @@ -439,40 +439,40 @@ void WorldEvent::triggerTrapObjects(MWWorld::CellStore* cellStore) } } -void WorldEvent::scaleObjects(MWWorld::CellStore* cellStore) +void ObjectList::scaleObjects(MWWorld::CellStore* cellStore) { - for (const auto &worldObject : worldObjects) + for (const auto &baseObject : baseObjects) { - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i, %i, scale: %f", worldObject.refId.c_str(), worldObject.refNumIndex, - worldObject.mpNum, worldObject.scale); + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i, %i, scale: %f", baseObject.refId.c_str(), baseObject.refNumIndex, + baseObject.mpNum, baseObject.scale); - MWWorld::Ptr ptrFound = cellStore->searchExact(worldObject.refNumIndex, worldObject.mpNum); + MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNumIndex, baseObject.mpNum); if (ptrFound) { LOG_APPEND(Log::LOG_VERBOSE, "-- Found %s, %i, %i", ptrFound.getCellRef().getRefId().c_str(), ptrFound.getCellRef().getRefNum().mIndex, ptrFound.getCellRef().getMpNum()); - MWBase::Environment::get().getWorld()->scaleObject(ptrFound, worldObject.scale); + MWBase::Environment::get().getWorld()->scaleObject(ptrFound, baseObject.scale); } } } -void WorldEvent::setObjectStates(MWWorld::CellStore* cellStore) +void ObjectList::setObjectStates(MWWorld::CellStore* cellStore) { - for (const auto &worldObject : worldObjects) + for (const auto &baseObject : baseObjects) { - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i, %i, state: %s", worldObject.refId.c_str(), worldObject.refNumIndex, - worldObject.mpNum, worldObject.objectState ? "true" : "false"); + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i, %i, state: %s", baseObject.refId.c_str(), baseObject.refNumIndex, + baseObject.mpNum, baseObject.objectState ? "true" : "false"); - MWWorld::Ptr ptrFound = cellStore->searchExact(worldObject.refNumIndex, worldObject.mpNum); + MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNumIndex, baseObject.mpNum); if (ptrFound) { LOG_APPEND(Log::LOG_VERBOSE, "-- Found %s, %i, %i", ptrFound.getCellRef().getRefId().c_str(), ptrFound.getCellRef().getRefNum().mIndex, ptrFound.getCellRef().getMpNum()); - if (worldObject.objectState) + if (baseObject.objectState) MWBase::Environment::get().getWorld()->enable(ptrFound); else MWBase::Environment::get().getWorld()->disable(ptrFound); @@ -480,32 +480,32 @@ void WorldEvent::setObjectStates(MWWorld::CellStore* cellStore) } } -void WorldEvent::moveObjects(MWWorld::CellStore* cellStore) +void ObjectList::moveObjects(MWWorld::CellStore* cellStore) { - for (const auto &worldObject : worldObjects) + for (const auto &baseObject : baseObjects) { - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i, %i", worldObject.refId.c_str(), worldObject.refNumIndex, worldObject.mpNum); + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i, %i", baseObject.refId.c_str(), baseObject.refNumIndex, baseObject.mpNum); - MWWorld::Ptr ptrFound = cellStore->searchExact(worldObject.refNumIndex, worldObject.mpNum); + MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNumIndex, baseObject.mpNum); if (ptrFound) { LOG_APPEND(Log::LOG_VERBOSE, "-- Found %s, %i, %i", ptrFound.getCellRef().getRefId().c_str(), ptrFound.getCellRef().getRefNum().mIndex, ptrFound.getCellRef().getMpNum()); - MWBase::Environment::get().getWorld()->moveObject(ptrFound, worldObject.position.pos[0], worldObject.position.pos[1], - worldObject.position.pos[2]); + MWBase::Environment::get().getWorld()->moveObject(ptrFound, baseObject.position.pos[0], baseObject.position.pos[1], + baseObject.position.pos[2]); } } } -void WorldEvent::rotateObjects(MWWorld::CellStore* cellStore) +void ObjectList::rotateObjects(MWWorld::CellStore* cellStore) { - for (const auto &worldObject : worldObjects) + for (const auto &baseObject : baseObjects) { - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i, %i", worldObject.refId.c_str(), worldObject.refNumIndex, worldObject.mpNum); + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i, %i", baseObject.refId.c_str(), baseObject.refNumIndex, baseObject.mpNum); - MWWorld::Ptr ptrFound = cellStore->searchExact(worldObject.refNumIndex, worldObject.mpNum); + MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNumIndex, baseObject.mpNum); if (ptrFound) { @@ -513,18 +513,18 @@ void WorldEvent::rotateObjects(MWWorld::CellStore* cellStore) ptrFound.getCellRef().getRefNum().mIndex, ptrFound.getCellRef().getMpNum()); MWBase::Environment::get().getWorld()->rotateObject(ptrFound, - worldObject.position.rot[0], worldObject.position.rot[1], worldObject.position.rot[2]); + baseObject.position.rot[0], baseObject.position.rot[1], baseObject.position.rot[2]); } } } -void WorldEvent::animateObjects(MWWorld::CellStore* cellStore) +void ObjectList::animateObjects(MWWorld::CellStore* cellStore) { - for (const auto &worldObject : worldObjects) + for (const auto &baseObject : baseObjects) { - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i, %i", worldObject.refId.c_str(), worldObject.refNumIndex, worldObject.mpNum); + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i, %i", baseObject.refId.c_str(), baseObject.refNumIndex, baseObject.mpNum); - MWWorld::Ptr ptrFound = cellStore->searchExact(worldObject.refNumIndex, worldObject.mpNum); + MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNumIndex, baseObject.mpNum); if (ptrFound) { @@ -532,66 +532,66 @@ void WorldEvent::animateObjects(MWWorld::CellStore* cellStore) ptrFound.getCellRef().getRefNum().mIndex, ptrFound.getCellRef().getMpNum()); MWBase::MechanicsManager * mechanicsManager = MWBase::Environment::get().getMechanicsManager(); - mechanicsManager->playAnimationGroup(ptrFound, worldObject.animGroup, worldObject.animMode, + mechanicsManager->playAnimationGroup(ptrFound, baseObject.animGroup, baseObject.animMode, std::numeric_limits::max(), true); } } } -void WorldEvent::activateDoors(MWWorld::CellStore* cellStore) +void ObjectList::activateDoors(MWWorld::CellStore* cellStore) { - for (const auto &worldObject : worldObjects) + for (const auto &baseObject : baseObjects) { - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i, %i", worldObject.refId.c_str(), worldObject.refNumIndex, worldObject.mpNum); + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i, %i", baseObject.refId.c_str(), baseObject.refNumIndex, baseObject.mpNum); - MWWorld::Ptr ptrFound = cellStore->searchExact(worldObject.refNumIndex, worldObject.mpNum); + MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNumIndex, baseObject.mpNum); if (ptrFound) { LOG_APPEND(Log::LOG_VERBOSE, "-- Found %s, %i, %i", ptrFound.getCellRef().getRefId().c_str(), ptrFound.getCellRef().getRefNum().mIndex, ptrFound.getCellRef().getMpNum()); - ptrFound.getClass().setDoorState(ptrFound, worldObject.doorState); - MWBase::Environment::get().getWorld()->saveDoorState(ptrFound, worldObject.doorState); + ptrFound.getClass().setDoorState(ptrFound, baseObject.doorState); + MWBase::Environment::get().getWorld()->saveDoorState(ptrFound, baseObject.doorState); } } } -void WorldEvent::setDoorDestinations(MWWorld::CellStore* cellStore) +void ObjectList::setDoorDestinations(MWWorld::CellStore* cellStore) { - for (const auto &worldObject : worldObjects) + for (const auto &baseObject : baseObjects) { - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i, %i", worldObject.refId.c_str(), worldObject.refNumIndex, worldObject.mpNum); + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i, %i", baseObject.refId.c_str(), baseObject.refNumIndex, baseObject.mpNum); - MWWorld::Ptr ptrFound = cellStore->searchExact(worldObject.refNumIndex, worldObject.mpNum); + MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNumIndex, baseObject.mpNum); if (ptrFound) { LOG_APPEND(Log::LOG_VERBOSE, "-- Found %s, %i, %i", ptrFound.getCellRef().getRefId().c_str(), ptrFound.getCellRef().getRefNum().mIndex, ptrFound.getCellRef().getMpNum()); - ptrFound.getCellRef().setTeleport(worldObject.teleportState); + ptrFound.getCellRef().setTeleport(baseObject.teleportState); - if (worldObject.teleportState) + if (baseObject.teleportState) { - ptrFound.getCellRef().setDoorDest(worldObject.destinationPosition); + ptrFound.getCellRef().setDoorDest(baseObject.destinationPosition); - if (worldObject.destinationCell.isExterior()) + if (baseObject.destinationCell.isExterior()) ptrFound.getCellRef().setDestCell(""); else - ptrFound.getCellRef().setDestCell(worldObject.destinationCell.getDescription()); + ptrFound.getCellRef().setDestCell(baseObject.destinationCell.getDescription()); } } } } -void WorldEvent::runConsoleCommands(MWWorld::CellStore* cellStore) +void ObjectList::runConsoleCommands(MWWorld::CellStore* cellStore) { MWBase::WindowManager *windowManager = MWBase::Environment::get().getWindowManager(); LOG_APPEND(Log::LOG_VERBOSE, "- console command: %s", consoleCommand.c_str()); - if (worldObjects.empty()) + if (baseObjects.empty()) { windowManager->clearConsolePtr(); @@ -600,13 +600,13 @@ void WorldEvent::runConsoleCommands(MWWorld::CellStore* cellStore) } else { - for (const auto &worldObject : worldObjects) + for (const auto &baseObject : baseObjects) { windowManager->clearConsolePtr(); - if (worldObject.isPlayer) + if (baseObject.isPlayer) { - if (worldObject.guid == Main::get().getLocalPlayer()->guid) + if (baseObject.guid == Main::get().getLocalPlayer()->guid) { LOG_APPEND(Log::LOG_VERBOSE, "-- running on local player"); windowManager->setConsolePtr(Main::get().getLocalPlayer()->getPlayerPtr()); @@ -614,7 +614,7 @@ void WorldEvent::runConsoleCommands(MWWorld::CellStore* cellStore) } else { - DedicatedPlayer *player = PlayerList::getPlayer(worldObject.guid); + DedicatedPlayer *player = PlayerList::getPlayer(baseObject.guid); if (player != 0) { @@ -626,9 +626,9 @@ void WorldEvent::runConsoleCommands(MWWorld::CellStore* cellStore) } else { - LOG_APPEND(Log::LOG_VERBOSE, "-- running on cellRef: %s, %i, %i", worldObject.refId.c_str(), worldObject.refNumIndex, worldObject.mpNum); + LOG_APPEND(Log::LOG_VERBOSE, "-- running on cellRef: %s, %i, %i", baseObject.refId.c_str(), baseObject.refNumIndex, baseObject.mpNum); - MWWorld::Ptr ptrFound = cellStore->searchExact(worldObject.refNumIndex, worldObject.mpNum); + MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNumIndex, baseObject.mpNum); if (ptrFound) { @@ -645,53 +645,53 @@ void WorldEvent::runConsoleCommands(MWWorld::CellStore* cellStore) } } -void WorldEvent::setLocalShorts(MWWorld::CellStore* cellStore) +void ObjectList::setLocalShorts(MWWorld::CellStore* cellStore) { - for (const auto &worldObject : worldObjects) + for (const auto &baseObject : baseObjects) { - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i, %i, index: %i, shortVal: %i", worldObject.refId.c_str(), - worldObject.refNumIndex, worldObject.mpNum, worldObject.index, worldObject.shortVal); + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i, %i, index: %i, shortVal: %i", baseObject.refId.c_str(), + baseObject.refNumIndex, baseObject.mpNum, baseObject.index, baseObject.shortVal); - MWWorld::Ptr ptrFound = cellStore->searchExact(worldObject.refNumIndex, worldObject.mpNum); + MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNumIndex, baseObject.mpNum); if (ptrFound) { LOG_APPEND(Log::LOG_VERBOSE, "-- Found %s, %i, %i", ptrFound.getCellRef().getRefId().c_str(), ptrFound.getCellRef().getRefNum().mIndex, ptrFound.getCellRef().getMpNum()); - ptrFound.getRefData().getLocals().mShorts.at(worldObject.index) = worldObject.shortVal; + ptrFound.getRefData().getLocals().mShorts.at(baseObject.index) = baseObject.shortVal; } } } -void WorldEvent::setLocalFloats(MWWorld::CellStore* cellStore) +void ObjectList::setLocalFloats(MWWorld::CellStore* cellStore) { - for (const auto &worldObject : worldObjects) + for (const auto &baseObject : baseObjects) { - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i, %i, index: %i, floatVal: %f", worldObject.refId.c_str(), - worldObject.refNumIndex, worldObject.mpNum, worldObject.index, worldObject.floatVal); + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i, %i, index: %i, floatVal: %f", baseObject.refId.c_str(), + baseObject.refNumIndex, baseObject.mpNum, baseObject.index, baseObject.floatVal); - MWWorld::Ptr ptrFound = cellStore->searchExact(worldObject.refNumIndex, worldObject.mpNum); + MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNumIndex, baseObject.mpNum); if (ptrFound) { LOG_APPEND(Log::LOG_VERBOSE, "-- Found %s, %i, %i", ptrFound.getCellRef().getRefId().c_str(), ptrFound.getCellRef().getRefNum().mIndex, ptrFound.getCellRef().getMpNum()); - ptrFound.getRefData().getLocals().mFloats.at(worldObject.index) = worldObject.floatVal; + ptrFound.getRefData().getLocals().mFloats.at(baseObject.index) = baseObject.floatVal; } } } -void WorldEvent::setMemberShorts() +void ObjectList::setMemberShorts() { - for (const auto &worldObject : worldObjects) + for (const auto &baseObject : baseObjects) { - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, index: %i, shortVal: %i", worldObject.refId.c_str(), - worldObject.index, worldObject.shortVal); + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, index: %i, shortVal: %i", baseObject.refId.c_str(), + baseObject.index, baseObject.shortVal); // Mimic the way a Ptr is fetched in InterpreterContext for similar situations - MWWorld::Ptr ptrFound = MWBase::Environment::get().getWorld()->searchPtr(worldObject.refId, false); + MWWorld::Ptr ptrFound = MWBase::Environment::get().getWorld()->searchPtr(baseObject.refId, false); if (!ptrFound.isEmpty()) { @@ -703,43 +703,43 @@ void WorldEvent::setMemberShorts() ptrFound.getRefData().setLocals( *MWBase::Environment::get().getWorld()->getStore().get().find(scriptId)); - ptrFound.getRefData().getLocals().mShorts.at(worldObject.index) = worldObject.shortVal;; + ptrFound.getRefData().getLocals().mShorts.at(baseObject.index) = baseObject.shortVal;; } } } -void WorldEvent::setGlobalShorts() +void ObjectList::setGlobalShorts() { - for (const auto &worldObject : worldObjects) + for (const auto &baseObject : baseObjects) { - LOG_APPEND(Log::LOG_VERBOSE, "- varName: %s, shortVal: %i", worldObject.varName.c_str(), worldObject.shortVal); + LOG_APPEND(Log::LOG_VERBOSE, "- varName: %s, shortVal: %i", baseObject.varName.c_str(), baseObject.shortVal); - MWBase::Environment::get().getWorld()->setGlobalInt(worldObject.varName, worldObject.shortVal); + MWBase::Environment::get().getWorld()->setGlobalInt(baseObject.varName, baseObject.shortVal); } } -void WorldEvent::playMusic() +void ObjectList::playMusic() { - for (const auto &worldObject : worldObjects) + for (const auto &baseObject : baseObjects) { - LOG_APPEND(Log::LOG_VERBOSE, "- filename: %s", worldObject.filename.c_str()); + LOG_APPEND(Log::LOG_VERBOSE, "- filename: %s", baseObject.filename.c_str()); - MWBase::Environment::get().getSoundManager()->streamMusic(worldObject.filename); + MWBase::Environment::get().getSoundManager()->streamMusic(baseObject.filename); } } -void WorldEvent::playVideo() +void ObjectList::playVideo() { - for (const auto &worldObject : worldObjects) + for (const auto &baseObject : baseObjects) { - LOG_APPEND(Log::LOG_VERBOSE, "- filename: %s, allowSkipping: %s", worldObject.filename.c_str(), - worldObject.allowSkipping ? "true" : "false"); + LOG_APPEND(Log::LOG_VERBOSE, "- filename: %s, allowSkipping: %s", baseObject.filename.c_str(), + baseObject.allowSkipping ? "true" : "false"); - MWBase::Environment::get().getWindowManager()->playVideo(worldObject.filename, worldObject.allowSkipping); + MWBase::Environment::get().getWindowManager()->playVideo(baseObject.filename, baseObject.allowSkipping); } } -void WorldEvent::addAllContainers(MWWorld::CellStore* cellStore) +void ObjectList::addAllContainers(MWWorld::CellStore* cellStore) { for (auto &ref : cellStore->getContainers()->mList) { @@ -760,14 +760,14 @@ void WorldEvent::addAllContainers(MWWorld::CellStore* cellStore) } } -void WorldEvent::addRequestedContainers(MWWorld::CellStore* cellStore, const std::vector& requestObjects) +void ObjectList::addRequestedContainers(MWWorld::CellStore* cellStore, const std::vector& requestObjects) { - for (const auto &worldObject : requestObjects) + for (const auto &baseObject : requestObjects) { - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i, %i", worldObject.refId.c_str(), - worldObject.refNumIndex, worldObject.mpNum); + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i, %i", baseObject.refId.c_str(), + baseObject.refNumIndex, baseObject.mpNum); - MWWorld::Ptr ptrFound = cellStore->searchExact(worldObject.refNumIndex, worldObject.mpNum); + MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNumIndex, baseObject.mpNum); if (ptrFound) { @@ -779,7 +779,7 @@ void WorldEvent::addRequestedContainers(MWWorld::CellStore* cellStore, const std } } -void WorldEvent::addObjectPlace(const MWWorld::Ptr& ptr, bool droppedByPlayer) +void ObjectList::addObjectPlace(const MWWorld::Ptr& ptr, bool droppedByPlayer) { if (ptr.getCellRef().getRefId().find("$dynamic") != string::npos) { @@ -789,29 +789,29 @@ void WorldEvent::addObjectPlace(const MWWorld::Ptr& ptr, bool droppedByPlayer) cell = *ptr.getCell()->getCell(); - mwmp::WorldObject worldObject; - worldObject.refId = ptr.getCellRef().getRefId(); - worldObject.refNumIndex = ptr.getCellRef().getRefNum().mIndex; - worldObject.mpNum = 0; - worldObject.charge = ptr.getCellRef().getCharge(); - worldObject.enchantmentCharge = ptr.getCellRef().getEnchantmentCharge(); - worldObject.droppedByPlayer = droppedByPlayer; + mwmp::BaseObject baseObject; + baseObject.refId = ptr.getCellRef().getRefId(); + baseObject.refNumIndex = ptr.getCellRef().getRefNum().mIndex; + baseObject.mpNum = 0; + baseObject.charge = ptr.getCellRef().getCharge(); + baseObject.enchantmentCharge = ptr.getCellRef().getEnchantmentCharge(); + baseObject.droppedByPlayer = droppedByPlayer; // Make sure we send the RefData position instead of the CellRef one, because that's what // we actually see on this client - worldObject.position = ptr.getRefData().getPosition(); + baseObject.position = ptr.getRefData().getPosition(); // We have to get the count from the dropped object because it gets changed // automatically for stacks of gold - worldObject.count = ptr.getRefData().getCount(); + baseObject.count = ptr.getRefData().getCount(); // Get the real count of gold in a stack - worldObject.goldValue = ptr.getCellRef().getGoldValue(); + baseObject.goldValue = ptr.getCellRef().getGoldValue(); - worldObjects.push_back(move(worldObject)); + baseObjects.push_back(move(baseObject)); } -void WorldEvent::addObjectSpawn(const MWWorld::Ptr& ptr) +void ObjectList::addObjectSpawn(const MWWorld::Ptr& ptr) { if (ptr.getCellRef().getRefId().find("$dynamic") != string::npos) { @@ -821,339 +821,339 @@ void WorldEvent::addObjectSpawn(const MWWorld::Ptr& ptr) cell = *ptr.getCell()->getCell(); - mwmp::WorldObject worldObject; - worldObject.refId = ptr.getCellRef().getRefId(); - worldObject.refNumIndex = ptr.getCellRef().getRefNum().mIndex; - worldObject.mpNum = 0; - worldObject.hasMaster = false; + mwmp::BaseObject baseObject; + baseObject.refId = ptr.getCellRef().getRefId(); + baseObject.refNumIndex = ptr.getCellRef().getRefNum().mIndex; + baseObject.mpNum = 0; + baseObject.hasMaster = false; // Make sure we send the RefData position instead of the CellRef one, because that's what // we actually see on this client - worldObject.position = ptr.getRefData().getPosition(); + baseObject.position = ptr.getRefData().getPosition(); - worldObjects.push_back(move(worldObject)); + baseObjects.push_back(move(baseObject)); } -void WorldEvent::addObjectSpawn(const MWWorld::Ptr& ptr, const MWWorld::Ptr& master) +void ObjectList::addObjectSpawn(const MWWorld::Ptr& ptr, const MWWorld::Ptr& master) { cell = *ptr.getCell()->getCell(); - mwmp::WorldObject worldObject; - worldObject.refId = ptr.getCellRef().getRefId(); - worldObject.refNumIndex = ptr.getCellRef().getRefNum().mIndex; - worldObject.mpNum = 0; + mwmp::BaseObject baseObject; + baseObject.refId = ptr.getCellRef().getRefId(); + baseObject.refNumIndex = ptr.getCellRef().getRefNum().mIndex; + baseObject.mpNum = 0; - worldObject.hasMaster = true; + baseObject.hasMaster = true; if (master == MWBase::Environment::get().getWorld()->getPlayerPtr()) { - worldObject.master.isPlayer = true; - worldObject.master.guid = mwmp::Main::get().getLocalPlayer()->guid; + baseObject.master.isPlayer = true; + baseObject.master.guid = mwmp::Main::get().getLocalPlayer()->guid; } else if (mwmp::PlayerList::isDedicatedPlayer(master)) { - worldObject.master.isPlayer = true; - worldObject.master.guid = mwmp::PlayerList::getPlayer(master)->guid; + baseObject.master.isPlayer = true; + baseObject.master.guid = mwmp::PlayerList::getPlayer(master)->guid; } else { MWWorld::CellRef *masterRef = &master.getCellRef(); - worldObject.master.isPlayer = false; - worldObject.master.refId = masterRef->getRefId(); - worldObject.master.refNumIndex = masterRef->getRefNum().mIndex; - worldObject.master.mpNum = masterRef->getMpNum(); + baseObject.master.isPlayer = false; + baseObject.master.refId = masterRef->getRefId(); + baseObject.master.refNumIndex = masterRef->getRefNum().mIndex; + baseObject.master.mpNum = masterRef->getMpNum(); } // Make sure we send the RefData position instead of the CellRef one, because that's what // we actually see on this client - worldObject.position = ptr.getRefData().getPosition(); + baseObject.position = ptr.getRefData().getPosition(); - worldObjects.push_back(move(worldObject)); + baseObjects.push_back(move(baseObject)); } -void WorldEvent::addObjectDelete(const MWWorld::Ptr& ptr) +void ObjectList::addObjectDelete(const MWWorld::Ptr& ptr) { cell = *ptr.getCell()->getCell(); - mwmp::WorldObject worldObject; - worldObject.refId = ptr.getCellRef().getRefId(); - worldObject.refNumIndex = ptr.getCellRef().getRefNum().mIndex; - worldObject.mpNum = ptr.getCellRef().getMpNum(); - worldObjects.push_back(move(worldObject)); + mwmp::BaseObject baseObject; + baseObject.refId = ptr.getCellRef().getRefId(); + baseObject.refNumIndex = ptr.getCellRef().getRefNum().mIndex; + baseObject.mpNum = ptr.getCellRef().getMpNum(); + baseObjects.push_back(move(baseObject)); } -void WorldEvent::addObjectLock(const MWWorld::Ptr& ptr, int lockLevel) +void ObjectList::addObjectLock(const MWWorld::Ptr& ptr, int lockLevel) { cell = *ptr.getCell()->getCell(); - mwmp::WorldObject worldObject; - worldObject.refId = ptr.getCellRef().getRefId(); - worldObject.refNumIndex = ptr.getCellRef().getRefNum().mIndex; - worldObject.mpNum = ptr.getCellRef().getMpNum(); - worldObject.lockLevel = lockLevel; - worldObjects.push_back(move(worldObject)); + mwmp::BaseObject baseObject; + baseObject.refId = ptr.getCellRef().getRefId(); + baseObject.refNumIndex = ptr.getCellRef().getRefNum().mIndex; + baseObject.mpNum = ptr.getCellRef().getMpNum(); + baseObject.lockLevel = lockLevel; + baseObjects.push_back(move(baseObject)); } -void WorldEvent::addObjectTrap(const MWWorld::Ptr& ptr, const ESM::Position& pos, bool isDisarmed) +void ObjectList::addObjectTrap(const MWWorld::Ptr& ptr, const ESM::Position& pos, bool isDisarmed) { cell = *ptr.getCell()->getCell(); - mwmp::WorldObject worldObject; - worldObject.refId = ptr.getCellRef().getRefId(); - worldObject.refNumIndex = ptr.getCellRef().getRefNum().mIndex; - worldObject.mpNum = ptr.getCellRef().getMpNum(); - worldObject.isDisarmed = isDisarmed; - worldObject.position = pos; - worldObjects.push_back(move(worldObject)); + mwmp::BaseObject baseObject; + baseObject.refId = ptr.getCellRef().getRefId(); + baseObject.refNumIndex = ptr.getCellRef().getRefNum().mIndex; + baseObject.mpNum = ptr.getCellRef().getMpNum(); + baseObject.isDisarmed = isDisarmed; + baseObject.position = pos; + baseObjects.push_back(move(baseObject)); } -void WorldEvent::addObjectScale(const MWWorld::Ptr& ptr, float scale) +void ObjectList::addObjectScale(const MWWorld::Ptr& ptr, float scale) { cell = *ptr.getCell()->getCell(); - mwmp::WorldObject worldObject; - worldObject.refId = ptr.getCellRef().getRefId(); - worldObject.refNumIndex = ptr.getCellRef().getRefNum().mIndex; - worldObject.mpNum = ptr.getCellRef().getMpNum(); - worldObject.scale = scale; - worldObjects.push_back(move(worldObject)); + mwmp::BaseObject baseObject; + baseObject.refId = ptr.getCellRef().getRefId(); + baseObject.refNumIndex = ptr.getCellRef().getRefNum().mIndex; + baseObject.mpNum = ptr.getCellRef().getMpNum(); + baseObject.scale = scale; + baseObjects.push_back(move(baseObject)); } -void WorldEvent::addObjectState(const MWWorld::Ptr& ptr, bool objectState) +void ObjectList::addObjectState(const MWWorld::Ptr& ptr, bool objectState) { cell = *ptr.getCell()->getCell(); - mwmp::WorldObject worldObject; - worldObject.refId = ptr.getCellRef().getRefId(); - worldObject.refNumIndex = ptr.getCellRef().getRefNum().mIndex; - worldObject.mpNum = ptr.getCellRef().getMpNum(); - worldObject.objectState = objectState; - worldObjects.push_back(move(worldObject)); + mwmp::BaseObject baseObject; + baseObject.refId = ptr.getCellRef().getRefId(); + baseObject.refNumIndex = ptr.getCellRef().getRefNum().mIndex; + baseObject.mpNum = ptr.getCellRef().getMpNum(); + baseObject.objectState = objectState; + baseObjects.push_back(move(baseObject)); } -void WorldEvent::addObjectAnimPlay(const MWWorld::Ptr& ptr, std::string group, int mode) +void ObjectList::addObjectAnimPlay(const MWWorld::Ptr& ptr, std::string group, int mode) { cell = *ptr.getCell()->getCell(); - mwmp::WorldObject worldObject; - worldObject.refId = ptr.getCellRef().getRefId(); - worldObject.refNumIndex = ptr.getCellRef().getRefNum().mIndex; - worldObject.mpNum = ptr.getCellRef().getMpNum(); - worldObject.animGroup = group; - worldObject.animMode = mode; - worldObjects.push_back(move(worldObject)); + mwmp::BaseObject baseObject; + baseObject.refId = ptr.getCellRef().getRefId(); + baseObject.refNumIndex = ptr.getCellRef().getRefNum().mIndex; + baseObject.mpNum = ptr.getCellRef().getMpNum(); + baseObject.animGroup = group; + baseObject.animMode = mode; + baseObjects.push_back(move(baseObject)); } -void WorldEvent::addDoorState(const MWWorld::Ptr& ptr, int state) +void ObjectList::addDoorState(const MWWorld::Ptr& ptr, int state) { cell = *ptr.getCell()->getCell(); - mwmp::WorldObject worldObject; - worldObject.refId = ptr.getCellRef().getRefId(); - worldObject.refNumIndex = ptr.getCellRef().getRefNum().mIndex; - worldObject.mpNum = ptr.getCellRef().getMpNum(); - worldObject.doorState = state; - worldObjects.push_back(move(worldObject)); + mwmp::BaseObject baseObject; + baseObject.refId = ptr.getCellRef().getRefId(); + baseObject.refNumIndex = ptr.getCellRef().getRefNum().mIndex; + baseObject.mpNum = ptr.getCellRef().getMpNum(); + baseObject.doorState = state; + baseObjects.push_back(move(baseObject)); } -void WorldEvent::addMusicPlay(std::string filename) +void ObjectList::addMusicPlay(std::string filename) { - mwmp::WorldObject worldObject; - worldObject.filename = filename; - worldObjects.push_back(move(worldObject)); + mwmp::BaseObject baseObject; + baseObject.filename = filename; + baseObjects.push_back(move(baseObject)); } -void WorldEvent::addVideoPlay(std::string filename, bool allowSkipping) +void ObjectList::addVideoPlay(std::string filename, bool allowSkipping) { - mwmp::WorldObject worldObject; - worldObject.filename = filename; - worldObject.allowSkipping = allowSkipping; - worldObjects.push_back(move(worldObject)); + mwmp::BaseObject baseObject; + baseObject.filename = filename; + baseObject.allowSkipping = allowSkipping; + baseObjects.push_back(move(baseObject)); } -void WorldEvent::addScriptLocalShort(const MWWorld::Ptr& ptr, int index, int shortVal) +void ObjectList::addScriptLocalShort(const MWWorld::Ptr& ptr, int index, int shortVal) { cell = *ptr.getCell()->getCell(); - mwmp::WorldObject worldObject; - worldObject.refId = ptr.getCellRef().getRefId(); - worldObject.refNumIndex = ptr.getCellRef().getRefNum().mIndex; - worldObject.mpNum = ptr.getCellRef().getMpNum(); - worldObject.index = index; - worldObject.shortVal = shortVal; - worldObjects.push_back(move(worldObject)); + mwmp::BaseObject baseObject; + baseObject.refId = ptr.getCellRef().getRefId(); + baseObject.refNumIndex = ptr.getCellRef().getRefNum().mIndex; + baseObject.mpNum = ptr.getCellRef().getMpNum(); + baseObject.index = index; + baseObject.shortVal = shortVal; + baseObjects.push_back(move(baseObject)); } -void WorldEvent::addScriptLocalFloat(const MWWorld::Ptr& ptr, int index, float floatVal) +void ObjectList::addScriptLocalFloat(const MWWorld::Ptr& ptr, int index, float floatVal) { cell = *ptr.getCell()->getCell(); - mwmp::WorldObject worldObject; - worldObject.refId = ptr.getCellRef().getRefId(); - worldObject.refNumIndex = ptr.getCellRef().getRefNum().mIndex; - worldObject.mpNum = ptr.getCellRef().getMpNum(); - worldObject.index = index; - worldObject.floatVal = floatVal; - worldObjects.push_back(move(worldObject)); + mwmp::BaseObject baseObject; + baseObject.refId = ptr.getCellRef().getRefId(); + baseObject.refNumIndex = ptr.getCellRef().getRefNum().mIndex; + baseObject.mpNum = ptr.getCellRef().getMpNum(); + baseObject.index = index; + baseObject.floatVal = floatVal; + baseObjects.push_back(move(baseObject)); } -void WorldEvent::addScriptMemberShort(std::string refId, int index, int shortVal) +void ObjectList::addScriptMemberShort(std::string refId, int index, int shortVal) { - mwmp::WorldObject worldObject; - worldObject.refId = refId; - worldObject.index = index; - worldObject.shortVal = shortVal; - worldObjects.push_back(move(worldObject)); + mwmp::BaseObject baseObject; + baseObject.refId = refId; + baseObject.index = index; + baseObject.shortVal = shortVal; + baseObjects.push_back(move(baseObject)); } -void WorldEvent::addScriptGlobalShort(std::string varName, int shortVal) +void ObjectList::addScriptGlobalShort(std::string varName, int shortVal) { - mwmp::WorldObject worldObject; - worldObject.varName = varName; - worldObject.shortVal = shortVal; - worldObjects.push_back(move(worldObject)); + mwmp::BaseObject baseObject; + baseObject.varName = varName; + baseObject.shortVal = shortVal; + baseObjects.push_back(move(baseObject)); } -void WorldEvent::sendObjectPlace() +void ObjectList::sendObjectPlace() { - if (worldObjects.size() == 0) + if (baseObjects.size() == 0) return; LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Sending ID_OBJECT_PLACE about %s", cell.getDescription().c_str()); - for (const auto &worldObject : worldObjects) - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, count: %i", worldObject.refId.c_str(), worldObject.count); + for (const auto &baseObject : baseObjects) + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, count: %i", baseObject.refId.c_str(), baseObject.count); - mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_PLACE)->setEvent(this); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_PLACE)->setObjectList(this); mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_PLACE)->Send(); } -void WorldEvent::sendObjectSpawn() +void ObjectList::sendObjectSpawn() { - if (worldObjects.size() == 0) + if (baseObjects.size() == 0) return; LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Sending ID_OBJECT_SPAWN about %s", cell.getDescription().c_str()); - for (const auto &worldObject : worldObjects) - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s-%i", worldObject.refId.c_str(), worldObject.refNumIndex); + for (const auto &baseObject : baseObjects) + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s-%i", baseObject.refId.c_str(), baseObject.refNumIndex); - mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_SPAWN)->setEvent(this); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_SPAWN)->setObjectList(this); mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_SPAWN)->Send(); } -void WorldEvent::sendObjectDelete() +void ObjectList::sendObjectDelete() { - mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_DELETE)->setEvent(this); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_DELETE)->setObjectList(this); mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_DELETE)->Send(); } -void WorldEvent::sendObjectLock() +void ObjectList::sendObjectLock() { - mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_LOCK)->setEvent(this); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_LOCK)->setObjectList(this); mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_LOCK)->Send(); } -void WorldEvent::sendObjectTrap() +void ObjectList::sendObjectTrap() { - mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_TRAP)->setEvent(this); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_TRAP)->setObjectList(this); mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_TRAP)->Send(); } -void WorldEvent::sendObjectScale() +void ObjectList::sendObjectScale() { - mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_SCALE)->setEvent(this); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_SCALE)->setObjectList(this); mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_SCALE)->Send(); } -void WorldEvent::sendObjectState() +void ObjectList::sendObjectState() { - mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_STATE)->setEvent(this); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_STATE)->setObjectList(this); mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_STATE)->Send(); } -void WorldEvent::sendObjectAnimPlay() +void ObjectList::sendObjectAnimPlay() { - mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_ANIM_PLAY)->setEvent(this); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_ANIM_PLAY)->setObjectList(this); mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_ANIM_PLAY)->Send(); } -void WorldEvent::sendDoorState() +void ObjectList::sendDoorState() { LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Sending ID_DOOR_STATE about %s", cell.getDescription().c_str()); - for (const auto &worldObject : worldObjects) - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s-%i, state: %s", worldObject.refId.c_str(), worldObject.refNumIndex, - worldObject.doorState ? "true" : "false"); + for (const auto &baseObject : baseObjects) + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s-%i, state: %s", baseObject.refId.c_str(), baseObject.refNumIndex, + baseObject.doorState ? "true" : "false"); - mwmp::Main::get().getNetworking()->getObjectPacket(ID_DOOR_STATE)->setEvent(this); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_DOOR_STATE)->setObjectList(this); mwmp::Main::get().getNetworking()->getObjectPacket(ID_DOOR_STATE)->Send(); } -void WorldEvent::sendMusicPlay() +void ObjectList::sendMusicPlay() { - mwmp::Main::get().getNetworking()->getObjectPacket(ID_MUSIC_PLAY)->setEvent(this); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_MUSIC_PLAY)->setObjectList(this); mwmp::Main::get().getNetworking()->getObjectPacket(ID_MUSIC_PLAY)->Send(); } -void WorldEvent::sendVideoPlay() +void ObjectList::sendVideoPlay() { - mwmp::Main::get().getNetworking()->getObjectPacket(ID_VIDEO_PLAY)->setEvent(this); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_VIDEO_PLAY)->setObjectList(this); mwmp::Main::get().getNetworking()->getObjectPacket(ID_VIDEO_PLAY)->Send(); } -void WorldEvent::sendScriptLocalShort() +void ObjectList::sendScriptLocalShort() { LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Sending ID_SCRIPT_LOCAL_SHORT about %s", cell.getDescription().c_str()); - for (const auto &worldObject : worldObjects) - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s-%i, index: %i, shortVal: %i", worldObject.refId.c_str(), - worldObject.refNumIndex, worldObject.index, worldObject.shortVal); + for (const auto &baseObject : baseObjects) + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s-%i, index: %i, shortVal: %i", baseObject.refId.c_str(), + baseObject.refNumIndex, baseObject.index, baseObject.shortVal); - mwmp::Main::get().getNetworking()->getObjectPacket(ID_SCRIPT_LOCAL_SHORT)->setEvent(this); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_SCRIPT_LOCAL_SHORT)->setObjectList(this); mwmp::Main::get().getNetworking()->getObjectPacket(ID_SCRIPT_LOCAL_SHORT)->Send(); } -void WorldEvent::sendScriptLocalFloat() +void ObjectList::sendScriptLocalFloat() { LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Sending ID_SCRIPT_LOCAL_FLOAT about %s", cell.getDescription().c_str()); - for (const auto &worldObject : worldObjects) - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s-%i, index: %i, floatVal: %f", worldObject.refId.c_str(), - worldObject.refNumIndex, worldObject.index, worldObject.floatVal); + for (const auto &baseObject : baseObjects) + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s-%i, index: %i, floatVal: %f", baseObject.refId.c_str(), + baseObject.refNumIndex, baseObject.index, baseObject.floatVal); - mwmp::Main::get().getNetworking()->getObjectPacket(ID_SCRIPT_LOCAL_FLOAT)->setEvent(this); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_SCRIPT_LOCAL_FLOAT)->setObjectList(this); mwmp::Main::get().getNetworking()->getObjectPacket(ID_SCRIPT_LOCAL_FLOAT)->Send(); } -void WorldEvent::sendScriptMemberShort() +void ObjectList::sendScriptMemberShort() { LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Sending ID_SCRIPT_MEMBER_SHORT"); - for (const auto &worldObject : worldObjects) - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, index: %i, shortVal: %i", worldObject.refId.c_str(), - worldObject.index, worldObject.shortVal); + for (const auto &baseObject : baseObjects) + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, index: %i, shortVal: %i", baseObject.refId.c_str(), + baseObject.index, baseObject.shortVal); - mwmp::Main::get().getNetworking()->getObjectPacket(ID_SCRIPT_MEMBER_SHORT)->setEvent(this); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_SCRIPT_MEMBER_SHORT)->setObjectList(this); mwmp::Main::get().getNetworking()->getObjectPacket(ID_SCRIPT_MEMBER_SHORT)->Send(); } -void WorldEvent::sendScriptGlobalShort() +void ObjectList::sendScriptGlobalShort() { LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Sending ID_SCRIPT_GLOBAL_SHORT"); - for (const auto &worldObject : worldObjects) - LOG_APPEND(Log::LOG_VERBOSE, "- varName: %s, shortVal: %i", worldObject.varName.c_str(), worldObject.shortVal); + for (const auto &baseObject : baseObjects) + LOG_APPEND(Log::LOG_VERBOSE, "- varName: %s, shortVal: %i", baseObject.varName.c_str(), baseObject.shortVal); - mwmp::Main::get().getNetworking()->getObjectPacket(ID_SCRIPT_GLOBAL_SHORT)->setEvent(this); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_SCRIPT_GLOBAL_SHORT)->setObjectList(this); mwmp::Main::get().getNetworking()->getObjectPacket(ID_SCRIPT_GLOBAL_SHORT)->Send(); } -void WorldEvent::sendContainer() +void ObjectList::sendContainer() { LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Sending ID_CONTAINER"); - mwmp::Main::get().getNetworking()->getObjectPacket(ID_CONTAINER)->setEvent(this); + mwmp::Main::get().getNetworking()->getObjectPacket(ID_CONTAINER)->setObjectList(this); mwmp::Main::get().getNetworking()->getObjectPacket(ID_CONTAINER)->Send(); } diff --git a/apps/openmw/mwmp/WorldEvent.hpp b/apps/openmw/mwmp/ObjectList.hpp similarity index 89% rename from apps/openmw/mwmp/WorldEvent.hpp rename to apps/openmw/mwmp/ObjectList.hpp index a14940fad..f77cccb16 100644 --- a/apps/openmw/mwmp/WorldEvent.hpp +++ b/apps/openmw/mwmp/ObjectList.hpp @@ -1,24 +1,24 @@ #ifndef OPENMW_WORLDEVENT_HPP #define OPENMW_WORLDEVENT_HPP -#include +#include #include "../mwworld/cellstore.hpp" #include namespace mwmp { class Networking; - class WorldEvent : public BaseEvent + class ObjectList : public BaseObjectList { public: - WorldEvent(); - virtual ~WorldEvent(); + ObjectList(); + virtual ~ObjectList(); void reset(); - WorldObject getWorldObject(const MWWorld::Ptr& ptr); - void addContainerItem(mwmp::WorldObject& worldObject, const MWWorld::Ptr& itemPtr, int actionCount); + BaseObject getBaseObject(const MWWorld::Ptr& ptr); + void addContainerItem(mwmp::BaseObject& baseObject, const MWWorld::Ptr& itemPtr, int actionCount); void addEntireContainer(const MWWorld::Ptr& ptr); void editContainers(MWWorld::CellStore* cellStore); @@ -46,7 +46,7 @@ namespace mwmp void playVideo(); void addAllContainers(MWWorld::CellStore* cellStore); - void addRequestedContainers(MWWorld::CellStore* cellStore, const std::vector& requestObjects); + void addRequestedContainers(MWWorld::CellStore* cellStore, const std::vector& requestObjects); void addObjectPlace(const MWWorld::Ptr& ptr, bool droppedByPlayer = false); void addObjectSpawn(const MWWorld::Ptr& ptr); diff --git a/apps/openmw/mwmp/processors/ActorProcessor.hpp b/apps/openmw/mwmp/processors/ActorProcessor.hpp index a63e4d9eb..4e94c5128 100644 --- a/apps/openmw/mwmp/processors/ActorProcessor.hpp +++ b/apps/openmw/mwmp/processors/ActorProcessor.hpp @@ -8,7 +8,7 @@ #include #include #include -#include "../WorldEvent.hpp" +#include "../ObjectList.hpp" #include "../ActorList.hpp" #include "BaseClientPacketProcessor.hpp" diff --git a/apps/openmw/mwmp/processors/WorldProcessor.cpp b/apps/openmw/mwmp/processors/WorldProcessor.cpp index b21292649..d951c02d9 100644 --- a/apps/openmw/mwmp/processors/WorldProcessor.cpp +++ b/apps/openmw/mwmp/processors/WorldProcessor.cpp @@ -1,7 +1,3 @@ -// -// Created by koncord on 16.04.17. -// - #include "WorldProcessor.hpp" #include "../Main.hpp" #include "../Networking.hpp" @@ -11,15 +7,15 @@ using namespace mwmp; template typename BasePacketProcessor::processors_t BasePacketProcessor::processors; -bool WorldProcessor::Process(RakNet::Packet &packet, WorldEvent &event) +bool WorldProcessor::Process(RakNet::Packet &packet, ObjectList &objectList) { RakNet::BitStream bsIn(&packet.data[1], packet.length, false); bsIn.Read(guid); - event.guid = guid; + objectList.guid = guid; ObjectPacket *myPacket = Main::get().getNetworking()->getObjectPacket(packet.data[0]); - myPacket->setEvent(&event); + myPacket->setObjectList(&objectList); myPacket->SetReadStream(&bsIn); for (auto &processor: processors) @@ -29,13 +25,13 @@ bool WorldProcessor::Process(RakNet::Packet &packet, WorldEvent &event) myGuid = Main::get().getLocalPlayer()->guid; request = packet.length == myPacket->headerSize(); - event.isValid = true; + objectList.isValid = true; if (!request && !processor.second->avoidReading) myPacket->Read(); - if (event.isValid) - processor.second->Do(*myPacket, event); + if (objectList.isValid) + processor.second->Do(*myPacket, objectList); else LOG_MESSAGE_SIMPLE(Log::LOG_ERROR, "Received %s that failed integrity check and was ignored!", processor.second->strPacketID.c_str()); diff --git a/apps/openmw/mwmp/processors/WorldProcessor.hpp b/apps/openmw/mwmp/processors/WorldProcessor.hpp index 776db3da8..1aa39b2ae 100644 --- a/apps/openmw/mwmp/processors/WorldProcessor.hpp +++ b/apps/openmw/mwmp/processors/WorldProcessor.hpp @@ -8,7 +8,7 @@ #include #include #include -#include "../WorldEvent.hpp" +#include "../ObjectList.hpp" #include "../LocalPlayer.hpp" #include "../DedicatedPlayer.hpp" #include "BaseClientPacketProcessor.hpp" @@ -18,9 +18,9 @@ namespace mwmp class WorldProcessor : public BasePacketProcessor, public BaseClientPacketProcessor { public: - virtual void Do(ObjectPacket &packet, WorldEvent &event) = 0; + virtual void Do(ObjectPacket &packet, ObjectList &objectList) = 0; - static bool Process(RakNet::Packet &packet, WorldEvent &event); + static bool Process(RakNet::Packet &packet, ObjectList &objectList); }; } diff --git a/apps/openmw/mwmp/processors/world/BaseObjectProcessor.hpp b/apps/openmw/mwmp/processors/world/BaseObjectProcessor.hpp index 3005e8515..b1a21ce08 100644 --- a/apps/openmw/mwmp/processors/world/BaseObjectProcessor.hpp +++ b/apps/openmw/mwmp/processors/world/BaseObjectProcessor.hpp @@ -15,13 +15,13 @@ namespace mwmp class BaseObjectProcessor: public WorldProcessor { public: - virtual void Do(ObjectPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, ObjectList &objectList) { - ptrCellStore = Main::get().getCellController()->getCellStore(event.cell); + ptrCellStore = Main::get().getCellController()->getCellStore(objectList.cell); if (!ptrCellStore) return; - LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Received %s about %s", strPacketID.c_str(), event.cell.getDescription().c_str()); + LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Received %s about %s", strPacketID.c_str(), objectList.cell.getDescription().c_str()); } protected: MWWorld::CellStore *ptrCellStore; diff --git a/apps/openmw/mwmp/processors/world/ProcessorConsoleCommand.hpp b/apps/openmw/mwmp/processors/world/ProcessorConsoleCommand.hpp index 6c838b9d8..d2162b404 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorConsoleCommand.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorConsoleCommand.hpp @@ -13,11 +13,11 @@ namespace mwmp BPP_INIT(ID_CONSOLE_COMMAND) } - virtual void Do(ObjectPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, ObjectList &objectList) { - BaseObjectProcessor::Do(packet, event); + BaseObjectProcessor::Do(packet, objectList); - event.runConsoleCommands(ptrCellStore); + objectList.runConsoleCommands(ptrCellStore); } }; } diff --git a/apps/openmw/mwmp/processors/world/ProcessorContainer.hpp b/apps/openmw/mwmp/processors/world/ProcessorContainer.hpp index a267f05d7..4302f482a 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorContainer.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorContainer.hpp @@ -13,43 +13,43 @@ namespace mwmp BPP_INIT(ID_CONTAINER) } - virtual void Do(ObjectPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, ObjectList &objectList) { - BaseObjectProcessor::Do(packet, event); + BaseObjectProcessor::Do(packet, objectList); - LOG_APPEND(Log::LOG_VERBOSE, "- action: %i, containerSubAction: %i", (int) event.action, (int) event.containerSubAction); + LOG_APPEND(Log::LOG_VERBOSE, "- action: %i, containerSubAction: %i", (int) objectList.action, (int) objectList.containerSubAction); // If we've received a request for information, comply with it - if (event.action == mwmp::BaseEvent::Action::Request) + if (objectList.action == mwmp::BaseObjectList::Action::Request) { - if (event.worldObjects.size() == 0) + if (objectList.baseObjects.size() == 0) { LOG_APPEND(Log::LOG_VERBOSE, "- Request had no objects attached, so we are sending all containers in the cell %s", - event.cell.getDescription().c_str()); - event.reset(); - event.cell = *ptrCellStore->getCell(); - event.action = BaseEvent::Action::Set; - event.addAllContainers(ptrCellStore); - event.sendContainer(); + objectList.cell.getDescription().c_str()); + objectList.reset(); + objectList.cell = *ptrCellStore->getCell(); + objectList.action = BaseObjectList::Action::Set; + objectList.addAllContainers(ptrCellStore); + objectList.sendContainer(); } else { - LOG_APPEND(Log::LOG_VERBOSE, "- Request was for %i %s", event.worldObjects.size(), event.worldObjects.size() == 1 ? "object" : "objects"); - std::vector requestObjects = event.worldObjects; - event.reset(); - event.cell = *ptrCellStore->getCell(); - event.action = mwmp::BaseEvent::Action::Set; - event.addRequestedContainers(ptrCellStore, requestObjects); - - if (event.worldObjects.size() > 0) - event.sendContainer(); + LOG_APPEND(Log::LOG_VERBOSE, "- Request was for %i %s", objectList.baseObjects.size(), objectList.baseObjects.size() == 1 ? "object" : "objects"); + std::vector requestObjects = objectList.baseObjects; + objectList.reset(); + objectList.cell = *ptrCellStore->getCell(); + objectList.action = mwmp::BaseObjectList::Action::Set; + objectList.addRequestedContainers(ptrCellStore, requestObjects); + + if (objectList.baseObjects.size() > 0) + objectList.sendContainer(); } } // Otherwise, edit containers based on the information received else { LOG_APPEND(Log::LOG_VERBOSE, "- Editing container contents to match those of packet"); - event.editContainers(ptrCellStore); + objectList.editContainers(ptrCellStore); } } diff --git a/apps/openmw/mwmp/processors/world/ProcessorDoorDestination.hpp b/apps/openmw/mwmp/processors/world/ProcessorDoorDestination.hpp index 70a648fbb..96bc057a3 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorDoorDestination.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorDoorDestination.hpp @@ -13,11 +13,11 @@ namespace mwmp BPP_INIT(ID_DOOR_DESTINATION) } - virtual void Do(ObjectPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, ObjectList &objectList) { - BaseObjectProcessor::Do(packet, event); + BaseObjectProcessor::Do(packet, objectList); - event.setDoorDestinations(ptrCellStore); + objectList.setDoorDestinations(ptrCellStore); } }; } diff --git a/apps/openmw/mwmp/processors/world/ProcessorDoorState.hpp b/apps/openmw/mwmp/processors/world/ProcessorDoorState.hpp index 12b4993bd..21422da00 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorDoorState.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorDoorState.hpp @@ -13,11 +13,11 @@ namespace mwmp BPP_INIT(ID_DOOR_STATE) } - virtual void Do(ObjectPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, ObjectList &objectList) { - BaseObjectProcessor::Do(packet, event); + BaseObjectProcessor::Do(packet, objectList); - event.activateDoors(ptrCellStore); + objectList.activateDoors(ptrCellStore); } }; } diff --git a/apps/openmw/mwmp/processors/world/ProcessorMusicPlay.hpp b/apps/openmw/mwmp/processors/world/ProcessorMusicPlay.hpp index e7498446f..4ba5f6295 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorMusicPlay.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorMusicPlay.hpp @@ -13,10 +13,10 @@ namespace mwmp BPP_INIT(ID_MUSIC_PLAY) } - virtual void Do(ObjectPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, ObjectList &objectList) { LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Received %s", strPacketID.c_str()); - event.playMusic(); + objectList.playMusic(); } }; } diff --git a/apps/openmw/mwmp/processors/world/ProcessorObjectAnimPlay.hpp b/apps/openmw/mwmp/processors/world/ProcessorObjectAnimPlay.hpp index a595a3862..2d596d9b1 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorObjectAnimPlay.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorObjectAnimPlay.hpp @@ -13,11 +13,11 @@ namespace mwmp BPP_INIT(ID_OBJECT_ANIM_PLAY) } - virtual void Do(ObjectPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, ObjectList &objectList) { - BaseObjectProcessor::Do(packet, event); + BaseObjectProcessor::Do(packet, objectList); - event.animateObjects(ptrCellStore); + objectList.animateObjects(ptrCellStore); } }; } diff --git a/apps/openmw/mwmp/processors/world/ProcessorObjectAttach.hpp b/apps/openmw/mwmp/processors/world/ProcessorObjectAttach.hpp index 95d8a0e7b..4fb1cf593 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorObjectAttach.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorObjectAttach.hpp @@ -13,11 +13,11 @@ namespace mwmp BPP_INIT(ID_OBJECT_ATTACH) } - virtual void Do(ObjectPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, ObjectList &objectList) { - BaseObjectProcessor::Do(packet, event); + BaseObjectProcessor::Do(packet, objectList); - //event.attachObjects(ptrCellStore); + //objectList.attachObjects(ptrCellStore); } }; diff --git a/apps/openmw/mwmp/processors/world/ProcessorObjectCollision.hpp b/apps/openmw/mwmp/processors/world/ProcessorObjectCollision.hpp index d8f69cbab..981b0b76f 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorObjectCollision.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorObjectCollision.hpp @@ -13,11 +13,11 @@ namespace mwmp BPP_INIT(ID_OBJECT_COLLISION) } - virtual void Do(ObjectPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, ObjectList &objectList) { - BaseObjectProcessor::Do(packet, event); + BaseObjectProcessor::Do(packet, objectList); - //event.setObjectCollisions(ptrCellStore); + //objectList.setObjectCollisions(ptrCellStore); } }; diff --git a/apps/openmw/mwmp/processors/world/ProcessorObjectDelete.hpp b/apps/openmw/mwmp/processors/world/ProcessorObjectDelete.hpp index 65a8d51d6..2013ff143 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorObjectDelete.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorObjectDelete.hpp @@ -13,11 +13,11 @@ namespace mwmp BPP_INIT(ID_OBJECT_DELETE) } - virtual void Do(ObjectPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, ObjectList &objectList) { - BaseObjectProcessor::Do(packet, event); + BaseObjectProcessor::Do(packet, objectList); - event.deleteObjects(ptrCellStore); + objectList.deleteObjects(ptrCellStore); } }; } diff --git a/apps/openmw/mwmp/processors/world/ProcessorObjectLock.hpp b/apps/openmw/mwmp/processors/world/ProcessorObjectLock.hpp index bb2614708..c39293433 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorObjectLock.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorObjectLock.hpp @@ -13,11 +13,11 @@ namespace mwmp BPP_INIT(ID_OBJECT_LOCK) } - virtual void Do(ObjectPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, ObjectList &objectList) { - BaseObjectProcessor::Do(packet, event); + BaseObjectProcessor::Do(packet, objectList); - event.lockObjects(ptrCellStore); + objectList.lockObjects(ptrCellStore); } }; } diff --git a/apps/openmw/mwmp/processors/world/ProcessorObjectMove.hpp b/apps/openmw/mwmp/processors/world/ProcessorObjectMove.hpp index baa9179fc..e45c415a0 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorObjectMove.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorObjectMove.hpp @@ -13,11 +13,11 @@ namespace mwmp BPP_INIT(ID_OBJECT_MOVE) } - virtual void Do(ObjectPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, ObjectList &objectList) { - BaseObjectProcessor::Do(packet, event); + BaseObjectProcessor::Do(packet, objectList); - event.moveObjects(ptrCellStore); + objectList.moveObjects(ptrCellStore); } }; } diff --git a/apps/openmw/mwmp/processors/world/ProcessorObjectPlace.hpp b/apps/openmw/mwmp/processors/world/ProcessorObjectPlace.hpp index 5ee9d41f1..805208e6a 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorObjectPlace.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorObjectPlace.hpp @@ -13,11 +13,11 @@ namespace mwmp BPP_INIT(ID_OBJECT_PLACE) } - virtual void Do(ObjectPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, ObjectList &objectList) { - BaseObjectProcessor::Do(packet, event); + BaseObjectProcessor::Do(packet, objectList); - event.placeObjects(ptrCellStore); + objectList.placeObjects(ptrCellStore); } }; diff --git a/apps/openmw/mwmp/processors/world/ProcessorObjectReset.hpp b/apps/openmw/mwmp/processors/world/ProcessorObjectReset.hpp index 385e6b79c..8fa943af3 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorObjectReset.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorObjectReset.hpp @@ -13,11 +13,11 @@ namespace mwmp BPP_INIT(ID_OBJECT_RESET) } - virtual void Do(ObjectPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, ObjectList &objectList) { - BaseObjectProcessor::Do(packet, event); + BaseObjectProcessor::Do(packet, objectList); - //event.resetObjects(ptrCellStore); + //objectList.resetObjects(ptrCellStore); } }; diff --git a/apps/openmw/mwmp/processors/world/ProcessorObjectRotate.hpp b/apps/openmw/mwmp/processors/world/ProcessorObjectRotate.hpp index 6528d5b05..48f5df284 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorObjectRotate.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorObjectRotate.hpp @@ -13,11 +13,11 @@ namespace mwmp BPP_INIT(ID_OBJECT_ROTATE) } - virtual void Do(ObjectPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, ObjectList &objectList) { - BaseObjectProcessor::Do(packet, event); + BaseObjectProcessor::Do(packet, objectList); - event.rotateObjects(ptrCellStore); + objectList.rotateObjects(ptrCellStore); } }; } diff --git a/apps/openmw/mwmp/processors/world/ProcessorObjectScale.hpp b/apps/openmw/mwmp/processors/world/ProcessorObjectScale.hpp index 65d3559a1..49deaf110 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorObjectScale.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorObjectScale.hpp @@ -13,11 +13,11 @@ namespace mwmp BPP_INIT(ID_OBJECT_SCALE) } - virtual void Do(ObjectPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, ObjectList &objectList) { - BaseObjectProcessor::Do(packet, event); + BaseObjectProcessor::Do(packet, objectList); - event.scaleObjects(ptrCellStore); + objectList.scaleObjects(ptrCellStore); } }; } diff --git a/apps/openmw/mwmp/processors/world/ProcessorObjectSpawn.hpp b/apps/openmw/mwmp/processors/world/ProcessorObjectSpawn.hpp index 53fce90ca..bc0dc8c6c 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorObjectSpawn.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorObjectSpawn.hpp @@ -13,11 +13,11 @@ namespace mwmp BPP_INIT(ID_OBJECT_SPAWN) } - virtual void Do(ObjectPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, ObjectList &objectList) { - BaseObjectProcessor::Do(packet, event); + BaseObjectProcessor::Do(packet, objectList); - event.spawnObjects(ptrCellStore); + objectList.spawnObjects(ptrCellStore); } }; } diff --git a/apps/openmw/mwmp/processors/world/ProcessorObjectState.hpp b/apps/openmw/mwmp/processors/world/ProcessorObjectState.hpp index b2e7e0b2f..337097e67 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorObjectState.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorObjectState.hpp @@ -13,11 +13,11 @@ namespace mwmp BPP_INIT(ID_OBJECT_STATE) } - virtual void Do(ObjectPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, ObjectList &objectList) { - BaseObjectProcessor::Do(packet, event); + BaseObjectProcessor::Do(packet, objectList); - event.setObjectStates(ptrCellStore); + objectList.setObjectStates(ptrCellStore); } }; } diff --git a/apps/openmw/mwmp/processors/world/ProcessorObjectTrap.hpp b/apps/openmw/mwmp/processors/world/ProcessorObjectTrap.hpp index ff79e140e..4c7baa95e 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorObjectTrap.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorObjectTrap.hpp @@ -13,11 +13,11 @@ namespace mwmp BPP_INIT(ID_OBJECT_TRAP) } - virtual void Do(ObjectPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, ObjectList &objectList) { - BaseObjectProcessor::Do(packet, event); + BaseObjectProcessor::Do(packet, objectList); - event.triggerTrapObjects(ptrCellStore); + objectList.triggerTrapObjects(ptrCellStore); } }; } diff --git a/apps/openmw/mwmp/processors/world/ProcessorScriptGlobalFloat.hpp b/apps/openmw/mwmp/processors/world/ProcessorScriptGlobalFloat.hpp index 419f54e06..2ac4400ac 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorScriptGlobalFloat.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorScriptGlobalFloat.hpp @@ -13,10 +13,10 @@ namespace mwmp BPP_INIT(ID_SCRIPT_GLOBAL_FLOAT) } - virtual void Do(ObjectPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, ObjectList &objectList) { LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Received %s", strPacketID.c_str()); - //event.setGlobalFloats(); + //objectList.setGlobalFloats(); } }; } diff --git a/apps/openmw/mwmp/processors/world/ProcessorScriptGlobalShort.hpp b/apps/openmw/mwmp/processors/world/ProcessorScriptGlobalShort.hpp index 5353e5a89..cbcb137a8 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorScriptGlobalShort.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorScriptGlobalShort.hpp @@ -13,10 +13,10 @@ namespace mwmp BPP_INIT(ID_SCRIPT_GLOBAL_SHORT) } - virtual void Do(ObjectPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, ObjectList &objectList) { LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Received %s", strPacketID.c_str()); - event.setGlobalShorts(); + objectList.setGlobalShorts(); } }; } diff --git a/apps/openmw/mwmp/processors/world/ProcessorScriptLocalFloat.hpp b/apps/openmw/mwmp/processors/world/ProcessorScriptLocalFloat.hpp index 16a5713c7..4c73d7bd9 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorScriptLocalFloat.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorScriptLocalFloat.hpp @@ -13,11 +13,11 @@ namespace mwmp BPP_INIT(ID_SCRIPT_LOCAL_FLOAT) } - virtual void Do(ObjectPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, ObjectList &objectList) { - BaseObjectProcessor::Do(packet, event); + BaseObjectProcessor::Do(packet, objectList); - event.setLocalFloats(ptrCellStore); + objectList.setLocalFloats(ptrCellStore); } }; } diff --git a/apps/openmw/mwmp/processors/world/ProcessorScriptLocalShort.hpp b/apps/openmw/mwmp/processors/world/ProcessorScriptLocalShort.hpp index 1687f34ad..b1f20312c 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorScriptLocalShort.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorScriptLocalShort.hpp @@ -13,11 +13,11 @@ namespace mwmp BPP_INIT(ID_SCRIPT_LOCAL_SHORT) } - virtual void Do(ObjectPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, ObjectList &objectList) { - BaseObjectProcessor::Do(packet, event); + BaseObjectProcessor::Do(packet, objectList); - event.setLocalShorts(ptrCellStore); + objectList.setLocalShorts(ptrCellStore); } }; } diff --git a/apps/openmw/mwmp/processors/world/ProcessorScriptMemberFloat.hpp b/apps/openmw/mwmp/processors/world/ProcessorScriptMemberFloat.hpp index b8b78e8f7..a10bb32c7 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorScriptMemberFloat.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorScriptMemberFloat.hpp @@ -13,10 +13,10 @@ namespace mwmp BPP_INIT(ID_SCRIPT_MEMBER_FLOAT) } - virtual void Do(ObjectPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, ObjectList &objectList) { LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Received %s", strPacketID.c_str()); - //event.setMemberFloats(); + //objectList.setMemberFloats(); } }; } diff --git a/apps/openmw/mwmp/processors/world/ProcessorScriptMemberShort.hpp b/apps/openmw/mwmp/processors/world/ProcessorScriptMemberShort.hpp index d0f4331ab..c159129d2 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorScriptMemberShort.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorScriptMemberShort.hpp @@ -13,10 +13,10 @@ namespace mwmp BPP_INIT(ID_SCRIPT_MEMBER_SHORT) } - virtual void Do(ObjectPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, ObjectList &objectList) { LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Received %s", strPacketID.c_str()); - event.setMemberShorts(); + objectList.setMemberShorts(); } }; } diff --git a/apps/openmw/mwmp/processors/world/ProcessorVideoPlay.hpp b/apps/openmw/mwmp/processors/world/ProcessorVideoPlay.hpp index df9e9a7d0..59a0beeef 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorVideoPlay.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorVideoPlay.hpp @@ -13,10 +13,10 @@ namespace mwmp BPP_INIT(ID_VIDEO_PLAY) } - virtual void Do(ObjectPacket &packet, WorldEvent &event) + virtual void Do(ObjectPacket &packet, ObjectList &objectList) { LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Received %s", strPacketID.c_str()); - event.playVideo(); + objectList.playVideo(); } }; } diff --git a/apps/openmw/mwscript/animationextensions.cpp b/apps/openmw/mwscript/animationextensions.cpp index 93eae86e9..bf7dd9957 100644 --- a/apps/openmw/mwscript/animationextensions.cpp +++ b/apps/openmw/mwscript/animationextensions.cpp @@ -10,7 +10,7 @@ */ #include "../mwmp/Main.hpp" #include "../mwmp/Networking.hpp" -#include "../mwmp/WorldEvent.hpp" +#include "../mwmp/ObjectList.hpp" /* End of tes3mp addition */ @@ -82,10 +82,10 @@ namespace MWScript */ if (mwmp::Main::isValidPacketScript(ptr.getClass().getScript(ptr))) { - mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); - worldEvent->reset(); - worldEvent->addObjectAnimPlay(ptr, group, mode); - worldEvent->sendObjectAnimPlay(); + mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); + objectList->reset(); + objectList->addObjectAnimPlay(ptr, group, mode); + objectList->sendObjectAnimPlay(); } /* End of tes3mp addition diff --git a/apps/openmw/mwscript/interpretercontext.cpp b/apps/openmw/mwscript/interpretercontext.cpp index 0a6b942c2..9a810e0e3 100644 --- a/apps/openmw/mwscript/interpretercontext.cpp +++ b/apps/openmw/mwscript/interpretercontext.cpp @@ -19,7 +19,7 @@ #include "../mwmp/Main.hpp" #include "../mwmp/Networking.hpp" #include "../mwmp/LocalPlayer.hpp" -#include "../mwmp/WorldEvent.hpp" +#include "../mwmp/ObjectList.hpp" /* End of tes3mp addition */ @@ -211,10 +211,10 @@ namespace MWScript */ if (sendPackets) { - mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); - worldEvent->reset(); - worldEvent->addScriptLocalShort(mReference, index, value); - worldEvent->sendScriptLocalShort(); + mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); + objectList->reset(); + objectList->addScriptLocalShort(mReference, index, value); + objectList->sendScriptLocalShort(); } /* End of tes3mp addition @@ -245,10 +245,10 @@ namespace MWScript */ if (sendPackets && value == (int) value) { - mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); - worldEvent->reset(); - worldEvent->addScriptLocalFloat(mReference, index, value); - worldEvent->sendScriptLocalFloat(); + mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); + objectList->reset(); + objectList->addScriptLocalFloat(mReference, index, value); + objectList->sendScriptLocalFloat(); } /* End of tes3mp addition @@ -304,10 +304,10 @@ namespace MWScript */ if (sendPackets) { - mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); - worldEvent->reset(); - worldEvent->addScriptGlobalShort(name, value); - worldEvent->sendScriptGlobalShort(); + mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); + objectList->reset(); + objectList->addScriptGlobalShort(name, value); + objectList->sendScriptGlobalShort(); } /* End of tes3mp addition @@ -594,10 +594,10 @@ namespace MWScript { if (ref.isInCell() && !ref.getRefData().isEnabled()) { - mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); - worldEvent->reset(); - worldEvent->addObjectState(ref, true); - worldEvent->sendObjectState(); + mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); + objectList->reset(); + objectList->addObjectState(ref, true); + objectList->sendObjectState(); } } /* @@ -622,10 +622,10 @@ namespace MWScript { if (ref.isInCell() && ref.getRefData().isEnabled()) { - mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); - worldEvent->reset(); - worldEvent->addObjectState(ref, false); - worldEvent->sendObjectState(); + mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); + objectList->reset(); + objectList->addObjectState(ref, false); + objectList->sendObjectState(); } } /* @@ -685,10 +685,10 @@ namespace MWScript */ if (sendPackets && !global) { - mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); - worldEvent->reset(); - worldEvent->addScriptMemberShort(id, index, value); - worldEvent->sendScriptMemberShort(); + mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); + objectList->reset(); + objectList->addScriptMemberShort(id, index, value); + objectList->sendScriptMemberShort(); } /* End of tes3mp addition diff --git a/apps/openmw/mwscript/miscextensions.cpp b/apps/openmw/mwscript/miscextensions.cpp index 42c50542a..382f6012e 100644 --- a/apps/openmw/mwscript/miscextensions.cpp +++ b/apps/openmw/mwscript/miscextensions.cpp @@ -9,7 +9,7 @@ */ #include "../mwmp/Main.hpp" #include "../mwmp/Networking.hpp" -#include "../mwmp/WorldEvent.hpp" +#include "../mwmp/ObjectList.hpp" /* End of tes3mp addition */ @@ -103,10 +103,10 @@ namespace MWScript Send an ID_VIDEO_PLAY packet every time a video is played through a script */ - mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); - worldEvent->reset(); - worldEvent->addVideoPlay(name, allowSkipping); - worldEvent->sendVideoPlay(); + mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); + objectList->reset(); + objectList->addVideoPlay(name, allowSkipping); + objectList->sendVideoPlay(); /* End of tes3mp addition */ @@ -213,10 +213,10 @@ namespace MWScript Send an ID_OBJECT_LOCK packet every time an object is locked through a script */ - mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); - worldEvent->reset(); - worldEvent->addObjectLock(ptr, lockLevel); - worldEvent->sendObjectLock(); + mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); + objectList->reset(); + objectList->addObjectLock(ptr, lockLevel); + objectList->sendObjectLock(); /* End of tes3mp addition */ @@ -253,10 +253,10 @@ namespace MWScript Send an ID_OBJECT_LOCK packet every time an object is unlocked through a script */ - mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); - worldEvent->reset(); - worldEvent->addObjectLock(ptr, 0); - worldEvent->sendObjectLock(); + mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); + objectList->reset(); + objectList->addObjectLock(ptr, 0); + objectList->sendObjectLock(); /* End of tes3mp addition */ @@ -733,10 +733,10 @@ namespace MWScript Send an ID_OBJECT_DELETE packet every time an object is deleted through a script */ - mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); - worldEvent->reset(); - worldEvent->addObjectDelete(ptr); - worldEvent->sendObjectDelete(); + mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); + objectList->reset(); + objectList->addObjectDelete(ptr); + objectList->sendObjectDelete(); /* End of tes3mp addition */ diff --git a/apps/openmw/mwscript/soundextensions.cpp b/apps/openmw/mwscript/soundextensions.cpp index c66944837..47016fdb0 100644 --- a/apps/openmw/mwscript/soundextensions.cpp +++ b/apps/openmw/mwscript/soundextensions.cpp @@ -7,7 +7,7 @@ */ #include "../mwmp/Main.hpp" #include "../mwmp/Networking.hpp" -#include "../mwmp/WorldEvent.hpp" +#include "../mwmp/ObjectList.hpp" /* End of tes3mp addition */ @@ -87,10 +87,10 @@ namespace MWScript Send an ID_MUSIC_PLAY packet every time new music is streamed through a script */ - mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); - worldEvent->reset(); - worldEvent->addMusicPlay(sound); - worldEvent->sendMusicPlay(); + mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); + objectList->reset(); + objectList->addMusicPlay(sound); + objectList->sendMusicPlay(); /* End of tes3mp addition */ diff --git a/apps/openmw/mwscript/transformationextensions.cpp b/apps/openmw/mwscript/transformationextensions.cpp index 933331de6..88a28a21c 100644 --- a/apps/openmw/mwscript/transformationextensions.cpp +++ b/apps/openmw/mwscript/transformationextensions.cpp @@ -10,7 +10,7 @@ #include "../mwmp/Networking.hpp" #include "../mwmp/LocalPlayer.hpp" #include "../mwmp/PlayerList.hpp" -#include "../mwmp/WorldEvent.hpp" +#include "../mwmp/ObjectList.hpp" /* End of tes3mp addition */ @@ -74,10 +74,10 @@ namespace MWScript return; else { - mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); - worldEvent->reset(); - worldEvent->addObjectScale(ptr, scale); - worldEvent->sendObjectScale(); + mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); + objectList->reset(); + objectList->addObjectScale(ptr, scale); + objectList->sendObjectScale(); } } /* @@ -582,18 +582,18 @@ namespace MWScript Send an ID_OBJECT_PLACE or ID_OBJECT_SPAWN packet every time an object is placed in the world through a script */ - mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); - worldEvent->reset(); + mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); + objectList->reset(); if (ptr.getClass().isActor()) { - worldEvent->addObjectSpawn(ptr); - worldEvent->sendObjectSpawn(); + objectList->addObjectSpawn(ptr); + objectList->sendObjectSpawn(); } else { - worldEvent->addObjectPlace(ptr); - worldEvent->sendObjectPlace(); + objectList->addObjectPlace(ptr); + objectList->sendObjectPlace(); } /* End of tes3mp addition diff --git a/apps/openmw/mwworld/actiontake.cpp b/apps/openmw/mwworld/actiontake.cpp index c9c83e8b9..c8742aa7b 100644 --- a/apps/openmw/mwworld/actiontake.cpp +++ b/apps/openmw/mwworld/actiontake.cpp @@ -7,7 +7,7 @@ */ #include "../mwmp/Main.hpp" #include "../mwmp/Networking.hpp" -#include "../mwmp/WorldEvent.hpp" +#include "../mwmp/ObjectList.hpp" #include "../mwmp/LocalPlayer.hpp" /* End of tes3mp addition @@ -40,10 +40,10 @@ namespace MWWorld Send an ID_PLAYER_INVENTORY packet as well because of the item thus gained by the player */ - mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); - worldEvent->reset(); - worldEvent->addObjectDelete(getTarget()); - worldEvent->sendObjectDelete(); + mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); + objectList->reset(); + objectList->addObjectDelete(getTarget()); + objectList->sendObjectDelete(); mwmp::Main::get().getLocalPlayer()->sendInventory(); /* End of tes3mp addition diff --git a/apps/openmw/mwworld/actiontrap.cpp b/apps/openmw/mwworld/actiontrap.cpp index ad07b0715..3facae94a 100644 --- a/apps/openmw/mwworld/actiontrap.cpp +++ b/apps/openmw/mwworld/actiontrap.cpp @@ -7,7 +7,7 @@ */ #include "../mwmp/Main.hpp" #include "../mwmp/Networking.hpp" -#include "../mwmp/WorldEvent.hpp" +#include "../mwmp/ObjectList.hpp" /* End of tes3mp addition */ @@ -48,8 +48,8 @@ namespace MWWorld Send an ID_OBJECT_TRAP packet every time a trap is triggered */ - mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); - worldEvent->reset(); + mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); + objectList->reset(); ESM::Position pos; @@ -58,8 +58,8 @@ namespace MWWorld else pos = actor.getRefData().getPosition(); - worldEvent->addObjectTrap(mTrapSource, pos, false); - worldEvent->sendObjectTrap(); + objectList->addObjectTrap(mTrapSource, pos, false); + objectList->sendObjectTrap(); /* End of tes3mp addition */ diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 59fe95ac0..8077c1086 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -17,7 +17,7 @@ #include "../mwmp/DedicatedPlayer.hpp" #include "../mwmp/LocalActor.hpp" #include "../mwmp/DedicatedActor.hpp" -#include "../mwmp/WorldEvent.hpp" +#include "../mwmp/ObjectList.hpp" #include "../mwmp/CellController.hpp" /* End of tes3mp addition @@ -2423,10 +2423,10 @@ namespace MWWorld Send an ID_DOOR_STATE packet every time a door is activated */ - mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); - worldEvent->reset(); - worldEvent->addDoorState(door, state); - worldEvent->sendDoorState(); + mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); + objectList->reset(); + objectList->addDoorState(door, state); + objectList->sendDoorState(); /* End of tes3mp addition */ @@ -2442,10 +2442,10 @@ namespace MWWorld Send an ID_DOOR_STATE packet every time a door is activated */ - mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); - worldEvent->reset(); - worldEvent->addDoorState(door, state); - worldEvent->sendDoorState(); + mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); + objectList->reset(); + objectList->addDoorState(door, state); + objectList->sendDoorState(); /* End of tes3mp addition */ @@ -3486,10 +3486,10 @@ namespace MWWorld */ MWWorld::Ptr ptr = safePlaceObject(ref.getPtr(), getPlayerPtr(), getPlayerPtr().getCell(), 0, 220.f); - mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); - worldEvent->reset(); - worldEvent->addObjectSpawn(ptr); - worldEvent->sendObjectSpawn(); + mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); + objectList->reset(); + objectList->addObjectSpawn(ptr); + objectList->sendObjectSpawn(); deleteObject(ptr); /* diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index e5965af2f..22aa7a89e 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -150,7 +150,7 @@ add_component_dir (openmw-mp ) add_component_dir (openmw-mp/Base - BaseActor BaseEvent BaseNetCreature BasePacketProcessor BasePlayer BaseStructs + BaseActor BaseObjectList BaseNetCreature BasePacketProcessor BasePlayer BaseStructs ) add_component_dir (openmw-mp/Controllers diff --git a/components/openmw-mp/Base/BaseEvent.hpp b/components/openmw-mp/Base/BaseObject.hpp similarity index 88% rename from components/openmw-mp/Base/BaseEvent.hpp rename to components/openmw-mp/Base/BaseObject.hpp index 1fb136c49..ec9f8bc29 100644 --- a/components/openmw-mp/Base/BaseEvent.hpp +++ b/components/openmw-mp/Base/BaseObject.hpp @@ -22,7 +22,7 @@ namespace mwmp } }; - struct WorldObject + struct BaseObject { std::string refId; unsigned refNumIndex; @@ -63,20 +63,20 @@ namespace mwmp std::vector containerItems; unsigned int containerItemCount; - RakNet::RakNetGUID guid; // only for events that can also affect players + RakNet::RakNetGUID guid; // only for object lists that can also include players bool isPlayer; }; - class BaseEvent + class BaseObjectList { public: - BaseEvent(RakNet::RakNetGUID guid) : guid(guid) + BaseObjectList(RakNet::RakNetGUID guid) : guid(guid) { } - BaseEvent() + BaseObjectList() { } @@ -99,7 +99,7 @@ namespace mwmp RakNet::RakNetGUID guid; - std::vector worldObjects; + std::vector baseObjects; ESM::Cell cell; std::string consoleCommand; diff --git a/components/openmw-mp/Packets/Object/ObjectPacket.cpp b/components/openmw-mp/Packets/Object/ObjectPacket.cpp index b8e5de7f0..a5bdaf9a6 100644 --- a/components/openmw-mp/Packets/Object/ObjectPacket.cpp +++ b/components/openmw-mp/Packets/Object/ObjectPacket.cpp @@ -15,10 +15,10 @@ ObjectPacket::ObjectPacket(RakNet::RakPeerInterface *peer) : BasePacket(peer) this->peer = peer; } -void ObjectPacket::setEvent(BaseEvent *event) +void ObjectPacket::setObjectList(BaseObjectList *objectList) { - this->event = event; - guid = event->guid; + this->objectList = objectList; + guid = objectList->guid; } void ObjectPacket::Packet(RakNet::BitStream *bs, bool send) @@ -26,9 +26,9 @@ void ObjectPacket::Packet(RakNet::BitStream *bs, bool send) if (!PacketHeader(bs, send)) return; - for (auto &&worldObject : event->worldObjects) + for (auto &&baseObject : objectList->baseObjects) { - Object(worldObject, send); + Object(baseObject, send); } } @@ -36,37 +36,37 @@ bool ObjectPacket::PacketHeader(RakNet::BitStream *bs, bool send) { BasePacket::Packet(bs, send); - uint32_t worldObjectCount; + uint32_t baseObjectCount; if (send) - worldObjectCount = (uint32_t) (event->worldObjects.size()); + baseObjectCount = (uint32_t) (objectList->baseObjects.size()); - RW(worldObjectCount, send); + RW(baseObjectCount, send); - if (worldObjectCount > maxObjects) + if (baseObjectCount > maxObjects) { - event->isValid = false; + objectList->isValid = false; return false; } if (!send) { - event->worldObjects.clear(); - event->worldObjects.resize(worldObjectCount); + objectList->baseObjects.clear(); + objectList->baseObjects.resize(baseObjectCount); } if (hasCellData) { - RW(event->cell.mData, send, true); - RW(event->cell.mName, send, true); + RW(objectList->cell.mData, send, true); + RW(objectList->cell.mName, send, true); } return true; } -void ObjectPacket::Object(WorldObject &worldObject, bool send) +void ObjectPacket::Object(BaseObject &baseObject, bool send) { - RW(worldObject.refId, send); - RW(worldObject.refNumIndex, send); - RW(worldObject.mpNum, send); + RW(baseObject.refId, send); + RW(baseObject.refNumIndex, send); + RW(baseObject.mpNum, send); } diff --git a/components/openmw-mp/Packets/Object/ObjectPacket.hpp b/components/openmw-mp/Packets/Object/ObjectPacket.hpp index 7b99905bd..5481739e8 100644 --- a/components/openmw-mp/Packets/Object/ObjectPacket.hpp +++ b/components/openmw-mp/Packets/Object/ObjectPacket.hpp @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include @@ -19,14 +19,14 @@ namespace mwmp ~ObjectPacket() override = default; - void setEvent(BaseEvent *event); + void setObjectList(BaseObjectList *objectList); void Packet(RakNet::BitStream *bs, bool send) override; protected: - virtual void Object(WorldObject &worldObject, bool send); + virtual void Object(BaseObject &baseObject, bool send); bool PacketHeader(RakNet::BitStream *bs, bool send); - BaseEvent *event; + BaseObjectList *objectList; static const int maxObjects = 3000; bool hasCellData; }; diff --git a/components/openmw-mp/Packets/Object/PacketConsoleCommand.cpp b/components/openmw-mp/Packets/Object/PacketConsoleCommand.cpp index b48ec8958..a96281daf 100644 --- a/components/openmw-mp/Packets/Object/PacketConsoleCommand.cpp +++ b/components/openmw-mp/Packets/Object/PacketConsoleCommand.cpp @@ -13,16 +13,16 @@ void PacketConsoleCommand::Packet(RakNet::BitStream *bs, bool send) if (!PacketHeader(bs, send)) return; - RW(event->consoleCommand, send); + RW(objectList->consoleCommand, send); - WorldObject worldObject; - for (auto &&worldObject : event->worldObjects) + BaseObject baseObject; + for (auto &&baseObject : objectList->baseObjects) { - RW(worldObject.isPlayer, send); + RW(baseObject.isPlayer, send); - if (worldObject.isPlayer) - RW(worldObject.guid, send); + if (baseObject.isPlayer) + RW(baseObject.guid, send); else - Object(worldObject, send); + Object(baseObject, send); } } diff --git a/components/openmw-mp/Packets/Object/PacketContainer.cpp b/components/openmw-mp/Packets/Object/PacketContainer.cpp index 23bc908c9..53d34351d 100644 --- a/components/openmw-mp/Packets/Object/PacketContainer.cpp +++ b/components/openmw-mp/Packets/Object/PacketContainer.cpp @@ -15,34 +15,34 @@ void PacketContainer::Packet(RakNet::BitStream *bs, bool send) if (!PacketHeader(bs, send)) return; - RW(event->action, send); - RW(event->containerSubAction, send); + RW(objectList->action, send); + RW(objectList->containerSubAction, send); - for (auto &&worldObject : event->worldObjects) + for (auto &&baseObject : objectList->baseObjects) { - Object(worldObject, send); + Object(baseObject, send); if (send) { - worldObject.containerItemCount = (unsigned int) (worldObject.containerItems.size()); + baseObject.containerItemCount = (unsigned int) (baseObject.containerItems.size()); } - RW(worldObject.containerItemCount, send); + RW(baseObject.containerItemCount, send); if (!send) { - worldObject.containerItems.clear(); - worldObject.containerItems.resize(worldObject.containerItemCount); + baseObject.containerItems.clear(); + baseObject.containerItems.resize(baseObject.containerItemCount); } - if (worldObject.containerItemCount > maxObjects || worldObject.refId.empty() - || (worldObject.refNumIndex != 0 && worldObject.mpNum != 0)) + if (baseObject.containerItemCount > maxObjects || baseObject.refId.empty() + || (baseObject.refNumIndex != 0 && baseObject.mpNum != 0)) { - event->isValid = false; + objectList->isValid = false; return; } - for (auto &&containerItem: worldObject.containerItems) + for (auto &&containerItem: baseObject.containerItems) { RW(containerItem.refId, send); RW(containerItem.count, send); diff --git a/components/openmw-mp/Packets/Object/PacketDoorDestination.cpp b/components/openmw-mp/Packets/Object/PacketDoorDestination.cpp index 45717075b..5a2c9d43e 100644 --- a/components/openmw-mp/Packets/Object/PacketDoorDestination.cpp +++ b/components/openmw-mp/Packets/Object/PacketDoorDestination.cpp @@ -9,19 +9,19 @@ PacketDoorDestination::PacketDoorDestination(RakNet::RakPeerInterface *peer) : O hasCellData = true; } -void PacketDoorDestination::Object(WorldObject &worldObject, bool send) +void PacketDoorDestination::Object(BaseObject &baseObject, bool send) { - ObjectPacket::Object(worldObject, send); + ObjectPacket::Object(baseObject, send); - RW(worldObject.teleportState, send); + RW(baseObject.teleportState, send); - if (worldObject.teleportState) + if (baseObject.teleportState) { - RW(worldObject.destinationCell.mData, send, 1); - RW(worldObject.destinationCell.mName, send, 1); + RW(baseObject.destinationCell.mData, send, 1); + RW(baseObject.destinationCell.mName, send, 1); - RW(worldObject.destinationPosition.pos, send, 1); - RW(worldObject.destinationPosition.rot[0], send, 1); - RW(worldObject.destinationPosition.rot[2], send, 1); + RW(baseObject.destinationPosition.pos, send, 1); + RW(baseObject.destinationPosition.rot[0], send, 1); + RW(baseObject.destinationPosition.rot[2], send, 1); } } diff --git a/components/openmw-mp/Packets/Object/PacketDoorDestination.hpp b/components/openmw-mp/Packets/Object/PacketDoorDestination.hpp index 64d23cfae..079409d3f 100644 --- a/components/openmw-mp/Packets/Object/PacketDoorDestination.hpp +++ b/components/openmw-mp/Packets/Object/PacketDoorDestination.hpp @@ -10,7 +10,7 @@ namespace mwmp public: PacketDoorDestination(RakNet::RakPeerInterface *peer); - virtual void Object(WorldObject &worldObject, bool send); + virtual void Object(BaseObject &baseObject, bool send); }; } diff --git a/components/openmw-mp/Packets/Object/PacketDoorState.cpp b/components/openmw-mp/Packets/Object/PacketDoorState.cpp index 51bc92c6a..483b499d9 100644 --- a/components/openmw-mp/Packets/Object/PacketDoorState.cpp +++ b/components/openmw-mp/Packets/Object/PacketDoorState.cpp @@ -9,8 +9,8 @@ PacketDoorState::PacketDoorState(RakNet::RakPeerInterface *peer) : ObjectPacket( hasCellData = true; } -void PacketDoorState::Object(WorldObject &worldObject, bool send) +void PacketDoorState::Object(BaseObject &baseObject, bool send) { - ObjectPacket::Object(worldObject, send); - RW(worldObject.doorState, send); + ObjectPacket::Object(baseObject, send); + RW(baseObject.doorState, send); } diff --git a/components/openmw-mp/Packets/Object/PacketDoorState.hpp b/components/openmw-mp/Packets/Object/PacketDoorState.hpp index 0796aa89f..e1ffa728f 100644 --- a/components/openmw-mp/Packets/Object/PacketDoorState.hpp +++ b/components/openmw-mp/Packets/Object/PacketDoorState.hpp @@ -10,7 +10,7 @@ namespace mwmp public: explicit PacketDoorState(RakNet::RakPeerInterface *peer); - void Object(WorldObject &worldObject, bool send) override; + void Object(BaseObject &baseObject, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Object/PacketMusicPlay.cpp b/components/openmw-mp/Packets/Object/PacketMusicPlay.cpp index 3c5263697..2f5c0fc97 100644 --- a/components/openmw-mp/Packets/Object/PacketMusicPlay.cpp +++ b/components/openmw-mp/Packets/Object/PacketMusicPlay.cpp @@ -8,7 +8,7 @@ PacketMusicPlay::PacketMusicPlay(RakNet::RakPeerInterface *peer) : ObjectPacket( packetID = ID_MUSIC_PLAY; } -void PacketMusicPlay::Object(WorldObject &worldObject, bool send) +void PacketMusicPlay::Object(BaseObject &baseObject, bool send) { - RW(worldObject.filename, send); + RW(baseObject.filename, send); } diff --git a/components/openmw-mp/Packets/Object/PacketMusicPlay.hpp b/components/openmw-mp/Packets/Object/PacketMusicPlay.hpp index 773a003ed..774deee91 100644 --- a/components/openmw-mp/Packets/Object/PacketMusicPlay.hpp +++ b/components/openmw-mp/Packets/Object/PacketMusicPlay.hpp @@ -10,7 +10,7 @@ namespace mwmp public: explicit PacketMusicPlay(RakNet::RakPeerInterface *peer); - void Object(WorldObject &worldObject, bool send) override; + void Object(BaseObject &baseObject, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Object/PacketObjectAnimPlay.cpp b/components/openmw-mp/Packets/Object/PacketObjectAnimPlay.cpp index 5d641d940..7786416cc 100644 --- a/components/openmw-mp/Packets/Object/PacketObjectAnimPlay.cpp +++ b/components/openmw-mp/Packets/Object/PacketObjectAnimPlay.cpp @@ -9,9 +9,9 @@ PacketObjectAnimPlay::PacketObjectAnimPlay(RakNet::RakPeerInterface *peer) : Obj hasCellData = true; } -void PacketObjectAnimPlay::Object(WorldObject &worldObject, bool send) +void PacketObjectAnimPlay::Object(BaseObject &baseObject, bool send) { - ObjectPacket::Object(worldObject, send); - RW(worldObject.animGroup, send); - RW(worldObject.animMode, send); + ObjectPacket::Object(baseObject, send); + RW(baseObject.animGroup, send); + RW(baseObject.animMode, send); } diff --git a/components/openmw-mp/Packets/Object/PacketObjectAnimPlay.hpp b/components/openmw-mp/Packets/Object/PacketObjectAnimPlay.hpp index 5bfa1eee0..cfd4c6a98 100644 --- a/components/openmw-mp/Packets/Object/PacketObjectAnimPlay.hpp +++ b/components/openmw-mp/Packets/Object/PacketObjectAnimPlay.hpp @@ -10,7 +10,7 @@ namespace mwmp public: explicit PacketObjectAnimPlay(RakNet::RakPeerInterface *peer); - void Object(WorldObject &worldObject, bool send) override; + void Object(BaseObject &baseObject, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Object/PacketObjectAttach.cpp b/components/openmw-mp/Packets/Object/PacketObjectAttach.cpp index b96a4cf8f..6ec6b7b22 100644 --- a/components/openmw-mp/Packets/Object/PacketObjectAttach.cpp +++ b/components/openmw-mp/Packets/Object/PacketObjectAttach.cpp @@ -9,8 +9,8 @@ PacketObjectAttach::PacketObjectAttach(RakNet::RakPeerInterface *peer) : ObjectP hasCellData = true; } -void PacketObjectAttach::Object(WorldObject &worldObject, bool send) +void PacketObjectAttach::Object(BaseObject &baseObject, bool send) { - ObjectPacket::Object(worldObject, send); + ObjectPacket::Object(baseObject, send); // Placeholder } diff --git a/components/openmw-mp/Packets/Object/PacketObjectAttach.hpp b/components/openmw-mp/Packets/Object/PacketObjectAttach.hpp index 680dc57f7..e03a331f0 100644 --- a/components/openmw-mp/Packets/Object/PacketObjectAttach.hpp +++ b/components/openmw-mp/Packets/Object/PacketObjectAttach.hpp @@ -10,7 +10,7 @@ namespace mwmp public: PacketObjectAttach(RakNet::RakPeerInterface *peer); - virtual void Object(WorldObject &worldObject, bool send); + virtual void Object(BaseObject &baseObject, bool send); }; } diff --git a/components/openmw-mp/Packets/Object/PacketObjectCollision.cpp b/components/openmw-mp/Packets/Object/PacketObjectCollision.cpp index 50d72e298..fbf1e339d 100644 --- a/components/openmw-mp/Packets/Object/PacketObjectCollision.cpp +++ b/components/openmw-mp/Packets/Object/PacketObjectCollision.cpp @@ -9,8 +9,8 @@ PacketObjectCollision::PacketObjectCollision(RakNet::RakPeerInterface *peer) : O hasCellData = true; } -void PacketObjectCollision::Object(WorldObject &worldObject, bool send) +void PacketObjectCollision::Object(BaseObject &baseObject, bool send) { - ObjectPacket::Object(worldObject, send); + ObjectPacket::Object(baseObject, send); // Placeholder } diff --git a/components/openmw-mp/Packets/Object/PacketObjectCollision.hpp b/components/openmw-mp/Packets/Object/PacketObjectCollision.hpp index 74bd1a085..ddaca261e 100644 --- a/components/openmw-mp/Packets/Object/PacketObjectCollision.hpp +++ b/components/openmw-mp/Packets/Object/PacketObjectCollision.hpp @@ -10,7 +10,7 @@ namespace mwmp public: PacketObjectCollision(RakNet::RakPeerInterface *peer); - virtual void Object(WorldObject &worldObject, bool send); + virtual void Object(BaseObject &baseObject, bool send); }; } diff --git a/components/openmw-mp/Packets/Object/PacketObjectLock.cpp b/components/openmw-mp/Packets/Object/PacketObjectLock.cpp index 9daf1d098..1880db92d 100644 --- a/components/openmw-mp/Packets/Object/PacketObjectLock.cpp +++ b/components/openmw-mp/Packets/Object/PacketObjectLock.cpp @@ -9,8 +9,8 @@ PacketObjectLock::PacketObjectLock(RakNet::RakPeerInterface *peer) : ObjectPacke hasCellData = true; } -void PacketObjectLock::Object(WorldObject &worldObject, bool send) +void PacketObjectLock::Object(BaseObject &baseObject, bool send) { - ObjectPacket::Object(worldObject, send); - RW(worldObject.lockLevel, send); + ObjectPacket::Object(baseObject, send); + RW(baseObject.lockLevel, send); } diff --git a/components/openmw-mp/Packets/Object/PacketObjectLock.hpp b/components/openmw-mp/Packets/Object/PacketObjectLock.hpp index 01eda365d..8585c3b87 100644 --- a/components/openmw-mp/Packets/Object/PacketObjectLock.hpp +++ b/components/openmw-mp/Packets/Object/PacketObjectLock.hpp @@ -10,7 +10,7 @@ namespace mwmp public: explicit PacketObjectLock(RakNet::RakPeerInterface *peer); - void Object(WorldObject &worldObject, bool send) override; + void Object(BaseObject &baseObject, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Object/PacketObjectMove.cpp b/components/openmw-mp/Packets/Object/PacketObjectMove.cpp index 4c043ebbf..fd46e0a43 100644 --- a/components/openmw-mp/Packets/Object/PacketObjectMove.cpp +++ b/components/openmw-mp/Packets/Object/PacketObjectMove.cpp @@ -9,8 +9,8 @@ PacketObjectMove::PacketObjectMove(RakNet::RakPeerInterface *peer) : ObjectPacke hasCellData = true; } -void PacketObjectMove::Object(WorldObject &worldObject, bool send) +void PacketObjectMove::Object(BaseObject &baseObject, bool send) { - ObjectPacket::Object(worldObject, send); - RW(worldObject.position.pos, send); + ObjectPacket::Object(baseObject, send); + RW(baseObject.position.pos, send); } diff --git a/components/openmw-mp/Packets/Object/PacketObjectMove.hpp b/components/openmw-mp/Packets/Object/PacketObjectMove.hpp index 78a0dd7a8..a586bd0db 100644 --- a/components/openmw-mp/Packets/Object/PacketObjectMove.hpp +++ b/components/openmw-mp/Packets/Object/PacketObjectMove.hpp @@ -10,7 +10,7 @@ namespace mwmp public: explicit PacketObjectMove(RakNet::RakPeerInterface *peer); - void Object(WorldObject &worldObject, bool send) override; + void Object(BaseObject &baseObject, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Object/PacketObjectPlace.cpp b/components/openmw-mp/Packets/Object/PacketObjectPlace.cpp index 2bc4682c3..2c65bee41 100644 --- a/components/openmw-mp/Packets/Object/PacketObjectPlace.cpp +++ b/components/openmw-mp/Packets/Object/PacketObjectPlace.cpp @@ -9,13 +9,13 @@ PacketObjectPlace::PacketObjectPlace(RakNet::RakPeerInterface *peer) : ObjectPac hasCellData = true; } -void PacketObjectPlace::Object(WorldObject &worldObject, bool send) +void PacketObjectPlace::Object(BaseObject &baseObject, bool send) { - ObjectPacket::Object(worldObject, send); - RW(worldObject.count, send); - RW(worldObject.charge, send); - RW(worldObject.enchantmentCharge, send); - RW(worldObject.goldValue, send); - RW(worldObject.position, send); - RW(worldObject.droppedByPlayer, send); + ObjectPacket::Object(baseObject, send); + RW(baseObject.count, send); + RW(baseObject.charge, send); + RW(baseObject.enchantmentCharge, send); + RW(baseObject.goldValue, send); + RW(baseObject.position, send); + RW(baseObject.droppedByPlayer, send); } diff --git a/components/openmw-mp/Packets/Object/PacketObjectPlace.hpp b/components/openmw-mp/Packets/Object/PacketObjectPlace.hpp index bb3a5de1d..baf69d260 100644 --- a/components/openmw-mp/Packets/Object/PacketObjectPlace.hpp +++ b/components/openmw-mp/Packets/Object/PacketObjectPlace.hpp @@ -10,7 +10,7 @@ namespace mwmp public: explicit PacketObjectPlace(RakNet::RakPeerInterface *peer); - void Object(WorldObject &worldObject, bool send) override; + void Object(BaseObject &baseObject, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Object/PacketObjectReset.cpp b/components/openmw-mp/Packets/Object/PacketObjectReset.cpp index 1d9b81635..2fc9230a9 100644 --- a/components/openmw-mp/Packets/Object/PacketObjectReset.cpp +++ b/components/openmw-mp/Packets/Object/PacketObjectReset.cpp @@ -9,8 +9,8 @@ PacketObjectReset::PacketObjectReset(RakNet::RakPeerInterface *peer) : ObjectPac hasCellData = true; } -void PacketObjectReset::Object(WorldObject &worldObject, bool send) +void PacketObjectReset::Object(BaseObject &baseObject, bool send) { - ObjectPacket::Object(worldObject, send); + ObjectPacket::Object(baseObject, send); // Placeholder } diff --git a/components/openmw-mp/Packets/Object/PacketObjectReset.hpp b/components/openmw-mp/Packets/Object/PacketObjectReset.hpp index 32c0deb5f..5040c5b0b 100644 --- a/components/openmw-mp/Packets/Object/PacketObjectReset.hpp +++ b/components/openmw-mp/Packets/Object/PacketObjectReset.hpp @@ -10,7 +10,7 @@ namespace mwmp public: PacketObjectReset(RakNet::RakPeerInterface *peer); - virtual void Object(WorldObject &worldObject, bool send); + virtual void Object(BaseObject &baseObject, bool send); }; } diff --git a/components/openmw-mp/Packets/Object/PacketObjectRotate.cpp b/components/openmw-mp/Packets/Object/PacketObjectRotate.cpp index c7665ab4e..40756fa9d 100644 --- a/components/openmw-mp/Packets/Object/PacketObjectRotate.cpp +++ b/components/openmw-mp/Packets/Object/PacketObjectRotate.cpp @@ -9,10 +9,10 @@ PacketObjectRotate::PacketObjectRotate(RakNet::RakPeerInterface *peer) : ObjectP hasCellData = true; } -void PacketObjectRotate::Object(WorldObject &worldObject, bool send) +void PacketObjectRotate::Object(BaseObject &baseObject, bool send) { - ObjectPacket::Object(worldObject, send); - RW(worldObject.position.rot[0], send); - RW(worldObject.position.rot[1], send); - RW(worldObject.position.rot[2], send); + ObjectPacket::Object(baseObject, send); + RW(baseObject.position.rot[0], send); + RW(baseObject.position.rot[1], send); + RW(baseObject.position.rot[2], send); } diff --git a/components/openmw-mp/Packets/Object/PacketObjectRotate.hpp b/components/openmw-mp/Packets/Object/PacketObjectRotate.hpp index e7f5438c6..021ef8c19 100644 --- a/components/openmw-mp/Packets/Object/PacketObjectRotate.hpp +++ b/components/openmw-mp/Packets/Object/PacketObjectRotate.hpp @@ -10,7 +10,7 @@ namespace mwmp public: explicit PacketObjectRotate(RakNet::RakPeerInterface *peer); - void Object(WorldObject &worldObject, bool send) override; + void Object(BaseObject &baseObject, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Object/PacketObjectScale.cpp b/components/openmw-mp/Packets/Object/PacketObjectScale.cpp index 5483e39c5..7698ac335 100644 --- a/components/openmw-mp/Packets/Object/PacketObjectScale.cpp +++ b/components/openmw-mp/Packets/Object/PacketObjectScale.cpp @@ -9,8 +9,8 @@ PacketObjectScale::PacketObjectScale(RakNet::RakPeerInterface *peer) : ObjectPac hasCellData = true; } -void PacketObjectScale::Object(WorldObject &worldObject, bool send) +void PacketObjectScale::Object(BaseObject &baseObject, bool send) { - ObjectPacket::Object(worldObject, send); - RW(worldObject.scale, send); + ObjectPacket::Object(baseObject, send); + RW(baseObject.scale, send); } diff --git a/components/openmw-mp/Packets/Object/PacketObjectScale.hpp b/components/openmw-mp/Packets/Object/PacketObjectScale.hpp index 9e47734d9..d99b584a8 100644 --- a/components/openmw-mp/Packets/Object/PacketObjectScale.hpp +++ b/components/openmw-mp/Packets/Object/PacketObjectScale.hpp @@ -10,7 +10,7 @@ namespace mwmp public: explicit PacketObjectScale(RakNet::RakPeerInterface *peer); - void Object(WorldObject &worldObject, bool send) override; + void Object(BaseObject &baseObject, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Object/PacketObjectSpawn.cpp b/components/openmw-mp/Packets/Object/PacketObjectSpawn.cpp index 00e686e13..0b5de8111 100644 --- a/components/openmw-mp/Packets/Object/PacketObjectSpawn.cpp +++ b/components/openmw-mp/Packets/Object/PacketObjectSpawn.cpp @@ -9,26 +9,26 @@ PacketObjectSpawn::PacketObjectSpawn(RakNet::RakPeerInterface *peer) : ObjectPac hasCellData = true; } -void PacketObjectSpawn::Object(WorldObject &worldObject, bool send) +void PacketObjectSpawn::Object(BaseObject &baseObject, bool send) { - ObjectPacket::Object(worldObject, send); - RW(worldObject.position, send); + ObjectPacket::Object(baseObject, send); + RW(baseObject.position, send); - RW(worldObject.hasMaster, send); + RW(baseObject.hasMaster, send); - if (worldObject.hasMaster) + if (baseObject.hasMaster) { - RW(worldObject.master.isPlayer, send); + RW(baseObject.master.isPlayer, send); - if (worldObject.master.isPlayer) + if (baseObject.master.isPlayer) { - RW(worldObject.master.guid, send); + RW(baseObject.master.guid, send); } else { - RW(worldObject.master.refId, send, 1); - RW(worldObject.master.refNumIndex, send); - RW(worldObject.master.mpNum, send); + RW(baseObject.master.refId, send, 1); + RW(baseObject.master.refNumIndex, send); + RW(baseObject.master.mpNum, send); } } } diff --git a/components/openmw-mp/Packets/Object/PacketObjectSpawn.hpp b/components/openmw-mp/Packets/Object/PacketObjectSpawn.hpp index 0520ee4c6..f55639687 100644 --- a/components/openmw-mp/Packets/Object/PacketObjectSpawn.hpp +++ b/components/openmw-mp/Packets/Object/PacketObjectSpawn.hpp @@ -10,7 +10,7 @@ namespace mwmp public: explicit PacketObjectSpawn(RakNet::RakPeerInterface *peer); - void Object(WorldObject &worldObject, bool send) override; + void Object(BaseObject &baseObject, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Object/PacketObjectState.cpp b/components/openmw-mp/Packets/Object/PacketObjectState.cpp index 1ca4dc338..b122f8b8b 100644 --- a/components/openmw-mp/Packets/Object/PacketObjectState.cpp +++ b/components/openmw-mp/Packets/Object/PacketObjectState.cpp @@ -9,8 +9,8 @@ PacketObjectState::PacketObjectState(RakNet::RakPeerInterface *peer) : ObjectPac hasCellData = true; } -void PacketObjectState::Object(WorldObject &worldObject, bool send) +void PacketObjectState::Object(BaseObject &baseObject, bool send) { - ObjectPacket::Object(worldObject, send); - RW(worldObject.objectState, send); + ObjectPacket::Object(baseObject, send); + RW(baseObject.objectState, send); } diff --git a/components/openmw-mp/Packets/Object/PacketObjectState.hpp b/components/openmw-mp/Packets/Object/PacketObjectState.hpp index fc177f1e3..aa540e547 100644 --- a/components/openmw-mp/Packets/Object/PacketObjectState.hpp +++ b/components/openmw-mp/Packets/Object/PacketObjectState.hpp @@ -10,7 +10,7 @@ namespace mwmp public: explicit PacketObjectState(RakNet::RakPeerInterface *peer); - void Object(WorldObject &worldObject, bool send) override; + void Object(BaseObject &baseObject, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Object/PacketObjectTrap.cpp b/components/openmw-mp/Packets/Object/PacketObjectTrap.cpp index 832618c91..36b884862 100644 --- a/components/openmw-mp/Packets/Object/PacketObjectTrap.cpp +++ b/components/openmw-mp/Packets/Object/PacketObjectTrap.cpp @@ -9,11 +9,11 @@ PacketObjectTrap::PacketObjectTrap(RakNet::RakPeerInterface *peer) : ObjectPacke hasCellData = true; } -void PacketObjectTrap::Object(WorldObject &worldObject, bool send) +void PacketObjectTrap::Object(BaseObject &baseObject, bool send) { - ObjectPacket::Object(worldObject, send); - RW(worldObject.isDisarmed, send); + ObjectPacket::Object(baseObject, send); + RW(baseObject.isDisarmed, send); - if (!worldObject.isDisarmed) - RW(worldObject.position, send); + if (!baseObject.isDisarmed) + RW(baseObject.position, send); } diff --git a/components/openmw-mp/Packets/Object/PacketObjectTrap.hpp b/components/openmw-mp/Packets/Object/PacketObjectTrap.hpp index af1dd5d05..10bbc7319 100644 --- a/components/openmw-mp/Packets/Object/PacketObjectTrap.hpp +++ b/components/openmw-mp/Packets/Object/PacketObjectTrap.hpp @@ -10,7 +10,7 @@ namespace mwmp public: explicit PacketObjectTrap(RakNet::RakPeerInterface *peer); - void Object(WorldObject &worldObject, bool send) override; + void Object(BaseObject &baseObject, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Object/PacketScriptGlobalFloat.cpp b/components/openmw-mp/Packets/Object/PacketScriptGlobalFloat.cpp index 5c6c39756..7fa837382 100644 --- a/components/openmw-mp/Packets/Object/PacketScriptGlobalFloat.cpp +++ b/components/openmw-mp/Packets/Object/PacketScriptGlobalFloat.cpp @@ -8,8 +8,8 @@ PacketScriptGlobalFloat::PacketScriptGlobalFloat(RakNet::RakPeerInterface *peer) packetID = ID_SCRIPT_GLOBAL_FLOAT; } -void PacketScriptGlobalFloat::Object(WorldObject &worldObject, bool send) +void PacketScriptGlobalFloat::Object(BaseObject &baseObject, bool send) { - RW(worldObject.varName, send); - RW(worldObject.floatVal, send); + RW(baseObject.varName, send); + RW(baseObject.floatVal, send); } diff --git a/components/openmw-mp/Packets/Object/PacketScriptGlobalFloat.hpp b/components/openmw-mp/Packets/Object/PacketScriptGlobalFloat.hpp index 9c59099b8..5b1e8ed63 100644 --- a/components/openmw-mp/Packets/Object/PacketScriptGlobalFloat.hpp +++ b/components/openmw-mp/Packets/Object/PacketScriptGlobalFloat.hpp @@ -10,7 +10,7 @@ namespace mwmp public: PacketScriptGlobalFloat(RakNet::RakPeerInterface *peer); - virtual void Object(WorldObject &worldObject, bool send); + virtual void Object(BaseObject &baseObject, bool send); }; } diff --git a/components/openmw-mp/Packets/Object/PacketScriptGlobalShort.cpp b/components/openmw-mp/Packets/Object/PacketScriptGlobalShort.cpp index f30f49bba..3f94d8cbf 100644 --- a/components/openmw-mp/Packets/Object/PacketScriptGlobalShort.cpp +++ b/components/openmw-mp/Packets/Object/PacketScriptGlobalShort.cpp @@ -8,8 +8,8 @@ PacketScriptGlobalShort::PacketScriptGlobalShort(RakNet::RakPeerInterface *peer) packetID = ID_SCRIPT_GLOBAL_SHORT; } -void PacketScriptGlobalShort::Object(WorldObject &worldObject, bool send) +void PacketScriptGlobalShort::Object(BaseObject &baseObject, bool send) { - RW(worldObject.varName, send); - RW(worldObject.shortVal, send); + RW(baseObject.varName, send); + RW(baseObject.shortVal, send); } diff --git a/components/openmw-mp/Packets/Object/PacketScriptGlobalShort.hpp b/components/openmw-mp/Packets/Object/PacketScriptGlobalShort.hpp index ce7157c40..b1e74cd72 100644 --- a/components/openmw-mp/Packets/Object/PacketScriptGlobalShort.hpp +++ b/components/openmw-mp/Packets/Object/PacketScriptGlobalShort.hpp @@ -10,7 +10,7 @@ namespace mwmp public: explicit PacketScriptGlobalShort(RakNet::RakPeerInterface *peer); - void Object(WorldObject &worldObject, bool send) override; + void Object(BaseObject &baseObject, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Object/PacketScriptLocalFloat.cpp b/components/openmw-mp/Packets/Object/PacketScriptLocalFloat.cpp index 32eb34d21..45d256733 100644 --- a/components/openmw-mp/Packets/Object/PacketScriptLocalFloat.cpp +++ b/components/openmw-mp/Packets/Object/PacketScriptLocalFloat.cpp @@ -9,9 +9,9 @@ PacketScriptLocalFloat::PacketScriptLocalFloat(RakNet::RakPeerInterface *peer) : hasCellData = true; } -void PacketScriptLocalFloat::Object(WorldObject &worldObject, bool send) +void PacketScriptLocalFloat::Object(BaseObject &baseObject, bool send) { - ObjectPacket::Object(worldObject, send); - RW(worldObject.index, send); - RW(worldObject.floatVal, send); + ObjectPacket::Object(baseObject, send); + RW(baseObject.index, send); + RW(baseObject.floatVal, send); } diff --git a/components/openmw-mp/Packets/Object/PacketScriptLocalFloat.hpp b/components/openmw-mp/Packets/Object/PacketScriptLocalFloat.hpp index 04e66ac32..330c51097 100644 --- a/components/openmw-mp/Packets/Object/PacketScriptLocalFloat.hpp +++ b/components/openmw-mp/Packets/Object/PacketScriptLocalFloat.hpp @@ -10,7 +10,7 @@ namespace mwmp public: explicit PacketScriptLocalFloat(RakNet::RakPeerInterface *peer); - void Object(WorldObject &worldObject, bool send) override; + void Object(BaseObject &baseObject, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Object/PacketScriptLocalShort.cpp b/components/openmw-mp/Packets/Object/PacketScriptLocalShort.cpp index ae6b7caca..b2315592c 100644 --- a/components/openmw-mp/Packets/Object/PacketScriptLocalShort.cpp +++ b/components/openmw-mp/Packets/Object/PacketScriptLocalShort.cpp @@ -9,9 +9,9 @@ PacketScriptLocalShort::PacketScriptLocalShort(RakNet::RakPeerInterface *peer) : hasCellData = true; } -void PacketScriptLocalShort::Object(WorldObject &worldObject, bool send) +void PacketScriptLocalShort::Object(BaseObject &baseObject, bool send) { - ObjectPacket::Object(worldObject, send); - RW(worldObject.index, send); - RW(worldObject.shortVal, send); + ObjectPacket::Object(baseObject, send); + RW(baseObject.index, send); + RW(baseObject.shortVal, send); } diff --git a/components/openmw-mp/Packets/Object/PacketScriptLocalShort.hpp b/components/openmw-mp/Packets/Object/PacketScriptLocalShort.hpp index 52e169039..d2375c9d9 100644 --- a/components/openmw-mp/Packets/Object/PacketScriptLocalShort.hpp +++ b/components/openmw-mp/Packets/Object/PacketScriptLocalShort.hpp @@ -10,7 +10,7 @@ namespace mwmp public: explicit PacketScriptLocalShort(RakNet::RakPeerInterface *peer); - void Object(WorldObject &obj, bool send) override; + void Object(BaseObject &obj, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Object/PacketScriptMemberFloat.cpp b/components/openmw-mp/Packets/Object/PacketScriptMemberFloat.cpp index 187ff9d3f..eae7644c8 100644 --- a/components/openmw-mp/Packets/Object/PacketScriptMemberFloat.cpp +++ b/components/openmw-mp/Packets/Object/PacketScriptMemberFloat.cpp @@ -8,9 +8,9 @@ PacketScriptMemberFloat::PacketScriptMemberFloat(RakNet::RakPeerInterface *peer) packetID = ID_SCRIPT_MEMBER_FLOAT; } -void PacketScriptMemberFloat::Object(WorldObject &worldObject, bool send) +void PacketScriptMemberFloat::Object(BaseObject &baseObject, bool send) { - RW(worldObject.refId, send); - RW(worldObject.index, send); - RW(worldObject.floatVal, send); + RW(baseObject.refId, send); + RW(baseObject.index, send); + RW(baseObject.floatVal, send); } diff --git a/components/openmw-mp/Packets/Object/PacketScriptMemberFloat.hpp b/components/openmw-mp/Packets/Object/PacketScriptMemberFloat.hpp index ccd7a49be..270fed933 100644 --- a/components/openmw-mp/Packets/Object/PacketScriptMemberFloat.hpp +++ b/components/openmw-mp/Packets/Object/PacketScriptMemberFloat.hpp @@ -10,7 +10,7 @@ namespace mwmp public: PacketScriptMemberFloat(RakNet::RakPeerInterface *peer); - virtual void Object(WorldObject &obj, bool send); + virtual void Object(BaseObject &obj, bool send); }; } diff --git a/components/openmw-mp/Packets/Object/PacketScriptMemberShort.cpp b/components/openmw-mp/Packets/Object/PacketScriptMemberShort.cpp index e7d038a7e..8cae9ab07 100644 --- a/components/openmw-mp/Packets/Object/PacketScriptMemberShort.cpp +++ b/components/openmw-mp/Packets/Object/PacketScriptMemberShort.cpp @@ -8,9 +8,9 @@ PacketScriptMemberShort::PacketScriptMemberShort(RakNet::RakPeerInterface *peer) packetID = ID_SCRIPT_MEMBER_SHORT; } -void PacketScriptMemberShort::Object(WorldObject &worldObject, bool send) +void PacketScriptMemberShort::Object(BaseObject &baseObject, bool send) { - RW(worldObject.refId, send); - RW(worldObject.index, send); - RW(worldObject.shortVal, send); + RW(baseObject.refId, send); + RW(baseObject.index, send); + RW(baseObject.shortVal, send); } diff --git a/components/openmw-mp/Packets/Object/PacketScriptMemberShort.hpp b/components/openmw-mp/Packets/Object/PacketScriptMemberShort.hpp index 38588a808..d4135f5a7 100644 --- a/components/openmw-mp/Packets/Object/PacketScriptMemberShort.hpp +++ b/components/openmw-mp/Packets/Object/PacketScriptMemberShort.hpp @@ -10,7 +10,7 @@ namespace mwmp public: explicit PacketScriptMemberShort(RakNet::RakPeerInterface *peer); - void Object(WorldObject &obj, bool send) override; + void Object(BaseObject &obj, bool send) override; }; } diff --git a/components/openmw-mp/Packets/Object/PacketVideoPlay.cpp b/components/openmw-mp/Packets/Object/PacketVideoPlay.cpp index d0cae224b..5db172bf9 100644 --- a/components/openmw-mp/Packets/Object/PacketVideoPlay.cpp +++ b/components/openmw-mp/Packets/Object/PacketVideoPlay.cpp @@ -8,8 +8,8 @@ PacketVideoPlay::PacketVideoPlay(RakNet::RakPeerInterface *peer) : ObjectPacket( packetID = ID_VIDEO_PLAY; } -void PacketVideoPlay::Object(WorldObject &worldObject, bool send) +void PacketVideoPlay::Object(BaseObject &baseObject, bool send) { - RW(worldObject.filename, send); - RW(worldObject.allowSkipping, send); + RW(baseObject.filename, send); + RW(baseObject.allowSkipping, send); } diff --git a/components/openmw-mp/Packets/Object/PacketVideoPlay.hpp b/components/openmw-mp/Packets/Object/PacketVideoPlay.hpp index dffc355f8..449f6ae08 100644 --- a/components/openmw-mp/Packets/Object/PacketVideoPlay.hpp +++ b/components/openmw-mp/Packets/Object/PacketVideoPlay.hpp @@ -10,7 +10,7 @@ namespace mwmp public: explicit PacketVideoPlay(RakNet::RakPeerInterface *peer); - void Object(WorldObject &obj, bool send) override; + void Object(BaseObject &obj, bool send) override; }; }