diff --git a/apps/openmw-mp/Script/Functions/Actors.cpp b/apps/openmw-mp/Script/Functions/Actors.cpp index 6cb7a0e5a..da5fd8c38 100644 --- a/apps/openmw-mp/Script/Functions/Actors.cpp +++ b/apps/openmw-mp/Script/Functions/Actors.cpp @@ -20,7 +20,7 @@ const BaseActor emptyActor = {}; static std::string tempCellDescription; -void ActorFunctions::ReadLastActorList() noexcept +void ActorFunctions::ReadReceivedActorList() noexcept { readActorList = mwmp::Networking::getPtr()->getLastActorList(); } @@ -46,7 +46,7 @@ void ActorFunctions::SetActorListPid(unsigned short pid) noexcept writeActorList.guid = player->guid; } -void ActorFunctions::CopyLastActorListToStore() noexcept +void ActorFunctions::CopyReceivedActorListToStore() noexcept { writeActorList = *readActorList; } @@ -497,10 +497,21 @@ void ActorFunctions::SendActorCellChange(bool sendToOtherVisitors, bool skipAtta } } + // All methods below are deprecated versions of methods from above +void ActorFunctions::ReadLastActorList() noexcept +{ + ReadReceivedActorList(); +} + void ActorFunctions::InitializeActorList(unsigned short pid) noexcept { ClearActorList(); SetActorListPid(pid); } + +void ActorFunctions::CopyLastActorListToStore() noexcept +{ + CopyLastActorListToStore(); +} diff --git a/apps/openmw-mp/Script/Functions/Actors.hpp b/apps/openmw-mp/Script/Functions/Actors.hpp index 29a089800..a55d6dbf5 100644 --- a/apps/openmw-mp/Script/Functions/Actors.hpp +++ b/apps/openmw-mp/Script/Functions/Actors.hpp @@ -2,13 +2,13 @@ #define OPENMW_ACTORAPI_HPP #define ACTORAPI \ - {"ReadLastActorList", ActorFunctions::ReadLastActorList},\ + {"ReadReceivedActorList", ActorFunctions::ReadReceivedActorList},\ {"ReadCellActorList", ActorFunctions::ReadCellActorList},\ \ {"ClearActorList", ActorFunctions::ClearActorList},\ {"SetActorListPid", ActorFunctions::SetActorListPid},\ \ - {"CopyLastActorListToStore", ActorFunctions::CopyLastActorListToStore},\ + {"CopyReceivedActorListToStore", ActorFunctions::CopyReceivedActorListToStore},\ \ {"GetActorListSize", ActorFunctions::GetActorListSize},\ {"GetActorListAction", ActorFunctions::GetActorListAction},\ @@ -92,7 +92,9 @@ {"SendActorAI", ActorFunctions::SendActorAI},\ {"SendActorCellChange", ActorFunctions::SendActorCellChange},\ \ - {"InitializeActorList", ActorFunctions::InitializeActorList} + {"ReadLastActorList", ActorFunctions::ReadLastActorList},\ + {"InitializeActorList", ActorFunctions::InitializeActorList},\ + {"CopyLastActorListToStore", ActorFunctions::CopyLastActorListToStore} class ActorFunctions { @@ -103,7 +105,7 @@ public: * * \return void */ - static void ReadLastActorList() noexcept; + static void ReadReceivedActorList() noexcept; /** * \brief Use the temporary actor list stored for a cell as the one being read. @@ -138,7 +140,7 @@ public: * * \return void */ - static void CopyLastActorListToStore() noexcept; + static void CopyReceivedActorListToStore() noexcept; /** * \brief Get the number of indexes in the read actor list. @@ -741,7 +743,9 @@ public: // All methods below are deprecated versions of methods from above + static void ReadLastActorList() noexcept; static void InitializeActorList(unsigned short pid) noexcept; + static void CopyLastActorListToStore() noexcept; }; diff --git a/apps/openmw-mp/Script/Functions/Objects.cpp b/apps/openmw-mp/Script/Functions/Objects.cpp index 380c1e712..58981d9b0 100644 --- a/apps/openmw-mp/Script/Functions/Objects.cpp +++ b/apps/openmw-mp/Script/Functions/Objects.cpp @@ -19,7 +19,7 @@ const BaseObject emptyObject = {}; ContainerItem tempContainerItem; const ContainerItem emptyContainerItem = {}; -void ObjectFunctions::ReadLastObjectList() noexcept +void ObjectFunctions::ReadReceivedObjectList() noexcept { readObjectList = mwmp::Networking::getPtr()->getLastObjectList(); } @@ -38,12 +38,12 @@ void ObjectFunctions::SetObjectListPid(unsigned short pid) noexcept writeObjectList.guid = player->guid; } -void ObjectFunctions::CopyLastObjectListToStore() noexcept +void ObjectFunctions::CopyReceivedObjectListToStore() noexcept { writeObjectList = *readObjectList; } -unsigned int ObjectFunctions::GetObjectChangesSize() noexcept +unsigned int ObjectFunctions::GetObjectListSize() noexcept { return readObjectList->baseObjectCount; } @@ -531,11 +531,17 @@ void ObjectFunctions::SendConsoleCommand(bool sendToOtherPlayers, bool skipAttac packet->Send(true); } + // All methods below are deprecated versions of methods from above +void ObjectFunctions::ReadLastObjectList() noexcept +{ + ReadReceivedObjectList(); +} + void ObjectFunctions::ReadLastEvent() noexcept { - ReadLastObjectList(); + ReadReceivedObjectList(); } void ObjectFunctions::InitializeObjectList(unsigned short pid) noexcept @@ -549,6 +555,16 @@ void ObjectFunctions::InitializeEvent(unsigned short pid) noexcept InitializeObjectList(pid); } +void ObjectFunctions::CopyLastObjectListToStore() noexcept +{ + CopyReceivedObjectListToStore(); +} + +unsigned int ObjectFunctions::GetObjectChangesSize() noexcept +{ + return GetObjectListSize(); +} + unsigned char ObjectFunctions::GetEventAction() noexcept { return GetObjectListAction(); diff --git a/apps/openmw-mp/Script/Functions/Objects.hpp b/apps/openmw-mp/Script/Functions/Objects.hpp index b7c0bab6c..5f9524296 100644 --- a/apps/openmw-mp/Script/Functions/Objects.hpp +++ b/apps/openmw-mp/Script/Functions/Objects.hpp @@ -2,14 +2,14 @@ #define OPENMW_OBJECTAPI_HPP #define OBJECTAPI \ - {"ReadLastObjectList", ObjectFunctions::ReadLastObjectList},\ + {"ReadReceivedObjectList", ObjectFunctions::ReadReceivedObjectList},\ \ {"ClearObjectList", ObjectFunctions::ClearObjectList},\ {"SetObjectListPid", ObjectFunctions::SetObjectListPid},\ \ - {"CopyLastObjectListToStore", ObjectFunctions::CopyLastObjectListToStore},\ + {"CopyReceivedObjectListToStore", ObjectFunctions::CopyReceivedObjectListToStore},\ \ - {"GetObjectChangesSize", ObjectFunctions::GetObjectChangesSize},\ + {"GetObjectListSize", ObjectFunctions::GetObjectListSize},\ {"GetObjectListAction", ObjectFunctions::GetObjectListAction},\ {"GetObjectListContainerSubAction", ObjectFunctions::GetObjectListContainerSubAction},\ \ @@ -102,9 +102,12 @@ {"SendVideoPlay", ObjectFunctions::SendVideoPlay},\ {"SendConsoleCommand", ObjectFunctions::SendConsoleCommand},\ \ + {"ReadLastObjectList", ObjectFunctions::ReadLastObjectList},\ {"ReadLastEvent", ObjectFunctions::ReadLastEvent},\ {"InitializeObjectList", ObjectFunctions::InitializeObjectList},\ {"InitializeEvent", ObjectFunctions::InitializeEvent},\ + {"CopyLastObjectListToStore", ObjectFunctions::CopyLastObjectListToStore},\ + {"GetObjectChangesSize", ObjectFunctions::GetObjectChangesSize},\ {"GetEventAction", ObjectFunctions::GetEventAction},\ {"GetEventContainerSubAction", ObjectFunctions::GetEventContainerSubAction},\ {"SetEventCell", ObjectFunctions::SetEventCell},\ @@ -121,7 +124,7 @@ public: * * \return void */ - static void ReadLastObjectList() noexcept; + static void ReadReceivedObjectList() noexcept; /** * \brief Clear the data from the last object list sent by the server. @@ -145,14 +148,14 @@ public: * * \return void */ - static void CopyLastObjectListToStore() noexcept; + static void CopyReceivedObjectListToStore() noexcept; /** - * \brief Get the number of indexes in the read object list's object changes. + * \brief Get the number of indexes in the read object list. * * \return The number of indexes. */ - static unsigned int GetObjectChangesSize() noexcept; + static unsigned int GetObjectListSize() noexcept; /** * \brief Get the action type used in the read object list. @@ -909,9 +912,12 @@ public: // All methods below are deprecated versions of methods from above + static void ReadLastObjectList() noexcept; static void ReadLastEvent() noexcept; static void InitializeObjectList(unsigned short pid) noexcept; static void InitializeEvent(unsigned short pid) noexcept; + static void CopyLastObjectListToStore() noexcept; + static unsigned int GetObjectChangesSize() noexcept; static unsigned char GetEventAction() noexcept; static unsigned char GetEventContainerSubAction() noexcept; static void SetEventCell(const char* cellDescription) noexcept; diff --git a/apps/openmw-mp/Script/Functions/Worldstate.cpp b/apps/openmw-mp/Script/Functions/Worldstate.cpp index 8ad64a9c5..3104c08ec 100644 --- a/apps/openmw-mp/Script/Functions/Worldstate.cpp +++ b/apps/openmw-mp/Script/Functions/Worldstate.cpp @@ -14,12 +14,12 @@ using namespace mwmp; BaseWorldstate writeWorldstate; BaseWorldstate *readWorldstate; -void WorldstateFunctions::ReadLastWorldstate() noexcept +void WorldstateFunctions::ReadReceivedWorldstate() noexcept { readWorldstate = mwmp::Networking::getPtr()->getLastWorldstate(); } -void WorldstateFunctions::CopyLastWorldstateToStore() noexcept +void WorldstateFunctions::CopyReceivedWorldstateToStore() noexcept { writeWorldstate = *readWorldstate; } @@ -184,3 +184,16 @@ void WorldstateFunctions::SendWorldCollisionOverride(unsigned short pid, bool se if (sendToOtherPlayers) packet->Send(true); } + + +// All methods below are deprecated versions of methods from above + +void WorldstateFunctions::ReadLastWorldstate() noexcept +{ + ReadReceivedWorldstate(); +} + +void WorldstateFunctions::CopyLastWorldstateToStore() noexcept +{ + CopyReceivedWorldstateToStore(); +} diff --git a/apps/openmw-mp/Script/Functions/Worldstate.hpp b/apps/openmw-mp/Script/Functions/Worldstate.hpp index 9ba77b120..682380468 100644 --- a/apps/openmw-mp/Script/Functions/Worldstate.hpp +++ b/apps/openmw-mp/Script/Functions/Worldstate.hpp @@ -4,9 +4,9 @@ #include "../Types.hpp" #define WORLDSTATEAPI \ - {"ReadLastWorldstate", WorldstateFunctions::ReadLastWorldstate},\ + {"ReadReceivedWorldstate", WorldstateFunctions::ReadReceivedWorldstate},\ \ - {"CopyLastWorldstateToStore", WorldstateFunctions::CopyLastWorldstateToStore},\ + {"CopyReceivedWorldstateToStore", WorldstateFunctions::CopyReceivedWorldstateToStore},\ \ {"ClearMapChanges", WorldstateFunctions::ClearMapChanges},\ \ @@ -35,7 +35,10 @@ \ {"SendWorldMap", WorldstateFunctions::SendWorldMap},\ {"SendWorldTime", WorldstateFunctions::SendWorldTime},\ - {"SendWorldCollisionOverride", WorldstateFunctions::SendWorldCollisionOverride} + {"SendWorldCollisionOverride", WorldstateFunctions::SendWorldCollisionOverride},\ + \ + {"ReadLastWorldstate", WorldstateFunctions::ReadLastWorldstate},\ + {"CopyLastWorldstateToStore", WorldstateFunctions::CopyLastWorldstateToStore} class WorldstateFunctions { @@ -46,7 +49,7 @@ public: * * \return void */ - static void ReadLastWorldstate() noexcept; + static void ReadReceivedWorldstate() noexcept; /** * \brief Take the contents of the read-only worldstate last received by the @@ -55,7 +58,7 @@ public: * * \return void */ - static void CopyLastWorldstateToStore() noexcept; + static void CopyReceivedWorldstateToStore() noexcept; /** * \brief Clear the map changes for the write-only worldstate. @@ -251,6 +254,12 @@ public: */ static void SendWorldCollisionOverride(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept; + + // All methods below are deprecated versions of methods from above + + static void ReadLastWorldstate() noexcept; + static void CopyLastWorldstateToStore() noexcept; + }; #endif //OPENMW_WORLDSTATEAPI_HPP