Make API headers C compatible

ffi-server-rewrite
Koncord 6 years ago
parent bd3c974ea1
commit a9701028a2

@ -70,7 +70,7 @@ set(SERVER
set(SERVER_HEADER
Script/Types.hpp Script/Script.hpp Script/SystemInterface.hpp
Script/ScriptFunction.hpp Script/Platform.hpp Script/Language.hpp
Script/ScriptFunction.hpp Script/Platform.h Script/Language.hpp
Script/ScriptFunctions.hpp Script/API/TimerAPI.hpp Script/API/PublicFnAPI.hpp
${LuaScript_Headers}
${NativeScript_Headers}

@ -41,7 +41,7 @@ namespace mwmp
#if defined(ENABLE_LUA)
static int CreateTimerLua(lua_State *lua, ScriptFuncLua callback, long msec, const std::string& def, std::vector<boost::any> args);
#endif
static int CreateTimer(ScriptFunc callback, long msec, const std::string& def, std::vector<boost::any> args);
static int CreateTimer(ScriptFunc callback, long msec, const std::string& def, const std::vector<boost::any> &args);
static void FreeTimer(int timerid);
static void ResetTimer(int timerid, long msec);
static void StartTimer(int timerid);

@ -8,7 +8,7 @@
#include <components/esm/creaturestats.hpp>
#include "Actors.hpp"
#include "Actors.h"
using namespace mwmp;

@ -1,7 +1,7 @@
#ifndef OPENMW_ACTORAPI_HPP
#define OPENMW_ACTORAPI_HPP
#include <Script/Platform.hpp>
#include "../api.h"
#define ACTORAPI \
{"ReadReceivedActorList", ActorFunctions::ReadReceivedActorList},\
@ -104,14 +104,13 @@
{"GetActorKillerRefNumIndex", ActorFunctions::GetActorKillerRefNumIndex},\
{"SetActorRefNumIndex", ActorFunctions::SetActorRefNumIndex}
namespace ActorFunctions
{
NAMESPACE_BEGIN(ActorFunctions)
/**
* \brief Use the last actor list received by the server as the one being read.
*
* \return void
*/
EXPORT_APIFUNCTION void CDECL ReadReceivedActorList() noexcept;
API_FUNCTION void CDECL ReadReceivedActorList() noexcept;
/**
* \brief Use the temporary actor list stored for a cell as the one being read.
@ -122,14 +121,14 @@ namespace ActorFunctions
* \param cellDescription The description of the cell whose actor list should be read.
* \return void
*/
EXPORT_APIFUNCTION void CDECL ReadCellActorList(const char* cellDescription) noexcept;
API_FUNCTION void CDECL ReadCellActorList(const char* cellDescription) noexcept;
/**
* \brief Clear the data from the actor list stored on the server.
*
* \return void
*/
EXPORT_APIFUNCTION void CDECL ClearActorList() noexcept;
API_FUNCTION void CDECL ClearActorList() noexcept;
/**
* \brief Set the pid attached to the ActorList.
@ -137,7 +136,7 @@ namespace ActorFunctions
* \param pid The player ID to whom the actor list should be attached.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetActorListPid(unsigned short pid) noexcept;
API_FUNCTION void CDECL SetActorListPid(unsigned short pid) noexcept;
/**
* \brief Take the contents of the read-only actor list last received by the
@ -146,21 +145,21 @@ namespace ActorFunctions
*
* \return void
*/
EXPORT_APIFUNCTION void CDECL CopyReceivedActorListToStore() noexcept;
API_FUNCTION void CDECL CopyReceivedActorListToStore() noexcept;
/**
* \brief Get the number of indexes in the read actor list.
*
* \return The number of indexes.
*/
EXPORT_APIFUNCTION unsigned int CDECL GetActorListSize() noexcept;
API_FUNCTION unsigned int CDECL GetActorListSize() noexcept;
/**
* \brief Get the action type used in the read actor list.
*
* \return The action type (0 for SET, 1 for ADD, 2 for REMOVE, 3 for REQUEST).
*/
EXPORT_APIFUNCTION unsigned char CDECL GetActorListAction() noexcept;
API_FUNCTION unsigned char CDECL GetActorListAction() noexcept;
/**
* \brief Get the cell description of the actor at a certain index in the read actor list.
@ -168,7 +167,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The cell description.
*/
EXPORT_APIFUNCTION const char *CDECL GetActorCell(unsigned int index) noexcept;
API_FUNCTION const char *CDECL GetActorCell(unsigned int index) noexcept;
/**
* \brief Get the refId of the actor at a certain index in the read actor list.
@ -176,7 +175,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The refId.
*/
EXPORT_APIFUNCTION const char *CDECL GetActorRefId(unsigned int index) noexcept;
API_FUNCTION const char *CDECL GetActorRefId(unsigned int index) noexcept;
/**
* \brief Get the refNum of the actor at a certain index in the read actor list.
@ -184,7 +183,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The refNum.
*/
EXPORT_APIFUNCTION unsigned int CDECL GetActorRefNum(unsigned int index) noexcept;
API_FUNCTION unsigned int CDECL GetActorRefNum(unsigned int index) noexcept;
/**
* \brief Get the mpNum of the actor at a certain index in the read actor list.
@ -192,7 +191,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The mpNum.
*/
EXPORT_APIFUNCTION unsigned int CDECL GetActorMpNum(unsigned int index) noexcept;
API_FUNCTION unsigned int CDECL GetActorMpNum(unsigned int index) noexcept;
/**
* \brief Get the X position of the actor at a certain index in the read actor list.
@ -200,7 +199,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The X position.
*/
EXPORT_APIFUNCTION double CDECL GetActorPosX(unsigned int index) noexcept;
API_FUNCTION double CDECL GetActorPosX(unsigned int index) noexcept;
/**
* \brief Get the Y position of the actor at a certain index in the read actor list.
@ -208,7 +207,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The Y position.
*/
EXPORT_APIFUNCTION double CDECL GetActorPosY(unsigned int index) noexcept;
API_FUNCTION double CDECL GetActorPosY(unsigned int index) noexcept;
/**
* \brief Get the Z position of the actor at a certain index in the read actor list.
@ -216,7 +215,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The Z position.
*/
EXPORT_APIFUNCTION double CDECL GetActorPosZ(unsigned int index) noexcept;
API_FUNCTION double CDECL GetActorPosZ(unsigned int index) noexcept;
/**
* \brief Get the X rotation of the actor at a certain index in the read actor list.
@ -224,7 +223,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The X rotation.
*/
EXPORT_APIFUNCTION double CDECL GetActorRotX(unsigned int index) noexcept;
API_FUNCTION double CDECL GetActorRotX(unsigned int index) noexcept;
/**
* \brief Get the Y rotation of the actor at a certain index in the read actor list.
@ -232,7 +231,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The Y rotation.
*/
EXPORT_APIFUNCTION double CDECL GetActorRotY(unsigned int index) noexcept;
API_FUNCTION double CDECL GetActorRotY(unsigned int index) noexcept;
/**
* \brief Get the Z rotation of the actor at a certain index in the read actor list.
@ -240,7 +239,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The Z rotation.
*/
EXPORT_APIFUNCTION double CDECL GetActorRotZ(unsigned int index) noexcept;
API_FUNCTION double CDECL GetActorRotZ(unsigned int index) noexcept;
/**
* \brief Get the base health of the actor at a certain index in the read actor list.
@ -248,7 +247,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The base health.
*/
EXPORT_APIFUNCTION double CDECL GetActorHealthBase(unsigned int index) noexcept;
API_FUNCTION double CDECL GetActorHealthBase(unsigned int index) noexcept;
/**
* \brief Get the current health of the actor at a certain index in the read actor list.
@ -256,7 +255,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The current health.
*/
EXPORT_APIFUNCTION double CDECL GetActorHealthCurrent(unsigned int index) noexcept;
API_FUNCTION double CDECL GetActorHealthCurrent(unsigned int index) noexcept;
/**
* \brief Get the modified health of the actor at a certain index in the read actor list.
@ -264,7 +263,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The modified health.
*/
EXPORT_APIFUNCTION double CDECL GetActorHealthModified(unsigned int index) noexcept;
API_FUNCTION double CDECL GetActorHealthModified(unsigned int index) noexcept;
/**
* \brief Get the base magicka of the actor at a certain index in the read actor list.
@ -272,7 +271,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The base magicka.
*/
EXPORT_APIFUNCTION double CDECL GetActorMagickaBase(unsigned int index) noexcept;
API_FUNCTION double CDECL GetActorMagickaBase(unsigned int index) noexcept;
/**
* \brief Get the current magicka of the actor at a certain index in the read actor list.
@ -280,7 +279,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The current magicka.
*/
EXPORT_APIFUNCTION double CDECL GetActorMagickaCurrent(unsigned int index) noexcept;
API_FUNCTION double CDECL GetActorMagickaCurrent(unsigned int index) noexcept;
/**
* \brief Get the modified magicka of the actor at a certain index in the read actor list.
@ -288,7 +287,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The modified magicka.
*/
EXPORT_APIFUNCTION double CDECL GetActorMagickaModified(unsigned int index) noexcept;
API_FUNCTION double CDECL GetActorMagickaModified(unsigned int index) noexcept;
/**
* \brief Get the base fatigue of the actor at a certain index in the read actor list.
@ -296,7 +295,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The base fatigue.
*/
EXPORT_APIFUNCTION double CDECL GetActorFatigueBase(unsigned int index) noexcept;
API_FUNCTION double CDECL GetActorFatigueBase(unsigned int index) noexcept;
/**
* \brief Get the current fatigue of the actor at a certain index in the read actor list.
@ -304,7 +303,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The current fatigue.
*/
EXPORT_APIFUNCTION double CDECL GetActorFatigueCurrent(unsigned int index) noexcept;
API_FUNCTION double CDECL GetActorFatigueCurrent(unsigned int index) noexcept;
/**
* \brief Get the modified fatigue of the actor at a certain index in the read actor list.
@ -312,7 +311,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The modified fatigue.
*/
EXPORT_APIFUNCTION double CDECL GetActorFatigueModified(unsigned int index) noexcept;
API_FUNCTION double CDECL GetActorFatigueModified(unsigned int index) noexcept;
/**
* \brief Get the refId of the item in a certain slot of the equipment of the actor at a
@ -322,7 +321,7 @@ namespace ActorFunctions
* \param slot The slot of the equipment item.
* \return The refId.
*/
EXPORT_APIFUNCTION const char *CDECL GetActorEquipmentItemRefId(unsigned int index, unsigned short slot) noexcept;
API_FUNCTION const char *CDECL GetActorEquipmentItemRefId(unsigned int index, unsigned short slot) noexcept;
/**
* \brief Get the count of the item in a certain slot of the equipment of the actor at a
@ -332,7 +331,7 @@ namespace ActorFunctions
* \param slot The slot of the equipment item.
* \return The item count.
*/
EXPORT_APIFUNCTION int CDECL GetActorEquipmentItemCount(unsigned int index, unsigned short slot) noexcept;
API_FUNCTION int CDECL GetActorEquipmentItemCount(unsigned int index, unsigned short slot) noexcept;
/**
* \brief Get the charge of the item in a certain slot of the equipment of the actor at a
@ -342,7 +341,7 @@ namespace ActorFunctions
* \param slot The slot of the equipment item.
* \return The charge.
*/
EXPORT_APIFUNCTION int CDECL GetActorEquipmentItemCharge(unsigned int index, unsigned short slot) noexcept;
API_FUNCTION int CDECL GetActorEquipmentItemCharge(unsigned int index, unsigned short slot) noexcept;
/**
* \brief Get the enchantment charge of the item in a certain slot of the equipment of the actor at a
@ -352,7 +351,7 @@ namespace ActorFunctions
* \param slot The slot of the equipment item.
* \return The enchantment charge.
*/
EXPORT_APIFUNCTION double CDECL GetActorEquipmentItemEnchantmentCharge(unsigned int index, unsigned short slot) noexcept;
API_FUNCTION double CDECL GetActorEquipmentItemEnchantmentCharge(unsigned int index, unsigned short slot) noexcept;
/**
* \brief Check whether the killer of the actor at a certain index in the read actor list is a player.
@ -360,7 +359,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return Whether the actor was killed by a player.
*/
EXPORT_APIFUNCTION bool CDECL DoesActorHavePlayerKiller(unsigned int index) noexcept;
API_FUNCTION bool CDECL DoesActorHavePlayerKiller(unsigned int index) noexcept;
/**
* \brief Get the player ID of the killer of the actor at a certain index in the read actor list.
@ -368,7 +367,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The player ID of the killer.
*/
EXPORT_APIFUNCTION int CDECL GetActorKillerPid(unsigned int index) noexcept;
API_FUNCTION int CDECL GetActorKillerPid(unsigned int index) noexcept;
/**
* \brief Get the refId of the actor killer of the actor at a certain index in the read actor list.
@ -376,7 +375,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The refId of the killer.
*/
EXPORT_APIFUNCTION const char *CDECL GetActorKillerRefId(unsigned int index) noexcept;
API_FUNCTION const char *CDECL GetActorKillerRefId(unsigned int index) noexcept;
/**
* \brief Get the refNum of the actor killer of the actor at a certain index in the read actor list.
@ -384,7 +383,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The refNum of the killer.
*/
EXPORT_APIFUNCTION unsigned int CDECL GetActorKillerRefNum(unsigned int index) noexcept;
API_FUNCTION unsigned int CDECL GetActorKillerRefNum(unsigned int index) noexcept;
/**
* \brief Get the mpNum of the actor killer of the actor at a certain index in the read actor list.
@ -392,7 +391,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The mpNum of the killer.
*/
EXPORT_APIFUNCTION unsigned int CDECL GetActorKillerMpNum(unsigned int index) noexcept;
API_FUNCTION unsigned int CDECL GetActorKillerMpNum(unsigned int index) noexcept;
/**
* \brief Get the name of the actor killer of the actor at a certain index in the read actor list.
@ -400,7 +399,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The name of the killer.
*/
EXPORT_APIFUNCTION const char *CDECL GetActorKillerName(unsigned int index) noexcept;
API_FUNCTION const char *CDECL GetActorKillerName(unsigned int index) noexcept;
/**
* \brief Check whether there is any positional data for the actor at a certain index in
@ -411,7 +410,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return Whether the read actor list contains positional data.
*/
EXPORT_APIFUNCTION bool CDECL DoesActorHavePosition(unsigned int index) noexcept;
API_FUNCTION bool CDECL DoesActorHavePosition(unsigned int index) noexcept;
/**
* \brief Check whether there is any dynamic stats data for the actor at a certain index in
@ -422,7 +421,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return Whether the read actor list contains dynamic stats data.
*/
EXPORT_APIFUNCTION bool CDECL DoesActorHaveStatsDynamic(unsigned int index) noexcept;
API_FUNCTION bool CDECL DoesActorHaveStatsDynamic(unsigned int index) noexcept;
/**
* \brief Set the cell of the temporary actor list stored on the server.
@ -433,7 +432,7 @@ namespace ActorFunctions
* \param cellDescription The description of the cell.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetActorListCell(const char* cellDescription) noexcept;
API_FUNCTION void CDECL SetActorListCell(const char* cellDescription) noexcept;
/**
* \brief Set the action type of the temporary actor list stored on the server.
@ -441,7 +440,7 @@ namespace ActorFunctions
* \param action The action type (0 for SET, 1 for ADD, 2 for REMOVE, 3 for REQUEST).
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetActorListAction(unsigned char action) noexcept;
API_FUNCTION void CDECL SetActorListAction(unsigned char action) noexcept;
/**
* \brief Set the cell of the temporary actor stored on the server.
@ -455,7 +454,7 @@ namespace ActorFunctions
* \param cellDescription The description of the cell.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetActorCell(const char* cellDescription) noexcept;
API_FUNCTION void CDECL SetActorCell(const char* cellDescription) noexcept;
/**
* \brief Set the refId of the temporary actor stored on the server.
@ -463,7 +462,7 @@ namespace ActorFunctions
* \param refId The refId.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetActorRefId(const char* refId) noexcept;
API_FUNCTION void CDECL SetActorRefId(const char* refId) noexcept;
/**
* \brief Set the refNum of the temporary actor stored on the server.
@ -471,7 +470,7 @@ namespace ActorFunctions
* \param refNum The refNum.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetActorRefNum(int refNum) noexcept;
API_FUNCTION void CDECL SetActorRefNum(int refNum) noexcept;
/**
* \brief Set the mpNum of the temporary actor stored on the server.
@ -479,7 +478,7 @@ namespace ActorFunctions
* \param mpNum The mpNum.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetActorMpNum(int mpNum) noexcept;
API_FUNCTION void CDECL SetActorMpNum(int mpNum) noexcept;
/**
* \brief Set the position of the temporary actor stored on the server.
@ -489,7 +488,7 @@ namespace ActorFunctions
* \param z The Z position.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetActorPosition(double x, double y, double z) noexcept;
API_FUNCTION void CDECL SetActorPosition(double x, double y, double z) noexcept;
/**
* \brief Set the rotation of the temporary actor stored on the server.
@ -499,7 +498,7 @@ namespace ActorFunctions
* \param z The Z rotation.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetActorRotation(double x, double y, double z) noexcept;
API_FUNCTION void CDECL SetActorRotation(double x, double y, double z) noexcept;
/**
* \brief Set the base health of the temporary actor stored on the server.
@ -507,7 +506,7 @@ namespace ActorFunctions
* \param value The new value.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetActorHealthBase(double value) noexcept;
API_FUNCTION void CDECL SetActorHealthBase(double value) noexcept;
/**
* \brief Set the current health of the temporary actor stored on the server.
@ -515,7 +514,7 @@ namespace ActorFunctions
* \param value The new value.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetActorHealthCurrent(double value) noexcept;
API_FUNCTION void CDECL SetActorHealthCurrent(double value) noexcept;
/**
* \brief Set the modified health of the temporary actor stored on the server.
@ -523,7 +522,7 @@ namespace ActorFunctions
* \param value The new value.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetActorHealthModified(double value) noexcept;
API_FUNCTION void CDECL SetActorHealthModified(double value) noexcept;
/**
* \brief Set the base magicka of the temporary actor stored on the server.
@ -531,7 +530,7 @@ namespace ActorFunctions
* \param value The new value.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetActorMagickaBase(double value) noexcept;
API_FUNCTION void CDECL SetActorMagickaBase(double value) noexcept;
/**
* \brief Set the current magicka of the temporary actor stored on the server.
@ -539,7 +538,7 @@ namespace ActorFunctions
* \param value The new value.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetActorMagickaCurrent(double value) noexcept;
API_FUNCTION void CDECL SetActorMagickaCurrent(double value) noexcept;
/**
* \brief Set the modified magicka of the temporary actor stored on the server.
@ -547,7 +546,7 @@ namespace ActorFunctions
* \param value The new value.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetActorMagickaModified(double value) noexcept;
API_FUNCTION void CDECL SetActorMagickaModified(double value) noexcept;
/**
* \brief Set the base fatigue of the temporary actor stored on the server.
@ -555,7 +554,7 @@ namespace ActorFunctions
* \param value The new value.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetActorFatigueBase(double value) noexcept;
API_FUNCTION void CDECL SetActorFatigueBase(double value) noexcept;
/**
* \brief Set the current fatigue of the temporary actor stored on the server.
@ -563,7 +562,7 @@ namespace ActorFunctions
* \param value The new value.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetActorFatigueCurrent(double value) noexcept;
API_FUNCTION void CDECL SetActorFatigueCurrent(double value) noexcept;
/**
* \brief Set the modified fatigue of the temporary actor stored on the server.
@ -571,7 +570,7 @@ namespace ActorFunctions
* \param value The new value.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetActorFatigueModified(double value) noexcept;
API_FUNCTION void CDECL SetActorFatigueModified(double value) noexcept;
/**
* \brief Set the sound of the temporary actor stored on the server.
@ -579,7 +578,7 @@ namespace ActorFunctions
* \param sound The sound.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetActorSound(const char* sound) noexcept;
API_FUNCTION void CDECL SetActorSound(const char* sound) noexcept;
/**
* \brief Set the AI action of the temporary actor stored on the server.
@ -587,7 +586,7 @@ namespace ActorFunctions
* \param action The new action.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetActorAIAction(unsigned int action) noexcept;
API_FUNCTION void CDECL SetActorAIAction(unsigned int action) noexcept;
/**
* \brief Set a player as the AI target of the temporary actor stored on the server.
@ -595,7 +594,7 @@ namespace ActorFunctions
* \param pid The player ID.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetActorAITargetToPlayer(unsigned short pid) noexcept;
API_FUNCTION void CDECL SetActorAITargetToPlayer(unsigned short pid) noexcept;
/**
* \brief Set another object as the AI target of the temporary actor stored on the server.
@ -604,7 +603,7 @@ namespace ActorFunctions
* \param mpNum The mpNum of the target object.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetActorAITargetToObject(int refNum, int mpNum) noexcept;
API_FUNCTION void CDECL SetActorAITargetToObject(int refNum, int mpNum) noexcept;
/**
* \brief Set the coordinates for the AI package associated with the current AI action.
@ -614,7 +613,7 @@ namespace ActorFunctions
* \param z The Z coordinate.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetActorAICoordinates(double x, double y, double z) noexcept;
API_FUNCTION void CDECL SetActorAICoordinates(double x, double y, double z) noexcept;
/**
* \brief Set the distance of the AI package associated with the current AI action.
@ -622,7 +621,7 @@ namespace ActorFunctions
* \param duration The distance of the package.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetActorAIDistance(unsigned int distance) noexcept;
API_FUNCTION void CDECL SetActorAIDistance(unsigned int distance) noexcept;
/**
* \brief Set the duration of the AI package associated with the current AI action.
@ -630,7 +629,7 @@ namespace ActorFunctions
* \param duration The duration of the package.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetActorAIDuration(unsigned int duration) noexcept;
API_FUNCTION void CDECL SetActorAIDuration(unsigned int duration) noexcept;
/**
* \brief Set whether the current AI package should be repeated.
@ -640,7 +639,7 @@ namespace ActorFunctions
* \param shouldRepeat Whether the package should be repeated.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetActorAIRepetition(bool shouldRepeat) noexcept;
API_FUNCTION void CDECL SetActorAIRepetition(bool shouldRepeat) noexcept;
/**
* \brief Equip an item in a certain slot of the equipment of the temporary actor stored
@ -653,7 +652,7 @@ namespace ActorFunctions
* \param enchantmentCharge The enchantment charge of the item.
* \return void
*/
EXPORT_APIFUNCTION void CDECL EquipActorItem(unsigned short slot, const char* refId, unsigned int count, int charge, double enchantmentCharge = -1) noexcept;
API_FUNCTION void CDECL EquipActorItem(unsigned short slot, const char* refId, unsigned int count, int charge, double enchantmentCharge = -1) noexcept;
/**
* \brief Unequip the item in a certain slot of the equipment of the temporary actor stored
@ -662,7 +661,7 @@ namespace ActorFunctions
* \param slot The equipment slot.
* \return void
*/
EXPORT_APIFUNCTION void CDECL UnequipActorItem(unsigned short slot) noexcept;
API_FUNCTION void CDECL UnequipActorItem(unsigned short slot) noexcept;
/**
* \brief Add a copy of the server's temporary actor to the server's temporary actor list.
@ -672,7 +671,7 @@ namespace ActorFunctions
*
* \return void
*/
EXPORT_APIFUNCTION void CDECL AddActor() noexcept;
API_FUNCTION void CDECL AddActor() noexcept;
/**
* \brief Send an ActorList packet.
@ -681,7 +680,7 @@ namespace ActorFunctions
*
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendActorList() noexcept;
API_FUNCTION void CDECL SendActorList() noexcept;
/**
* \brief Send an ActorAuthority packet.
@ -693,7 +692,7 @@ namespace ActorFunctions
*
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendActorAuthority() noexcept;
API_FUNCTION void CDECL SendActorAuthority() noexcept;
/**
* \brief Send an ActorPosition packet.
@ -705,7 +704,7 @@ namespace ActorFunctions
*
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendActorPosition(bool sendToOtherVisitors, bool skipAttachedPlayer) noexcept;
API_FUNCTION void CDECL SendActorPosition(bool sendToOtherVisitors, bool skipAttachedPlayer) noexcept;
/**
* \brief Send an ActorStatsDynamic packet.
@ -717,7 +716,7 @@ namespace ActorFunctions
*
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendActorStatsDynamic(bool sendToOtherVisitors, bool skipAttachedPlayer) noexcept;
API_FUNCTION void CDECL SendActorStatsDynamic(bool sendToOtherVisitors, bool skipAttachedPlayer) noexcept;
/**
* \brief Send an ActorEquipment packet.
@ -729,7 +728,7 @@ namespace ActorFunctions
*
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendActorEquipment(bool sendToOtherVisitors, bool skipAttachedPlayer) noexcept;
API_FUNCTION void CDECL SendActorEquipment(bool sendToOtherVisitors, bool skipAttachedPlayer) noexcept;
/**
* \brief Send an ActorSpeech packet.
@ -740,7 +739,7 @@ namespace ActorFunctions
* to the packet (false by default).
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendActorSpeech(bool sendToOtherVisitors, bool skipAttachedPlayer) noexcept;
API_FUNCTION void CDECL SendActorSpeech(bool sendToOtherVisitors, bool skipAttachedPlayer) noexcept;
/**
* \brief Send an ActorAI packet.
@ -751,7 +750,7 @@ namespace ActorFunctions
* to the packet (false by default).
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendActorAI(bool sendToOtherVisitors, bool skipAttachedPlayer) noexcept;
API_FUNCTION void CDECL SendActorAI(bool sendToOtherVisitors, bool skipAttachedPlayer) noexcept;
/**
* \brief Send an ActorCellChange packet.
@ -763,18 +762,18 @@ namespace ActorFunctions
*
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendActorCellChange(bool sendToOtherVisitors, bool skipAttachedPlayer) noexcept;
API_FUNCTION void CDECL SendActorCellChange(bool sendToOtherVisitors, bool skipAttachedPlayer) noexcept;
// All methods below are deprecated versions of methods from above
EXPORT_APIFUNCTION void CDECL ReadLastActorList() noexcept;
EXPORT_APIFUNCTION void CDECL InitializeActorList(unsigned short pid) noexcept;
EXPORT_APIFUNCTION void CDECL CopyLastActorListToStore() noexcept;
EXPORT_APIFUNCTION unsigned int CDECL GetActorRefNumIndex(unsigned int index) noexcept;
EXPORT_APIFUNCTION unsigned int CDECL GetActorKillerRefNumIndex(unsigned int index) noexcept;
EXPORT_APIFUNCTION void CDECL SetActorRefNumIndex(int refNum) noexcept;
}
API_FUNCTION void CDECL ReadLastActorList() noexcept;
API_FUNCTION void CDECL InitializeActorList(unsigned short pid) noexcept;
API_FUNCTION void CDECL CopyLastActorListToStore() noexcept;
API_FUNCTION unsigned int CDECL GetActorRefNumIndex(unsigned int index) noexcept;
API_FUNCTION unsigned int CDECL GetActorKillerRefNumIndex(unsigned int index) noexcept;
API_FUNCTION void CDECL SetActorRefNumIndex(int refNum) noexcept;
NAMESPACE_END()
#endif //OPENMW_ACTORAPI_HPP

@ -1,4 +1,4 @@
#include "Books.hpp"
#include "Books.h"
#include <components/openmw-mp/NetworkMessages.hpp>

@ -1,7 +1,7 @@
#ifndef OPENMW_BOOKAPI_HPP
#define OPENMW_BOOKAPI_HPP
#include <Script/Platform.hpp>
#include "../api.h"
#define BOOKAPI \
{"ClearBookChanges", BookFunctions::ClearBookChanges},\
@ -16,8 +16,7 @@
\
{"InitializeBookChanges", BookFunctions::InitializeBookChanges}
namespace BookFunctions
{
NAMESPACE_BEGIN(BookFunctions)
/**
* \brief Clear the last recorded book changes for a player.
@ -27,7 +26,7 @@ namespace BookFunctions
* \param pid The player ID whose book changes should be used.
* \return void
*/
EXPORT_APIFUNCTION void CDECL ClearBookChanges(unsigned short pid) noexcept;
API_FUNCTION void CDECL ClearBookChanges(unsigned short pid) noexcept;
/**
* \brief Get the number of indexes in a player's latest book changes.
@ -35,7 +34,7 @@ namespace BookFunctions
* \param pid The player ID whose book changes should be used.
* \return The number of indexes.
*/
EXPORT_APIFUNCTION unsigned int CDECL GetBookChangesSize(unsigned short pid) noexcept;
API_FUNCTION unsigned int CDECL GetBookChangesSize(unsigned short pid) noexcept;
/**
* \brief Add a new book to the book changes for a player.
@ -44,7 +43,7 @@ namespace BookFunctions
* \param bookId The bookId of the book.
* \return void
*/
EXPORT_APIFUNCTION void CDECL AddBook(unsigned short pid, const char* bookId) noexcept;
API_FUNCTION void CDECL AddBook(unsigned short pid, const char* bookId) noexcept;
/**
* \brief Get the bookId at a certain index in a player's latest book changes.
@ -53,7 +52,7 @@ namespace BookFunctions
* \param index The index of the book.
* \return The bookId.
*/
EXPORT_APIFUNCTION const char *CDECL GetBookId(unsigned short pid, unsigned int index) noexcept;
API_FUNCTION const char *CDECL GetBookId(unsigned short pid, unsigned int index) noexcept;
/**
* \brief Send a PlayerBook packet with a player's recorded book changes.
@ -65,11 +64,11 @@ namespace BookFunctions
* to the packet (false by default).
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendBookChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
API_FUNCTION void CDECL SendBookChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
// All methods below are deprecated versions of methods from above
EXPORT_APIFUNCTION void CDECL InitializeBookChanges(unsigned short pid) noexcept;
}
API_FUNCTION void CDECL InitializeBookChanges(unsigned short pid) noexcept;
NAMESPACE_END()
#endif //OPENMW_BOOKAPI_HPP

@ -1,4 +1,4 @@
#include "Cells.hpp"
#include "Cells.h"
#include <components/openmw-mp/Log.hpp>
#include <components/openmw-mp/NetworkMessages.hpp>

@ -3,7 +3,7 @@
#include "../Types.hpp"
#include <Script/Platform.hpp>
#include "../api.h"
#define CELLAPI \
{"GetCellStateChangesSize", CellFunctions::GetCellStateChangesSize},\
@ -25,15 +25,14 @@
{"SendCell", CellFunctions::SendCell}
namespace CellFunctions
{
NAMESPACE_BEGIN(CellFunctions)
/**
* \brief Get the number of indexes in a player's latest cell state changes.
*
* \param pid The player ID whose cell state changes should be used.
* \return The number of indexes.
*/
EXPORT_APIFUNCTION unsigned int CDECL GetCellStateChangesSize(unsigned short pid) noexcept;
API_FUNCTION unsigned int CDECL GetCellStateChangesSize(unsigned short pid) noexcept;
/**
* \brief Get the cell state type at a certain index in a player's latest cell state changes.
@ -42,7 +41,7 @@ namespace CellFunctions
* \param index The index of the cell state.
* \return The cell state type (0 for LOAD, 1 for UNLOAD).
*/
EXPORT_APIFUNCTION unsigned int CDECL GetCellStateType(unsigned short pid, unsigned int index) noexcept;
API_FUNCTION unsigned int CDECL GetCellStateType(unsigned short pid, unsigned int index) noexcept;
/**
* \brief Get the cell description at a certain index in a player's latest cell state changes.
@ -51,7 +50,7 @@ namespace CellFunctions
* \param index The index of the cell state.
* \return The cell description.
*/
EXPORT_APIFUNCTION const char *CDECL GetCellStateDescription(unsigned short pid, unsigned int index) noexcept;
API_FUNCTION const char *CDECL GetCellStateDescription(unsigned short pid, unsigned int index) noexcept;
/**
* \brief Get the cell description of a player's cell.
@ -59,7 +58,7 @@ namespace CellFunctions
* \param pid The player ID.
* \return The cell description.
*/
EXPORT_APIFUNCTION const char *CDECL GetCell(unsigned short pid) noexcept;
API_FUNCTION const char *CDECL GetCell(unsigned short pid) noexcept;
/**
* \brief Get the X coordinate of the player's exterior cell.
@ -67,7 +66,7 @@ namespace CellFunctions
* \param pid The player ID.
* \return The X coordinate of the cell.
*/
EXPORT_APIFUNCTION int CDECL GetExteriorX(unsigned short pid) noexcept;
API_FUNCTION int CDECL GetExteriorX(unsigned short pid) noexcept;
/**
* \brief Get the Y coordinate of the player's exterior cell.
@ -75,7 +74,7 @@ namespace CellFunctions
* \param pid The player ID.
* \return The Y coordinate of the cell.
*/
EXPORT_APIFUNCTION int CDECL GetExteriorY(unsigned short pid) noexcept;
API_FUNCTION int CDECL GetExteriorY(unsigned short pid) noexcept;
/**
* \brief Check whether the player is in an exterior cell or not.
@ -83,7 +82,7 @@ namespace CellFunctions
* \param pid The player ID.
* \return Whether the player is in an exterior cell.
*/
EXPORT_APIFUNCTION bool CDECL IsInExterior(unsigned short pid) noexcept;
API_FUNCTION bool CDECL IsInExterior(unsigned short pid) noexcept;
/**
* \brief Get the region of the player's exterior cell.
@ -93,7 +92,7 @@ namespace CellFunctions
* \param pid The player ID.
* \return The region.
*/
EXPORT_APIFUNCTION const char *CDECL GetRegion(unsigned short pid) noexcept;
API_FUNCTION const char *CDECL GetRegion(unsigned short pid) noexcept;
/**
* \brief Check whether the player's last cell change has involved a region change.
@ -101,7 +100,7 @@ namespace CellFunctions
* \param pid The player ID.
* \return Whether the player has changed their region.
*/
EXPORT_APIFUNCTION bool CDECL IsChangingRegion(unsigned short pid) noexcept;
API_FUNCTION bool CDECL IsChangingRegion(unsigned short pid) noexcept;
/**
* \brief Set the cell of a player.
@ -116,7 +115,7 @@ namespace CellFunctions
* \param cellDescription The cell description.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetCell(unsigned short pid, const char *cellDescription) noexcept;
API_FUNCTION void CDECL SetCell(unsigned short pid, const char *cellDescription) noexcept;
/**
* \brief Set the cell of a player to an exterior cell.
@ -129,7 +128,7 @@ namespace CellFunctions
* \param y The Y coordinate of the cell.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetExteriorCell(unsigned short pid, int x, int y) noexcept;
API_FUNCTION void CDECL SetExteriorCell(unsigned short pid, int x, int y) noexcept;
/**
* \brief Send a PlayerCellChange packet about a player.
@ -139,7 +138,7 @@ namespace CellFunctions
* \param pid The player ID.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendCell(unsigned short pid) noexcept;
}
API_FUNCTION void CDECL SendCell(unsigned short pid) noexcept;
NAMESPACE_END()
#endif //OPENMW_CELLAPI_HPP

@ -2,7 +2,7 @@
// Created by koncord on 29.08.16.
//
#include "CharClass.hpp"
#include "CharClass.h"
#include <components/openmw-mp/NetworkMessages.hpp>

@ -7,7 +7,7 @@
#include "../Types.hpp"
#include <Script/Platform.hpp>
#include "../api.h"
#define CHARCLASSAPI \
{"GetDefaultClass", CharClassFunctions::GetDefaultClass},\
@ -30,15 +30,14 @@
{"SendClass", CharClassFunctions::SendClass}
namespace CharClassFunctions
{
NAMESPACE_BEGIN(CharClassFunctions)
/**
* \brief Get the default class used by a player.
*
* \param pid The player ID.
* \return The ID of the default class.
*/
EXPORT_APIFUNCTION const char *CDECL GetDefaultClass(unsigned short pid) noexcept;
API_FUNCTION const char *CDECL GetDefaultClass(unsigned short pid) noexcept;
/**
* \brief Get the name of the custom class used by a player.
@ -46,7 +45,7 @@ namespace CharClassFunctions
* \param pid The player ID.
* \return The name of the custom class.
*/
EXPORT_APIFUNCTION const char *CDECL GetClassName(unsigned short pid) noexcept;
API_FUNCTION const char *CDECL GetClassName(unsigned short pid) noexcept;
/**
* \brief Get the description of the custom class used by a player.
@ -54,7 +53,7 @@ namespace CharClassFunctions
* \param pid The player ID.
* \return The description of the custom class.
*/
EXPORT_APIFUNCTION const char *CDECL GetClassDesc(unsigned short pid) noexcept;
API_FUNCTION const char *CDECL GetClassDesc(unsigned short pid) noexcept;
/**
* \brief Get the ID of one of the two major attributes of a custom class used by a player.
@ -63,7 +62,7 @@ namespace CharClassFunctions
* \param slot The slot of the major attribute (0 or 1).
* \return The ID of the major attribute.
*/
EXPORT_APIFUNCTION int CDECL GetClassMajorAttribute(unsigned short pid, unsigned char slot) noexcept;
API_FUNCTION int CDECL GetClassMajorAttribute(unsigned short pid, unsigned char slot) noexcept;
/**
* \brief Get the specialization ID of the custom class used by a player.
@ -71,7 +70,7 @@ namespace CharClassFunctions
* \param pid The player ID.
* \return The specialization ID of the custom class (0 for Combat, 1 for Magic, 2 for Stealth).
*/
EXPORT_APIFUNCTION int CDECL GetClassSpecialization(unsigned short pid) noexcept;
API_FUNCTION int CDECL GetClassSpecialization(unsigned short pid) noexcept;
/**
* \brief Get the ID of one of the five major skills of a custom class used by a player.
@ -80,7 +79,7 @@ namespace CharClassFunctions
* \param slot The slot of the major skill (0 to 4).
* \return The ID of the major skill.
*/
EXPORT_APIFUNCTION int CDECL GetClassMajorSkill(unsigned short pid, unsigned char slot) noexcept;
API_FUNCTION int CDECL GetClassMajorSkill(unsigned short pid, unsigned char slot) noexcept;
/**
* \brief Get the ID of one of the five minor skills of a custom class used by a player.
@ -89,7 +88,7 @@ namespace CharClassFunctions
* \param slot The slot of the minor skill (0 to 4).
* \return The ID of the minor skill.
*/
EXPORT_APIFUNCTION int CDECL GetClassMinorSkill(unsigned short pid, unsigned char slot) noexcept;
API_FUNCTION int CDECL GetClassMinorSkill(unsigned short pid, unsigned char slot) noexcept;
/**
* \brief Check whether the player is using a default class instead of a custom one.
@ -97,7 +96,7 @@ namespace CharClassFunctions
* \param pid The player ID.
* \return Whether the player is using a default class.
*/
EXPORT_APIFUNCTION int CDECL IsClassDefault(unsigned short pid) noexcept;
API_FUNCTION int CDECL IsClassDefault(unsigned short pid) noexcept;
/**
* \brief Set the default class used by a player.
@ -108,7 +107,7 @@ namespace CharClassFunctions
* \param id The ID of the default class.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetDefaultClass(unsigned short pid, const char *id) noexcept;
API_FUNCTION void CDECL SetDefaultClass(unsigned short pid, const char *id) noexcept;
/**
* \brief Set the name of the custom class used by a player.
@ -117,7 +116,7 @@ namespace CharClassFunctions
* \param name The name of the custom class.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetClassName(unsigned short pid, const char *name) noexcept;
API_FUNCTION void CDECL SetClassName(unsigned short pid, const char *name) noexcept;
/**
* \brief Set the description of the custom class used by a player.
@ -126,7 +125,7 @@ namespace CharClassFunctions
* \param desc The description of the custom class.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetClassDesc(unsigned short pid, const char *desc) noexcept;
API_FUNCTION void CDECL SetClassDesc(unsigned short pid, const char *desc) noexcept;
/**
* \brief Set the ID of one of the two major attributes of the custom class used by a player.
@ -136,7 +135,7 @@ namespace CharClassFunctions
* \param attrId The ID to use for the attribute.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetClassMajorAttribute(unsigned short pid, unsigned char slot, int attrId) noexcept;
API_FUNCTION void CDECL SetClassMajorAttribute(unsigned short pid, unsigned char slot, int attrId) noexcept;
/**
* \brief Set the specialization of the custom class used by a player.
@ -145,7 +144,7 @@ namespace CharClassFunctions
* \param spec The specialization ID to use (0 for Combat, 1 for Magic, 2 for Stealth).
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetClassSpecialization(unsigned short pid, int spec) noexcept;
API_FUNCTION void CDECL SetClassSpecialization(unsigned short pid, int spec) noexcept;
/**
* \brief Set the ID of one of the five major skills of the custom class used by a player.
@ -155,7 +154,7 @@ namespace CharClassFunctions
* \param skillId The ID to use for the skill.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetClassMajorSkill(unsigned short pid, unsigned char slot, int skillId) noexcept;
API_FUNCTION void CDECL SetClassMajorSkill(unsigned short pid, unsigned char slot, int skillId) noexcept;
/**
* \brief Set the ID of one of the five minor skills of the custom class used by a player.
@ -165,7 +164,7 @@ namespace CharClassFunctions
* \param skillId The ID to use for the skill.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetClassMinorSkill(unsigned short pid, unsigned char slot, int skillId) noexcept;
API_FUNCTION void CDECL SetClassMinorSkill(unsigned short pid, unsigned char slot, int skillId) noexcept;
/**
* \brief Send a PlayerCharClass packet about a player.
@ -175,7 +174,7 @@ namespace CharClassFunctions
* \param pid The player ID.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendClass(unsigned short pid) noexcept;
}
API_FUNCTION void CDECL SendClass(unsigned short pid) noexcept;
NAMESPACE_END()
#endif //OPENMW_CHARCLASSAPI_HPP

@ -1,4 +1,4 @@
#include "Chat.hpp"
#include "Chat.h"
#include <components/openmw-mp/NetworkMessages.hpp>
#include <components/openmw-mp/Log.hpp>

@ -3,15 +3,14 @@
#include "../Types.hpp"
#include <Script/Platform.hpp>
#include "../api.h"
#define CHATAPI \
{"SendMessage", ChatFunctions::SendMessage},\
{"CleanChatForPid", ChatFunctions::CleanChat},\
{"CleanChat", ChatFunctions::CleanChatForPid}
namespace ChatFunctions
{
NAMESPACE_BEGIN(ChatFunctions)
/**
* \brief Send a message to a certain player.
*
@ -23,7 +22,7 @@ namespace ChatFunctions
* to the packet (false by default).
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendMessage(unsigned short pid, const char *message, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
API_FUNCTION void CDECL SendMessage(unsigned short pid, const char *message, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
/**
* \brief Remove all messages from chat for a certain player.
@ -31,14 +30,14 @@ namespace ChatFunctions
* \param pid The player ID.
* \return void
*/
EXPORT_APIFUNCTION void CDECL CleanChatForPid(unsigned short pid);
API_FUNCTION void CDECL CleanChatForPid(unsigned short pid);
/**
* \brief Remove all messages from chat for everyone on the server.
*
* \return void
*/
EXPORT_APIFUNCTION void CDECL CleanChat();
}
API_FUNCTION void CDECL CleanChat();
NAMESPACE_END()
#endif //OPENMW_CHATAPI_HPP

@ -1,4 +1,4 @@
#include "Dialogue.hpp"
#include "Dialogue.h"
#include <components/openmw-mp/NetworkMessages.hpp>

@ -1,7 +1,7 @@
#ifndef OPENMW_DIALOGUEAPI_HPP
#define OPENMW_DIALOGUEAPI_HPP
#include <Script/Platform.hpp>
#include "../api.h"
#define DIALOGUEAPI \
{"ClearTopicChanges", DialogueFunctions::ClearTopicChanges},\
@ -19,8 +19,7 @@
\
{"InitializeTopicChanges", DialogueFunctions::InitializeTopicChanges}
namespace DialogueFunctions
{
NAMESPACE_BEGIN(DialogueFunctions)
/**
* \brief Clear the last recorded topic changes for a player.
*
@ -29,7 +28,7 @@ namespace DialogueFunctions
* \param pid The player ID whose topic changes should be used.
* \return void
*/
EXPORT_APIFUNCTION void CDECL ClearTopicChanges(unsigned short pid) noexcept;
API_FUNCTION void CDECL ClearTopicChanges(unsigned short pid) noexcept;
/**
* \brief Get the number of indexes in a player's latest topic changes.
@ -37,7 +36,7 @@ namespace DialogueFunctions
* \param pid The player ID whose topic changes should be used.
* \return The number of indexes.
*/
EXPORT_APIFUNCTION unsigned int CDECL GetTopicChangesSize(unsigned short pid) noexcept;
API_FUNCTION unsigned int CDECL GetTopicChangesSize(unsigned short pid) noexcept;
/**
* \brief Add a new topic to the topic changes for a player.
@ -46,7 +45,7 @@ namespace DialogueFunctions
* \param topicId The topicId of the topic.
* \return void
*/
EXPORT_APIFUNCTION void CDECL AddTopic(unsigned short pid, const char* topicId) noexcept;
API_FUNCTION void CDECL AddTopic(unsigned short pid, const char* topicId) noexcept;
/**
* \brief Get the topicId at a certain index in a player's latest topic changes.
@ -55,7 +54,7 @@ namespace DialogueFunctions
* \param index The index of the topic.
* \return The topicId.
*/
EXPORT_APIFUNCTION const char *CDECL GetTopicId(unsigned short pid, unsigned int index) noexcept;
API_FUNCTION const char *CDECL GetTopicId(unsigned short pid, unsigned int index) noexcept;
/**
* \brief Send a PlayerTopic packet with a player's recorded topic changes.
@ -67,7 +66,7 @@ namespace DialogueFunctions
* to the packet (false by default).
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendTopicChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
API_FUNCTION void CDECL SendTopicChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
/**
* \brief Play a certain animation on a player's character by sending a PlayerAnimation
@ -80,7 +79,7 @@ namespace DialogueFunctions
* \param bool Whether the animation should persist or not.
* \return void
*/
EXPORT_APIFUNCTION void CDECL PlayAnimation(unsigned short pid, const char* groupname, int mode, int count, bool persist) noexcept;
API_FUNCTION void CDECL PlayAnimation(unsigned short pid, const char* groupname, int mode, int count, bool persist) noexcept;
/**
* \brief Play a certain sound for a player as spoken by their character by sending
@ -90,11 +89,11 @@ namespace DialogueFunctions
* \param sound The path of the sound file.
* \return void
*/
EXPORT_APIFUNCTION void CDECL PlaySpeech(unsigned short pid, const char* sound) noexcept;
API_FUNCTION void CDECL PlaySpeech(unsigned short pid, const char* sound) noexcept;
// All methods below are deprecated versions of methods from above
EXPORT_APIFUNCTION void CDECL InitializeTopicChanges(unsigned short pid) noexcept;
}
API_FUNCTION void CDECL InitializeTopicChanges(unsigned short pid) noexcept;
NAMESPACE_END()
#endif //OPENMW_DIALOGUEAPI_HPP

@ -1,4 +1,4 @@
#include "Factions.hpp"
#include "Factions.h"
#include <components/misc/stringops.hpp>
#include <components/openmw-mp/NetworkMessages.hpp>

@ -1,7 +1,7 @@
#ifndef OPENMW_FACTIONAPI_HPP
#define OPENMW_FACTIONAPI_HPP
#include <Script/Platform.hpp>
#include "../api.h"
#define FACTIONAPI \
{"ClearFactionChanges", FactionFunctions::ClearFactionChanges},\
@ -26,8 +26,7 @@
\
{"InitializeFactionChanges", FactionFunctions::InitializeFactionChanges}
namespace FactionFunctions
{
NAMESPACE_BEGIN(FactionFunctions)
/**
* \brief Clear the last recorded faction changes for a player.
*
@ -36,7 +35,7 @@ namespace FactionFunctions
* \param pid The player ID whose faction changes should be used.
* \return void
*/
EXPORT_APIFUNCTION void CDECL ClearFactionChanges(unsigned short pid) noexcept;
API_FUNCTION void CDECL ClearFactionChanges(unsigned short pid) noexcept;
/**
* \brief Get the number of indexes in a player's latest faction changes.
@ -44,7 +43,7 @@ namespace FactionFunctions
* \param pid The player ID whose faction changes should be used.
* \return The number of indexes.
*/
EXPORT_APIFUNCTION unsigned int CDECL GetFactionChangesSize(unsigned short pid) noexcept;
API_FUNCTION unsigned int CDECL GetFactionChangesSize(unsigned short pid) noexcept;
/**
* \brief Get the action type used in a player's latest faction changes.
@ -52,7 +51,7 @@ namespace FactionFunctions
* \param pid The player ID whose faction changes should be used.
* \return The action type (0 for RANK, 1 for EXPULSION, 2 for REPUTATION).
*/
EXPORT_APIFUNCTION unsigned char CDECL GetFactionChangesAction(unsigned short pid) noexcept;
API_FUNCTION unsigned char CDECL GetFactionChangesAction(unsigned short pid) noexcept;
/**
* \brief Get the factionId at a certain index in a player's latest faction changes.
@ -61,7 +60,7 @@ namespace FactionFunctions
* \param index The index of the faction.
* \return The factionId.
*/
EXPORT_APIFUNCTION const char *CDECL GetFactionId(unsigned short pid, unsigned int index) noexcept;
API_FUNCTION const char *CDECL GetFactionId(unsigned short pid, unsigned int index) noexcept;
/**
* \brief Get the rank at a certain index in a player's latest faction changes.
@ -70,7 +69,7 @@ namespace FactionFunctions
* \param index The index of the faction.
* \return The rank.
*/
EXPORT_APIFUNCTION int CDECL GetFactionRank(unsigned short pid, unsigned int index) noexcept;
API_FUNCTION int CDECL GetFactionRank(unsigned short pid, unsigned int index) noexcept;
/**
* \brief Get the expulsion state at a certain index in a player's latest faction changes.
@ -79,7 +78,7 @@ namespace FactionFunctions
* \param index The index of the faction.
* \return The expulsion state.
*/
EXPORT_APIFUNCTION bool CDECL GetFactionExpulsionState(unsigned short pid, unsigned int index) noexcept;
API_FUNCTION bool CDECL GetFactionExpulsionState(unsigned short pid, unsigned int index) noexcept;
/**
* \brief Get the reputation at a certain index in a player's latest faction changes.
@ -88,7 +87,7 @@ namespace FactionFunctions
* \param index The index of the faction.
* \return The reputation.
*/
EXPORT_APIFUNCTION int CDECL GetFactionReputation(unsigned short pid, unsigned int index) noexcept;
API_FUNCTION int CDECL GetFactionReputation(unsigned short pid, unsigned int index) noexcept;
/**
* \brief Set the action type in a player's faction changes.
@ -97,7 +96,7 @@ namespace FactionFunctions
* \param action The action (0 for RANK, 1 for EXPULSION, 2 for REPUTATION).
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetFactionChangesAction(unsigned short pid, unsigned char action) noexcept;
API_FUNCTION void CDECL SetFactionChangesAction(unsigned short pid, unsigned char action) noexcept;
/**
* \brief Set the factionId of the temporary faction stored on the server.
@ -105,7 +104,7 @@ namespace FactionFunctions
* \param factionId The factionId.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetFactionId(const char* factionId) noexcept;
API_FUNCTION void CDECL SetFactionId(const char* factionId) noexcept;
/**
* \brief Set the rank of the temporary faction stored on the server.
@ -113,7 +112,7 @@ namespace FactionFunctions
* \param rank The rank.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetFactionRank(unsigned int rank) noexcept;
API_FUNCTION void CDECL SetFactionRank(unsigned int rank) noexcept;
/**
* \brief Set the expulsion state of the temporary faction stored on the server.
@ -121,7 +120,7 @@ namespace FactionFunctions
* \param expulsionState The expulsion state.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetFactionExpulsionState(bool expulsionState) noexcept;
API_FUNCTION void CDECL SetFactionExpulsionState(bool expulsionState) noexcept;
/**
* \brief Set the reputation of the temporary faction stored on the server.
@ -129,7 +128,7 @@ namespace FactionFunctions
* \param reputation The reputation.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetFactionReputation(int reputation) noexcept;
API_FUNCTION void CDECL SetFactionReputation(int reputation) noexcept;
/**
* \brief Add the server's temporary faction to the faction changes for a player.
@ -140,7 +139,7 @@ namespace FactionFunctions
* \param pid The player ID whose faction changes should be used.
* \return void
*/
EXPORT_APIFUNCTION void CDECL AddFaction(unsigned short pid) noexcept;
API_FUNCTION void CDECL AddFaction(unsigned short pid) noexcept;
/**
* \brief Send a PlayerFaction packet with a player's recorded faction changes.
@ -152,11 +151,11 @@ namespace FactionFunctions
* to the packet (false by default).
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendFactionChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
API_FUNCTION void CDECL SendFactionChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
// All methods below are deprecated versions of methods from above
EXPORT_APIFUNCTION void CDECL InitializeFactionChanges(unsigned short pid) noexcept;
}
API_FUNCTION void CDECL InitializeFactionChanges(unsigned short pid) noexcept;
NAMESPACE_END()
#endif //OPENMW_FACTIONAPI_HPP

@ -1,4 +1,4 @@
#include "GUI.hpp"
#include "GUI.h"
#include <components/openmw-mp/NetworkMessages.hpp>

@ -1,7 +1,7 @@
#ifndef OPENMW_GUIAPI_HPP
#define OPENMW_GUIAPI_HPP
#include <Script/Platform.hpp>
#include "../api.h"
#define GUIAPI \
{"MessageBox", GUIFunctions::_MessageBox},\
@ -27,8 +27,7 @@
\
{"InitializeQuickKeyChanges", GUIFunctions::InitializeQuickKeyChanges}
namespace GUIFunctions
{
NAMESPACE_BEGIN(GUIFunctions)
/**
* \brief Display a simple messagebox at the bottom of the screen that vanishes
* after a few seconds.
@ -41,7 +40,7 @@ namespace GUIFunctions
* \param label The text in the messagebox.
* \return void
*/
EXPORT_APIFUNCTION void CDECL _MessageBox(unsigned short pid, int id, const char *label) noexcept;
API_FUNCTION void CDECL _MessageBox(unsigned short pid, int id, const char *label) noexcept;
/**
* \brief Display an interactive messagebox at the center of the screen that
@ -53,7 +52,7 @@ namespace GUIFunctions
* \parm buttons The captions of the buttons, separated by semicolons (e.g. "Yes;No;Maybe").
* \return void
*/
EXPORT_APIFUNCTION void CDECL CustomMessageBox(unsigned short pid, int id, const char *label, const char *buttons) noexcept;
API_FUNCTION void CDECL CustomMessageBox(unsigned short pid, int id, const char *label, const char *buttons) noexcept;
/**
* \brief Display an input dialog at the center of the screen.
@ -64,7 +63,7 @@ namespace GUIFunctions
* \parm note The text at the bottom of the input dialog.
* \return void
*/
EXPORT_APIFUNCTION void CDECL InputDialog(unsigned short pid, int id, const char *label, const char *note) noexcept;
API_FUNCTION void CDECL InputDialog(unsigned short pid, int id, const char *label, const char *note) noexcept;
/**
* \brief Display a password dialog at the center of the screen.
@ -78,7 +77,7 @@ namespace GUIFunctions
* \parm note The text at the bottom of the password dialog.
* \return void
*/
EXPORT_APIFUNCTION void CDECL PasswordDialog(unsigned short pid, int id, const char *label, const char *note) noexcept;
API_FUNCTION void CDECL PasswordDialog(unsigned short pid, int id, const char *label, const char *note) noexcept;
/**
* \brief Display a listbox at the center of the screen where each item takes up
@ -91,7 +90,7 @@ namespace GUIFunctions
* \parm items The items in the listbox, separated by newlines (e.g. "Item 1\nItem 2").
* \return void
*/
EXPORT_APIFUNCTION void CDECL ListBox(unsigned short pid, int id, const char *label, const char *items);
API_FUNCTION void CDECL ListBox(unsigned short pid, int id, const char *label, const char *items);
/**
* \brief Clear the last recorded quick key changes for a player.
@ -101,7 +100,7 @@ namespace GUIFunctions
* \param pid The player ID whose quick key changes should be used.
* \return void
*/
EXPORT_APIFUNCTION void CDECL ClearQuickKeyChanges(unsigned short pid) noexcept;
API_FUNCTION void CDECL ClearQuickKeyChanges(unsigned short pid) noexcept;
/**
* \brief Get the number of indexes in a player's latest quick key changes.
@ -109,7 +108,7 @@ namespace GUIFunctions
* \param pid The player ID whose quick key changes should be used.
* \return The number of indexes.
*/
EXPORT_APIFUNCTION unsigned int CDECL GetQuickKeyChangesSize(unsigned short pid) noexcept;
API_FUNCTION unsigned int CDECL GetQuickKeyChangesSize(unsigned short pid) noexcept;
/**
* \brief Add a new quick key to the quick key changes for a player.
@ -120,7 +119,7 @@ namespace GUIFunctions
* \param itemId The itemId of the item.
* \return void
*/
EXPORT_APIFUNCTION void CDECL AddQuickKey(unsigned short pid, unsigned short slot, int type, const char* itemId = "") noexcept;
API_FUNCTION void CDECL AddQuickKey(unsigned short pid, unsigned short slot, int type, const char* itemId = "") noexcept;
/**
* \brief Get the slot of the quick key at a certain index in a player's latest quick key changes.
@ -129,7 +128,7 @@ namespace GUIFunctions
* \param index The index of the quick key in the quick key changes vector.
* \return The slot.
*/
EXPORT_APIFUNCTION int CDECL GetQuickKeySlot(unsigned short pid, unsigned int index) noexcept;
API_FUNCTION int CDECL GetQuickKeySlot(unsigned short pid, unsigned int index) noexcept;
/**
* \brief Get the type of the quick key at a certain index in a player's latest quick key changes.
@ -138,7 +137,7 @@ namespace GUIFunctions
* \param index The index of the quick key in the quick key changes vector.
* \return The quick key type.
*/
EXPORT_APIFUNCTION int CDECL GetQuickKeyType(unsigned short pid, unsigned int index) noexcept;
API_FUNCTION int CDECL GetQuickKeyType(unsigned short pid, unsigned int index) noexcept;
/**
* \brief Get the itemId at a certain index in a player's latest quick key changes.
@ -147,7 +146,7 @@ namespace GUIFunctions
* \param index The index of the quick key in the quick key changes vector.
* \return The itemId.
*/
EXPORT_APIFUNCTION const char *CDECL GetQuickKeyItemId(unsigned short pid, unsigned int index) noexcept;
API_FUNCTION const char *CDECL GetQuickKeyItemId(unsigned short pid, unsigned int index) noexcept;
/**
* \brief Send a PlayerQuickKeys packet with a player's recorded quick key changes.
@ -155,7 +154,7 @@ namespace GUIFunctions
* \param pid The player ID whose quick key changes should be used.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendQuickKeyChanges(unsigned short pid) noexcept;
API_FUNCTION void CDECL SendQuickKeyChanges(unsigned short pid) noexcept;
//state 0 - disallow, 1 - allow
@ -169,7 +168,7 @@ namespace GUIFunctions
* \param state The state of the map marker (false to hide, true to reveal).
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetMapVisibility(unsigned short targetPid, unsigned short affectedPid, unsigned short state) noexcept;
API_FUNCTION void CDECL SetMapVisibility(unsigned short targetPid, unsigned short affectedPid, unsigned short state) noexcept;
/**
* \brief Determine whether a player's map marker can be seen by all other players.
@ -180,11 +179,11 @@ namespace GUIFunctions
* \param state The state of the map marker (false to hide, true to reveal).
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetMapVisibilityAll(unsigned short targetPid, unsigned short state) noexcept;
API_FUNCTION void CDECL SetMapVisibilityAll(unsigned short targetPid, unsigned short state) noexcept;
// All methods below are deprecated versions of methods from above
EXPORT_APIFUNCTION void CDECL InitializeQuickKeyChanges(unsigned short pid) noexcept;
}
API_FUNCTION void CDECL InitializeQuickKeyChanges(unsigned short pid) noexcept;
NAMESPACE_END()
#endif //OPENMW_GUIAPI_HPP

@ -1,4 +1,4 @@
#include "Items.hpp"
#include "Items.h"
#include <components/misc/stringops.hpp>
#include <components/openmw-mp/NetworkMessages.hpp>

@ -1,7 +1,7 @@
#ifndef OPENMW_ITEMAPI_HPP
#define OPENMW_ITEMAPI_HPP
#include <Script/Platform.hpp>
#include "../api.h"
#define ITEMAPI \
{"ClearInventoryChanges", ItemFunctions::ClearInventoryChanges},\
@ -43,8 +43,7 @@
{"InitializeInventoryChanges", ItemFunctions::InitializeInventoryChanges},\
{"AddItem", ItemFunctions::AddItem}
namespace ItemFunctions
{
NAMESPACE_BEGIN(ItemFunctions)
/**
* \brief Clear the last recorded inventory changes for a player.
*
@ -53,7 +52,7 @@ namespace ItemFunctions
* \param pid The player ID whose inventory changes should be used.
* \return void
*/
EXPORT_APIFUNCTION void CDECL ClearInventoryChanges(unsigned short pid) noexcept;
API_FUNCTION void CDECL ClearInventoryChanges(unsigned short pid) noexcept;
/**
* \brief Get the number of slots used for equipment.
@ -62,7 +61,7 @@ namespace ItemFunctions
*
* \return The number of slots.
*/
EXPORT_APIFUNCTION int CDECL GetEquipmentSize() noexcept;
API_FUNCTION int CDECL GetEquipmentSize() noexcept;
/**
* \brief Get the number of indexes in a player's latest inventory changes.
@ -70,7 +69,7 @@ namespace ItemFunctions
* \param pid The player ID whose inventory changes should be used.
* \return The number of indexes.
*/
EXPORT_APIFUNCTION unsigned int CDECL GetInventoryChangesSize(unsigned short pid) noexcept;
API_FUNCTION unsigned int CDECL GetInventoryChangesSize(unsigned short pid) noexcept;
/**
* \brief Get the action type used in a player's latest inventory changes.
@ -78,7 +77,7 @@ namespace ItemFunctions
* \param pid The player ID whose inventory changes should be used.
* \return The action type (0 for SET, 1 for ADD, 2 for REMOVE).
*/
EXPORT_APIFUNCTION unsigned int CDECL GetInventoryChangesAction(unsigned short pid) noexcept;
API_FUNCTION unsigned int CDECL GetInventoryChangesAction(unsigned short pid) noexcept;
/**
* \brief Set the action type in a player's inventory changes.
@ -87,7 +86,7 @@ namespace ItemFunctions
* \param action The action (0 for SET, 1 for ADD, 2 for REMOVE).
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetInventoryChangesAction(unsigned short pid, unsigned char action) noexcept;
API_FUNCTION void CDECL SetInventoryChangesAction(unsigned short pid, unsigned char action) noexcept;
/**
* \brief Equip an item in a certain slot of the equipment of a player.
@ -100,7 +99,7 @@ namespace ItemFunctions
* \param enchantmentCharge The enchantment charge of the item.
* \return void
*/
EXPORT_APIFUNCTION void CDECL EquipItem(unsigned short pid, unsigned short slot, const char* refId, unsigned int count, int charge,
API_FUNCTION void CDECL EquipItem(unsigned short pid, unsigned short slot, const char* refId, unsigned int count, int charge,
double enchantmentCharge = -1) noexcept;
/**
@ -110,7 +109,7 @@ namespace ItemFunctions
* \param slot The equipment slot.
* \return void
*/
EXPORT_APIFUNCTION void CDECL UnequipItem(unsigned short pid, unsigned short slot) noexcept;
API_FUNCTION void CDECL UnequipItem(unsigned short pid, unsigned short slot) noexcept;
/**
* \brief Add an item change to a player's inventory changes.
@ -123,7 +122,7 @@ namespace ItemFunctions
* \param soul The soul of the item.
* \return void
*/
EXPORT_APIFUNCTION void CDECL AddItemChange(unsigned short pid, const char* refId, unsigned int count, int charge,
API_FUNCTION void CDECL AddItemChange(unsigned short pid, const char* refId, unsigned int count, int charge,
double enchantmentCharge, const char* soul) noexcept;
/**
@ -133,7 +132,7 @@ namespace ItemFunctions
* \param refId The refId of the item.
* \return Whether the player has the item equipped.
*/
EXPORT_APIFUNCTION bool CDECL HasItemEquipped(unsigned short pid, const char* refId);
API_FUNCTION bool CDECL HasItemEquipped(unsigned short pid, const char* refId);
/**
* \brief Get the refId of the item in a certain slot of the equipment of a player.
@ -142,7 +141,7 @@ namespace ItemFunctions
* \param slot The slot of the equipment item.
* \return The refId.
*/
EXPORT_APIFUNCTION const char *CDECL GetEquipmentItemRefId(unsigned short pid, unsigned short slot) noexcept;
API_FUNCTION const char *CDECL GetEquipmentItemRefId(unsigned short pid, unsigned short slot) noexcept;
/**
* \brief Get the count of the item in a certain slot of the equipment of a player.
@ -151,7 +150,7 @@ namespace ItemFunctions
* \param slot The slot of the equipment item.
* \return The item count.
*/
EXPORT_APIFUNCTION int CDECL GetEquipmentItemCount(unsigned short pid, unsigned short slot) noexcept;
API_FUNCTION int CDECL GetEquipmentItemCount(unsigned short pid, unsigned short slot) noexcept;
/**
* \brief Get the charge of the item in a certain slot of the equipment of a player.
@ -160,7 +159,7 @@ namespace ItemFunctions
* \param slot The slot of the equipment item.
* \return The charge.
*/
EXPORT_APIFUNCTION int CDECL GetEquipmentItemCharge(unsigned short pid, unsigned short slot) noexcept;
API_FUNCTION int CDECL GetEquipmentItemCharge(unsigned short pid, unsigned short slot) noexcept;
/**
* \brief Get the enchantment charge of the item in a certain slot of the equipment of
@ -170,7 +169,7 @@ namespace ItemFunctions
* \param slot The slot of the equipment item.
* \return The enchantment charge.
*/
EXPORT_APIFUNCTION double CDECL GetEquipmentItemEnchantmentCharge(unsigned short pid, unsigned short slot) noexcept;
API_FUNCTION double CDECL GetEquipmentItemEnchantmentCharge(unsigned short pid, unsigned short slot) noexcept;
/**
* \brief Get the refId of the item at a certain index in a player's latest inventory
@ -180,7 +179,7 @@ namespace ItemFunctions
* \param index The index of the inventory item.
* \return The refId.
*/
EXPORT_APIFUNCTION const char *CDECL GetInventoryItemRefId(unsigned short pid, unsigned int index) noexcept;
API_FUNCTION const char *CDECL GetInventoryItemRefId(unsigned short pid, unsigned int index) noexcept;
/**
* \brief Get the count of the item at a certain index in a player's latest inventory
@ -190,7 +189,7 @@ namespace ItemFunctions
* \param index The index of the inventory item.
* \return The item count.
*/
EXPORT_APIFUNCTION int CDECL GetInventoryItemCount(unsigned short pid, unsigned int index) noexcept;
API_FUNCTION int CDECL GetInventoryItemCount(unsigned short pid, unsigned int index) noexcept;
/**
* \brief Get the charge of the item at a certain index in a player's latest inventory
@ -200,7 +199,7 @@ namespace ItemFunctions
* \param index The index of the inventory item.
* \return The charge.
*/
EXPORT_APIFUNCTION int CDECL GetInventoryItemCharge(unsigned short pid, unsigned int index) noexcept;
API_FUNCTION int CDECL GetInventoryItemCharge(unsigned short pid, unsigned int index) noexcept;
/**
* \brief Get the enchantment charge of the item at a certain index in a player's
@ -210,7 +209,7 @@ namespace ItemFunctions
* \param index The index of the inventory item.
* \return The enchantment charge.
*/
EXPORT_APIFUNCTION double CDECL GetInventoryItemEnchantmentCharge(unsigned short pid, unsigned int index) noexcept;
API_FUNCTION double CDECL GetInventoryItemEnchantmentCharge(unsigned short pid, unsigned int index) noexcept;
/**
* \brief Get the soul of the item at a certain index in a player's latest inventory
@ -220,7 +219,7 @@ namespace ItemFunctions
* \param index The index of the inventory item.
* \return The soul.
*/
EXPORT_APIFUNCTION const char *CDECL GetInventoryItemSoul(unsigned short pid, unsigned int index) noexcept;
API_FUNCTION const char *CDECL GetInventoryItemSoul(unsigned short pid, unsigned int index) noexcept;
/**
* \brief Get the refId of the item last used by a player.
@ -228,7 +227,7 @@ namespace ItemFunctions
* \param pid The player ID.
* \return The refId.
*/
EXPORT_APIFUNCTION const char *CDECL GetUsedItemRefId(unsigned short pid) noexcept;
API_FUNCTION const char *CDECL GetUsedItemRefId(unsigned short pid) noexcept;
/**
* \brief Get the count of the item last used by a player.
@ -236,7 +235,7 @@ namespace ItemFunctions
* \param pid The player ID.
* \return The item count.
*/
EXPORT_APIFUNCTION int CDECL GetUsedItemCount(unsigned short pid) noexcept;
API_FUNCTION int CDECL GetUsedItemCount(unsigned short pid) noexcept;
/**
* \brief Get the charge of the item last used by a player.
@ -244,7 +243,7 @@ namespace ItemFunctions
* \param pid The player ID.
* \return The charge.
*/
EXPORT_APIFUNCTION int CDECL GetUsedItemCharge(unsigned short pid) noexcept;
API_FUNCTION int CDECL GetUsedItemCharge(unsigned short pid) noexcept;
/**
* \brief Get the enchantment charge of the item last used by a player.
@ -252,7 +251,7 @@ namespace ItemFunctions
* \param pid The player ID.
* \return The enchantment charge.
*/
EXPORT_APIFUNCTION double CDECL GetUsedItemEnchantmentCharge(unsigned short pid) noexcept;
API_FUNCTION double CDECL GetUsedItemEnchantmentCharge(unsigned short pid) noexcept;
/**
* \brief Get the soul of the item last used by a player.
@ -260,7 +259,7 @@ namespace ItemFunctions
* \param pid The player ID.
* \return The soul.
*/
EXPORT_APIFUNCTION const char *CDECL GetUsedItemSoul(unsigned short pid) noexcept;
API_FUNCTION const char *CDECL GetUsedItemSoul(unsigned short pid) noexcept;
/**
* \brief Send a PlayerEquipment packet with a player's equipment.
@ -270,7 +269,7 @@ namespace ItemFunctions
* \param pid The player ID whose equipment should be sent.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendEquipment(unsigned short pid) noexcept;
API_FUNCTION void CDECL SendEquipment(unsigned short pid) noexcept;
/**
* \brief Send a PlayerInventory packet with a player's recorded inventory changes.
@ -282,7 +281,7 @@ namespace ItemFunctions
* to the packet (false by default).
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendInventoryChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
API_FUNCTION void CDECL SendInventoryChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
/**
* \brief Send a PlayerItemUse causing a player to use their recorded usedItem.
@ -290,14 +289,14 @@ namespace ItemFunctions
* \param pid The player ID affected.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendItemUse(unsigned short pid) noexcept;
API_FUNCTION void CDECL SendItemUse(unsigned short pid) noexcept;
// All methods below are deprecated versions of methods from above
EXPORT_APIFUNCTION void CDECL InitializeInventoryChanges(unsigned short pid) noexcept;
API_FUNCTION void CDECL InitializeInventoryChanges(unsigned short pid) noexcept;
EXPORT_APIFUNCTION void CDECL AddItem(unsigned short pid, const char* refId, unsigned int count, int charge,
API_FUNCTION void CDECL AddItem(unsigned short pid, const char* refId, unsigned int count, int charge,
double enchantmentCharge, const char* soul) noexcept;
}
NAMESPACE_END()
#endif //OPENMW_ITEMAPI_HPP

@ -1,4 +1,4 @@
#include "Mechanics.hpp"
#include "Mechanics.h"
#include <components/openmw-mp/NetworkMessages.hpp>
#include <components/openmw-mp/Log.hpp>

@ -3,7 +3,7 @@
#include "../Types.hpp"
#include <Script/Platform.hpp>
#include "../api.h"
#define MECHANICSAPI \
{"GetMiscellaneousChangeType", MechanicsFunctions::GetMiscellaneousChangeType},\
@ -40,15 +40,14 @@
{"GetDeathReason", MechanicsFunctions::GetDeathReason},\
{"GetPlayerKillerRefNumIndex", MechanicsFunctions::GetPlayerKillerRefNumIndex}
namespace MechanicsFunctions
{
NAMESPACE_BEGIN(MechanicsFunctions)
/**
* \brief Get the type of a PlayerMiscellaneous packet.
*
* \param pid The player ID.
* \return The type.
*/
EXPORT_APIFUNCTION unsigned char CDECL GetMiscellaneousChangeType(unsigned short pid) noexcept;
API_FUNCTION unsigned char CDECL GetMiscellaneousChangeType(unsigned short pid) noexcept;
/**
* \brief Get the cell description of a player's Mark cell.
@ -56,7 +55,7 @@ namespace MechanicsFunctions
* \param pid The player ID.
* \return The cell description.
*/
EXPORT_APIFUNCTION const char *CDECL GetMarkCell(unsigned short pid) noexcept;
API_FUNCTION const char *CDECL GetMarkCell(unsigned short pid) noexcept;
/**
* \brief Get the X position of a player's Mark.
@ -64,7 +63,7 @@ namespace MechanicsFunctions
* \param pid The player ID.
* \return The X position.
*/
EXPORT_APIFUNCTION double CDECL GetMarkPosX(unsigned short pid) noexcept;
API_FUNCTION double CDECL GetMarkPosX(unsigned short pid) noexcept;
/**
* \brief Get the Y position of a player's Mark.
@ -72,7 +71,7 @@ namespace MechanicsFunctions
* \param pid The player ID.
* \return The Y position.
*/
EXPORT_APIFUNCTION double CDECL GetMarkPosY(unsigned short pid) noexcept;
API_FUNCTION double CDECL GetMarkPosY(unsigned short pid) noexcept;
/**
* \brief Get the Z position of a player's Mark.
@ -80,7 +79,7 @@ namespace MechanicsFunctions
* \param pid The player ID.
* \return The Z position.
*/
EXPORT_APIFUNCTION double CDECL GetMarkPosZ(unsigned short pid) noexcept;
API_FUNCTION double CDECL GetMarkPosZ(unsigned short pid) noexcept;
/**
* \brief Get the X rotation of a player's Mark.
@ -88,7 +87,7 @@ namespace MechanicsFunctions
* \param pid The player ID.
* \return The X rotation.
*/
EXPORT_APIFUNCTION double CDECL GetMarkRotX(unsigned short pid) noexcept;
API_FUNCTION double CDECL GetMarkRotX(unsigned short pid) noexcept;
/**
* \brief Get the Z rotation of a player's Mark.
@ -96,7 +95,7 @@ namespace MechanicsFunctions
* \param pid The player ID.
* \return The X rotation.
*/
EXPORT_APIFUNCTION double CDECL GetMarkRotZ(unsigned short pid) noexcept;
API_FUNCTION double CDECL GetMarkRotZ(unsigned short pid) noexcept;
/**
* \brief Get the ID of a player's selected spell.
@ -104,7 +103,7 @@ namespace MechanicsFunctions
* \param pid The player ID.
* \return The spell ID.
*/
EXPORT_APIFUNCTION const char *CDECL GetSelectedSpellId(unsigned short pid) noexcept;
API_FUNCTION const char *CDECL GetSelectedSpellId(unsigned short pid) noexcept;
/**
* \brief Check whether the killer of a certain player is also a player.
@ -112,7 +111,7 @@ namespace MechanicsFunctions
* \param pid The player ID of the killed player.
* \return Whether the player was killed by another player.
*/
EXPORT_APIFUNCTION bool CDECL DoesPlayerHavePlayerKiller(unsigned short pid) noexcept;
API_FUNCTION bool CDECL DoesPlayerHavePlayerKiller(unsigned short pid) noexcept;
/**
* \brief Get the player ID of the killer of a certain player.
@ -120,7 +119,7 @@ namespace MechanicsFunctions
* \param pid The player ID of the killed player.
* \return The player ID of the killer.
*/
EXPORT_APIFUNCTION int CDECL GetPlayerKillerPid(unsigned short pid) noexcept;
API_FUNCTION int CDECL GetPlayerKillerPid(unsigned short pid) noexcept;
/**
* \brief Get the refId of the actor killer of a certain player.
@ -128,7 +127,7 @@ namespace MechanicsFunctions
* \param pid The player ID of the killed player.
* \return The refId of the killer.
*/
EXPORT_APIFUNCTION const char *CDECL GetPlayerKillerRefId(unsigned short pid) noexcept;
API_FUNCTION const char *CDECL GetPlayerKillerRefId(unsigned short pid) noexcept;
/**
* \brief Get the refNum of the actor killer of a certain player.
@ -136,7 +135,7 @@ namespace MechanicsFunctions
* \param pid The player ID of the killed player.
* \return The refNum of the killer.
*/
EXPORT_APIFUNCTION unsigned int CDECL GetPlayerKillerRefNum(unsigned short pid) noexcept;
API_FUNCTION unsigned int CDECL GetPlayerKillerRefNum(unsigned short pid) noexcept;
/**
* \brief Get the mpNum of the actor killer of a certain player.
@ -144,7 +143,7 @@ namespace MechanicsFunctions
* \param pid The player ID of the killed player.
* \return The mpNum of the killer.
*/
EXPORT_APIFUNCTION unsigned int CDECL GetPlayerKillerMpNum(unsigned short pid) noexcept;
API_FUNCTION unsigned int CDECL GetPlayerKillerMpNum(unsigned short pid) noexcept;
/**
* \brief Get the name of the actor killer of a certain player.
@ -152,7 +151,7 @@ namespace MechanicsFunctions
* \param pid The player ID of the killed player.
* \return The name of the killer.
*/
EXPORT_APIFUNCTION const char *CDECL GetPlayerKillerName(unsigned short pid) noexcept;
API_FUNCTION const char *CDECL GetPlayerKillerName(unsigned short pid) noexcept;
/**
* \brief Get the draw state of a player (0 for nothing, 1 for drawn weapon,
@ -161,7 +160,7 @@ namespace MechanicsFunctions
* \param pid The player ID.
* \return The draw state.
*/
EXPORT_APIFUNCTION unsigned int CDECL GetDrawState(unsigned short pid) noexcept;
API_FUNCTION unsigned int CDECL GetDrawState(unsigned short pid) noexcept;
/**
* \brief Get the sneak state of a player.
@ -169,7 +168,7 @@ namespace MechanicsFunctions
* \param pid The player ID.
* \return Whether the player is sneaking.
*/
EXPORT_APIFUNCTION bool CDECL GetSneakState(unsigned short pid) noexcept;
API_FUNCTION bool CDECL GetSneakState(unsigned short pid) noexcept;
/**
* \brief Set the Mark cell of a player.
@ -184,7 +183,7 @@ namespace MechanicsFunctions
* \param cellDescription The cell description.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetMarkCell(unsigned short pid, const char *cellDescription) noexcept;
API_FUNCTION void CDECL SetMarkCell(unsigned short pid, const char *cellDescription) noexcept;
/**
* \brief Set the Mark position of a player.
@ -198,7 +197,7 @@ namespace MechanicsFunctions
* \param z The Z position.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetMarkPos(unsigned short pid, double x, double y, double z) noexcept;
API_FUNCTION void CDECL SetMarkPos(unsigned short pid, double x, double y, double z) noexcept;
/**
* \brief Set the Mark rotation of a player.
@ -211,7 +210,7 @@ namespace MechanicsFunctions
* \param z The Z rotation.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetMarkRot(unsigned short pid, double x, double z) noexcept;
API_FUNCTION void CDECL SetMarkRot(unsigned short pid, double x, double z) noexcept;
/**
* \brief Set the ID of a player's selected spell.
@ -223,7 +222,7 @@ namespace MechanicsFunctions
* \param spellId The spell ID.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetSelectedSpellId(unsigned short pid, const char *spellId) noexcept;
API_FUNCTION void CDECL SetSelectedSpellId(unsigned short pid, const char *spellId) noexcept;
/**
* \brief Send a PlayerMiscellaneous packet with a Mark location to a player.
@ -231,7 +230,7 @@ namespace MechanicsFunctions
* \param pid The player ID.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendMarkLocation(unsigned short pid);
API_FUNCTION void CDECL SendMarkLocation(unsigned short pid);
/**
* \brief Send a PlayerMiscellaneous packet with a selected spell ID to a player.
@ -239,7 +238,7 @@ namespace MechanicsFunctions
* \param pid The player ID.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendSelectedSpell(unsigned short pid);
API_FUNCTION void CDECL SendSelectedSpell(unsigned short pid);
/**
* \brief Send a PlayerJail packet about a player.
@ -261,7 +260,7 @@ namespace MechanicsFunctions
* \param jailEndText The text that should be displayed once the jailing period is over.
* \return void
*/
EXPORT_APIFUNCTION void CDECL Jail(unsigned short pid, int jailDays, bool ignoreJailTeleportation, bool ignoreJailSkillIncreases,
API_FUNCTION void CDECL Jail(unsigned short pid, int jailDays, bool ignoreJailTeleportation, bool ignoreJailSkillIncreases,
const char* jailProgressText, const char* jailEndText) noexcept;
/**
@ -274,12 +273,12 @@ namespace MechanicsFunctions
* 2 for TRIBUNAL_TEMPLE).
* \return void
*/
EXPORT_APIFUNCTION void CDECL Resurrect(unsigned short pid, unsigned int type) noexcept;
API_FUNCTION void CDECL Resurrect(unsigned short pid, unsigned int type) noexcept;
// All methods below are deprecated versions of methods from above
EXPORT_APIFUNCTION const char *CDECL GetDeathReason(unsigned short pid) noexcept;
EXPORT_APIFUNCTION unsigned int CDECL GetPlayerKillerRefNumIndex(unsigned short pid) noexcept;
}
API_FUNCTION const char *CDECL GetDeathReason(unsigned short pid) noexcept;
API_FUNCTION unsigned int CDECL GetPlayerKillerRefNumIndex(unsigned short pid) noexcept;
NAMESPACE_END()
#endif //OPENMW_MECHANICSAPI_HPP

@ -1,4 +1,4 @@
#include "Miscellaneous.hpp"
#include "Miscellaneous.h"
#include <components/misc/stringops.hpp>
#include <components/openmw-mp/Log.hpp>

@ -3,7 +3,7 @@
#include "../Types.hpp"
#include <Script/Platform.hpp>
#include "../api.h"
#define MISCELLANEOUSAPI \
{"DoesFileExist", MiscellaneousFunctions::DoesFileExist},\
@ -17,8 +17,7 @@
{"LogMessage", MiscellaneousFunctions::LogMessage},\
{"LogAppend", MiscellaneousFunctions::LogAppend}
namespace MiscellaneousFunctions
{
NAMESPACE_BEGIN(MiscellaneousFunctions)
/**
* \brief Check whether a certain file exists.
*
@ -28,7 +27,7 @@ namespace MiscellaneousFunctions
*
* \return Whether the file exists or not.
*/
EXPORT_APIFUNCTION bool CDECL DoesFileExist(const char *filePath) noexcept;
API_FUNCTION bool CDECL DoesFileExist(const char *filePath) noexcept;
/**
* \brief Get the first filename in a folder that has a case insensitive match with the filename
@ -38,7 +37,7 @@ namespace MiscellaneousFunctions
*
* \return The filename that matches.
*/
EXPORT_APIFUNCTION const char *CDECL GetCaseInsensitiveFilename(const char *folderPath, const char *filename) noexcept;
API_FUNCTION const char *CDECL GetCaseInsensitiveFilename(const char *folderPath, const char *filename) noexcept;
/**
* \brief Get the last player ID currently connected to the server.
@ -48,7 +47,7 @@ namespace MiscellaneousFunctions
*
* \return The player ID.
*/
EXPORT_APIFUNCTION unsigned int CDECL GetLastPlayerId() noexcept;
API_FUNCTION unsigned int CDECL GetLastPlayerId() noexcept;
/**
* \brief Get the current (latest) mpNum generated by the server.
@ -62,7 +61,7 @@ namespace MiscellaneousFunctions
*
* \return The mpNum.
*/
EXPORT_APIFUNCTION int CDECL GetCurrentMpNum() noexcept;
API_FUNCTION int CDECL GetCurrentMpNum() noexcept;
/**
* \brief Set the current (latest) mpNum generated by the server.
@ -74,7 +73,7 @@ namespace MiscellaneousFunctions
* \param mpNum The number that should be used as the new current mpNum.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetCurrentMpNum(int mpNum) noexcept;
API_FUNCTION void CDECL SetCurrentMpNum(int mpNum) noexcept;
/**
* \brief Write a log message with its own timestamp.
@ -86,7 +85,7 @@ namespace MiscellaneousFunctions
* \param message The message logged.
* \return void
*/
EXPORT_APIFUNCTION void CDECL LogMessage(unsigned short level, const char *message) noexcept;
API_FUNCTION void CDECL LogMessage(unsigned short level, const char *message) noexcept;
/**
* \brief Write a log message without its own timestamp.
@ -98,7 +97,7 @@ namespace MiscellaneousFunctions
* \param message The message logged.
* \return void
*/
EXPORT_APIFUNCTION void CDECL LogAppend(unsigned short level, const char *message) noexcept;
}
API_FUNCTION void CDECL LogAppend(unsigned short level, const char *message) noexcept;
NAMESPACE_END()
#endif //OPENMW_MISCELLANEOUSAPI_HPP

@ -6,7 +6,7 @@
#include <apps/openmw-mp/Utils.hpp>
#include <apps/openmw-mp/Script/ScriptFunctions.hpp>
#include "Objects.hpp"
#include "Objects.h"
using namespace mwmp;

@ -1,7 +1,7 @@
#ifndef OPENMW_OBJECTAPI_HPP
#define OPENMW_OBJECTAPI_HPP
#include <Script/Platform.hpp>
#include "../api.h"
#define OBJECTAPI \
{"ReadReceivedObjectList", ObjectFunctions::ReadReceivedObjectList},\
@ -138,21 +138,20 @@
{"SetObjectRefNumIndex", ObjectFunctions::SetObjectRefNumIndex},\
{"AddWorldObject", ObjectFunctions::AddWorldObject}
namespace ObjectFunctions
{
NAMESPACE_BEGIN(ObjectFunctions)
/**
* \brief Use the last object list received by the server as the one being read.
*
* \return void
*/
EXPORT_APIFUNCTION void CDECL ReadReceivedObjectList() noexcept;
API_FUNCTION void CDECL ReadReceivedObjectList() noexcept;
/**
* \brief Clear the data from the object list stored on the server.
*
* \return void
*/
EXPORT_APIFUNCTION void CDECL ClearObjectList() noexcept;
API_FUNCTION void CDECL ClearObjectList() noexcept;
/**
* \brief Set the pid attached to the ObjectList.
@ -160,7 +159,7 @@ namespace ObjectFunctions
* \param pid The player ID to whom the object list should be attached.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetObjectListPid(unsigned short pid) noexcept;
API_FUNCTION void CDECL SetObjectListPid(unsigned short pid) noexcept;
/**
* \brief Take the contents of the read-only object list last received by the
@ -169,14 +168,14 @@ namespace ObjectFunctions
*
* \return void
*/
EXPORT_APIFUNCTION void CDECL CopyReceivedObjectListToStore() noexcept;
API_FUNCTION void CDECL CopyReceivedObjectListToStore() noexcept;
/**
* \brief Get the number of indexes in the read object list.
*
* \return The number of indexes.
*/
EXPORT_APIFUNCTION unsigned int CDECL GetObjectListSize() noexcept;
API_FUNCTION unsigned int CDECL GetObjectListSize() noexcept;
/**
* \brief Get the origin of the read object list.
@ -185,7 +184,7 @@ namespace ObjectFunctions
* CLIENT_DIALOGUE, 3 for CLIENT_SCRIPT_LOCAL, 4 for CLIENT_SCRIPT_GLOBAL,
* 5 for SERVER_SCRIPT).
*/
EXPORT_APIFUNCTION unsigned char CDECL GetObjectListOrigin() noexcept;
API_FUNCTION unsigned char CDECL GetObjectListOrigin() noexcept;
/**
* \brief Get the client script that the read object list originated from.
@ -194,21 +193,21 @@ namespace ObjectFunctions
*
* \return The ID of the client script.
*/
EXPORT_APIFUNCTION const char *CDECL GetObjectListClientScript() noexcept;
API_FUNCTION const char *CDECL GetObjectListClientScript() noexcept;
/**
* \brief Get the action type used in the read object list.
*
* \return The action type (0 for SET, 1 for ADD, 2 for REMOVE, 3 for REQUEST).
*/
EXPORT_APIFUNCTION unsigned char CDECL GetObjectListAction() noexcept;
API_FUNCTION unsigned char CDECL GetObjectListAction() noexcept;
/**
* \brief Get the container subaction type used in the read object list.
*
* \return The action type (0 for NONE, 1 for DRAG, 2 for DROP, 3 for TAKE_ALL).
*/
EXPORT_APIFUNCTION unsigned char CDECL GetObjectListContainerSubAction() noexcept;
API_FUNCTION unsigned char CDECL GetObjectListContainerSubAction() noexcept;
/**
* \brief Check whether the object at a certain index in the read object list is a
@ -221,7 +220,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return Whether the object is a player.
*/
EXPORT_APIFUNCTION bool CDECL IsObjectPlayer(unsigned int index) noexcept;
API_FUNCTION bool CDECL IsObjectPlayer(unsigned int index) noexcept;
/**
* \brief Get the player ID of the object at a certain index in the read object list,
@ -233,7 +232,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The player ID of the object.
*/
EXPORT_APIFUNCTION int CDECL GetObjectPid(unsigned int index) noexcept;
API_FUNCTION int CDECL GetObjectPid(unsigned int index) noexcept;
/**
* \brief Get the refId of the object at a certain index in the read object list.
@ -241,7 +240,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The refId.
*/
EXPORT_APIFUNCTION const char *CDECL GetObjectRefId(unsigned int index) noexcept;
API_FUNCTION const char *CDECL GetObjectRefId(unsigned int index) noexcept;
/**
* \brief Get the refNum of the object at a certain index in the read object list.
@ -249,7 +248,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The refNum.
*/
EXPORT_APIFUNCTION unsigned int CDECL GetObjectRefNum(unsigned int index) noexcept;
API_FUNCTION unsigned int CDECL GetObjectRefNum(unsigned int index) noexcept;
/**
* \brief Get the mpNum of the object at a certain index in the read object list.
@ -257,7 +256,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The mpNum.
*/
EXPORT_APIFUNCTION unsigned int CDECL GetObjectMpNum(unsigned int index) noexcept;
API_FUNCTION unsigned int CDECL GetObjectMpNum(unsigned int index) noexcept;
/**
* \brief Get the count of the object at a certain index in the read object list.
@ -265,7 +264,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The object count.
*/
EXPORT_APIFUNCTION int CDECL GetObjectCount(unsigned int index) noexcept;
API_FUNCTION int CDECL GetObjectCount(unsigned int index) noexcept;
/**
* \brief Get the charge of the object at a certain index in the read object list.
@ -273,7 +272,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The charge.
*/
EXPORT_APIFUNCTION int CDECL GetObjectCharge(unsigned int index) noexcept;
API_FUNCTION int CDECL GetObjectCharge(unsigned int index) noexcept;
/**
* \brief Get the enchantment charge of the object at a certain index in the read object list.
@ -281,7 +280,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The enchantment charge.
*/
EXPORT_APIFUNCTION double CDECL GetObjectEnchantmentCharge(unsigned int index) noexcept;
API_FUNCTION double CDECL GetObjectEnchantmentCharge(unsigned int index) noexcept;
/**
* \brief Get the soul of the object at a certain index in the read object list.
@ -289,7 +288,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The soul.
*/
EXPORT_APIFUNCTION const char *CDECL GetObjectSoul(unsigned int index) noexcept;
API_FUNCTION const char *CDECL GetObjectSoul(unsigned int index) noexcept;
/**
* \brief Get the gold value of the object at a certain index in the read object list.
@ -299,7 +298,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The gold value.
*/
EXPORT_APIFUNCTION int CDECL GetObjectGoldValue(unsigned int index) noexcept;
API_FUNCTION int CDECL GetObjectGoldValue(unsigned int index) noexcept;
/**
* \brief Get the object scale of the object at a certain index in the read object list.
@ -307,7 +306,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The object scale.
*/
EXPORT_APIFUNCTION double CDECL GetObjectScale(unsigned int index) noexcept;
API_FUNCTION double CDECL GetObjectScale(unsigned int index) noexcept;
/**
* \brief Get the object state of the object at a certain index in the read object list.
@ -315,7 +314,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The object state.
*/
EXPORT_APIFUNCTION bool CDECL GetObjectState(unsigned int index) noexcept;
API_FUNCTION bool CDECL GetObjectState(unsigned int index) noexcept;
/**
* \brief Get the door state of the object at a certain index in the read object list.
@ -323,7 +322,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The door state.
*/
EXPORT_APIFUNCTION int CDECL GetObjectDoorState(unsigned int index) noexcept;
API_FUNCTION int CDECL GetObjectDoorState(unsigned int index) noexcept;
/**
* \brief Get the lock level of the object at a certain index in the read object list.
@ -331,7 +330,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The lock level.
*/
EXPORT_APIFUNCTION int CDECL GetObjectLockLevel(unsigned int index) noexcept;
API_FUNCTION int CDECL GetObjectLockLevel(unsigned int index) noexcept;
/**
* \brief Check whether the object at a certain index in the read object list has been
@ -340,7 +339,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return Whether the object has been activated by a player.
*/
EXPORT_APIFUNCTION bool CDECL DoesObjectHavePlayerActivating(unsigned int index) noexcept;
API_FUNCTION bool CDECL DoesObjectHavePlayerActivating(unsigned int index) noexcept;
/**
* \brief Get the player ID of the player activating the object at a certain index in the
@ -349,7 +348,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The player ID of the activating player.
*/
EXPORT_APIFUNCTION int CDECL GetObjectActivatingPid(unsigned int index) noexcept;
API_FUNCTION int CDECL GetObjectActivatingPid(unsigned int index) noexcept;
/**
* \brief Get the refId of the actor activating the object at a certain index in the read
@ -358,7 +357,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The refId of the activating actor.
*/
EXPORT_APIFUNCTION const char *CDECL GetObjectActivatingRefId(unsigned int index) noexcept;
API_FUNCTION const char *CDECL GetObjectActivatingRefId(unsigned int index) noexcept;
/**
* \brief Get the refNum of the actor activating the object at a certain index in the read
@ -367,7 +366,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The refNum of the activating actor.
*/
EXPORT_APIFUNCTION unsigned int CDECL GetObjectActivatingRefNum(unsigned int index) noexcept;
API_FUNCTION unsigned int CDECL GetObjectActivatingRefNum(unsigned int index) noexcept;
/**
* \brief Get the mpNum of the actor activating the object at a certain index in the read
@ -376,7 +375,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The mpNum of the activating actor.
*/
EXPORT_APIFUNCTION unsigned int CDECL GetObjectActivatingMpNum(unsigned int index) noexcept;
API_FUNCTION unsigned int CDECL GetObjectActivatingMpNum(unsigned int index) noexcept;
/**
* \brief Get the name of the actor activating the object at a certain index in the read
@ -385,7 +384,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The name of the activating actor.
*/
EXPORT_APIFUNCTION const char *CDECL GetObjectActivatingName(unsigned int index) noexcept;
API_FUNCTION const char *CDECL GetObjectActivatingName(unsigned int index) noexcept;
/**
* \brief Check whether the object at a certain index in the read object list is a
@ -395,7 +394,7 @@ namespace ObjectFunctions
*
* \return The summon state.
*/
EXPORT_APIFUNCTION bool CDECL GetObjectSummonState(unsigned int index) noexcept;
API_FUNCTION bool CDECL GetObjectSummonState(unsigned int index) noexcept;
/**
* \brief Get the summon duration of the object at a certain index in the read object list.
@ -405,7 +404,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The summon duration.
*/
EXPORT_APIFUNCTION double CDECL GetObjectSummonDuration(unsigned int index) noexcept;
API_FUNCTION double CDECL GetObjectSummonDuration(unsigned int index) noexcept;
/**
* \brief Check whether the object at a certain index in the read object list has a player
@ -416,7 +415,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return Whether a player is the summoner of the object.
*/
EXPORT_APIFUNCTION bool CDECL DoesObjectHavePlayerSummoner(unsigned int index) noexcept;
API_FUNCTION bool CDECL DoesObjectHavePlayerSummoner(unsigned int index) noexcept;
/**
* \brief Get the player ID of the summoner of the object at a certain index in the read object
@ -425,7 +424,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The player ID of the summoner.
*/
EXPORT_APIFUNCTION int CDECL GetObjectSummonerPid(unsigned int index) noexcept;
API_FUNCTION int CDECL GetObjectSummonerPid(unsigned int index) noexcept;
/**
* \brief Get the refId of the actor summoner of the object at a certain index in the read object
@ -434,7 +433,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The refId of the summoner.
*/
EXPORT_APIFUNCTION const char *CDECL GetObjectSummonerRefId(unsigned int index) noexcept;
API_FUNCTION const char *CDECL GetObjectSummonerRefId(unsigned int index) noexcept;
/**
* \brief Get the refNum of the actor summoner of the object at a certain index in the read object
@ -443,7 +442,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The refNum of the summoner.
*/
EXPORT_APIFUNCTION unsigned int CDECL GetObjectSummonerRefNum(unsigned int index) noexcept;
API_FUNCTION unsigned int CDECL GetObjectSummonerRefNum(unsigned int index) noexcept;
/**
* \brief Get the mpNum of the actor summoner of the object at a certain index in the read object list.
@ -451,7 +450,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The mpNum of the summoner.
*/
EXPORT_APIFUNCTION unsigned int CDECL GetObjectSummonerMpNum(unsigned int index) noexcept;
API_FUNCTION unsigned int CDECL GetObjectSummonerMpNum(unsigned int index) noexcept;
/**
* \brief Get the X position of the object at a certain index in the read object list.
@ -459,7 +458,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The X position.
*/
EXPORT_APIFUNCTION double CDECL GetObjectPosX(unsigned int index) noexcept;
API_FUNCTION double CDECL GetObjectPosX(unsigned int index) noexcept;
/**
* \brief Get the Y position of the object at a certain index in the read object list.
@ -467,7 +466,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The Y position.
*/
EXPORT_APIFUNCTION double CDECL GetObjectPosY(unsigned int index) noexcept;
API_FUNCTION double CDECL GetObjectPosY(unsigned int index) noexcept;
/**
* \brief Get the Z position at a certain index in the read object list.
@ -475,7 +474,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The Z position.
*/
EXPORT_APIFUNCTION double CDECL GetObjectPosZ(unsigned int index) noexcept;
API_FUNCTION double CDECL GetObjectPosZ(unsigned int index) noexcept;
/**
* \brief Get the X rotation of the object at a certain index in the read object list.
@ -483,7 +482,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The X rotation.
*/
EXPORT_APIFUNCTION double CDECL GetObjectRotX(unsigned int index) noexcept;
API_FUNCTION double CDECL GetObjectRotX(unsigned int index) noexcept;
/**
* \brief Get the Y rotation of the object at a certain index in the read object list.
@ -491,7 +490,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The Y rotation.
*/
EXPORT_APIFUNCTION double CDECL GetObjectRotY(unsigned int index) noexcept;
API_FUNCTION double CDECL GetObjectRotY(unsigned int index) noexcept;
/**
* \brief Get the Z rotation of the object at a certain index in the read object list.
@ -499,14 +498,14 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The Z rotation.
*/
EXPORT_APIFUNCTION double CDECL GetObjectRotZ(unsigned int index) noexcept;
API_FUNCTION double CDECL GetObjectRotZ(unsigned int index) noexcept;
/**
* \brief Get the videoFilename of the object at a certain index in the read object list.
*
* \return The videoFilename.
*/
EXPORT_APIFUNCTION const char *CDECL GetVideoFilename(unsigned int index) noexcept;
API_FUNCTION const char *CDECL GetVideoFilename(unsigned int index) noexcept;
/**
* \brief Get the number of container item indexes of the object at a certain index in the
@ -515,7 +514,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The number of container item indexes.
*/
EXPORT_APIFUNCTION unsigned int CDECL GetContainerChangesSize(unsigned int objectIndex) noexcept;
API_FUNCTION unsigned int CDECL GetContainerChangesSize(unsigned int objectIndex) noexcept;
/**
* \brief Get the refId of the container item at a certain itemIndex in the container changes
@ -525,7 +524,7 @@ namespace ObjectFunctions
* \param itemIndex The index of the container item.
* \return The refId.
*/
EXPORT_APIFUNCTION const char *CDECL GetContainerItemRefId(unsigned int objectIndex, unsigned int itemIndex) noexcept;
API_FUNCTION const char *CDECL GetContainerItemRefId(unsigned int objectIndex, unsigned int itemIndex) noexcept;
/**
* \brief Get the item count of the container item at a certain itemIndex in the container
@ -535,7 +534,7 @@ namespace ObjectFunctions
* \param itemIndex The index of the container item.
* \return The item count.
*/
EXPORT_APIFUNCTION int CDECL GetContainerItemCount(unsigned int objectIndex, unsigned int itemIndex) noexcept;
API_FUNCTION int CDECL GetContainerItemCount(unsigned int objectIndex, unsigned int itemIndex) noexcept;
/**
* \brief Get the charge of the container item at a certain itemIndex in the container changes
@ -545,7 +544,7 @@ namespace ObjectFunctions
* \param itemIndex The index of the container item.
* \return The charge.
*/
EXPORT_APIFUNCTION int CDECL GetContainerItemCharge(unsigned int objectIndex, unsigned int itemIndex) noexcept;
API_FUNCTION int CDECL GetContainerItemCharge(unsigned int objectIndex, unsigned int itemIndex) noexcept;
/**
* \brief Get the enchantment charge of the container item at a certain itemIndex in the container changes
@ -555,7 +554,7 @@ namespace ObjectFunctions
* \param itemIndex The index of the container item.
* \return The enchantment charge.
*/
EXPORT_APIFUNCTION double CDECL GetContainerItemEnchantmentCharge(unsigned int objectIndex, unsigned int itemIndex) noexcept;
API_FUNCTION double CDECL GetContainerItemEnchantmentCharge(unsigned int objectIndex, unsigned int itemIndex) noexcept;
/**
* \brief Get the soul of the container item at a certain itemIndex in the container changes
@ -565,7 +564,7 @@ namespace ObjectFunctions
* \param itemIndex The index of the container item.
* \return The soul.
*/
EXPORT_APIFUNCTION const char *CDECL GetContainerItemSoul(unsigned int objectIndex, unsigned int itemIndex) noexcept;
API_FUNCTION const char *CDECL GetContainerItemSoul(unsigned int objectIndex, unsigned int itemIndex) noexcept;
/**
* \brief Get the action count of the container item at a certain itemIndex in the container
@ -575,7 +574,7 @@ namespace ObjectFunctions
* \param itemIndex The index of the container item.
* \return The action count.
*/
EXPORT_APIFUNCTION int CDECL GetContainerItemActionCount(unsigned int objectIndex, unsigned int itemIndex) noexcept;
API_FUNCTION int CDECL GetContainerItemActionCount(unsigned int objectIndex, unsigned int itemIndex) noexcept;
/**
* \brief Check whether the object at a certain index in the read object list has a container.
@ -586,7 +585,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return Whether the object has a container.
*/
EXPORT_APIFUNCTION bool CDECL DoesObjectHaveContainer(unsigned int index) noexcept;
API_FUNCTION bool CDECL DoesObjectHaveContainer(unsigned int index) noexcept;
/**
* \brief Set the cell of the temporary object list stored on the server.
@ -597,7 +596,7 @@ namespace ObjectFunctions
* \param cellDescription The description of the cell.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetObjectListCell(const char* cellDescription) noexcept;
API_FUNCTION void CDECL SetObjectListCell(const char* cellDescription) noexcept;
/**
* \brief Set the action type of the temporary object list stored on the server.
@ -605,7 +604,7 @@ namespace ObjectFunctions
* \param action The action type (0 for SET, 1 for ADD, 2 for REMOVE, 3 for REQUEST).
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetObjectListAction(unsigned char action) noexcept;
API_FUNCTION void CDECL SetObjectListAction(unsigned char action) noexcept;
/**
* \brief Set the console command of the temporary object list stored on the server.
@ -616,7 +615,7 @@ namespace ObjectFunctions
* \param consoleCommand The console command.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetObjectListConsoleCommand(const char* consoleCommand) noexcept;
API_FUNCTION void CDECL SetObjectListConsoleCommand(const char* consoleCommand) noexcept;
/**
* \brief Set the refId of the temporary object stored on the server.
@ -624,7 +623,7 @@ namespace ObjectFunctions
* \param refId The refId.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetObjectRefId(const char* refId) noexcept;
API_FUNCTION void CDECL SetObjectRefId(const char* refId) noexcept;
/**
* \brief Set the refNum of the temporary object stored on the server.
@ -638,7 +637,7 @@ namespace ObjectFunctions
* \param refNum The refNum.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetObjectRefNum(int refNum) noexcept;
API_FUNCTION void CDECL SetObjectRefNum(int refNum) noexcept;
/**
* \brief Set the mpNum of the temporary object stored on the server.
@ -653,7 +652,7 @@ namespace ObjectFunctions
* \param mpNum The mpNum.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetObjectMpNum(int mpNum) noexcept;
API_FUNCTION void CDECL SetObjectMpNum(int mpNum) noexcept;
/**
* \brief Set the object count of the temporary object stored on the server.
@ -663,7 +662,7 @@ namespace ObjectFunctions
* \param count The object count.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetObjectCount(int count) noexcept;
API_FUNCTION void CDECL SetObjectCount(int count) noexcept;
/**
* \brief Set the charge of the temporary object stored on the server.
@ -673,7 +672,7 @@ namespace ObjectFunctions
* \param charge The charge.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetObjectCharge(int charge) noexcept;
API_FUNCTION void CDECL SetObjectCharge(int charge) noexcept;
/**
* \brief Set the enchantment charge of the temporary object stored on the server.
@ -683,7 +682,7 @@ namespace ObjectFunctions
* \param charge The enchantment charge.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetObjectEnchantmentCharge(double enchantmentCharge) noexcept;
API_FUNCTION void CDECL SetObjectEnchantmentCharge(double enchantmentCharge) noexcept;
/**
* \brief Set the soul of the temporary object stored on the server.
@ -691,7 +690,7 @@ namespace ObjectFunctions
* \param refId The soul.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetObjectSoul(const char* soul) noexcept;
API_FUNCTION void CDECL SetObjectSoul(const char* soul) noexcept;
/**
* \brief Set the gold value of the temporary object stored on the server.
@ -701,7 +700,7 @@ namespace ObjectFunctions
* \param goldValue The gold value.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetObjectGoldValue(int goldValue) noexcept;
API_FUNCTION void CDECL SetObjectGoldValue(int goldValue) noexcept;
/**
* \brief Set the scale of the temporary object stored on the server.
@ -711,7 +710,7 @@ namespace ObjectFunctions
* \param scale The scale.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetObjectScale(double scale) noexcept;
API_FUNCTION void CDECL SetObjectScale(double scale) noexcept;
/**
* \brief Set the object state of the temporary object stored on the server.
@ -721,7 +720,7 @@ namespace ObjectFunctions
* \param objectState The object state.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetObjectState(bool objectState) noexcept;
API_FUNCTION void CDECL SetObjectState(bool objectState) noexcept;
/**
* \brief Set the lock level of the temporary object stored on the server.
@ -729,7 +728,7 @@ namespace ObjectFunctions
* \param lockLevel The lock level.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetObjectLockLevel(int lockLevel) noexcept;
API_FUNCTION void CDECL SetObjectLockLevel(int lockLevel) noexcept;
/**
* \brief Set the summon duration of the temporary object stored on the server.
@ -737,7 +736,7 @@ namespace ObjectFunctions
* \param summonDuration The summon duration.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetObjectSummonDuration(float summonDuration) noexcept;
API_FUNCTION void CDECL SetObjectSummonDuration(float summonDuration) noexcept;
/**
* \brief Set the disarm state of the temporary object stored on the server.
@ -745,7 +744,7 @@ namespace ObjectFunctions
* \param disarmState The disarmState.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetObjectDisarmState(bool disarmState) noexcept;
API_FUNCTION void CDECL SetObjectDisarmState(bool disarmState) noexcept;
/**
* \brief Set the summon state of the temporary object stored on the server.
@ -756,7 +755,7 @@ namespace ObjectFunctions
* \param summonState The summon state.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetObjectSummonState(bool summonState) noexcept;
API_FUNCTION void CDECL SetObjectSummonState(bool summonState) noexcept;
/**
* \brief Set the position of the temporary object stored on the server.
@ -766,7 +765,7 @@ namespace ObjectFunctions
* \param z The Z position.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetObjectPosition(double x, double y, double z) noexcept;
API_FUNCTION void CDECL SetObjectPosition(double x, double y, double z) noexcept;
/**
* \brief Set the rotation of the temporary object stored on the server.
@ -776,7 +775,7 @@ namespace ObjectFunctions
* \param z The Z rotation.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetObjectRotation(double x, double y, double z) noexcept;
API_FUNCTION void CDECL SetObjectRotation(double x, double y, double z) noexcept;
/**
* \brief Set the player ID of the player activating the temporary object stored on the
@ -785,7 +784,7 @@ namespace ObjectFunctions
* \param pid The pid of the player.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetObjectActivatingPid(unsigned short pid) noexcept;
API_FUNCTION void CDECL SetObjectActivatingPid(unsigned short pid) noexcept;
/**
* \brief Set the door state of the temporary object stored on the server.
@ -795,7 +794,7 @@ namespace ObjectFunctions
* \param doorState The door state.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetObjectDoorState(int doorState) noexcept;
API_FUNCTION void CDECL SetObjectDoorState(int doorState) noexcept;
/**
* \brief Set the teleport state of the temporary object stored on the server.
@ -806,7 +805,7 @@ namespace ObjectFunctions
* \param teleportState The teleport state.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetObjectDoorTeleportState(bool teleportState) noexcept;
API_FUNCTION void CDECL SetObjectDoorTeleportState(bool teleportState) noexcept;
/**
* \brief Set the door destination cell of the temporary object stored on the server.
@ -817,7 +816,7 @@ namespace ObjectFunctions
* \param cellDescription The description of the cell.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetObjectDoorDestinationCell(const char* cellDescription) noexcept;
API_FUNCTION void CDECL SetObjectDoorDestinationCell(const char* cellDescription) noexcept;
/**
* \brief Set the door destination position of the temporary object stored on the server.
@ -827,7 +826,7 @@ namespace ObjectFunctions
* \param z The Z position.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetObjectDoorDestinationPosition(double x, double y, double z) noexcept;
API_FUNCTION void CDECL SetObjectDoorDestinationPosition(double x, double y, double z) noexcept;
/**
* \brief Set the door destination rotation of the temporary object stored on the server.
@ -839,7 +838,7 @@ namespace ObjectFunctions
* \param z The Z rotation.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetObjectDoorDestinationRotation(double x, double z) noexcept;
API_FUNCTION void CDECL SetObjectDoorDestinationRotation(double x, double z) noexcept;
/**
* \brief Set a player as the object in the temporary object stored on the server.
@ -848,7 +847,7 @@ namespace ObjectFunctions
* \param pid The pid of the player.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetPlayerAsObject(unsigned short pid) noexcept;
API_FUNCTION void CDECL SetPlayerAsObject(unsigned short pid) noexcept;
/**
* \brief Set the refId of the temporary container item stored on the server.
@ -856,7 +855,7 @@ namespace ObjectFunctions
* \param refId The refId.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetContainerItemRefId(const char* refId) noexcept;
API_FUNCTION void CDECL SetContainerItemRefId(const char* refId) noexcept;
/**
* \brief Set the item count of the temporary container item stored on the server.
@ -864,7 +863,7 @@ namespace ObjectFunctions
* \param count The item count.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetContainerItemCount(int count) noexcept;
API_FUNCTION void CDECL SetContainerItemCount(int count) noexcept;
/**
* \brief Set the charge of the temporary container item stored on the server.
@ -872,7 +871,7 @@ namespace ObjectFunctions
* \param charge The charge.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetContainerItemCharge(int charge) noexcept;
API_FUNCTION void CDECL SetContainerItemCharge(int charge) noexcept;
/**
* \brief Set the enchantment charge of the temporary container item stored on the server.
@ -880,7 +879,7 @@ namespace ObjectFunctions
* \param charge The enchantment charge.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetContainerItemEnchantmentCharge(double enchantmentCharge) noexcept;
API_FUNCTION void CDECL SetContainerItemEnchantmentCharge(double enchantmentCharge) noexcept;
/**
* \brief Set the soul of the temporary container item stored on the server.
@ -888,7 +887,7 @@ namespace ObjectFunctions
* \param refId The soul.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetContainerItemSoul(const char* soul) noexcept;
API_FUNCTION void CDECL SetContainerItemSoul(const char* soul) noexcept;
/**
* \brief Set the action count of the container item at a certain itemIndex in the container
@ -903,7 +902,7 @@ namespace ObjectFunctions
* \param actionCount The action count.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetContainerItemActionCountByIndex(unsigned int objectIndex, unsigned int itemIndex, int actionCount) noexcept;
API_FUNCTION void CDECL SetContainerItemActionCountByIndex(unsigned int objectIndex, unsigned int itemIndex, int actionCount) noexcept;
/**
* \brief Add a copy of the server's temporary object to the server's currently stored object
@ -914,7 +913,7 @@ namespace ObjectFunctions
*
* \return void
*/
EXPORT_APIFUNCTION void CDECL AddObject() noexcept;
API_FUNCTION void CDECL AddObject() noexcept;
/**
* \brief Add a copy of the server's temporary container item to the container changes of the
@ -925,7 +924,7 @@ namespace ObjectFunctions
*
* \return void
*/
EXPORT_APIFUNCTION void CDECL AddContainerItem() noexcept;
API_FUNCTION void CDECL AddContainerItem() noexcept;
/**
* \brief Send an ObjectActivate packet.
@ -936,7 +935,7 @@ namespace ObjectFunctions
* to the packet (false by default).
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendObjectActivate(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
API_FUNCTION void CDECL SendObjectActivate(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
/**
* \brief Send an ObjectPlace packet.
@ -947,7 +946,7 @@ namespace ObjectFunctions
* to the packet (false by default).
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendObjectPlace(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
API_FUNCTION void CDECL SendObjectPlace(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
/**
* \brief Send an ObjectSpawn packet.
@ -958,7 +957,7 @@ namespace ObjectFunctions
* to the packet (false by default).
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendObjectSpawn(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
API_FUNCTION void CDECL SendObjectSpawn(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
/**
* \brief Send an ObjectDelete packet.
@ -968,7 +967,7 @@ namespace ObjectFunctions
*
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendObjectDelete(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
API_FUNCTION void CDECL SendObjectDelete(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
/**
* \brief Send an ObjectLock packet.
@ -979,7 +978,7 @@ namespace ObjectFunctions
* to the packet (false by default).
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendObjectLock(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
API_FUNCTION void CDECL SendObjectLock(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
/**
* \brief Send an ObjectTrap packet.
@ -989,7 +988,7 @@ namespace ObjectFunctions
*
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendObjectTrap(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
API_FUNCTION void CDECL SendObjectTrap(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
/**
* \brief Send an ObjectScale packet.
@ -1000,7 +999,7 @@ namespace ObjectFunctions
* to the packet (false by default).
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendObjectScale(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
API_FUNCTION void CDECL SendObjectScale(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
/**
* \brief Send an ObjectState packet.
@ -1011,7 +1010,7 @@ namespace ObjectFunctions
* to the packet (false by default).
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendObjectState(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
API_FUNCTION void CDECL SendObjectState(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
/**
* \brief Send a DoorState packet.
@ -1022,7 +1021,7 @@ namespace ObjectFunctions
* to the packet (false by default).
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendDoorState(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
API_FUNCTION void CDECL SendDoorState(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
/**
* \brief Send a DoorDestination packet.
@ -1033,7 +1032,7 @@ namespace ObjectFunctions
* to the packet (false by default).
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendDoorDestination(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
API_FUNCTION void CDECL SendDoorDestination(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
/**
* \brief Send a Container packet.
@ -1044,7 +1043,7 @@ namespace ObjectFunctions
* to the packet (false by default).
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendContainer(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
API_FUNCTION void CDECL SendContainer(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
/**
* \brief Send a VideoPlay packet.
@ -1055,7 +1054,7 @@ namespace ObjectFunctions
* to the packet (false by default).
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendVideoPlay(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
API_FUNCTION void CDECL SendVideoPlay(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
/**
* \brief Send a ConsoleCommand packet.
@ -1066,27 +1065,27 @@ namespace ObjectFunctions
* to the packet (false by default).
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendConsoleCommand(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
API_FUNCTION void CDECL SendConsoleCommand(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
// All methods below are deprecated versions of methods from above
EXPORT_APIFUNCTION void CDECL ReadLastObjectList() noexcept;
EXPORT_APIFUNCTION void CDECL ReadLastEvent() noexcept;
EXPORT_APIFUNCTION void CDECL InitializeObjectList(unsigned short pid) noexcept;
EXPORT_APIFUNCTION void CDECL InitializeEvent(unsigned short pid) noexcept;
EXPORT_APIFUNCTION void CDECL CopyLastObjectListToStore() noexcept;
EXPORT_APIFUNCTION unsigned int CDECL GetObjectChangesSize() noexcept;
EXPORT_APIFUNCTION unsigned char CDECL GetEventAction() noexcept;
EXPORT_APIFUNCTION unsigned char CDECL GetEventContainerSubAction() noexcept;
EXPORT_APIFUNCTION unsigned int CDECL GetObjectRefNumIndex(unsigned int index) noexcept;
EXPORT_APIFUNCTION unsigned int CDECL GetObjectSummonerRefNumIndex(unsigned int index) noexcept;
EXPORT_APIFUNCTION void CDECL SetEventCell(const char* cellDescription) noexcept;
EXPORT_APIFUNCTION void CDECL SetEventAction(unsigned char action) noexcept;
EXPORT_APIFUNCTION void CDECL SetEventConsoleCommand(const char* consoleCommand) noexcept;
EXPORT_APIFUNCTION void CDECL SetObjectRefNumIndex(int refNum) noexcept;
EXPORT_APIFUNCTION void CDECL AddWorldObject() noexcept;
}
API_FUNCTION void CDECL ReadLastObjectList() noexcept;
API_FUNCTION void CDECL ReadLastEvent() noexcept;
API_FUNCTION void CDECL InitializeObjectList(unsigned short pid) noexcept;
API_FUNCTION void CDECL InitializeEvent(unsigned short pid) noexcept;
API_FUNCTION void CDECL CopyLastObjectListToStore() noexcept;
API_FUNCTION unsigned int CDECL GetObjectChangesSize() noexcept;
API_FUNCTION unsigned char CDECL GetEventAction() noexcept;
API_FUNCTION unsigned char CDECL GetEventContainerSubAction() noexcept;
API_FUNCTION unsigned int CDECL GetObjectRefNumIndex(unsigned int index) noexcept;
API_FUNCTION unsigned int CDECL GetObjectSummonerRefNumIndex(unsigned int index) noexcept;
API_FUNCTION void CDECL SetEventCell(const char* cellDescription) noexcept;
API_FUNCTION void CDECL SetEventAction(unsigned char action) noexcept;
API_FUNCTION void CDECL SetEventConsoleCommand(const char* consoleCommand) noexcept;
API_FUNCTION void CDECL SetObjectRefNumIndex(int refNum) noexcept;
API_FUNCTION void CDECL AddWorldObject() noexcept;
NAMESPACE_END()
#endif //OPENMW_OBJECTAPI_HPP

@ -1,4 +1,4 @@
#include "Positions.hpp"
#include "Positions.h"
#include <apps/openmw-mp/Script/ScriptFunctions.hpp>
#include <components/openmw-mp/NetworkMessages.hpp>
#include <apps/openmw-mp/Player.hpp>

@ -3,7 +3,7 @@
#include "../Types.hpp"
#include <Script/Platform.hpp>
#include "../api.h"
#define POSITIONAPI \
{"GetPosX", PositionFunctions::GetPosX},\
@ -25,15 +25,14 @@
{"SendMomentum", PositionFunctions::SendMomentum}
namespace PositionFunctions
{
NAMESPACE_BEGIN(PositionFunctions)
/**
* \brief Get the X position of a player.
*
* \param pid The player ID.
* \return The X position.
*/
EXPORT_APIFUNCTION double CDECL GetPosX(unsigned short pid) noexcept;
API_FUNCTION double CDECL GetPosX(unsigned short pid) noexcept;
/**
* \brief Get the Y position of a player.
@ -41,7 +40,7 @@ namespace PositionFunctions
* \param pid The player ID.
* \return The Y position.
*/
EXPORT_APIFUNCTION double CDECL GetPosY(unsigned short pid) noexcept;
API_FUNCTION double CDECL GetPosY(unsigned short pid) noexcept;
/**
* \brief Get the Z position of a player.
@ -49,7 +48,7 @@ namespace PositionFunctions
* \param pid The player ID.
* \return The Z position.
*/
EXPORT_APIFUNCTION double CDECL GetPosZ(unsigned short pid) noexcept;
API_FUNCTION double CDECL GetPosZ(unsigned short pid) noexcept;
/**
* \brief Get the X position of a player from before their latest cell change.
@ -57,7 +56,7 @@ namespace PositionFunctions
* \param pid The player ID.
* \return The X position.
*/
EXPORT_APIFUNCTION double CDECL GetPreviousCellPosX(unsigned short pid) noexcept;
API_FUNCTION double CDECL GetPreviousCellPosX(unsigned short pid) noexcept;
/**
* \brief Get the Y position of a player from before their latest cell change.
@ -65,7 +64,7 @@ namespace PositionFunctions
* \param pid The player ID.
* \return The Y position.
*/
EXPORT_APIFUNCTION double CDECL GetPreviousCellPosY(unsigned short pid) noexcept;
API_FUNCTION double CDECL GetPreviousCellPosY(unsigned short pid) noexcept;
/**
* \brief Get the Z position of a player from before their latest cell change.
@ -73,7 +72,7 @@ namespace PositionFunctions
* \param pid The player ID.
* \return The Z position.
*/
EXPORT_APIFUNCTION double CDECL GetPreviousCellPosZ(unsigned short pid) noexcept;
API_FUNCTION double CDECL GetPreviousCellPosZ(unsigned short pid) noexcept;
/**
* \brief Get the X rotation of a player.
@ -81,7 +80,7 @@ namespace PositionFunctions
* \param pid The player ID.
* \return The X rotation.
*/
EXPORT_APIFUNCTION double CDECL GetRotX(unsigned short pid) noexcept;
API_FUNCTION double CDECL GetRotX(unsigned short pid) noexcept;
/**
* \brief Get the Z rotation of a player.
@ -89,7 +88,7 @@ namespace PositionFunctions
* \param pid The player ID.
* \return The Z rotation.
*/
EXPORT_APIFUNCTION double CDECL GetRotZ(unsigned short pid) noexcept;
API_FUNCTION double CDECL GetRotZ(unsigned short pid) noexcept;
/**
* \brief Set the position of a player.
@ -103,7 +102,7 @@ namespace PositionFunctions
* \param z The Z position.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetPos(unsigned short pid, double x, double y, double z) noexcept;
API_FUNCTION void CDECL SetPos(unsigned short pid, double x, double y, double z) noexcept;
/**
* \brief Set the rotation of a player.
@ -118,7 +117,7 @@ namespace PositionFunctions
* \param z The Z position.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRot(unsigned short pid, double x, double z) noexcept;
API_FUNCTION void CDECL SetRot(unsigned short pid, double x, double z) noexcept;
/**
* \brief Set the momentum of a player.
@ -132,7 +131,7 @@ namespace PositionFunctions
* \param z The Z momentum.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetMomentum(unsigned short pid, double x, double y, double z) noexcept;
API_FUNCTION void CDECL SetMomentum(unsigned short pid, double x, double y, double z) noexcept;
/**
* \brief Send a PlayerPosition packet about a player.
@ -142,7 +141,7 @@ namespace PositionFunctions
* \param pid The player ID.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendPos(unsigned short pid) noexcept;
API_FUNCTION void CDECL SendPos(unsigned short pid) noexcept;
/**
* \brief Send a PlayerMomentum packet about a player.
@ -152,7 +151,7 @@ namespace PositionFunctions
* \param pid The player ID.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendMomentum(unsigned short pid) noexcept;
}
API_FUNCTION void CDECL SendMomentum(unsigned short pid) noexcept;
NAMESPACE_END()
#endif //OPENMW_POSITIONAPI_HPP

@ -2,7 +2,7 @@
// Created by koncord on 09.12.18.
//
#include "Public.hpp"
#include "Public.h"
#include <Script/ScriptFunctions.hpp>
#include <Script/API/PublicFnAPI.hpp>

@ -0,0 +1,16 @@
//
// Created by koncord on 09.12.18.
//
#ifndef OPENMW_PUBLIC_HPP
#define OPENMW_PUBLIC_HPP
#include <apps/openmw-mp/Script/ScriptFunction.hpp>
#include "../api.h"
NAMESPACE_BEGIN(PublicFunctions)
API_FUNCTION void CDECL MakePublic(ScriptFunc _public, const char *name, char ret_type, const char *def) noexcept;
API_FUNCTION boost::any CDECL CallPublic(const char *name, va_list args) noexcept;
NAMESPACE_END()
#endif

@ -1,16 +0,0 @@
//
// Created by koncord on 09.12.18.
//
#ifndef OPENMW_PUBLIC_HPP
#define OPENMW_PUBLIC_HPP
#include <apps/openmw-mp/Script/ScriptFunction.hpp>
namespace PublicFunctions
{
extern "C" void MakePublic(ScriptFunc _public, const char *name, char ret_type, const char *def) noexcept;
extern "C" boost::any CallPublic(const char *name, va_list args) noexcept;
}
#endif

@ -1,4 +1,4 @@
#include "Quests.hpp"
#include "Quests.h"
#include <components/misc/stringops.hpp>
#include <components/openmw-mp/NetworkMessages.hpp>

@ -1,7 +1,7 @@
#ifndef OPENMW_QUESTAPI_HPP
#define OPENMW_QUESTAPI_HPP
#include <Script/Platform.hpp>
#include "../api.h"
#define QUESTAPI \
{"ClearJournalChanges", QuestFunctions::ClearJournalChanges},\
@ -33,8 +33,7 @@
{"InitializeJournalChanges", QuestFunctions::InitializeJournalChanges},\
{"InitializeKillChanges", QuestFunctions::InitializeKillChanges}
namespace QuestFunctions
{
NAMESPACE_BEGIN(QuestFunctions)
/**
* \brief Clear the last recorded journal changes for a player.
*
@ -43,7 +42,7 @@ namespace QuestFunctions
* \param pid The player ID whose journal changes should be used.
* \return void
*/
EXPORT_APIFUNCTION void CDECL ClearJournalChanges(unsigned short pid) noexcept;
API_FUNCTION void CDECL ClearJournalChanges(unsigned short pid) noexcept;
/**
* \brief Clear the last recorded kill count changes for a player.
@ -53,7 +52,7 @@ namespace QuestFunctions
* \param pid The player ID whose kill count changes should be used.
* \return void
*/
EXPORT_APIFUNCTION void CDECL ClearKillChanges(unsigned short pid) noexcept;
API_FUNCTION void CDECL ClearKillChanges(unsigned short pid) noexcept;
/**
* \brief Get the number of indexes in a player's latest journal changes.
@ -61,7 +60,7 @@ namespace QuestFunctions
* \param pid The player ID whose journal changes should be used.
* \return The number of indexes.
*/
EXPORT_APIFUNCTION unsigned int CDECL GetJournalChangesSize(unsigned short pid) noexcept;
API_FUNCTION unsigned int CDECL GetJournalChangesSize(unsigned short pid) noexcept;
/**
* \brief Get the number of indexes in a player's latest kill count changes.
@ -69,7 +68,7 @@ namespace QuestFunctions
* \param pid The player ID whose kill count changes should be used.
* \return The number of indexes.
*/
EXPORT_APIFUNCTION unsigned int CDECL GetKillChangesSize(unsigned short pid) noexcept;
API_FUNCTION unsigned int CDECL GetKillChangesSize(unsigned short pid) noexcept;
/**
* \brief Add a new journal item of type ENTRY to the journal changes for a player,
@ -81,7 +80,7 @@ namespace QuestFunctions
* \param actorRefId The actor refId of the journal item.
* \return void
*/
EXPORT_APIFUNCTION void CDECL AddJournalEntry(unsigned short pid, const char* quest, unsigned int index, const char* actorRefId) noexcept;
API_FUNCTION void CDECL AddJournalEntry(unsigned short pid, const char* quest, unsigned int index, const char* actorRefId) noexcept;
/**
* \brief Add a new journal item of type ENTRY to the journal changes for a player,
@ -96,7 +95,7 @@ namespace QuestFunctions
* \param The day of the month for the journal item.
* \return void
*/
EXPORT_APIFUNCTION void CDECL AddJournalEntryWithTimestamp(unsigned short pid, const char* quest, unsigned int index, const char* actorRefId,
API_FUNCTION void CDECL AddJournalEntryWithTimestamp(unsigned short pid, const char* quest, unsigned int index, const char* actorRefId,
unsigned int daysPassed, unsigned int month, unsigned int day) noexcept;
/**
@ -107,7 +106,7 @@ namespace QuestFunctions
* \param index The quest index of the journal item.
* \return void
*/
EXPORT_APIFUNCTION void CDECL AddJournalIndex(unsigned short pid, const char* quest, unsigned int index) noexcept;
API_FUNCTION void CDECL AddJournalIndex(unsigned short pid, const char* quest, unsigned int index) noexcept;
/**
* \brief Add a new kill count to the kill count changes for a player.
@ -117,7 +116,7 @@ namespace QuestFunctions
* \param number The number of kills in the kill count.
* \return void
*/
EXPORT_APIFUNCTION void CDECL AddKill(unsigned short pid, const char* refId, int number) noexcept;
API_FUNCTION void CDECL AddKill(unsigned short pid, const char* refId, int number) noexcept;
/**
* \brief Set the reputation of a certain player.
@ -126,7 +125,7 @@ namespace QuestFunctions
* \param value The reputation.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetReputation(unsigned short pid, int value) noexcept;
API_FUNCTION void CDECL SetReputation(unsigned short pid, int value) noexcept;
/**
* \brief Get the quest at a certain index in a player's latest journal changes.
@ -135,7 +134,7 @@ namespace QuestFunctions
* \param index The index of the journalItem.
* \return The quest.
*/
EXPORT_APIFUNCTION const char *CDECL GetJournalItemQuest(unsigned short pid, unsigned int index) noexcept;
API_FUNCTION const char *CDECL GetJournalItemQuest(unsigned short pid, unsigned int index) noexcept;
/**
* \brief Get the quest index at a certain index in a player's latest journal changes.
@ -144,7 +143,7 @@ namespace QuestFunctions
* \param index The index of the journalItem.
* \return The quest index.
*/
EXPORT_APIFUNCTION int CDECL GetJournalItemIndex(unsigned short pid, unsigned int index) noexcept;
API_FUNCTION int CDECL GetJournalItemIndex(unsigned short pid, unsigned int index) noexcept;
/**
* \brief Get the journal item type at a certain index in a player's latest journal changes.
@ -153,7 +152,7 @@ namespace QuestFunctions
* \param index The index of the journalItem.
* \return The type (0 for ENTRY, 1 for INDEX).
*/
EXPORT_APIFUNCTION int CDECL GetJournalItemType(unsigned short pid, unsigned int index) noexcept;
API_FUNCTION int CDECL GetJournalItemType(unsigned short pid, unsigned int index) noexcept;
/**
* \brief Get the actor refId at a certain index in a player's latest journal changes.
@ -164,7 +163,7 @@ namespace QuestFunctions
* \param index The index of the journalItem.
* \return The actor refId.
*/
EXPORT_APIFUNCTION const char *CDECL GetJournalItemActorRefId(unsigned short pid, unsigned int index) noexcept;
API_FUNCTION const char *CDECL GetJournalItemActorRefId(unsigned short pid, unsigned int index) noexcept;
/**
* \brief Get the refId at a certain index in a player's latest kill count changes.
@ -173,7 +172,7 @@ namespace QuestFunctions
* \param index The index of the kill count.
* \return The refId.
*/
EXPORT_APIFUNCTION const char *CDECL GetKillRefId(unsigned short pid, unsigned int index) noexcept;
API_FUNCTION const char *CDECL GetKillRefId(unsigned short pid, unsigned int index) noexcept;
/**
* \brief Get the number of kills at a certain index in a player's latest kill count changes.
@ -182,7 +181,7 @@ namespace QuestFunctions
* \param index The index of the kill count.
* \return The number of kills.
*/
EXPORT_APIFUNCTION int CDECL GetKillNumber(unsigned short pid, unsigned int index) noexcept;
API_FUNCTION int CDECL GetKillNumber(unsigned short pid, unsigned int index) noexcept;
/**
* \brief Get the a certain player's reputation.
@ -190,7 +189,7 @@ namespace QuestFunctions
* \param pid The player ID.
* \return The reputation.
*/
EXPORT_APIFUNCTION int CDECL GetReputation(unsigned short pid) noexcept;
API_FUNCTION int CDECL GetReputation(unsigned short pid) noexcept;
/**
* \brief Send a PlayerJournal packet with a player's recorded journal changes.
@ -202,7 +201,7 @@ namespace QuestFunctions
* to the packet (false by default).
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendJournalChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
API_FUNCTION void CDECL SendJournalChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
/**
* \brief Send a WorldKillCount packet with a player's recorded kill count changes.
@ -214,7 +213,7 @@ namespace QuestFunctions
* to the packet (false by default).
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendKillChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
API_FUNCTION void CDECL SendKillChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
/**
* \brief Send a PlayerReputation packet with a player's recorded reputation.
@ -226,12 +225,12 @@ namespace QuestFunctions
* to the packet (false by default).
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendReputation(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
API_FUNCTION void CDECL SendReputation(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
// All methods below are deprecated versions of methods from above
EXPORT_APIFUNCTION void CDECL InitializeJournalChanges(unsigned short pid) noexcept;
EXPORT_APIFUNCTION void CDECL InitializeKillChanges(unsigned short pid) noexcept;
}
API_FUNCTION void CDECL InitializeJournalChanges(unsigned short pid) noexcept;
API_FUNCTION void CDECL InitializeKillChanges(unsigned short pid) noexcept;
NAMESPACE_END()
#endif //OPENMW_QUESTAPI_HPP

@ -4,10 +4,10 @@
#include <apps/openmw-mp/Networking.hpp>
#include <apps/openmw-mp/Player.hpp>
#include <apps/openmw-mp/Script/ScriptFunctions.hpp>
#include <apps/openmw-mp/Script/Functions/Worldstate.hpp>
#include <fstream>
#include "RecordsDynamic.hpp"
#include "Worldstate.h"
#include "RecordsDynamic.h"
using namespace std;
using namespace mwmp;

@ -3,7 +3,7 @@
#include "../Types.hpp"
#include <Script/Platform.hpp>
#include "../api.h"
#define RECORDSDYNAMICAPI \
{"ClearRecords", RecordsDynamicFunctions::ClearRecords},\
@ -112,14 +112,13 @@
\
{"SendRecordDynamic", RecordsDynamicFunctions::SendRecordDynamic}
namespace RecordsDynamicFunctions
{
NAMESPACE_BEGIN(RecordsDynamicFunctions)
/**
* \brief Clear the data from the records stored on the server.
*
* \return void
*/
EXPORT_APIFUNCTION void CDECL ClearRecords() noexcept;
API_FUNCTION void CDECL ClearRecords() noexcept;
/**
* \brief Get the type of records in the read worldstate's dynamic records.
@ -127,14 +126,14 @@ namespace RecordsDynamicFunctions
* \return The type of records (0 for SPELL, 1 for POTION, 2 for ENCHANTMENT,
* 3 for NPC).
*/
EXPORT_APIFUNCTION unsigned short CDECL GetRecordType() noexcept;
API_FUNCTION unsigned short CDECL GetRecordType() noexcept;
/**
* \brief Get the number of records in the read worldstate's dynamic records.
*
* \return The number of records.
*/
EXPORT_APIFUNCTION unsigned int CDECL GetRecordCount() noexcept;
API_FUNCTION unsigned int CDECL GetRecordCount() noexcept;
/**
* \brief Get the number of effects for the record at a certain index in the read
@ -143,7 +142,7 @@ namespace RecordsDynamicFunctions
* \param recordIndex The index of the record.
* \return The number of effects.
*/
EXPORT_APIFUNCTION unsigned int CDECL GetRecordEffectCount(unsigned int recordIndex) noexcept;
API_FUNCTION unsigned int CDECL GetRecordEffectCount(unsigned int recordIndex) noexcept;
/**
* \brief Get the id of the record at a certain index in the read worldstate's
@ -152,7 +151,7 @@ namespace RecordsDynamicFunctions
* \param index The index of the record.
* \return The id of the record.
*/
EXPORT_APIFUNCTION const char *CDECL GetRecordId(unsigned int index) noexcept;
API_FUNCTION const char *CDECL GetRecordId(unsigned int index) noexcept;
/**
* \brief Get the base id (i.e. the id this record should inherit default
@ -162,7 +161,7 @@ namespace RecordsDynamicFunctions
* \param index The index of the record.
* \return The base id of the record.
*/
EXPORT_APIFUNCTION const char *CDECL GetRecordBaseId(unsigned int index) noexcept;
API_FUNCTION const char *CDECL GetRecordBaseId(unsigned int index) noexcept;
/**
* \brief Get the subtype of the record at a certain index in the read worldstate's
@ -171,7 +170,7 @@ namespace RecordsDynamicFunctions
* \param index The index of the record.
* \return The type of the record.
*/
EXPORT_APIFUNCTION int CDECL GetRecordSubtype(unsigned int index) noexcept;
API_FUNCTION int CDECL GetRecordSubtype(unsigned int index) noexcept;
/**
* \brief Get the name of the record at a certain index in the read worldstate's
@ -180,7 +179,7 @@ namespace RecordsDynamicFunctions
* \param index The index of the record.
* \return The name of the record.
*/
EXPORT_APIFUNCTION const char *CDECL GetRecordName(unsigned int index) noexcept;
API_FUNCTION const char *CDECL GetRecordName(unsigned int index) noexcept;
/**
* \brief Get the model of the record at a certain index in the read worldstate's
@ -189,7 +188,7 @@ namespace RecordsDynamicFunctions
* \param index The index of the record.
* \return The model of the record.
*/
EXPORT_APIFUNCTION const char *CDECL GetRecordModel(unsigned int index) noexcept;
API_FUNCTION const char *CDECL GetRecordModel(unsigned int index) noexcept;
/**
* \brief Get the icon of the record at a certain index in the read worldstate's
@ -198,7 +197,7 @@ namespace RecordsDynamicFunctions
* \param index The index of the record.
* \return The icon of the record.
*/
EXPORT_APIFUNCTION const char *CDECL GetRecordIcon(unsigned int index) noexcept;
API_FUNCTION const char *CDECL GetRecordIcon(unsigned int index) noexcept;
/**
* \brief Get the script of the record at a certain index in the read worldstate's
@ -207,7 +206,7 @@ namespace RecordsDynamicFunctions
* \param index The index of the record.
* \return The script of the record.
*/
EXPORT_APIFUNCTION const char *CDECL GetRecordScript(unsigned int index) noexcept;
API_FUNCTION const char *CDECL GetRecordScript(unsigned int index) noexcept;
/**
* \brief Get the enchantment id of the record at a certain index in the read
@ -216,7 +215,7 @@ namespace RecordsDynamicFunctions
* \param index The index of the record.
* \return The enchantment id of the record.
*/
EXPORT_APIFUNCTION const char *CDECL GetRecordEnchantmentId(unsigned int index) noexcept;
API_FUNCTION const char *CDECL GetRecordEnchantmentId(unsigned int index) noexcept;
/**
* \brief Get the enchantment charge of the record at a certain index in
@ -225,7 +224,7 @@ namespace RecordsDynamicFunctions
* \param index The index of the record.
* \return The enchantment charge of the record.
*/
EXPORT_APIFUNCTION int CDECL GetRecordEnchantmentCharge(unsigned int index) noexcept;
API_FUNCTION int CDECL GetRecordEnchantmentCharge(unsigned int index) noexcept;
/**
* \brief Get the auto-calculation flag value of the record at a certain index in
@ -234,7 +233,7 @@ namespace RecordsDynamicFunctions
* \param index The index of the record.
* \return The auto-calculation flag value of the record.
*/
EXPORT_APIFUNCTION int CDECL GetRecordAutoCalc(unsigned int index) noexcept;
API_FUNCTION int CDECL GetRecordAutoCalc(unsigned int index) noexcept;
/**
* \brief Get the charge of the record at a certain index in the read worldstate's
@ -243,7 +242,7 @@ namespace RecordsDynamicFunctions
* \param index The index of the record.
* \return The charge of the record.
*/
EXPORT_APIFUNCTION int CDECL GetRecordCharge(unsigned int index) noexcept;
API_FUNCTION int CDECL GetRecordCharge(unsigned int index) noexcept;
/**
* \brief Get the cost of the record at a certain index in the read worldstate's
@ -252,7 +251,7 @@ namespace RecordsDynamicFunctions
* \param index The index of the record.
* \return The cost of the record.
*/
EXPORT_APIFUNCTION int CDECL GetRecordCost(unsigned int index) noexcept;
API_FUNCTION int CDECL GetRecordCost(unsigned int index) noexcept;
/**
* \brief Get the flags of the record at a certain index in the read worldstate's
@ -261,7 +260,7 @@ namespace RecordsDynamicFunctions
* \param index The index of the record.
* \return The flags of the spell as an integer.
*/
EXPORT_APIFUNCTION int CDECL GetRecordFlags(unsigned int index) noexcept;
API_FUNCTION int CDECL GetRecordFlags(unsigned int index) noexcept;
/**
* \brief Get the value of the record at a certain index in the read worldstate's
@ -270,7 +269,7 @@ namespace RecordsDynamicFunctions
* \param index The index of the record.
* \return The value of the record.
*/
EXPORT_APIFUNCTION int CDECL GetRecordValue(unsigned int index) noexcept;
API_FUNCTION int CDECL GetRecordValue(unsigned int index) noexcept;
/**
* \brief Get the weight of the record at a certain index in the read worldstate's
@ -279,7 +278,7 @@ namespace RecordsDynamicFunctions
* \param index The index of the record.
* \return The weight of the record.
*/
EXPORT_APIFUNCTION double CDECL GetRecordWeight(unsigned int index) noexcept;
API_FUNCTION double CDECL GetRecordWeight(unsigned int index) noexcept;
/**
* \brief Get the ID of the effect at a certain index in the read worldstate's
@ -289,7 +288,7 @@ namespace RecordsDynamicFunctions
* \param effectIndex The index of the effect.
* \return The ID of the effect.
*/
EXPORT_APIFUNCTION unsigned int CDECL GetRecordEffectId(unsigned int recordIndex, unsigned int effectIndex) noexcept;
API_FUNCTION unsigned int CDECL GetRecordEffectId(unsigned int recordIndex, unsigned int effectIndex) noexcept;
/**
* \brief Get the ID of the attribute modified by the effect at a certain index in the
@ -299,7 +298,7 @@ namespace RecordsDynamicFunctions
* \param effectIndex The index of the effect.
* \return The attribute ID for the effect.
*/
EXPORT_APIFUNCTION int CDECL GetRecordEffectAttribute(unsigned int recordIndex, unsigned int effectIndex) noexcept;
API_FUNCTION int CDECL GetRecordEffectAttribute(unsigned int recordIndex, unsigned int effectIndex) noexcept;
/**
* \brief Get the ID of the skill modified by the effect at a certain index in the
@ -309,7 +308,7 @@ namespace RecordsDynamicFunctions
* \param effectIndex The index of the effect.
* \return The skill ID for the effect.
*/
EXPORT_APIFUNCTION int CDECL GetRecordEffectSkill(unsigned int recordIndex, unsigned int effectIndex) noexcept;
API_FUNCTION int CDECL GetRecordEffectSkill(unsigned int recordIndex, unsigned int effectIndex) noexcept;
/**
* \brief Get the range type of the effect at a certain index in the read worldstate's
@ -319,7 +318,7 @@ namespace RecordsDynamicFunctions
* \param effectIndex The index of the effect.
* \return The range of the effect.
*/
EXPORT_APIFUNCTION unsigned int CDECL GetRecordEffectRangeType(unsigned int recordIndex, unsigned int effectIndex) noexcept;
API_FUNCTION unsigned int CDECL GetRecordEffectRangeType(unsigned int recordIndex, unsigned int effectIndex) noexcept;
/**
* \brief Get the area of the effect at a certain index in the read worldstate's current
@ -329,7 +328,7 @@ namespace RecordsDynamicFunctions
* \param effectIndex The index of the effect.
* \return The area of the effect.
*/
EXPORT_APIFUNCTION int CDECL GetRecordEffectArea(unsigned int recordIndex, unsigned int effectIndex) noexcept;
API_FUNCTION int CDECL GetRecordEffectArea(unsigned int recordIndex, unsigned int effectIndex) noexcept;
/**
* \brief Get the duration of the effect at a certain index in the read worldstate's current
@ -339,7 +338,7 @@ namespace RecordsDynamicFunctions
* \param effectIndex The index of the effect.
* \return The duration of the effect.
*/
EXPORT_APIFUNCTION int CDECL GetRecordEffectDuration(unsigned int recordIndex, unsigned int effectIndex) noexcept;
API_FUNCTION int CDECL GetRecordEffectDuration(unsigned int recordIndex, unsigned int effectIndex) noexcept;
/**
* \brief Get the maximum magnitude of the effect at a certain index in the read
@ -349,7 +348,7 @@ namespace RecordsDynamicFunctions
* \param effectIndex The index of the effect.
* \return The maximum magnitude of the effect.
*/
EXPORT_APIFUNCTION int CDECL GetRecordEffectMagnitudeMax(unsigned int recordIndex, unsigned int effectIndex) noexcept;
API_FUNCTION int CDECL GetRecordEffectMagnitudeMax(unsigned int recordIndex, unsigned int effectIndex) noexcept;
/**
* \brief Get the minimum magnitude of the effect at a certain index in the read
@ -359,7 +358,7 @@ namespace RecordsDynamicFunctions
* \param effectIndex The index of the effect.
* \return The minimum magnitude of the effect.
*/
EXPORT_APIFUNCTION int CDECL GetRecordEffectMagnitudeMin(unsigned int recordIndex, unsigned int effectIndex) noexcept;
API_FUNCTION int CDECL GetRecordEffectMagnitudeMin(unsigned int recordIndex, unsigned int effectIndex) noexcept;
/**
* \brief Set which type of temporary records stored on the server should have
@ -368,7 +367,7 @@ namespace RecordsDynamicFunctions
* \param type The type of records.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordType(unsigned int type) noexcept;
API_FUNCTION void CDECL SetRecordType(unsigned int type) noexcept;
/**
* \brief Set the id of the temporary record stored on the server for the
@ -377,7 +376,7 @@ namespace RecordsDynamicFunctions
* \param id The id of the record.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordId(const char* id) noexcept;
API_FUNCTION void CDECL SetRecordId(const char* id) noexcept;
/**
* \brief Set the base id (i.e. the id this record should inherit default
@ -387,7 +386,7 @@ namespace RecordsDynamicFunctions
* \param baseId The baseId of the record.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordBaseId(const char* baseId) noexcept;
API_FUNCTION void CDECL SetRecordBaseId(const char* baseId) noexcept;
/**
* \brief Set the inventory base id (i.e. the id this record should inherit
@ -397,7 +396,7 @@ namespace RecordsDynamicFunctions
* \param inventoryBaseId The inventoryBaseId of the record.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordInventoryBaseId(const char* inventoryBaseId) noexcept;
API_FUNCTION void CDECL SetRecordInventoryBaseId(const char* inventoryBaseId) noexcept;
/**
* \brief Set the subtype of the temporary record stored on the server for
@ -406,7 +405,7 @@ namespace RecordsDynamicFunctions
* \param type The spell type.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordSubtype(unsigned int subtype) noexcept;
API_FUNCTION void CDECL SetRecordSubtype(unsigned int subtype) noexcept;
/**
* \brief Set the name of the temporary record stored on the server for the
@ -415,7 +414,7 @@ namespace RecordsDynamicFunctions
* \param name The name of the record.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordName(const char* name) noexcept;
API_FUNCTION void CDECL SetRecordName(const char* name) noexcept;
/**
* \brief Set the model of the temporary record stored on the server for the
@ -424,7 +423,7 @@ namespace RecordsDynamicFunctions
* \param model The model of the record.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordModel(const char* model) noexcept;
API_FUNCTION void CDECL SetRecordModel(const char* model) noexcept;
/**
* \brief Set the icon of the temporary record stored on the server for the
@ -433,7 +432,7 @@ namespace RecordsDynamicFunctions
* \param icon The icon of the record.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordIcon(const char* icon) noexcept;
API_FUNCTION void CDECL SetRecordIcon(const char* icon) noexcept;
/**
* \brief Set the script of the temporary record stored on the server for the
@ -442,7 +441,7 @@ namespace RecordsDynamicFunctions
* \param script The script of the record.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordScript(const char* script) noexcept;
API_FUNCTION void CDECL SetRecordScript(const char* script) noexcept;
/**
* \brief Set the enchantment id of the temporary record stored on the server
@ -451,7 +450,7 @@ namespace RecordsDynamicFunctions
* \param enchantmentId The enchantment id of the record.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordEnchantmentId(const char* enchantmentId) noexcept;
API_FUNCTION void CDECL SetRecordEnchantmentId(const char* enchantmentId) noexcept;
/**
* \brief Set the enchantment charge of the temporary record stored on the server
@ -460,7 +459,7 @@ namespace RecordsDynamicFunctions
* \param enchantmentCharge The enchantmentCharge of the record.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordEnchantmentCharge(int enchantmentCharge) noexcept;
API_FUNCTION void CDECL SetRecordEnchantmentCharge(int enchantmentCharge) noexcept;
/**
* \brief Set the auto-calculation flag value of the temporary record stored
@ -469,7 +468,7 @@ namespace RecordsDynamicFunctions
* \param autoCalc The auto-calculation flag value of the record.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordAutoCalc(int autoCalc) noexcept;
API_FUNCTION void CDECL SetRecordAutoCalc(int autoCalc) noexcept;
/**
* \brief Set the charge of the temporary record stored on the server for the
@ -478,7 +477,7 @@ namespace RecordsDynamicFunctions
* \param charge The charge of the record.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordCharge(int charge) noexcept;
API_FUNCTION void CDECL SetRecordCharge(int charge) noexcept;
/**
* \brief Set the cost of the temporary record stored on the server for the
@ -487,7 +486,7 @@ namespace RecordsDynamicFunctions
* \param cost The cost of the record.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordCost(int cost) noexcept;
API_FUNCTION void CDECL SetRecordCost(int cost) noexcept;
/**
* \brief Set the flags of the temporary record stored on the server for the
@ -496,7 +495,7 @@ namespace RecordsDynamicFunctions
* \param flags The flags of the record.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordFlags(int flags) noexcept;
API_FUNCTION void CDECL SetRecordFlags(int flags) noexcept;
/**
* \brief Set the value of the temporary record stored on the server for the
@ -505,7 +504,7 @@ namespace RecordsDynamicFunctions
* \param value The value of the record.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordValue(int value) noexcept;
API_FUNCTION void CDECL SetRecordValue(int value) noexcept;
/**
* \brief Set the weight of the temporary record stored on the server for the
@ -514,7 +513,7 @@ namespace RecordsDynamicFunctions
* \param weight The weight of the record.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordWeight(double weight) noexcept;
API_FUNCTION void CDECL SetRecordWeight(double weight) noexcept;
/**
* \brief Set the armor rating of the temporary record stored on the server
@ -523,7 +522,7 @@ namespace RecordsDynamicFunctions
* \param armorRating The armor rating of the record.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordArmorRating(int armorRating) noexcept;
API_FUNCTION void CDECL SetRecordArmorRating(int armorRating) noexcept;
/**
* \brief Set the health of the temporary record stored on the server for the
@ -532,7 +531,7 @@ namespace RecordsDynamicFunctions
* \param health The health of the record.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordHealth(int health) noexcept;
API_FUNCTION void CDECL SetRecordHealth(int health) noexcept;
/**
* \brief Set the chop damage of the temporary record stored on the server for the
@ -542,7 +541,7 @@ namespace RecordsDynamicFunctions
* \param maxDamage The maximum damage of the record.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordDamageChop(unsigned int minDamage, unsigned int maxDamage) noexcept;
API_FUNCTION void CDECL SetRecordDamageChop(unsigned int minDamage, unsigned int maxDamage) noexcept;
/**
* \brief Set the slash damage of the temporary record stored on the server for the
@ -552,7 +551,7 @@ namespace RecordsDynamicFunctions
* \param maxDamage The maximum damage of the record.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordDamageSlash(unsigned int minDamage, unsigned int maxDamage) noexcept;
API_FUNCTION void CDECL SetRecordDamageSlash(unsigned int minDamage, unsigned int maxDamage) noexcept;
/**
* \brief Set the thrust damage of the temporary record stored on the server for the
@ -562,7 +561,7 @@ namespace RecordsDynamicFunctions
* \param maxDamage The maximum damage of the record.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordDamageThrust(unsigned int minDamage, unsigned int maxDamage) noexcept;
API_FUNCTION void CDECL SetRecordDamageThrust(unsigned int minDamage, unsigned int maxDamage) noexcept;
/**
* \brief Set the reach of the temporary record stored on the server for the
@ -571,7 +570,7 @@ namespace RecordsDynamicFunctions
* \param reach The reach of the record.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordReach(double reach) noexcept;
API_FUNCTION void CDECL SetRecordReach(double reach) noexcept;
/**
* \brief Set the speed of the temporary record stored on the server for the
@ -580,7 +579,7 @@ namespace RecordsDynamicFunctions
* \param speed The speed of the record.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordSpeed(double speed) noexcept;
API_FUNCTION void CDECL SetRecordSpeed(double speed) noexcept;
/**
* \brief Set whether the temporary record stored on the server for the
@ -591,7 +590,7 @@ namespace RecordsDynamicFunctions
* \param keyState Whether the record is a key.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordKeyState(bool keyState) noexcept;
API_FUNCTION void CDECL SetRecordKeyState(bool keyState) noexcept;
/**
* \brief Set whether the temporary record stored on the server for the
@ -602,7 +601,7 @@ namespace RecordsDynamicFunctions
* \param scrollState Whether the record is a scroll.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordScrollState(bool scrollState) noexcept;
API_FUNCTION void CDECL SetRecordScrollState(bool scrollState) noexcept;
/**
* \brief Set the skill ID of the temporary record stored on the server for the
@ -611,7 +610,7 @@ namespace RecordsDynamicFunctions
* \param skillId The skill ID of the record.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordSkillId(int skillId) noexcept;
API_FUNCTION void CDECL SetRecordSkillId(int skillId) noexcept;
/**
* \brief Set the text of the temporary record stored on the server for the
@ -620,7 +619,7 @@ namespace RecordsDynamicFunctions
* \param text The text of the record.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordText(const char* text) noexcept;
API_FUNCTION void CDECL SetRecordText(const char* text) noexcept;
/**
* \brief Set the hair of the temporary record stored on the server for the
@ -629,7 +628,7 @@ namespace RecordsDynamicFunctions
* \param hair The hair of the record.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordHair(const char* hair) noexcept;
API_FUNCTION void CDECL SetRecordHair(const char* hair) noexcept;
/**
* \brief Set the head of the temporary record stored on the server for the
@ -638,7 +637,7 @@ namespace RecordsDynamicFunctions
* \param hair The head of the record.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordHead(const char* head) noexcept;
API_FUNCTION void CDECL SetRecordHead(const char* head) noexcept;
/**
* \brief Set the gender of the temporary record stored on the server for the
@ -647,7 +646,7 @@ namespace RecordsDynamicFunctions
* \param hair The race of the record.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordGender(unsigned int gender) noexcept;
API_FUNCTION void CDECL SetRecordGender(unsigned int gender) noexcept;
/**
* \brief Set the race of the temporary record stored on the server for the
@ -656,7 +655,7 @@ namespace RecordsDynamicFunctions
* \param hair The race of the record.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordRace(const char* race) noexcept;
API_FUNCTION void CDECL SetRecordRace(const char* race) noexcept;
/**
* \brief Set the character class of the temporary record stored on the server
@ -665,7 +664,7 @@ namespace RecordsDynamicFunctions
* \param hair The character class of the record.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordClass(const char* charClass) noexcept;
API_FUNCTION void CDECL SetRecordClass(const char* charClass) noexcept;
/**
* \brief Set the faction of the temporary record stored on the server for the
@ -674,7 +673,7 @@ namespace RecordsDynamicFunctions
* \param faction The faction of the record.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordFaction(const char* faction) noexcept;
API_FUNCTION void CDECL SetRecordFaction(const char* faction) noexcept;
/**
* \brief Set the level of the temporary record stored on the server for the
@ -683,7 +682,7 @@ namespace RecordsDynamicFunctions
* \param level The level of the record.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordLevel(int level) noexcept;
API_FUNCTION void CDECL SetRecordLevel(int level) noexcept;
/**
* \brief Set the magicka of the temporary record stored on the server for the
@ -692,7 +691,7 @@ namespace RecordsDynamicFunctions
* \param magicka The magicka of the record.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordMagicka(int magicka) noexcept;
API_FUNCTION void CDECL SetRecordMagicka(int magicka) noexcept;
/**
* \brief Set the fatigue of the temporary record stored on the server for the
@ -701,7 +700,7 @@ namespace RecordsDynamicFunctions
* \param fatigue The fatigue of the record.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordFatigue(int fatigue) noexcept;
API_FUNCTION void CDECL SetRecordFatigue(int fatigue) noexcept;
/**
* \brief Set the AI fight value of the temporary record stored on the server for the
@ -710,7 +709,7 @@ namespace RecordsDynamicFunctions
* \param aiFight The AI fight value of the record.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordAIFight(int aiFight) noexcept;
API_FUNCTION void CDECL SetRecordAIFight(int aiFight) noexcept;
/**
* \brief Set the id of the record at a certain index in the records stored on the server.
@ -722,7 +721,7 @@ namespace RecordsDynamicFunctions
* \param id The id of the record.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordIdByIndex(unsigned int index, const char* id) noexcept;
API_FUNCTION void CDECL SetRecordIdByIndex(unsigned int index, const char* id) noexcept;
/**
* \brief Set the enchantment id of the record at a certain index in the records stored on
@ -735,7 +734,7 @@ namespace RecordsDynamicFunctions
* \param enchantmentId The enchantment id of the record.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordEnchantmentIdByIndex(unsigned int index, const char* enchantmentId) noexcept;
API_FUNCTION void CDECL SetRecordEnchantmentIdByIndex(unsigned int index, const char* enchantmentId) noexcept;
/**
* \brief Set the ID of the temporary effect stored on the server.
@ -743,7 +742,7 @@ namespace RecordsDynamicFunctions
* \param effectId The ID of the effect.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordEffectId(unsigned int effectId) noexcept;
API_FUNCTION void CDECL SetRecordEffectId(unsigned int effectId) noexcept;
/**
* \brief Set the ID of the attribute modified by the temporary effect stored on
@ -752,7 +751,7 @@ namespace RecordsDynamicFunctions
* \param attributeId The ID of the attribute.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordEffectAttribute(int attributeId) noexcept;
API_FUNCTION void CDECL SetRecordEffectAttribute(int attributeId) noexcept;
/**
* \brief Set the ID of the skill modified by the temporary effect stored on the
@ -761,7 +760,7 @@ namespace RecordsDynamicFunctions
* \param skillId The ID of the skill.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordEffectSkill(int skillId) noexcept;
API_FUNCTION void CDECL SetRecordEffectSkill(int skillId) noexcept;
/**
* \brief Set the range type of the temporary effect stored on the server (0 for
@ -770,7 +769,7 @@ namespace RecordsDynamicFunctions
* \param rangeType The range type of the effect.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordEffectRangeType(unsigned int rangeType) noexcept;
API_FUNCTION void CDECL SetRecordEffectRangeType(unsigned int rangeType) noexcept;
/**
* \brief Set the area of the temporary effect stored on the server.
@ -778,7 +777,7 @@ namespace RecordsDynamicFunctions
* \param area The area of the effect.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordEffectArea(int area) noexcept;
API_FUNCTION void CDECL SetRecordEffectArea(int area) noexcept;
/**
* \brief Set the duration of the temporary effect stored on the server.
@ -786,7 +785,7 @@ namespace RecordsDynamicFunctions
* \param duration The duration of the effect.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordEffectDuration(int duration) noexcept;
API_FUNCTION void CDECL SetRecordEffectDuration(int duration) noexcept;
/**
* \brief Set the maximum magnitude of the temporary effect stored on the server.
@ -794,7 +793,7 @@ namespace RecordsDynamicFunctions
* \param magnitudeMax The maximum magnitude of the effect.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordEffectMagnitudeMax(int magnitudeMax) noexcept;
API_FUNCTION void CDECL SetRecordEffectMagnitudeMax(int magnitudeMax) noexcept;
/**
* \brief Set the minimum magnitude of the temporary effect stored on the server.
@ -802,7 +801,7 @@ namespace RecordsDynamicFunctions
* \param magnitudeMin The minimum magnitude of the effect.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordEffectMagnitudeMin(int magnitudeMin) noexcept;
API_FUNCTION void CDECL SetRecordEffectMagnitudeMin(int magnitudeMin) noexcept;
/**
* \brief Set the type of the temporary body part stored on the server.
@ -810,7 +809,7 @@ namespace RecordsDynamicFunctions
* \param partType The type of the body part.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordBodyPartType(unsigned int partType) noexcept;
API_FUNCTION void CDECL SetRecordBodyPartType(unsigned int partType) noexcept;
/**
* \brief Set the id of the male version of the temporary body part stored on the
@ -819,7 +818,7 @@ namespace RecordsDynamicFunctions
* \param partId The id of the body part.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordBodyPartIdForMale(const char* partId) noexcept;
API_FUNCTION void CDECL SetRecordBodyPartIdForMale(const char* partId) noexcept;
/**
* \brief Set the id of the female version of the temporary body part stored on the
@ -828,7 +827,7 @@ namespace RecordsDynamicFunctions
* \param partId The id of the body part.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordBodyPartIdForFemale(const char* partId) noexcept;
API_FUNCTION void CDECL SetRecordBodyPartIdForFemale(const char* partId) noexcept;
/**
* \brief Set the id of the of the temporary inventory item stored on the server.
@ -836,7 +835,7 @@ namespace RecordsDynamicFunctions
* \param partId The id of the inventory item.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordInventoryItemId(const char* itemId) noexcept;
API_FUNCTION void CDECL SetRecordInventoryItemId(const char* itemId) noexcept;
/**
* \brief Set the count of the of the temporary inventory item stored on the server.
@ -844,7 +843,7 @@ namespace RecordsDynamicFunctions
* \param count The count of the inventory item.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRecordInventoryItemCount(unsigned int count) noexcept;
API_FUNCTION void CDECL SetRecordInventoryItemCount(unsigned int count) noexcept;
/**
* \brief Add a copy of the server's temporary record of the current specified
@ -855,7 +854,7 @@ namespace RecordsDynamicFunctions
*
* \return void
*/
EXPORT_APIFUNCTION void CDECL AddRecord() noexcept;
API_FUNCTION void CDECL AddRecord() noexcept;
/**
* \brief Add a copy of the server's temporary effect to the temporary record
@ -866,7 +865,7 @@ namespace RecordsDynamicFunctions
*
* \return void
*/
EXPORT_APIFUNCTION void CDECL AddRecordEffect() noexcept;
API_FUNCTION void CDECL AddRecordEffect() noexcept;
/**
* \brief Add a copy of the server's temporary body part to the temporary record
@ -877,7 +876,7 @@ namespace RecordsDynamicFunctions
*
* \return void
*/
EXPORT_APIFUNCTION void CDECL AddRecordBodyPart() noexcept;
API_FUNCTION void CDECL AddRecordBodyPart() noexcept;
/**
* \brief Add a copy of the server's temporary inventory item to the temporary record
@ -891,7 +890,7 @@ namespace RecordsDynamicFunctions
*
* \return void
*/
EXPORT_APIFUNCTION void CDECL AddRecordInventoryItem() noexcept;
API_FUNCTION void CDECL AddRecordInventoryItem() noexcept;
/**
* \brief Send a RecordDynamic packet with the current specified record type.
@ -903,7 +902,7 @@ namespace RecordsDynamicFunctions
* to the packet (false by default).
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendRecordDynamic(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
}
API_FUNCTION void CDECL SendRecordDynamic(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
NAMESPACE_END()
#endif //OPENMW_RECORDSDYNAMICAPI_HPP

@ -1,4 +1,4 @@
#include "Server.hpp"
#include "Server.h"
#include <components/openmw-mp/NetworkMessages.hpp>
#include <components/openmw-mp/Log.hpp>

@ -3,9 +3,9 @@
#include "../Types.hpp"
#include <Script/Platform.hpp>
#include "../api.h"
#include <Script/Platform.hpp>
#include "../api.h"
#define SERVERAPI \
{"StopServer", ServerFunctions::StopServer},\
@ -36,15 +36,14 @@
{"AddPluginHash", ServerFunctions::AddPluginHash},\
{"GetModDir", ServerFunctions::GetModDir}
namespace ServerFunctions
{
NAMESPACE_BEGIN(ServerFunctions)
/**
* \brief Shut down the server.
*
* \param code The shutdown code.
* \return void
*/
EXPORT_APIFUNCTION void CDECL StopServer(int code) noexcept;
API_FUNCTION void CDECL StopServer(int code) noexcept;
/**
* \brief Kick a certain player from the server.
@ -52,7 +51,7 @@ namespace ServerFunctions
* \param pid The player ID.
* \return void
*/
EXPORT_APIFUNCTION void CDECL Kick(unsigned short pid) noexcept;
API_FUNCTION void CDECL Kick(unsigned short pid) noexcept;
/**
* \brief Ban a certain IP address from the server.
@ -60,7 +59,7 @@ namespace ServerFunctions
* \param ipAddress The IP address.
* \return void
*/
EXPORT_APIFUNCTION void CDECL BanAddress(const char *ipAddress) noexcept;
API_FUNCTION void CDECL BanAddress(const char *ipAddress) noexcept;
/**
* \brief Unban a certain IP address from the server.
@ -68,7 +67,7 @@ namespace ServerFunctions
* \param ipAddress The IP address.
* \return void
*/
EXPORT_APIFUNCTION void CDECL UnbanAddress(const char *ipAddress) noexcept;
API_FUNCTION void CDECL UnbanAddress(const char *ipAddress) noexcept;
/**
* \brief Get the type of the operating system used by the server.
@ -77,7 +76,7 @@ namespace ServerFunctions
*
* \return The type of the operating system.
*/
EXPORT_APIFUNCTION const char *CDECL GetOperatingSystemType() noexcept;
API_FUNCTION const char *CDECL GetOperatingSystemType() noexcept;
/**
* \brief Get the architecture type used by the server.
@ -86,21 +85,21 @@ namespace ServerFunctions
*
* \return The architecture type.
*/
EXPORT_APIFUNCTION const char *CDECL GetArchitectureType() noexcept;
API_FUNCTION const char *CDECL GetArchitectureType() noexcept;
/**
* \brief Get the TES3MP version of the server.
*
* \return The server version.
*/
EXPORT_APIFUNCTION const char *CDECL GetServerVersion() noexcept;
API_FUNCTION const char *CDECL GetServerVersion() noexcept;
/**
* \brief Get the protocol version of the server.
*
* \return The protocol version.
*/
EXPORT_APIFUNCTION const char *CDECL GetProtocolVersion() noexcept;
API_FUNCTION const char *CDECL GetProtocolVersion() noexcept;
/**
* \brief Get the average ping of a certain player.
@ -108,7 +107,7 @@ namespace ServerFunctions
* \param pid The player ID.
* \return The average ping.
*/
EXPORT_APIFUNCTION int CDECL GetAvgPing(unsigned short pid) noexcept;
API_FUNCTION int CDECL GetAvgPing(unsigned short pid) noexcept;
/**
* \brief Get the IP address of a certain player.
@ -116,28 +115,28 @@ namespace ServerFunctions
* \param pid The player ID.
* \return The IP address.
*/
EXPORT_APIFUNCTION const CDECL char* GetIP(unsigned short pid) noexcept;
API_FUNCTION const CDECL char* GetIP(unsigned short pid) noexcept;
/**
* \brief Get the port used by the server.
*
* \return Port
*/
EXPORT_APIFUNCTION unsigned short CDECL GetPort() noexcept;
API_FUNCTION unsigned short CDECL GetPort() noexcept;
/**
* \brief Get the maximum number of players.
*
* \return Max players
*/
EXPORT_APIFUNCTION unsigned int CDECL GetMaxPlayers() noexcept;
API_FUNCTION unsigned int CDECL GetMaxPlayers() noexcept;
/**
* \brief Checking if the server requires a password to connect.
*
* @return
*/
EXPORT_APIFUNCTION bool CDECL HasPassword() noexcept;
API_FUNCTION bool CDECL HasPassword() noexcept;
/**
* \brief Get the plugin enforcement state of the server.
@ -146,7 +145,7 @@ namespace ServerFunctions
*
* \return The enforcement state.
*/
EXPORT_APIFUNCTION bool CDECL GetPluginEnforcementState() noexcept;
API_FUNCTION bool CDECL GetPluginEnforcementState() noexcept;
/**
* \brief Get the script error ignoring state of the server.
@ -155,7 +154,7 @@ namespace ServerFunctions
*
* \return The script error ignoring state.
*/
EXPORT_APIFUNCTION bool CDECL GetScriptErrorIgnoringState() noexcept;
API_FUNCTION bool CDECL GetScriptErrorIgnoringState() noexcept;
/**
* \brief Set the game mode of the server, as displayed in the server browser.
@ -163,7 +162,7 @@ namespace ServerFunctions
* \param name The new game mode.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetGameMode(const char* gameMode) noexcept;
API_FUNCTION void CDECL SetGameMode(const char* gameMode) noexcept;
/**
* \brief Set the name of the server, as displayed in the server browser.
@ -171,7 +170,7 @@ namespace ServerFunctions
* \param name The new name.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetHostname(const char* name) noexcept;
API_FUNCTION void CDECL SetHostname(const char* name) noexcept;
/**
* \brief Set the password required to join the server.
@ -179,7 +178,7 @@ namespace ServerFunctions
* \param password The password.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetServerPassword(const char *password) noexcept;
API_FUNCTION void CDECL SetServerPassword(const char *password) noexcept;
/**
* \brief Set the plugin enforcement state of the server.
@ -189,7 +188,7 @@ namespace ServerFunctions
* \param state The new enforcement state.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetPluginEnforcementState(bool state) noexcept;
API_FUNCTION void CDECL SetPluginEnforcementState(bool state) noexcept;
/**
* \brief Set whether script errors should be ignored or not.
@ -201,7 +200,7 @@ namespace ServerFunctions
* \param state The new script error ignoring state.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetScriptErrorIgnoringState(bool state) noexcept;
API_FUNCTION void CDECL SetScriptErrorIgnoringState(bool state) noexcept;
/**
* \brief Set a rule string for the server details displayed in the server browser.
@ -210,7 +209,7 @@ namespace ServerFunctions
* \param value The string value of the rule.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRuleString(const char *key, const char *value) noexcept;
API_FUNCTION void CDECL SetRuleString(const char *key, const char *value) noexcept;
/**
* \brief Set a rule value for the server details displayed in the server browser.
@ -219,16 +218,16 @@ namespace ServerFunctions
* \param value The numerical value of the rule.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRuleValue(const char *key, double value) noexcept;
API_FUNCTION void CDECL SetRuleValue(const char *key, double value) noexcept;
/**
* \brief Adds plugins to the internal server structure to validate players.
* @param pluginName Name with extension of the plugin or master file.
* @param hash Hash string
*/
EXPORT_APIFUNCTION void CDECL AddPluginHash(const char *pluginName, const char *hash) noexcept;
API_FUNCTION void CDECL AddPluginHash(const char *pluginName, const char *hash) noexcept;
EXPORT_APIFUNCTION const char *CDECL GetModDir() noexcept;
}
API_FUNCTION const char *CDECL GetModDir() noexcept;
NAMESPACE_END()
#endif //OPENMW_SERVERAPI_HPP

@ -1,4 +1,4 @@
#include "Settings.hpp"
#include "Settings.h"
#include <components/openmw-mp/NetworkMessages.hpp>
#include <components/openmw-mp/Log.hpp>

@ -3,7 +3,7 @@
#include "../Types.hpp"
#include <Script/Platform.hpp>
#include "../api.h"
#define SETTINGSAPI \
{"SetDifficulty", SettingFunctions::SetDifficulty},\
@ -17,8 +17,7 @@
\
{"SendSettings", SettingFunctions::SendSettings}
namespace SettingFunctions
{
NAMESPACE_BEGIN(SettingFunctions)
/**
* \brief Set the difficulty for a player.
*
@ -29,7 +28,7 @@ namespace SettingFunctions
* \param difficulty The difficulty.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetDifficulty(unsigned short pid, int difficulty);
API_FUNCTION void CDECL SetDifficulty(unsigned short pid, int difficulty);
/**
* \brief Set the client log level enforced for a player.
@ -47,7 +46,7 @@ namespace SettingFunctions
* \param enforcedLogLevel The enforced log level.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetEnforcedLogLevel(unsigned short pid, int enforcedLogLevel);
API_FUNCTION void CDECL SetEnforcedLogLevel(unsigned short pid, int enforcedLogLevel);
/**
* \brief Set the physics framerate for a player.
@ -59,7 +58,7 @@ namespace SettingFunctions
* \param physicsFramerate The physics framerate.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetPhysicsFramerate(unsigned short pid, double physicsFramerate);
API_FUNCTION void CDECL SetPhysicsFramerate(unsigned short pid, double physicsFramerate);
/**
* \brief Set whether the console is allowed for a player.
@ -71,7 +70,7 @@ namespace SettingFunctions
* \param state The console permission state.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetConsoleAllowed(unsigned short pid, bool state);
API_FUNCTION void CDECL SetConsoleAllowed(unsigned short pid, bool state);
/**
* \brief Set whether resting in beds is allowed for a player.
@ -83,7 +82,7 @@ namespace SettingFunctions
* \param state The resting permission state.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetBedRestAllowed(unsigned short pid, bool state);
API_FUNCTION void CDECL SetBedRestAllowed(unsigned short pid, bool state);
/**
* \brief Set whether resting in the wilderness is allowed for a player.
@ -95,7 +94,7 @@ namespace SettingFunctions
* \param state The resting permission state.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetWildernessRestAllowed(unsigned short pid, bool state);
API_FUNCTION void CDECL SetWildernessRestAllowed(unsigned short pid, bool state);
/**
* \brief Set whether waiting is allowed for a player.
@ -107,7 +106,7 @@ namespace SettingFunctions
* \param state The waiting permission state.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetWaitAllowed(unsigned short pid, bool state);
API_FUNCTION void CDECL SetWaitAllowed(unsigned short pid, bool state);
/**
* \brief Send a PlayerSettings packet to the player affected by it.
@ -115,7 +114,7 @@ namespace SettingFunctions
* \param pid The player ID to send it to.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendSettings(unsigned short pid) noexcept;
}
API_FUNCTION void CDECL SendSettings(unsigned short pid) noexcept;
NAMESPACE_END()
#endif //OPENMW_SETTINGSAPI_HPP

@ -1,4 +1,4 @@
#include "Shapeshift.hpp"
#include "Shapeshift.h"
#include <components/openmw-mp/NetworkMessages.hpp>
#include <components/openmw-mp/Log.hpp>

@ -3,7 +3,7 @@
#include "../Types.hpp"
#include <Script/Platform.hpp>
#include "../api.h"
#define SHAPESHIFTAPI \
{"GetScale", ShapeshiftFunctions::GetScale},\
@ -18,15 +18,14 @@
\
{"SendShapeshift", ShapeshiftFunctions::SendShapeshift}
namespace ShapeshiftFunctions
{
NAMESPACE_BEGIN(ShapeshiftFunctions)
/**
* \brief Get the scale of a player.
*
* \param pid The player ID.
* \return The scale.
*/
EXPORT_APIFUNCTION double CDECL GetScale(unsigned short pid) noexcept;
API_FUNCTION double CDECL GetScale(unsigned short pid) noexcept;
/**
* \brief Check whether a player is a werewolf.
@ -36,7 +35,7 @@ namespace ShapeshiftFunctions
* \param pid The player ID.
* \return The werewolf state.
*/
EXPORT_APIFUNCTION bool CDECL IsWerewolf(unsigned short pid) noexcept;
API_FUNCTION bool CDECL IsWerewolf(unsigned short pid) noexcept;
/**
* \brief Get the refId of the creature the player is disguised as.
@ -44,7 +43,7 @@ namespace ShapeshiftFunctions
* \param pid The player ID.
* \return The creature refId.
*/
EXPORT_APIFUNCTION const char *CDECL GetCreatureRefId(unsigned short pid) noexcept;
API_FUNCTION const char *CDECL GetCreatureRefId(unsigned short pid) noexcept;
/**
* \brief Check whether a player's name is replaced by that of the creature they are
@ -55,7 +54,7 @@ namespace ShapeshiftFunctions
* \param pid The player ID.
* \return The creature name display state.
*/
EXPORT_APIFUNCTION bool CDECL GetCreatureNameDisplayState(unsigned short pid) noexcept;
API_FUNCTION bool CDECL GetCreatureNameDisplayState(unsigned short pid) noexcept;
/**
* \brief Set the scale of a player.
@ -67,7 +66,7 @@ namespace ShapeshiftFunctions
* \param scale The new scale.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetScale(unsigned short pid, double scale) noexcept;
API_FUNCTION void CDECL SetScale(unsigned short pid, double scale) noexcept;
/**
* \brief Set the werewolf state of a player.
@ -79,7 +78,7 @@ namespace ShapeshiftFunctions
* \param isWerewolf The new werewolf state.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetWerewolfState(unsigned short pid, bool isWerewolf) noexcept;
API_FUNCTION void CDECL SetWerewolfState(unsigned short pid, bool isWerewolf) noexcept;
/**
* \brief Set the refId of the creature a player is disguised as.
@ -93,7 +92,7 @@ namespace ShapeshiftFunctions
* when hovered over by others.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetCreatureRefId(unsigned short pid, const char *refId) noexcept;
API_FUNCTION void CDECL SetCreatureRefId(unsigned short pid, const char *refId) noexcept;
/**
* \brief Set whether a player's name is replaced by that of the creature they are
@ -103,7 +102,7 @@ namespace ShapeshiftFunctions
* \param displayState The creature name display state.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetCreatureNameDisplayState(unsigned short pid, bool displayState) noexcept;
API_FUNCTION void CDECL SetCreatureNameDisplayState(unsigned short pid, bool displayState) noexcept;
/**
* \brief Send a PlayerShapeshift packet about a player.
@ -114,7 +113,7 @@ namespace ShapeshiftFunctions
* \param pid The player ID.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendShapeshift(unsigned short pid);
}
API_FUNCTION void CDECL SendShapeshift(unsigned short pid);
NAMESPACE_END()
#endif //OPENMW_SHAPESHIFTAPI_HPP

@ -1,4 +1,4 @@
#include "Spells.hpp"
#include "Spells.h"
#include <components/misc/stringops.hpp>
#include <components/openmw-mp/NetworkMessages.hpp>

@ -1,7 +1,7 @@
#ifndef OPENMW_SPELLAPI_HPP
#define OPENMW_SPELLAPI_HPP
#include <Script/Platform.hpp>
#include "../api.h"
#define SPELLAPI \
{"ClearSpellbookChanges", SpellFunctions::ClearSpellbookChanges},\
@ -18,8 +18,7 @@
\
{"InitializeSpellbookChanges", SpellFunctions::InitializeSpellbookChanges}
namespace SpellFunctions
{
NAMESPACE_BEGIN(SpellFunctions)
/**
* \brief Clear the last recorded spellbook changes for a player.
*
@ -28,7 +27,7 @@ namespace SpellFunctions
* \param pid The player ID whose spellbook changes should be used.
* \return void
*/
EXPORT_APIFUNCTION void CDECL ClearSpellbookChanges(unsigned short pid) noexcept;
API_FUNCTION void CDECL ClearSpellbookChanges(unsigned short pid) noexcept;
/**
* \brief Get the number of indexes in a player's latest spellbook changes.
@ -36,7 +35,7 @@ namespace SpellFunctions
* \param pid The player ID whose spellbook changes should be used.
* \return The number of indexes.
*/
EXPORT_APIFUNCTION unsigned int CDECL GetSpellbookChangesSize(unsigned short pid) noexcept;
API_FUNCTION unsigned int CDECL GetSpellbookChangesSize(unsigned short pid) noexcept;
/**
* \brief Get the action type used in a player's latest spellbook changes.
@ -44,7 +43,7 @@ namespace SpellFunctions
* \param pid The player ID whose spellbook changes should be used.
* \return The action type (0 for SET, 1 for ADD, 2 for REMOVE).
*/
EXPORT_APIFUNCTION unsigned int CDECL GetSpellbookChangesAction(unsigned short pid) noexcept;
API_FUNCTION unsigned int CDECL GetSpellbookChangesAction(unsigned short pid) noexcept;
/**
* \brief Set the action type in a player's spellbook changes.
@ -53,7 +52,7 @@ namespace SpellFunctions
* \param action The action (0 for SET, 1 for ADD, 2 for REMOVE).
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetSpellbookChangesAction(unsigned short pid, unsigned char action) noexcept;
API_FUNCTION void CDECL SetSpellbookChangesAction(unsigned short pid, unsigned char action) noexcept;
/**
* \brief Add a new spell to the spellbook changes for a player.
@ -62,7 +61,7 @@ namespace SpellFunctions
* \param spellId The spellId of the spell.
* \return void
*/
EXPORT_APIFUNCTION void CDECL AddSpell(unsigned short pid, const char* spellId) noexcept;
API_FUNCTION void CDECL AddSpell(unsigned short pid, const char* spellId) noexcept;
/**
* \brief Get the spellId at a certain index in a player's latest spellbook changes.
@ -71,7 +70,7 @@ namespace SpellFunctions
* \param index The index of the spell.
* \return The spellId.
*/
EXPORT_APIFUNCTION const char *CDECL GetSpellId(unsigned short pid, unsigned int index) noexcept;
API_FUNCTION const char *CDECL GetSpellId(unsigned short pid, unsigned int index) noexcept;
/**
* \brief Send a PlayerSpellbook packet with a player's recorded spellbook changes.
@ -83,11 +82,11 @@ namespace SpellFunctions
* to the packet (false by default).
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendSpellbookChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
API_FUNCTION void CDECL SendSpellbookChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
// All methods below are deprecated versions of methods from above
EXPORT_APIFUNCTION void CDECL InitializeSpellbookChanges(unsigned short pid) noexcept;
}
API_FUNCTION void CDECL InitializeSpellbookChanges(unsigned short pid) noexcept;
NAMESPACE_END()
#endif //OPENMW_SPELLAPI_HPP

@ -1,4 +1,4 @@
#include "Stats.hpp"
#include "Stats.h"
#include <iostream>

@ -1,7 +1,7 @@
#ifndef OPENMW_STATAPI_HPP
#define OPENMW_STATAPI_HPP
#include <Script/Platform.hpp>
#include "../api.h"
#define STATAPI \
{"GetAttributeCount", StatsFunctions::GetAttributeCount},\
@ -77,8 +77,7 @@
{"SendLevel", StatsFunctions::SendLevel},\
{"SendBounty", StatsFunctions::SendBounty}
namespace StatsFunctions
{
NAMESPACE_BEGIN(StatsFunctions)
/**
* \brief Get the number of attributes.
*
@ -86,7 +85,7 @@ namespace StatsFunctions
*
* \return The number of attributes.
*/
EXPORT_APIFUNCTION int CDECL GetAttributeCount() noexcept;
API_FUNCTION int CDECL GetAttributeCount() noexcept;
/**
* \brief Get the number of skills.
@ -95,7 +94,7 @@ namespace StatsFunctions
*
* \return The number of skills.
*/
EXPORT_APIFUNCTION int CDECL GetSkillCount() noexcept;
API_FUNCTION int CDECL GetSkillCount() noexcept;
/**
* \brief Get the numerical ID of an attribute with a certain name.
@ -105,7 +104,7 @@ namespace StatsFunctions
* \param name The name of the attribute.
* \return The ID of the attribute.
*/
EXPORT_APIFUNCTION int CDECL GetAttributeId(const char *name) noexcept;
API_FUNCTION int CDECL GetAttributeId(const char *name) noexcept;
/**
* \brief Get the numerical ID of a skill with a certain name.
@ -115,7 +114,7 @@ namespace StatsFunctions
* \param name The name of the skill.
* \return The ID of the skill.
*/
EXPORT_APIFUNCTION int CDECL GetSkillId(const char *name) noexcept;
API_FUNCTION int CDECL GetSkillId(const char *name) noexcept;
/**
* \brief Get the name of the attribute with a certain numerical ID.
@ -125,7 +124,7 @@ namespace StatsFunctions
* \param attributeId The ID of the attribute.
* \return The name of the attribute.
*/
EXPORT_APIFUNCTION const char *CDECL GetAttributeName(unsigned short attributeId) noexcept;
API_FUNCTION const char *CDECL GetAttributeName(unsigned short attributeId) noexcept;
/**
* \brief Get the name of the skill with a certain numerical ID.
@ -135,7 +134,7 @@ namespace StatsFunctions
* \param skillId The ID of the skill.
* \return The name of the skill.
*/
EXPORT_APIFUNCTION const char *CDECL GetSkillName(unsigned short skillId) noexcept;
API_FUNCTION const char *CDECL GetSkillName(unsigned short skillId) noexcept;
/**
* \brief Get the name of a player.
@ -143,7 +142,7 @@ namespace StatsFunctions
* \param pid The player ID.
* \return The name of the player.
*/
EXPORT_APIFUNCTION const char *CDECL GetName(unsigned short pid) noexcept;
API_FUNCTION const char *CDECL GetName(unsigned short pid) noexcept;
/**
* \brief Get the race of a player.
@ -151,7 +150,7 @@ namespace StatsFunctions
* \param pid The player ID.
* \return The race of the player.
*/
EXPORT_APIFUNCTION const char *CDECL GetRace(unsigned short pid) noexcept;
API_FUNCTION const char *CDECL GetRace(unsigned short pid) noexcept;
/**
* \brief Get the head mesh used by a player.
@ -159,7 +158,7 @@ namespace StatsFunctions
* \param pid The player ID.
* \return The head mesh of the player.
*/
EXPORT_APIFUNCTION const char *CDECL GetHead(unsigned short pid) noexcept;
API_FUNCTION const char *CDECL GetHead(unsigned short pid) noexcept;
/**
* \brief Get the hairstyle mesh used by a player.
@ -167,7 +166,7 @@ namespace StatsFunctions
* \param pid The player ID.
* \return The hairstyle mesh of the player.
*/
EXPORT_APIFUNCTION const char *CDECL GetHairstyle(unsigned short pid) noexcept;
API_FUNCTION const char *CDECL GetHairstyle(unsigned short pid) noexcept;
/**
* \brief Check whether a player is male or not.
@ -175,7 +174,7 @@ namespace StatsFunctions
* \param pid The player ID.
* \return Whether the player is male.
*/
EXPORT_APIFUNCTION int CDECL GetIsMale(unsigned short pid) noexcept;
API_FUNCTION int CDECL GetIsMale(unsigned short pid) noexcept;
/**
* \brief Get the birthsign of a player.
@ -183,7 +182,7 @@ namespace StatsFunctions
* \param pid The player ID.
* \return The birthsign of the player.
*/
EXPORT_APIFUNCTION const char *CDECL GetBirthsign(unsigned short pid) noexcept;
API_FUNCTION const char *CDECL GetBirthsign(unsigned short pid) noexcept;
/**
* \brief Get the character level of a player.
@ -191,7 +190,7 @@ namespace StatsFunctions
* \param pid The player ID.
* \return The level of the player.
*/
EXPORT_APIFUNCTION int CDECL GetLevel(unsigned short pid) noexcept;
API_FUNCTION int CDECL GetLevel(unsigned short pid) noexcept;
/**
* \brief Get the player's progress to their next character level.
@ -199,7 +198,7 @@ namespace StatsFunctions
* \param pid The player ID.
* \return The level progress.
*/
EXPORT_APIFUNCTION int CDECL GetLevelProgress(unsigned short pid) noexcept;
API_FUNCTION int CDECL GetLevelProgress(unsigned short pid) noexcept;
/**
* \brief Get the base health of the player.
@ -207,7 +206,7 @@ namespace StatsFunctions
* \param pid The player ID.
* \return The base health.
*/
EXPORT_APIFUNCTION double CDECL GetHealthBase(unsigned short pid) noexcept;
API_FUNCTION double CDECL GetHealthBase(unsigned short pid) noexcept;
/**
* \brief Get the current health of the player.
@ -215,7 +214,7 @@ namespace StatsFunctions
* \param pid The player ID.
* \return The current health.
*/
EXPORT_APIFUNCTION double CDECL GetHealthCurrent(unsigned short pid) noexcept;
API_FUNCTION double CDECL GetHealthCurrent(unsigned short pid) noexcept;
/**
* \brief Get the base magicka of the player.
@ -223,7 +222,7 @@ namespace StatsFunctions
* \param pid The player ID.
* \return The base magicka.
*/
EXPORT_APIFUNCTION double CDECL GetMagickaBase(unsigned short pid) noexcept;
API_FUNCTION double CDECL GetMagickaBase(unsigned short pid) noexcept;
/**
* \brief Get the current magicka of the player.
@ -231,7 +230,7 @@ namespace StatsFunctions
* \param pid The player ID.
* \return The current magicka.
*/
EXPORT_APIFUNCTION double CDECL GetMagickaCurrent(unsigned short pid) noexcept;
API_FUNCTION double CDECL GetMagickaCurrent(unsigned short pid) noexcept;
/**
* \brief Get the base fatigue of the player.
@ -239,7 +238,7 @@ namespace StatsFunctions
* \param pid The player ID.
* \return The base fatigue.
*/
EXPORT_APIFUNCTION double CDECL GetFatigueBase(unsigned short pid) noexcept;
API_FUNCTION double CDECL GetFatigueBase(unsigned short pid) noexcept;
/**
* \brief Get the current fatigue of the player.
@ -247,7 +246,7 @@ namespace StatsFunctions
* \param pid The player ID.
* \return The current fatigue.
*/
EXPORT_APIFUNCTION double CDECL GetFatigueCurrent(unsigned short pid) noexcept;
API_FUNCTION double CDECL GetFatigueCurrent(unsigned short pid) noexcept;
/**
* \brief Get the base value of a player's attribute.
@ -256,7 +255,7 @@ namespace StatsFunctions
* \param attributeId The attribute ID.
* \return The base value of the attribute.
*/
EXPORT_APIFUNCTION int CDECL GetAttributeBase(unsigned short pid, unsigned short attributeId) noexcept;
API_FUNCTION int CDECL GetAttributeBase(unsigned short pid, unsigned short attributeId) noexcept;
/**
* \brief Get the modifier value of a player's attribute.
@ -265,7 +264,7 @@ namespace StatsFunctions
* \param attributeId The attribute ID.
* \return The modifier value of the attribute.
*/
EXPORT_APIFUNCTION int CDECL GetAttributeModifier(unsigned short pid, unsigned short attributeId) noexcept;
API_FUNCTION int CDECL GetAttributeModifier(unsigned short pid, unsigned short attributeId) noexcept;
/**
* \brief Get the base value of a player's skill.
@ -274,7 +273,7 @@ namespace StatsFunctions
* \param skillId The skill ID.
* \return The base value of the skill.
*/
EXPORT_APIFUNCTION int CDECL GetSkillBase(unsigned short pid, unsigned short skillId) noexcept;
API_FUNCTION int CDECL GetSkillBase(unsigned short pid, unsigned short skillId) noexcept;
/**
* \brief Get the modifier value of a player's skill.
@ -283,7 +282,7 @@ namespace StatsFunctions
* \param skillId The skill ID.
* \return The modifier value of the skill.
*/
EXPORT_APIFUNCTION int CDECL GetSkillModifier(unsigned short pid, unsigned short skillId) noexcept;
API_FUNCTION int CDECL GetSkillModifier(unsigned short pid, unsigned short skillId) noexcept;
/**
* \brief Get the progress the player has made towards increasing a certain skill by 1.
@ -292,7 +291,7 @@ namespace StatsFunctions
* \param skillId The skill ID.
* \return The skill progress.
*/
EXPORT_APIFUNCTION double CDECL GetSkillProgress(unsigned short pid, unsigned short skillId) noexcept;
API_FUNCTION double CDECL GetSkillProgress(unsigned short pid, unsigned short skillId) noexcept;
/**
* \brief Get the bonus applied to a certain attribute at the next level up as a result
@ -304,7 +303,7 @@ namespace StatsFunctions
* \param skillId The attribute ID.
* \return The increase in the attribute caused by skills.
*/
EXPORT_APIFUNCTION int CDECL GetSkillIncrease(unsigned short pid, unsigned int attributeId) noexcept;
API_FUNCTION int CDECL GetSkillIncrease(unsigned short pid, unsigned int attributeId) noexcept;
/**
* \brief Get the bounty of the player.
@ -312,7 +311,7 @@ namespace StatsFunctions
* \param pid The player ID.
* \return The bounty.
*/
EXPORT_APIFUNCTION int CDECL GetBounty(unsigned short pid) noexcept;
API_FUNCTION int CDECL GetBounty(unsigned short pid) noexcept;
/**
* \brief Set the name of a player.
@ -321,7 +320,7 @@ namespace StatsFunctions
* \param name The new name of the player.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetName(unsigned short pid, const char *name) noexcept;
API_FUNCTION void CDECL SetName(unsigned short pid, const char *name) noexcept;
/**
* \brief Set the race of a player.
@ -330,7 +329,7 @@ namespace StatsFunctions
* \param race The new race of the player.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetRace(unsigned short pid, const char *race) noexcept;
API_FUNCTION void CDECL SetRace(unsigned short pid, const char *race) noexcept;
/**
* \brief Set the head mesh used by a player.
@ -339,7 +338,7 @@ namespace StatsFunctions
* \param head The new head mesh of the player.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetHead(unsigned short pid, const char *head) noexcept;
API_FUNCTION void CDECL SetHead(unsigned short pid, const char *head) noexcept;
/**
* \brief Set the hairstyle mesh used by a player.
@ -348,7 +347,7 @@ namespace StatsFunctions
* \param hairstyle The new hairstyle mesh of the player.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetHairstyle(unsigned short pid, const char *hairstyle) noexcept;
API_FUNCTION void CDECL SetHairstyle(unsigned short pid, const char *hairstyle) noexcept;
/**
* \brief Set whether a player is male or not.
@ -357,7 +356,7 @@ namespace StatsFunctions
* \param state Whether the player is male.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetIsMale(unsigned short pid, int state) noexcept;
API_FUNCTION void CDECL SetIsMale(unsigned short pid, int state) noexcept;
/**
* \brief Set the birthsign of a player.
@ -366,7 +365,7 @@ namespace StatsFunctions
* \param name The new birthsign of the player.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetBirthsign(unsigned short pid, const char *name) noexcept;
API_FUNCTION void CDECL SetBirthsign(unsigned short pid, const char *name) noexcept;
/**
* \brief Set whether the player's stats should be reset based on their
@ -379,7 +378,7 @@ namespace StatsFunctions
* \param resetStats The stat reset state.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetResetStats(unsigned short pid, bool resetStats) noexcept;
API_FUNCTION void CDECL SetResetStats(unsigned short pid, bool resetStats) noexcept;
/**
* \brief Set the character level of a player.
@ -388,7 +387,7 @@ namespace StatsFunctions
* \param value The new level of the player.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetLevel(unsigned short pid, int value) noexcept;
API_FUNCTION void CDECL SetLevel(unsigned short pid, int value) noexcept;
/**
* \brief Set the player's progress to their next character level.
@ -397,7 +396,7 @@ namespace StatsFunctions
* \param value The new level progress of the player.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetLevelProgress(unsigned short pid, int value) noexcept;
API_FUNCTION void CDECL SetLevelProgress(unsigned short pid, int value) noexcept;
/**
* \brief Set the base health of a player.
@ -406,7 +405,7 @@ namespace StatsFunctions
* \param name The new base health of the player.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetHealthBase(unsigned short pid, double value) noexcept;
API_FUNCTION void CDECL SetHealthBase(unsigned short pid, double value) noexcept;
/**
* \brief Set the current health of a player.
@ -415,7 +414,7 @@ namespace StatsFunctions
* \param name The new current health of the player.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetHealthCurrent(unsigned short pid, double value) noexcept;
API_FUNCTION void CDECL SetHealthCurrent(unsigned short pid, double value) noexcept;
/**
* \brief Set the base magicka of a player.
@ -424,7 +423,7 @@ namespace StatsFunctions
* \param name The new base magicka of the player.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetMagickaBase(unsigned short pid, double value) noexcept;
API_FUNCTION void CDECL SetMagickaBase(unsigned short pid, double value) noexcept;
/**
* \brief Set the current magicka of a player.
@ -433,7 +432,7 @@ namespace StatsFunctions
* \param name The new current magicka of the player.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetMagickaCurrent(unsigned short pid, double value) noexcept;
API_FUNCTION void CDECL SetMagickaCurrent(unsigned short pid, double value) noexcept;
/**
* \brief Set the base fatigue of a player.
@ -442,7 +441,7 @@ namespace StatsFunctions
* \param name The new base fatigue of the player.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetFatigueBase(unsigned short pid, double value) noexcept;
API_FUNCTION void CDECL SetFatigueBase(unsigned short pid, double value) noexcept;
/**
* \brief Set the current fatigue of a player.
@ -451,7 +450,7 @@ namespace StatsFunctions
* \param name The new current fatigue of the player.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetFatigueCurrent(unsigned short pid, double value) noexcept;
API_FUNCTION void CDECL SetFatigueCurrent(unsigned short pid, double value) noexcept;
/**
* \brief Set the base value of a player's attribute.
@ -461,7 +460,7 @@ namespace StatsFunctions
* \param value The new base value of the player's attribute.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetAttributeBase(unsigned short pid, unsigned short attributeId, int value) noexcept;
API_FUNCTION void CDECL SetAttributeBase(unsigned short pid, unsigned short attributeId, int value) noexcept;
/**
* \brief Clear the modifier value of a player's attribute.
@ -475,7 +474,7 @@ namespace StatsFunctions
* \param attributeId The attribute ID.
* \return void
*/
EXPORT_APIFUNCTION void CDECL ClearAttributeModifier(unsigned short pid, unsigned short attributeId) noexcept;
API_FUNCTION void CDECL ClearAttributeModifier(unsigned short pid, unsigned short attributeId) noexcept;
/**
* \brief Set the base value of a player's skill.
@ -485,7 +484,7 @@ namespace StatsFunctions
* \param value The new base value of the player's skill.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetSkillBase(unsigned short pid, unsigned short skillId, int value) noexcept;
API_FUNCTION void CDECL SetSkillBase(unsigned short pid, unsigned short skillId, int value) noexcept;
/**
* \brief Clear the modifier value of a player's skill.
@ -499,7 +498,7 @@ namespace StatsFunctions
* \param skillId The skill ID.
* \return void
*/
EXPORT_APIFUNCTION void CDECL ClearSkillModifier(unsigned short pid, unsigned short skillId) noexcept;
API_FUNCTION void CDECL ClearSkillModifier(unsigned short pid, unsigned short skillId) noexcept;
/**
* \brief Set the progress the player has made towards increasing a certain skill by 1.
@ -509,7 +508,7 @@ namespace StatsFunctions
* \param value The progress value.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetSkillProgress(unsigned short pid, unsigned short skillId, double value) noexcept;
API_FUNCTION void CDECL SetSkillProgress(unsigned short pid, unsigned short skillId, double value) noexcept;
/**
* \brief Set the bonus applied to a certain attribute at the next level up as a result
@ -522,7 +521,7 @@ namespace StatsFunctions
* \param value The increase in the attribute caused by skills.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetSkillIncrease(unsigned short pid, unsigned int attributeId, int value) noexcept;
API_FUNCTION void CDECL SetSkillIncrease(unsigned short pid, unsigned int attributeId, int value) noexcept;
/**
* \brief Set the bounty of a player.
@ -531,7 +530,7 @@ namespace StatsFunctions
* \param value The new bounty.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetBounty(unsigned short pid, int value) noexcept;
API_FUNCTION void CDECL SetBounty(unsigned short pid, int value) noexcept;
/**
* \brief Set the current and ending stages of character generation for a player.
@ -543,7 +542,7 @@ namespace StatsFunctions
* \param endStage The new ending stage.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetCharGenStage(unsigned short pid, int currentStage, int endStage) noexcept;
API_FUNCTION void CDECL SetCharGenStage(unsigned short pid, int currentStage, int endStage) noexcept;
/**
* \brief Send a PlayerBaseInfo packet with a player's name, race, head mesh,
@ -554,7 +553,7 @@ namespace StatsFunctions
* \param pid The player ID.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendBaseInfo(unsigned short pid) noexcept;
API_FUNCTION void CDECL SendBaseInfo(unsigned short pid) noexcept;
/**
* \brief Send a PlayerStatsDynamic packet with a player's dynamic stats (health,
@ -565,7 +564,7 @@ namespace StatsFunctions
* \param pid The player ID.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendStatsDynamic(unsigned short pid) noexcept;
API_FUNCTION void CDECL SendStatsDynamic(unsigned short pid) noexcept;
/**
* \brief Send a PlayerAttribute packet with a player's attributes and bonuses
@ -577,7 +576,7 @@ namespace StatsFunctions
* \param pid The player ID.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendAttributes(unsigned short pid) noexcept;
API_FUNCTION void CDECL SendAttributes(unsigned short pid) noexcept;
/**
* \brief Send a PlayerSkill packet with a player's skills.
@ -587,7 +586,7 @@ namespace StatsFunctions
* \param pid The player ID.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendSkills(unsigned short pid) noexcept;
API_FUNCTION void CDECL SendSkills(unsigned short pid) noexcept;
/**
* \brief Send a PlayerLevel packet with a player's character level and
@ -598,7 +597,7 @@ namespace StatsFunctions
* \param pid The player ID.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendLevel(unsigned short pid) noexcept;
API_FUNCTION void CDECL SendLevel(unsigned short pid) noexcept;
/**
* \brief Send a PlayerBounty packet with a player's bounty.
@ -608,7 +607,7 @@ namespace StatsFunctions
* \param pid The player ID.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendBounty(unsigned short pid) noexcept;
}
API_FUNCTION void CDECL SendBounty(unsigned short pid) noexcept;
NAMESPACE_END()
#endif //OPENMW_STATAPI_HPP

@ -8,6 +8,8 @@
#include <Networking.hpp>
#include <Script/API/TimerAPI.hpp>
#include "Timer.h"
using namespace std;
using namespace mwmp;

@ -6,10 +6,9 @@
#define OPENMW_TIMER_HPP
#include <Script/ScriptFunction.hpp>
#include <Script/Platform.hpp>
#include "../api.h"
namespace TimerFunctions
{
NAMESPACE_BEGIN(TimerFunctions)
/**
* \brief Create a timer that will run a script function after a certain interval.
*
@ -17,7 +16,7 @@ namespace TimerFunctions
* \param msec The interval in miliseconds.
* \return The ID of the timer thus created.
*/
EXPORT_APIFUNCTION int CDECL CreateTimer(ScriptFunc callback, int msec) noexcept;
API_FUNCTION int CDECL CreateTimer(ScriptFunc callback, int msec) noexcept;
/**
* \brief Create a timer that will run a script function after a certain interval and pass
@ -33,7 +32,7 @@ namespace TimerFunctions
* \param args The arguments.
* \return The ID of the timer thus created.
*/
EXPORT_APIFUNCTION int CDECL CreateTimerEx(ScriptFunc callback, int msec, const char *types, va_list args) noexcept;
API_FUNCTION int CDECL CreateTimerEx(ScriptFunc callback, int msec, const char *types, va_list args) noexcept;
/**
* \brief Start the timer with a certain ID.
@ -41,7 +40,7 @@ namespace TimerFunctions
* \param timerId The timer ID.
* \return void
*/
EXPORT_APIFUNCTION void CDECL StartTimer(int timerId) noexcept;
API_FUNCTION void CDECL StartTimer(int timerId) noexcept;
/**
* \brief Stop the timer with a certain ID.
@ -49,7 +48,7 @@ namespace TimerFunctions
* \param timerId The timer ID.
* \return void
*/
EXPORT_APIFUNCTION void CDECL StopTimer(int timerId) noexcept;
API_FUNCTION void CDECL StopTimer(int timerId) noexcept;
/**
* \brief Restart the timer with a certain ID for a certain interval.
@ -58,7 +57,7 @@ namespace TimerFunctions
* \param msec The interval in miliseconds.
* \return void
*/
EXPORT_APIFUNCTION void CDECL RestartTimer(int timerId, int msec) noexcept;
API_FUNCTION void CDECL RestartTimer(int timerId, int msec) noexcept;
/**
* \brief Free the timer with a certain ID.
@ -66,7 +65,7 @@ namespace TimerFunctions
* \param timerId The timer ID.
* \return void
*/
EXPORT_APIFUNCTION void CDECL FreeTimer(int timerId) noexcept;
API_FUNCTION void CDECL FreeTimer(int timerId) noexcept;
/**
* \brief Check whether a timer is elapsed.
@ -74,7 +73,7 @@ namespace TimerFunctions
* \param timerId The timer ID.
* \return Whether the timer is elapsed.
*/
EXPORT_APIFUNCTION bool CDECL IsTimerElapsed(int timerId) noexcept;
}
API_FUNCTION bool CDECL IsTimerElapsed(int timerId) noexcept;
NAMESPACE_END()
#endif //OPENMW_TIMER_HPP

@ -5,7 +5,7 @@
#include <apps/openmw-mp/Script/ScriptFunctions.hpp>
#include <fstream>
#include "Worldstate.hpp"
#include "Worldstate.h"
using namespace std;
using namespace mwmp;

@ -4,7 +4,7 @@
#include <components/openmw-mp/Base/BaseWorldstate.hpp>
#include "../Types.hpp"
#include <Script/Platform.hpp>
#include "../api.h"
#define WORLDSTATEAPI \
{"ReadReceivedWorldstate", WorldstateFunctions::ReadReceivedWorldstate},\
@ -60,17 +60,15 @@
{"ReadLastWorldstate", WorldstateFunctions::ReadLastWorldstate},\
{"CopyLastWorldstateToStore", WorldstateFunctions::CopyLastWorldstateToStore}
namespace WorldstateFunctions
{
EXPORT_APIFUNCTION mwmp::BaseWorldstate CDECL *readWorldstate;
EXPORT_APIFUNCTION mwmp::BaseWorldstate CDECL writeWorldstate;
NAMESPACE_BEGIN(WorldstateFunctions)
API_FUNCTION mwmp::BaseWorldstate CDECL *readWorldstate;
API_FUNCTION mwmp::BaseWorldstate CDECL writeWorldstate;
/**
* \brief Use the last worldstate received by the server as the one being read.
*
* \return void
*/
EXPORT_APIFUNCTION void CDECL ReadReceivedWorldstate() noexcept;
API_FUNCTION void CDECL ReadReceivedWorldstate() noexcept;
/**
* \brief Take the contents of the read-only worldstate last received by the
@ -79,7 +77,7 @@ namespace WorldstateFunctions
*
* \return void
*/
EXPORT_APIFUNCTION void CDECL CopyReceivedWorldstateToStore() noexcept;
API_FUNCTION void CDECL CopyReceivedWorldstateToStore() noexcept;
/**
* \brief Clear the map changes for the write-only worldstate.
@ -88,49 +86,49 @@ namespace WorldstateFunctions
*
* \return void
*/
EXPORT_APIFUNCTION void CDECL ClearMapChanges() noexcept;
API_FUNCTION void CDECL ClearMapChanges() noexcept;
/**
* \brief Get the number of indexes in the read worldstate's map changes.
*
* \return The number of indexes.
*/
EXPORT_APIFUNCTION unsigned int CDECL GetMapChangesSize() noexcept;
API_FUNCTION unsigned int CDECL GetMapChangesSize() noexcept;
/**
* \brief Get the weather region in the read worldstate.
*
* \return The weather region.
*/
EXPORT_APIFUNCTION const char *CDECL GetWeatherRegion() noexcept;
API_FUNCTION const char *CDECL GetWeatherRegion() noexcept;
/**
* \brief Get the current weather in the read worldstate.
*
* \return The current weather.
*/
EXPORT_APIFUNCTION int CDECL GetWeatherCurrent() noexcept;
API_FUNCTION int CDECL GetWeatherCurrent() noexcept;
/**
* \brief Get the next weather in the read worldstate.
*
* \return The next weather.
*/
EXPORT_APIFUNCTION int CDECL GetWeatherNext() noexcept;
API_FUNCTION int CDECL GetWeatherNext() noexcept;
/**
* \brief Get the queued weather in the read worldstate.
*
* \return The queued weather.
*/
EXPORT_APIFUNCTION int CDECL GetWeatherQueued() noexcept;
API_FUNCTION int CDECL GetWeatherQueued() noexcept;
/**
* \brief Get the transition factor of the weather in the read worldstate.
*
* \return The transition factor of the weather.
*/
EXPORT_APIFUNCTION double CDECL GetWeatherTransitionFactor() noexcept;
API_FUNCTION double CDECL GetWeatherTransitionFactor() noexcept;
/**
* \brief Get the X coordinate of the cell corresponding to the map tile at a certain index in
@ -139,7 +137,7 @@ namespace WorldstateFunctions
* \param index The index of the map tile.
* \return The X coordinate of the cell.
*/
EXPORT_APIFUNCTION int CDECL GetMapTileCellX(unsigned int index) noexcept;
API_FUNCTION int CDECL GetMapTileCellX(unsigned int index) noexcept;
/**
* \brief Get the Y coordinate of the cell corresponding to the map tile at a certain index in
@ -148,7 +146,7 @@ namespace WorldstateFunctions
* \param index The index of the map tile.
* \return The Y coordinate of the cell.
*/
EXPORT_APIFUNCTION int CDECL GetMapTileCellY(unsigned int index) noexcept;
API_FUNCTION int CDECL GetMapTileCellY(unsigned int index) noexcept;
/**
* \brief Set the region affected by the next WorldRegionAuthority packet sent.
@ -156,7 +154,7 @@ namespace WorldstateFunctions
* \param region The region.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetAuthorityRegion(const char* authorityRegion) noexcept;
API_FUNCTION void CDECL SetAuthorityRegion(const char* authorityRegion) noexcept;
/**
* \brief Set the weather region in the write-only worldstate stored on the server.
@ -164,7 +162,7 @@ namespace WorldstateFunctions
* \param region The region.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetWeatherRegion(const char* region) noexcept;
API_FUNCTION void CDECL SetWeatherRegion(const char* region) noexcept;
/**
* \brief Set the weather forcing state in the write-only worldstate stored on the server.
@ -174,7 +172,7 @@ namespace WorldstateFunctions
* \param forceState The weather forcing state.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetWeatherForceState(bool forceState) noexcept;
API_FUNCTION void CDECL SetWeatherForceState(bool forceState) noexcept;
/**
* \brief Set the current weather in the write-only worldstate stored on the server.
@ -182,7 +180,7 @@ namespace WorldstateFunctions
* \param currentWeather The current weather.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetWeatherCurrent(int currentWeather) noexcept;
API_FUNCTION void CDECL SetWeatherCurrent(int currentWeather) noexcept;
/**
* \brief Set the next weather in the write-only worldstate stored on the server.
@ -190,7 +188,7 @@ namespace WorldstateFunctions
* \param nextWeather The next weather.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetWeatherNext(int nextWeather) noexcept;
API_FUNCTION void CDECL SetWeatherNext(int nextWeather) noexcept;
/**
* \brief Set the queued weather in the write-only worldstate stored on the server.
@ -198,7 +196,7 @@ namespace WorldstateFunctions
* \param queuedWeather The queued weather.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetWeatherQueued(int queuedWeather) noexcept;
API_FUNCTION void CDECL SetWeatherQueued(int queuedWeather) noexcept;
/**
* \brief Set the transition factor for the weather in the write-only worldstate stored on the server.
@ -206,7 +204,7 @@ namespace WorldstateFunctions
* \param transitionFactor The transition factor.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetWeatherTransitionFactor(double transitionFactor) noexcept;
API_FUNCTION void CDECL SetWeatherTransitionFactor(double transitionFactor) noexcept;
/**
* \brief Set the world's hour in the write-only worldstate stored on the server.
@ -214,7 +212,7 @@ namespace WorldstateFunctions
* \param hour The hour.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetHour(double hour) noexcept;
API_FUNCTION void CDECL SetHour(double hour) noexcept;
/**
* \brief Set the world's day in the write-only worldstate stored on the server.
@ -222,7 +220,7 @@ namespace WorldstateFunctions
* \param day The day.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetDay(int day) noexcept;
API_FUNCTION void CDECL SetDay(int day) noexcept;
/**
* \brief Set the world's month in the write-only worldstate stored on the server.
@ -230,7 +228,7 @@ namespace WorldstateFunctions
* \param month The month.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetMonth(int month) noexcept;
API_FUNCTION void CDECL SetMonth(int month) noexcept;
/**
* \brief Set the world's year in the write-only worldstate stored on the server.
@ -238,7 +236,7 @@ namespace WorldstateFunctions
* \param year The year.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetYear(int year) noexcept;
API_FUNCTION void CDECL SetYear(int year) noexcept;
/**
* \brief Set the world's days passed in the write-only worldstate stored on the server.
@ -246,7 +244,7 @@ namespace WorldstateFunctions
* \param daysPassed The days passed.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetDaysPassed(int daysPassed) noexcept;
API_FUNCTION void CDECL SetDaysPassed(int daysPassed) noexcept;
/**
* \brief Set the world's time scale in the write-only worldstate stored on the server.
@ -255,7 +253,7 @@ namespace WorldstateFunctions
* \param timeScale The time scale.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetTimeScale(double timeScale) noexcept;
API_FUNCTION void CDECL SetTimeScale(double timeScale) noexcept;
/**
* \brief Set the collision state for other players in the write-only worldstate stored
@ -264,7 +262,7 @@ namespace WorldstateFunctions
* \param state The collision state.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetPlayerCollisionState(bool state) noexcept;
API_FUNCTION void CDECL SetPlayerCollisionState(bool state) noexcept;
/**
* \brief Set the collision state for actors in the write-only worldstate stored on the
@ -273,7 +271,7 @@ namespace WorldstateFunctions
* \param state The collision state.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetActorCollisionState(bool state) noexcept;
API_FUNCTION void CDECL SetActorCollisionState(bool state) noexcept;
/**
* \brief Set the collision state for placed objects in the write-only worldstate stored
@ -282,7 +280,7 @@ namespace WorldstateFunctions
* \param state The collision state.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SetPlacedObjectCollisionState(bool state) noexcept;
API_FUNCTION void CDECL SetPlacedObjectCollisionState(bool state) noexcept;
/**
* \brief Whether placed objects with collision turned on should use actor collision, i.e.
@ -291,7 +289,7 @@ namespace WorldstateFunctions
* \param useActorCollision Whether to use actor collision.
* \return void
*/
EXPORT_APIFUNCTION void CDECL UseActorCollisionForPlacedObjects(bool useActorCollision) noexcept;
API_FUNCTION void CDECL UseActorCollisionForPlacedObjects(bool useActorCollision) noexcept;
/**
* \brief Add a refId to the list of refIds for which collision should be enforced
@ -300,7 +298,7 @@ namespace WorldstateFunctions
* \param refId The refId.
* \return void
*/
EXPORT_APIFUNCTION void CDECL AddEnforcedCollisionRefId(const char* refId) noexcept;
API_FUNCTION void CDECL AddEnforcedCollisionRefId(const char* refId) noexcept;
/**
* \brief Clear the list of refIdsd for which collision should be enforced irrespective
@ -308,7 +306,7 @@ namespace WorldstateFunctions
*
* \return void
*/
EXPORT_APIFUNCTION void CDECL ClearEnforcedCollisionRefIds() noexcept;
API_FUNCTION void CDECL ClearEnforcedCollisionRefIds() noexcept;
/**
* \brief Save the .png image data of the map tile at a certain index in the read worldstate's
@ -318,7 +316,7 @@ namespace WorldstateFunctions
* \param filePath The file path of the resulting file.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SaveMapTileImageFile(unsigned int index, const char *filePath) noexcept;
API_FUNCTION void CDECL SaveMapTileImageFile(unsigned int index, const char *filePath) noexcept;
/**
* \brief Load a .png file as the image data for a map tile and add it to the write-only worldstate
@ -329,7 +327,7 @@ namespace WorldstateFunctions
* \param filePath The file path of the loaded file.
* \return void
*/
EXPORT_APIFUNCTION void CDECL LoadMapTileImageFile(int cellX, int cellY, const char* filePath) noexcept;
API_FUNCTION void CDECL LoadMapTileImageFile(int cellX, int cellY, const char* filePath) noexcept;
/**
* \brief Send a WorldRegionAuthority packet establishing a certain player as the only one who
@ -340,7 +338,7 @@ namespace WorldstateFunctions
* \param pid The player ID attached to the packet.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendWorldRegionAuthority(unsigned short pid) noexcept;
API_FUNCTION void CDECL SendWorldRegionAuthority(unsigned short pid) noexcept;
/**
* \brief Send a WorldMap packet with the current set of map changes in the write-only
@ -351,7 +349,7 @@ namespace WorldstateFunctions
* or to all players on the server.
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendWorldMap(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
API_FUNCTION void CDECL SendWorldMap(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
/**
* \brief Send a WorldTime packet with the current time and time scale in the write-only
@ -364,7 +362,7 @@ namespace WorldstateFunctions
* to the packet (false by default).
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendWorldTime(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
API_FUNCTION void CDECL SendWorldTime(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
/**
* \brief Send a WorldWeather packet with the current weather in the write-only worldstate.
@ -376,7 +374,7 @@ namespace WorldstateFunctions
* to the packet (false by default).
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendWorldWeather(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
API_FUNCTION void CDECL SendWorldWeather(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
/**
* \brief Send a WorldCollisionOverride packet with the current collision overrides in
@ -389,13 +387,13 @@ namespace WorldstateFunctions
* to the packet (false by default).
* \return void
*/
EXPORT_APIFUNCTION void CDECL SendWorldCollisionOverride(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
API_FUNCTION void CDECL SendWorldCollisionOverride(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
// All methods below are deprecated versions of methods from above
EXPORT_APIFUNCTION void CDECL ReadLastWorldstate() noexcept;
EXPORT_APIFUNCTION void CDECL CopyLastWorldstateToStore() noexcept;
}
API_FUNCTION void CDECL ReadLastWorldstate() noexcept;
API_FUNCTION void CDECL CopyLastWorldstateToStore() noexcept;
NAMESPACE_END()
#endif //OPENMW_WORLDSTATEAPI_HPP

@ -0,0 +1,58 @@
//
// Created by koncord on 23.01.16.
//
#ifndef PLATFORM_HPP
#define PLATFORM_HPP
#ifdef _MSC_VER
#ifdef _M_X86
#define ARCH_X86
#endif
#endif
#ifdef __GNUC__
#ifdef __i386__
#define ARCH_X86
#endif
#endif
#if defined _WIN32 && !defined _LUAJIT_PREPROCESS
#ifndef CDECL
#define CDECL __cdecl
#endif
#else
#define CDECL
#endif
#if defined __cplusplus
#define EXTERN extern "C"
#else
#define EXTERN extern
#endif
#if defined _WIN32
#define IMPORT_FUNCTION EXTERN __declspec(dllimport)
#define EXPORT_FUNCTION EXTERN __declspec(dllexport)
#else
#define EXPORT_FUNCTION EXTERN __attribute__ ((visibility ("default")))
#define IMPORT_FUNCTION EXTERN
#endif
#if defined _LUAJIT_PREPROCESS
#define API_FUNCTION
#elif !defined _HOST
#define API_FUNCTION IMPORT_FUNCTION
#else
#define API_FUNCTION EXPORT_FUNCTION
#endif // _LUAJIT_PREPROCESS
#if defined __cplusplus
#define NAMESPACE_BEGIN(name) namespace name {
#define NAMESPACE_END() }
#else
#define NAMESPACE_BEGIN(name)
#define NAMESPACE_END()
#endif
#endif //PLATFORM_HPP

@ -1,28 +0,0 @@
//
// Created by koncord on 23.01.16.
//
#ifndef PLATFORM_HPP
#define PLATFORM_HPP
#ifdef _MSC_VER
#ifdef _M_X86
#define ARCH_X86
#endif
#endif
#ifdef __GNUC__
#ifdef __i386__
#define ARCH_X86
#endif
#endif
#ifdef _WIN32
#define EXPORT_APIFUNCTION extern "C" __declspec(dllexport)
#define CDECL __cdecl
#else
#define EXPORT_APIFUNCTION extern "C" __attribute__ ((visibility ("default")))
#define CDECL
#endif
#endif //PLATFORM_HPP

@ -1,29 +1,29 @@
#ifndef SCRIPTFUNCTIONS_HPP
#define SCRIPTFUNCTIONS_HPP
#include <Script/Functions/Actors.hpp>
#include <Script/Functions/Books.hpp>
#include <Script/Functions/Cells.hpp>
#include <Script/Functions/CharClass.hpp>
#include <Script/Functions/Chat.hpp>
#include <Script/Functions/Dialogue.hpp>
#include <Script/Functions/Factions.hpp>
#include <Script/Functions/GUI.hpp>
#include <Script/Functions/Items.hpp>
#include <Script/Functions/Mechanics.hpp>
#include <Script/Functions/Miscellaneous.hpp>
#include <Script/Functions/Objects.hpp>
#include <Script/Functions/Positions.hpp>
#include <Script/Functions/Public.hpp>
#include <Script/Functions/Quests.hpp>
#include <Script/Functions/RecordsDynamic.hpp>
#include <Script/Functions/Shapeshift.hpp>
#include <Script/Functions/Server.hpp>
#include <Script/Functions/Settings.hpp>
#include <Script/Functions/Spells.hpp>
#include <Script/Functions/Stats.hpp>
#include <Script/Functions/Timer.hpp>
#include <Script/Functions/Worldstate.hpp>
#include <Script/Functions/Actors.h>
#include <Script/Functions/Books.h>
#include <Script/Functions/Cells.h>
#include <Script/Functions/CharClass.h>
#include <Script/Functions/Chat.h>
#include <Script/Functions/Dialogue.h>
#include <Script/Functions/Factions.h>
#include <Script/Functions/GUI.h>
#include <Script/Functions/Items.h>
#include <Script/Functions/Mechanics.h>
#include <Script/Functions/Miscellaneous.h>
#include <Script/Functions/Objects.h>
#include <Script/Functions/Positions.h>
#include <Script/Functions/Public.h>
#include <Script/Functions/Quests.h>
#include <Script/Functions/RecordsDynamic.h>
#include <Script/Functions/Shapeshift.h>
#include <Script/Functions/Server.h>
#include <Script/Functions/Settings.h>
#include <Script/Functions/Spells.h>
#include <Script/Functions/Stats.h>
#include <Script/Functions/Timer.h>
#include <Script/Functions/Worldstate.h>
#include <RakNetTypes.h>
#include <tuple>
#include <apps/openmw-mp/Player.hpp>

@ -0,0 +1,56 @@
/**
* @file api.h
* @brief External API for plugins.
* @authors koncord
* @date 08.01.19
*/
#ifndef NEWNATIVE_API_H
#define NEWNATIVE_API_H
#ifndef DOXYGEN_SHOULD_SKIP_THIS
#include "Platform.h"
#endif
/** @addtogroup APIFunctions API Functions
* @brief API provided by the server.
* @{
**/
NAMESPACE_BEGIN(Event)
/**
* @param event
* @param addr
*/
API_FUNCTION void CDECL RegisterEvent(const char *event, void *addr);
NAMESPACE_END()
/** @}*/
#if !(defined _HOST || defined _LUAJIT_PREPROCESS)
/** @addtogroup PluginFunctions Plugin Functions
* @brief Those functions must be implemented by plugin.
* @{
*/
/*! @brief This function must be implemented by every plugin.
*
* Called by the server on initialization process, there is no possible to call any API functions in this function.
* If this function returns 0, PluginFree() will be called
*
* @return 1 on success 0 on fail
*/
EXPORT_FUNCTION int CDECL PluginInit();
/*! @brief This function must be implemented by every plugin.
*
* Called by the server on qutitting or failing to initialize plugin by PluginInit()
*/
EXPORT_FUNCTION void CDECL PluginFree();
/** @}*/
#endif
#endif //NEWNATIVE_API_H
Loading…
Cancel
Save