[Server] Create ActorFunctions placeholder

This commit is contained in:
David Cernat 2017-04-09 12:24:33 +03:00
parent 4f3d05eed2
commit a24ef3a25e
3 changed files with 49 additions and 0 deletions

View file

@ -0,0 +1,28 @@
#include <regex>
#include <apps/openmw-mp/Player.hpp>
#include <apps/openmw-mp/Script/ScriptFunctions.hpp>
#include <apps/openmw-mp/Networking.hpp>
#include <components/openmw-mp/NetworkMessages.hpp>
#include <components/openmw-mp/Base/BaseActor.hpp>
#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;
}

View file

@ -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

View file

@ -13,6 +13,7 @@
#include <Script/Functions/Items.hpp> #include <Script/Functions/Items.hpp>
#include <Script/Functions/Quests.hpp> #include <Script/Functions/Quests.hpp>
#include <Script/Functions/Spells.hpp> #include <Script/Functions/Spells.hpp>
#include <Script/Functions/Actors.hpp>
#include <Script/Functions/World.hpp> #include <Script/Functions/World.hpp>
#include <Script/Functions/Miscellaneous.hpp> #include <Script/Functions/Miscellaneous.hpp>
#include <RakNetTypes.h> #include <RakNetTypes.h>
@ -101,6 +102,7 @@ public:
GUIAPI, GUIAPI,
CHARCLASSAPI, CHARCLASSAPI,
WORLDAPI, WORLDAPI,
ACTORAPI,
MISCELLANEOUSAPI MISCELLANEOUSAPI
}; };