From a24ef3a25ef68780c0f241843d1f286faea7e580 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Sun, 9 Apr 2017 12:24:33 +0300 Subject: [PATCH] [Server] Create ActorFunctions placeholder --- apps/openmw-mp/Script/Functions/Actors.cpp | 28 ++++++++++++++++++++++ apps/openmw-mp/Script/Functions/Actors.hpp | 19 +++++++++++++++ apps/openmw-mp/Script/ScriptFunctions.hpp | 2 ++ 3 files changed, 49 insertions(+) create mode 100644 apps/openmw-mp/Script/Functions/Actors.cpp create mode 100644 apps/openmw-mp/Script/Functions/Actors.hpp diff --git a/apps/openmw-mp/Script/Functions/Actors.cpp b/apps/openmw-mp/Script/Functions/Actors.cpp new file mode 100644 index 000000000..3466a7872 --- /dev/null +++ b/apps/openmw-mp/Script/Functions/Actors.cpp @@ -0,0 +1,28 @@ +#include + +#include +#include +#include +#include +#include +#include "Actors.hpp" + +using namespace mwmp; + +ActorList actorList; +BaseActor tempActor; + +void ActorFunctions::InitActorList(unsigned short pid) noexcept +{ + Player *player; + GET_PLAYER(pid, player, ); + + actorList.cell.blank(); + actorList.baseActors.clear(); + actorList.guid = player->guid; +} + +unsigned int ActorFunctions::GetActorListSize() noexcept +{ + return mwmp::Networking::getPtr()->getLastEvent()->objectChanges.count; +} diff --git a/apps/openmw-mp/Script/Functions/Actors.hpp b/apps/openmw-mp/Script/Functions/Actors.hpp new file mode 100644 index 000000000..9f607b966 --- /dev/null +++ b/apps/openmw-mp/Script/Functions/Actors.hpp @@ -0,0 +1,19 @@ +#ifndef OPENMW_ACTORFUNCTIONS_HPP +#define OPENMW_ACTORFUNCTIONS_HPP + +#define ACTORAPI \ + {"InitActorList", ActorFunctions::InitActorList},\ + \ + {"GetActorListSize", ActorFunctions::GetActorListSize} + +class ActorFunctions +{ +public: + + static void InitActorList(unsigned short pid) noexcept; + + static unsigned int GetActorListSize() noexcept; +}; + + +#endif //OPENMW_ACTORFUNCTIONS_HPP diff --git a/apps/openmw-mp/Script/ScriptFunctions.hpp b/apps/openmw-mp/Script/ScriptFunctions.hpp index 24e17471d..b0e61a91b 100644 --- a/apps/openmw-mp/Script/ScriptFunctions.hpp +++ b/apps/openmw-mp/Script/ScriptFunctions.hpp @@ -13,6 +13,7 @@ #include