diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index 6bdad16ed..2e90a5a7a 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -96,7 +96,7 @@ add_openmw_dir (mwbase inputmanager windowmanager statemanager ) -add_openmw_dir (mwmp DedicatedPlayer LocalEvent LocalPlayer Networking Main GUIChat GUILogin GUIController PlayerMarkerCollection GUIDialogList WorldController) +add_openmw_dir (mwmp DedicatedPlayer WorldEvent LocalPlayer Networking Main GUIChat GUILogin GUIController PlayerMarkerCollection GUIDialogList WorldController) # Main executable diff --git a/apps/openmw/mwgui/container.cpp b/apps/openmw/mwgui/container.cpp index fdd0bae52..3c1b4961b 100644 --- a/apps/openmw/mwgui/container.cpp +++ b/apps/openmw/mwgui/container.cpp @@ -6,7 +6,7 @@ #include #include "../mwmp/Main.hpp" #include "../mwmp/Networking.hpp" -#include "../mwmp/LocalEvent.hpp" +#include "../mwmp/WorldEvent.hpp" #include "../mwmp/WorldController.hpp" #include "../mwbase/environment.hpp" @@ -102,7 +102,7 @@ namespace MWGui return; // Added by tes3mp - mwmp::LocalEvent *event = mwmp::Main::get().getNetworking()->createLocalEvent(); + mwmp::WorldEvent *event = mwmp::Main::get().getNetworking()->createWorldEvent(); event->cell = *mPtr.getCell()->getCell(); mwmp::WorldObject worldObject; @@ -155,7 +155,7 @@ namespace MWGui } // Added by tes3mp - mwmp::LocalEvent *event = mwmp::Main::get().getNetworking()->createLocalEvent(); + mwmp::WorldEvent *event = mwmp::Main::get().getNetworking()->createWorldEvent(); event->cell = *mPtr.getCell()->getCell(); mwmp::WorldObject worldObject; @@ -301,7 +301,7 @@ namespace MWGui MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Container); // Added by tes3mp - mwmp::LocalEvent *event = mwmp::Main::get().getNetworking()->createLocalEvent(); + mwmp::WorldEvent *event = mwmp::Main::get().getNetworking()->createWorldEvent(); event->cell = *mPtr.getCell()->getCell(); mwmp::WorldObject worldObject; diff --git a/apps/openmw/mwgui/hud.cpp b/apps/openmw/mwgui/hud.cpp index f22139d3f..c8a627459 100644 --- a/apps/openmw/mwgui/hud.cpp +++ b/apps/openmw/mwgui/hud.cpp @@ -2,7 +2,7 @@ #include "../mwmp/Main.hpp" #include "../mwmp/Networking.hpp" -#include "../mwmp/LocalEvent.hpp" +#include "../mwmp/WorldEvent.hpp" #include "../mwmp/LocalPlayer.hpp" #include "../mwworld/cellstore.hpp" @@ -67,7 +67,7 @@ namespace MWGui dropped.getCellRef().setRefNumIndex(cellStore->getLastRefNumIndex()); // Added by tes3mp - mwmp::LocalEvent *event = mwmp::Main::get().getNetworking()->createLocalEvent(); + mwmp::WorldEvent *event = mwmp::Main::get().getNetworking()->createWorldEvent(); event->cell = *dropped.getCell()->getCell(); mwmp::WorldObject worldObject; diff --git a/apps/openmw/mwgui/inventorywindow.cpp b/apps/openmw/mwgui/inventorywindow.cpp index b477bf2b4..22c2356c8 100644 --- a/apps/openmw/mwgui/inventorywindow.cpp +++ b/apps/openmw/mwgui/inventorywindow.cpp @@ -18,7 +18,7 @@ #include "../mwmp/Main.hpp" #include "../mwmp/Networking.hpp" -#include "../mwmp/LocalEvent.hpp" +#include "../mwmp/WorldEvent.hpp" #include "../mwmp/LocalPlayer.hpp" #include "../mwworld/cellstore.hpp" @@ -636,7 +636,7 @@ namespace MWGui MWWorld::Ptr newObject = *player.getClass().getContainerStore (player).add (object, object.getRefData().getCount(), player); // Added by tes3mp - mwmp::LocalEvent *event = mwmp::Main::get().getNetworking()->createLocalEvent(); + mwmp::WorldEvent *event = mwmp::Main::get().getNetworking()->createWorldEvent(); event->cell = *object.getCell()->getCell(); mwmp::WorldObject worldObject; diff --git a/apps/openmw/mwmechanics/security.cpp b/apps/openmw/mwmechanics/security.cpp index 82905ee4a..8bf44dafd 100644 --- a/apps/openmw/mwmechanics/security.cpp +++ b/apps/openmw/mwmechanics/security.cpp @@ -2,7 +2,7 @@ #include "../mwmp/Main.hpp" #include "../mwmp/Networking.hpp" -#include "../mwmp/LocalEvent.hpp" +#include "../mwmp/WorldEvent.hpp" #include "../mwworld/cellstore.hpp" @@ -59,7 +59,7 @@ namespace MWMechanics if (Misc::Rng::roll0to99() <= x) { // Added by tes3mp - mwmp::LocalEvent *event = mwmp::Main::get().getNetworking()->createLocalEvent(); + mwmp::WorldEvent *event = mwmp::Main::get().getNetworking()->createWorldEvent(); event->cell = *lock.getCell()->getCell(); mwmp::WorldObject worldObject; diff --git a/apps/openmw/mwmp/Networking.cpp b/apps/openmw/mwmp/Networking.cpp index 1f1cf532e..889c4abc1 100644 --- a/apps/openmw/mwmp/Networking.cpp +++ b/apps/openmw/mwmp/Networking.cpp @@ -734,7 +734,7 @@ void Networking::processWorldPacket(RakNet::Packet *packet) pl = Players::getPlayer(guid); WorldPacket *myPacket = worldController.GetPacket(packet->data[0]); - LocalEvent *event = new LocalEvent(guid); + WorldEvent *event = new WorldEvent(guid); myPacket->Packet(&bsIn, event, false); switch (packet->data[0]) @@ -935,9 +935,9 @@ LocalPlayer *Networking::getLocalPlayer() return mwmp::Main::get().getLocalPlayer(); } -LocalEvent *Networking::createLocalEvent() +WorldEvent *Networking::createWorldEvent() { - return new LocalEvent(getLocalPlayer()->guid); + return new WorldEvent(getLocalPlayer()->guid); } bool Networking::isDedicatedPlayer(const MWWorld::Ptr &ptr) diff --git a/apps/openmw/mwmp/Networking.hpp b/apps/openmw/mwmp/Networking.hpp index 699a75302..9a589e389 100644 --- a/apps/openmw/mwmp/Networking.hpp +++ b/apps/openmw/mwmp/Networking.hpp @@ -9,7 +9,7 @@ #include #include -#include "LocalEvent.hpp" +#include "WorldEvent.hpp" #include #include #include @@ -40,7 +40,7 @@ namespace mwmp bool isConnected(); - LocalEvent *createLocalEvent(); + WorldEvent *createWorldEvent(); private: bool connected; diff --git a/apps/openmw/mwmp/LocalEvent.cpp b/apps/openmw/mwmp/WorldEvent.cpp similarity index 92% rename from apps/openmw/mwmp/LocalEvent.cpp rename to apps/openmw/mwmp/WorldEvent.cpp index f06afb047..9d1d316e0 100644 --- a/apps/openmw/mwmp/LocalEvent.cpp +++ b/apps/openmw/mwmp/WorldEvent.cpp @@ -1,4 +1,4 @@ -#include "LocalEvent.hpp" +#include "WorldEvent.hpp" #include "Main.hpp" #include "Networking.hpp" #include "LocalPlayer.hpp" @@ -20,32 +20,32 @@ using namespace mwmp; using namespace std; -LocalEvent::LocalEvent(RakNet::RakNetGUID guid) +WorldEvent::WorldEvent(RakNet::RakNetGUID guid) { this->guid = guid; } -LocalEvent::~LocalEvent() +WorldEvent::~WorldEvent() { } -Networking *LocalEvent::getNetworking() +Networking *WorldEvent::getNetworking() { return mwmp::Main::get().getNetworking(); } -void LocalEvent::addObject(WorldObject worldObject) +void WorldEvent::addObject(WorldObject worldObject) { objectChanges.objects.push_back(worldObject); } -void LocalEvent::addContainerItem(ContainerItem containerItem) +void WorldEvent::addContainerItem(ContainerItem containerItem) { containerChanges.items.push_back(containerItem); } -void LocalEvent::editContainer(MWWorld::CellStore* cellStore) +void WorldEvent::editContainer(MWWorld::CellStore* cellStore) { WorldObject worldObject; @@ -103,7 +103,7 @@ void LocalEvent::editContainer(MWWorld::CellStore* cellStore) } } -void LocalEvent::placeObjects(MWWorld::CellStore* cellStore) +void WorldEvent::placeObjects(MWWorld::CellStore* cellStore) { WorldObject worldObject; @@ -141,7 +141,7 @@ void LocalEvent::placeObjects(MWWorld::CellStore* cellStore) } } -void LocalEvent::deleteObjects(MWWorld::CellStore* cellStore) +void WorldEvent::deleteObjects(MWWorld::CellStore* cellStore) { WorldObject worldObject; @@ -167,7 +167,7 @@ void LocalEvent::deleteObjects(MWWorld::CellStore* cellStore) } } -void LocalEvent::lockObjects(MWWorld::CellStore* cellStore) +void WorldEvent::lockObjects(MWWorld::CellStore* cellStore) { WorldObject worldObject; @@ -193,7 +193,7 @@ void LocalEvent::lockObjects(MWWorld::CellStore* cellStore) } } -void LocalEvent::unlockObjects(MWWorld::CellStore* cellStore) +void WorldEvent::unlockObjects(MWWorld::CellStore* cellStore) { WorldObject worldObject; @@ -219,7 +219,7 @@ void LocalEvent::unlockObjects(MWWorld::CellStore* cellStore) } } -void LocalEvent::scaleObjects(MWWorld::CellStore* cellStore) +void WorldEvent::scaleObjects(MWWorld::CellStore* cellStore) { WorldObject worldObject; @@ -245,7 +245,7 @@ void LocalEvent::scaleObjects(MWWorld::CellStore* cellStore) } } -void LocalEvent::moveObjects(MWWorld::CellStore* cellStore) +void WorldEvent::moveObjects(MWWorld::CellStore* cellStore) { WorldObject worldObject; @@ -272,7 +272,7 @@ void LocalEvent::moveObjects(MWWorld::CellStore* cellStore) } } -void LocalEvent::rotateObjects(MWWorld::CellStore* cellStore) +void WorldEvent::rotateObjects(MWWorld::CellStore* cellStore) { WorldObject worldObject; @@ -299,7 +299,7 @@ void LocalEvent::rotateObjects(MWWorld::CellStore* cellStore) } } -void LocalEvent::animateObjects(MWWorld::CellStore* cellStore) +void WorldEvent::animateObjects(MWWorld::CellStore* cellStore) { WorldObject worldObject; @@ -326,7 +326,7 @@ void LocalEvent::animateObjects(MWWorld::CellStore* cellStore) } } -void LocalEvent::activateDoors(MWWorld::CellStore* cellStore) +void WorldEvent::activateDoors(MWWorld::CellStore* cellStore) { WorldObject worldObject; @@ -353,7 +353,7 @@ void LocalEvent::activateDoors(MWWorld::CellStore* cellStore) } } -void LocalEvent::playMusic() +void WorldEvent::playMusic() { WorldObject worldObject; @@ -368,7 +368,7 @@ void LocalEvent::playMusic() } } -void LocalEvent::playVideo() +void WorldEvent::playVideo() { WorldObject worldObject; @@ -384,7 +384,7 @@ void LocalEvent::playVideo() } } -void LocalEvent::setLocalShorts(MWWorld::CellStore* cellStore) +void WorldEvent::setLocalShorts(MWWorld::CellStore* cellStore) { WorldObject worldObject; @@ -412,7 +412,7 @@ void LocalEvent::setLocalShorts(MWWorld::CellStore* cellStore) } } -void LocalEvent::setLocalFloats(MWWorld::CellStore* cellStore) +void WorldEvent::setLocalFloats(MWWorld::CellStore* cellStore) { WorldObject worldObject; @@ -440,7 +440,7 @@ void LocalEvent::setLocalFloats(MWWorld::CellStore* cellStore) } } -void LocalEvent::setMemberShorts() +void WorldEvent::setMemberShorts() { WorldObject worldObject; @@ -472,7 +472,7 @@ void LocalEvent::setMemberShorts() } } -void LocalEvent::setGlobalShorts() +void WorldEvent::setGlobalShorts() { WorldObject worldObject; diff --git a/apps/openmw/mwmp/LocalEvent.hpp b/apps/openmw/mwmp/WorldEvent.hpp similarity index 84% rename from apps/openmw/mwmp/LocalEvent.hpp rename to apps/openmw/mwmp/WorldEvent.hpp index d9e5256ec..70cb408e1 100644 --- a/apps/openmw/mwmp/LocalEvent.hpp +++ b/apps/openmw/mwmp/WorldEvent.hpp @@ -1,5 +1,5 @@ -#ifndef OPENMW_LOCALEVENT_HPP -#define OPENMW_LOCALEVENT_HPP +#ifndef OPENMW_WORLDEVENT_HPP +#define OPENMW_WORLDEVENT_HPP #include #include "../mwworld/cellstore.hpp" @@ -8,12 +8,12 @@ namespace mwmp { class Networking; - class LocalEvent : public BaseEvent + class WorldEvent : public BaseEvent { public: - LocalEvent(RakNet::RakNetGUID guid); - virtual ~LocalEvent(); + WorldEvent(RakNet::RakNetGUID guid); + virtual ~WorldEvent(); void addObject(WorldObject worldObject); void addContainerItem(ContainerItem containerItem); @@ -43,4 +43,4 @@ namespace mwmp }; } -#endif //OPENMW_LOCALEVENT_HPP +#endif //OPENMW_WORLDEVENT_HPP diff --git a/apps/openmw/mwscript/animationextensions.cpp b/apps/openmw/mwscript/animationextensions.cpp index 08463f479..c7cbb2a45 100644 --- a/apps/openmw/mwscript/animationextensions.cpp +++ b/apps/openmw/mwscript/animationextensions.cpp @@ -5,7 +5,7 @@ #include "../mwmp/Main.hpp" #include "../mwmp/Networking.hpp" -#include "../mwmp/LocalEvent.hpp" +#include "../mwmp/WorldEvent.hpp" #include "../mwworld/cellstore.hpp" #include "../mwworld/class.hpp" @@ -66,7 +66,7 @@ namespace MWScript // Added by tes3mp to check and set whether packets should be sent about this script if (mwmp::Main::isValidPacketScript(ptr.getClass().getScript(ptr))) { - mwmp::LocalEvent *event = mwmp::Main::get().getNetworking()->createLocalEvent(); + mwmp::WorldEvent *event = mwmp::Main::get().getNetworking()->createWorldEvent(); event->cell = *ptr.getCell()->getCell(); mwmp::WorldObject worldObject; diff --git a/apps/openmw/mwscript/interpretercontext.cpp b/apps/openmw/mwscript/interpretercontext.cpp index 4dce7a0ac..2be4ea654 100644 --- a/apps/openmw/mwscript/interpretercontext.cpp +++ b/apps/openmw/mwscript/interpretercontext.cpp @@ -13,7 +13,7 @@ #include #include "../mwmp/Main.hpp" #include "../mwmp/Networking.hpp" -#include "../mwmp/LocalEvent.hpp" +#include "../mwmp/WorldEvent.hpp" #include "../mwworld/esmstore.hpp" @@ -189,7 +189,7 @@ namespace MWScript // Added by tes3mp if (sendPackets) { - mwmp::LocalEvent *event = mwmp::Main::get().getNetworking()->createLocalEvent(); + mwmp::WorldEvent *event = mwmp::Main::get().getNetworking()->createWorldEvent(); event->cell = *mReference.getCell()->getCell(); mwmp::WorldObject worldObject; @@ -233,7 +233,7 @@ namespace MWScript // Only send a packet if this float has no decimals (to avoid spam) if (sendPackets && value == (int) value) { - mwmp::LocalEvent *event = mwmp::Main::get().getNetworking()->createLocalEvent(); + mwmp::WorldEvent *event = mwmp::Main::get().getNetworking()->createWorldEvent(); event->cell = *mReference.getCell()->getCell(); mwmp::WorldObject worldObject; @@ -301,7 +301,7 @@ namespace MWScript // Added by tes3mp if (sendPackets) { - mwmp::LocalEvent *event = mwmp::Main::get().getNetworking()->createLocalEvent(); + mwmp::WorldEvent *event = mwmp::Main::get().getNetworking()->createWorldEvent(); mwmp::WorldObject worldObject; worldObject.varName = name; @@ -641,7 +641,7 @@ namespace MWScript // Added by tes3mp if (sendPackets && !global) { - mwmp::LocalEvent *event = mwmp::Main::get().getNetworking()->createLocalEvent(); + mwmp::WorldEvent *event = mwmp::Main::get().getNetworking()->createWorldEvent(); mwmp::WorldObject worldObject; worldObject.refId = id; diff --git a/apps/openmw/mwscript/miscextensions.cpp b/apps/openmw/mwscript/miscextensions.cpp index e9bb1d254..e5a991722 100644 --- a/apps/openmw/mwscript/miscextensions.cpp +++ b/apps/openmw/mwscript/miscextensions.cpp @@ -4,7 +4,7 @@ #include "../mwmp/Main.hpp" #include "../mwmp/Networking.hpp" -#include "../mwmp/LocalEvent.hpp" +#include "../mwmp/WorldEvent.hpp" #include #include @@ -90,7 +90,7 @@ namespace MWScript runtime.pop(); // Added by tes3mp - mwmp::LocalEvent *event = mwmp::Main::get().getNetworking()->createLocalEvent(); + mwmp::WorldEvent *event = mwmp::Main::get().getNetworking()->createWorldEvent(); mwmp::WorldObject worldObject; worldObject.filename = name; @@ -200,7 +200,7 @@ namespace MWScript } // Added by tes3mp - mwmp::LocalEvent *event = mwmp::Main::get().getNetworking()->createLocalEvent(); + mwmp::WorldEvent *event = mwmp::Main::get().getNetworking()->createWorldEvent(); event->cell = *ptr.getCell()->getCell(); mwmp::WorldObject worldObject; @@ -240,7 +240,7 @@ namespace MWScript MWWorld::Ptr ptr = R()(runtime); // Added by tes3mp - mwmp::LocalEvent *event = mwmp::Main::get().getNetworking()->createLocalEvent(); + mwmp::WorldEvent *event = mwmp::Main::get().getNetworking()->createWorldEvent(); event->cell = *ptr.getCell()->getCell(); mwmp::WorldObject worldObject; @@ -713,7 +713,7 @@ namespace MWScript if (parameter == 1) { // Added by tes3mp - mwmp::LocalEvent *event = mwmp::Main::get().getNetworking()->createLocalEvent(); + mwmp::WorldEvent *event = mwmp::Main::get().getNetworking()->createWorldEvent(); event->cell = *ptr.getCell()->getCell(); mwmp::WorldObject worldObject; diff --git a/apps/openmw/mwscript/soundextensions.cpp b/apps/openmw/mwscript/soundextensions.cpp index 01711730e..04a30d042 100644 --- a/apps/openmw/mwscript/soundextensions.cpp +++ b/apps/openmw/mwscript/soundextensions.cpp @@ -2,7 +2,7 @@ #include "../mwmp/Main.hpp" #include "../mwmp/Networking.hpp" -#include "../mwmp/LocalEvent.hpp" +#include "../mwmp/WorldEvent.hpp" #include #include @@ -71,7 +71,7 @@ namespace MWScript runtime.pop(); // Added by tes3mp - mwmp::LocalEvent *event = mwmp::Main::get().getNetworking()->createLocalEvent(); + mwmp::WorldEvent *event = mwmp::Main::get().getNetworking()->createWorldEvent(); mwmp::WorldObject worldObject; worldObject.filename = sound; diff --git a/apps/openmw/mwscript/transformationextensions.cpp b/apps/openmw/mwscript/transformationextensions.cpp index f040a8e0a..0ef233a82 100644 --- a/apps/openmw/mwscript/transformationextensions.cpp +++ b/apps/openmw/mwscript/transformationextensions.cpp @@ -2,7 +2,7 @@ #include "../mwmp/Main.hpp" #include "../mwmp/Networking.hpp" -#include "../mwmp/LocalEvent.hpp" +#include "../mwmp/WorldEvent.hpp" #include @@ -47,7 +47,7 @@ namespace MWScript runtime.pop(); // Added by tes3mp - mwmp::LocalEvent *event = mwmp::Main::get().getNetworking()->createLocalEvent(); + mwmp::WorldEvent *event = mwmp::Main::get().getNetworking()->createWorldEvent(); event->cell = *ptr.getCell()->getCell(); mwmp::WorldObject worldObject; @@ -552,7 +552,7 @@ namespace MWScript ptr.getCellRef().setRefNumIndex(cellStore->getLastRefNumIndex()); // Added by tes3mp - mwmp::LocalEvent *event = mwmp::Main::get().getNetworking()->createLocalEvent(); + mwmp::WorldEvent *event = mwmp::Main::get().getNetworking()->createWorldEvent(); event->cell = *ptr.getCell()->getCell(); mwmp::WorldObject worldObject; diff --git a/apps/openmw/mwworld/actiontake.cpp b/apps/openmw/mwworld/actiontake.cpp index 5365a9b6a..f6c322295 100644 --- a/apps/openmw/mwworld/actiontake.cpp +++ b/apps/openmw/mwworld/actiontake.cpp @@ -3,7 +3,7 @@ #include #include "../mwmp/Main.hpp" #include "../mwmp/Networking.hpp" -#include "../mwmp/LocalEvent.hpp" +#include "../mwmp/WorldEvent.hpp" #include "../mwmp/LocalPlayer.hpp" #include "../mwworld/cellstore.hpp" @@ -26,7 +26,7 @@ namespace MWWorld MWWorld::Ptr newitem = *actor.getClass().getContainerStore (actor).add (getTarget(), getTarget().getRefData().getCount(), actor); // Added by tes3mp - mwmp::LocalEvent *event = mwmp::Main::get().getNetworking()->createLocalEvent(); + mwmp::WorldEvent *event = mwmp::Main::get().getNetworking()->createWorldEvent(); event->cell = *getTarget().getCell()->getCell(); mwmp::WorldObject worldObject; diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index cf341e1d8..1941f3ac0 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -7,7 +7,7 @@ #include "../mwmp/Main.hpp" #include "../mwmp/Networking.hpp" -#include "../mwmp/LocalEvent.hpp" +#include "../mwmp/WorldEvent.hpp" #include #include @@ -2266,7 +2266,7 @@ namespace MWWorld } // Added by tes3mp - mwmp::LocalEvent *event = mwmp::Main::get().getNetworking()->createLocalEvent(); + mwmp::WorldEvent *event = mwmp::Main::get().getNetworking()->createWorldEvent(); event->cell = *door.getCell()->getCell(); mwmp::WorldObject worldObject; @@ -2293,7 +2293,7 @@ namespace MWWorld void World::activateDoor(const Ptr &door, int state) { // Added by tes3mp - mwmp::LocalEvent *event = mwmp::Main::get().getNetworking()->createLocalEvent(); + mwmp::WorldEvent *event = mwmp::Main::get().getNetworking()->createWorldEvent(); event->cell = *door.getCell()->getCell(); mwmp::WorldObject worldObject;