[Server] Add Windows support for Mono API

experimental-mono
Koncord 5 years ago
parent fba99071f8
commit 10d7e68dd5

@ -1,6 +1,8 @@
#ifndef OPENMW_ACTORAPI_HPP
#define OPENMW_ACTORAPI_HPP
#include <Script/Platform.hpp>
#define ACTORAPI \
{"ReadReceivedActorList", ActorFunctions::ReadReceivedActorList},\
{"ReadCellActorList", ActorFunctions::ReadCellActorList},\
@ -109,7 +111,7 @@ namespace ActorFunctions
*
* \return void
*/
extern "C" void ReadReceivedActorList() noexcept;
EXPORT_APIFUNCTION void CDECL ReadReceivedActorList() noexcept;
/**
* \brief Use the temporary actor list stored for a cell as the one being read.
@ -120,14 +122,14 @@ namespace ActorFunctions
* \param cellDescription The description of the cell whose actor list should be read.
* \return void
*/
extern "C" void ReadCellActorList(const char* cellDescription) noexcept;
EXPORT_APIFUNCTION void CDECL ReadCellActorList(const char* cellDescription) noexcept;
/**
* \brief Clear the data from the actor list stored on the server.
*
* \return void
*/
extern "C" void ClearActorList() noexcept;
EXPORT_APIFUNCTION void CDECL ClearActorList() noexcept;
/**
* \brief Set the pid attached to the ActorList.
@ -135,7 +137,7 @@ namespace ActorFunctions
* \param pid The player ID to whom the actor list should be attached.
* \return void
*/
extern "C" void SetActorListPid(unsigned short pid) noexcept;
EXPORT_APIFUNCTION void CDECL SetActorListPid(unsigned short pid) noexcept;
/**
* \brief Take the contents of the read-only actor list last received by the
@ -144,21 +146,21 @@ namespace ActorFunctions
*
* \return void
*/
extern "C" void CopyReceivedActorListToStore() noexcept;
EXPORT_APIFUNCTION void CDECL CopyReceivedActorListToStore() noexcept;
/**
* \brief Get the number of indexes in the read actor list.
*
* \return The number of indexes.
*/
extern "C" unsigned int GetActorListSize() noexcept;
EXPORT_APIFUNCTION unsigned CDECL int 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).
*/
extern "C" unsigned char GetActorListAction() noexcept;
EXPORT_APIFUNCTION unsigned CDECL char GetActorListAction() noexcept;
/**
* \brief Get the cell description of the actor at a certain index in the read actor list.
@ -166,7 +168,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The cell description.
*/
extern "C" const char *GetActorCell(unsigned int index) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetActorCell(unsigned int index) noexcept;
/**
* \brief Get the refId of the actor at a certain index in the read actor list.
@ -174,7 +176,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The refId.
*/
extern "C" const char *GetActorRefId(unsigned int index) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetActorRefId(unsigned int index) noexcept;
/**
* \brief Get the refNum of the actor at a certain index in the read actor list.
@ -182,7 +184,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The refNum.
*/
extern "C" unsigned int GetActorRefNum(unsigned int index) noexcept;
EXPORT_APIFUNCTION unsigned CDECL int GetActorRefNum(unsigned int index) noexcept;
/**
* \brief Get the mpNum of the actor at a certain index in the read actor list.
@ -190,7 +192,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The mpNum.
*/
extern "C" unsigned int GetActorMpNum(unsigned int index) noexcept;
EXPORT_APIFUNCTION unsigned CDECL int GetActorMpNum(unsigned int index) noexcept;
/**
* \brief Get the X position of the actor at a certain index in the read actor list.
@ -198,7 +200,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The X position.
*/
extern "C" double GetActorPosX(unsigned int index) noexcept;
EXPORT_APIFUNCTION double CDECL GetActorPosX(unsigned int index) noexcept;
/**
* \brief Get the Y position of the actor at a certain index in the read actor list.
@ -206,7 +208,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The Y position.
*/
extern "C" double GetActorPosY(unsigned int index) noexcept;
EXPORT_APIFUNCTION double CDECL GetActorPosY(unsigned int index) noexcept;
/**
* \brief Get the Z position of the actor at a certain index in the read actor list.
@ -214,7 +216,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The Z position.
*/
extern "C" double GetActorPosZ(unsigned int index) noexcept;
EXPORT_APIFUNCTION double CDECL GetActorPosZ(unsigned int index) noexcept;
/**
* \brief Get the X rotation of the actor at a certain index in the read actor list.
@ -222,7 +224,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The X rotation.
*/
extern "C" double GetActorRotX(unsigned int index) noexcept;
EXPORT_APIFUNCTION double CDECL GetActorRotX(unsigned int index) noexcept;
/**
* \brief Get the Y rotation of the actor at a certain index in the read actor list.
@ -230,7 +232,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The Y rotation.
*/
extern "C" double GetActorRotY(unsigned int index) noexcept;
EXPORT_APIFUNCTION double CDECL GetActorRotY(unsigned int index) noexcept;
/**
* \brief Get the Z rotation of the actor at a certain index in the read actor list.
@ -238,7 +240,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The Z rotation.
*/
extern "C" double GetActorRotZ(unsigned int index) noexcept;
EXPORT_APIFUNCTION double CDECL GetActorRotZ(unsigned int index) noexcept;
/**
* \brief Get the base health of the actor at a certain index in the read actor list.
@ -246,7 +248,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The base health.
*/
extern "C" double GetActorHealthBase(unsigned int index) noexcept;
EXPORT_APIFUNCTION double CDECL GetActorHealthBase(unsigned int index) noexcept;
/**
* \brief Get the current health of the actor at a certain index in the read actor list.
@ -254,7 +256,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The current health.
*/
extern "C" double GetActorHealthCurrent(unsigned int index) noexcept;
EXPORT_APIFUNCTION double CDECL GetActorHealthCurrent(unsigned int index) noexcept;
/**
* \brief Get the modified health of the actor at a certain index in the read actor list.
@ -262,7 +264,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The modified health.
*/
extern "C" double GetActorHealthModified(unsigned int index) noexcept;
EXPORT_APIFUNCTION double CDECL GetActorHealthModified(unsigned int index) noexcept;
/**
* \brief Get the base magicka of the actor at a certain index in the read actor list.
@ -270,7 +272,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The base magicka.
*/
extern "C" double GetActorMagickaBase(unsigned int index) noexcept;
EXPORT_APIFUNCTION double CDECL GetActorMagickaBase(unsigned int index) noexcept;
/**
* \brief Get the current magicka of the actor at a certain index in the read actor list.
@ -278,7 +280,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The current magicka.
*/
extern "C" double GetActorMagickaCurrent(unsigned int index) noexcept;
EXPORT_APIFUNCTION double CDECL GetActorMagickaCurrent(unsigned int index) noexcept;
/**
* \brief Get the modified magicka of the actor at a certain index in the read actor list.
@ -286,7 +288,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The modified magicka.
*/
extern "C" double GetActorMagickaModified(unsigned int index) noexcept;
EXPORT_APIFUNCTION double CDECL GetActorMagickaModified(unsigned int index) noexcept;
/**
* \brief Get the base fatigue of the actor at a certain index in the read actor list.
@ -294,7 +296,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The base fatigue.
*/
extern "C" double GetActorFatigueBase(unsigned int index) noexcept;
EXPORT_APIFUNCTION double CDECL GetActorFatigueBase(unsigned int index) noexcept;
/**
* \brief Get the current fatigue of the actor at a certain index in the read actor list.
@ -302,7 +304,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The current fatigue.
*/
extern "C" double GetActorFatigueCurrent(unsigned int index) noexcept;
EXPORT_APIFUNCTION double CDECL GetActorFatigueCurrent(unsigned int index) noexcept;
/**
* \brief Get the modified fatigue of the actor at a certain index in the read actor list.
@ -310,7 +312,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The modified fatigue.
*/
extern "C" double GetActorFatigueModified(unsigned int index) noexcept;
EXPORT_APIFUNCTION 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
@ -320,7 +322,7 @@ namespace ActorFunctions
* \param slot The slot of the equipment item.
* \return The refId.
*/
extern "C" const char *GetActorEquipmentItemRefId(unsigned int index, unsigned short slot) noexcept;
EXPORT_APIFUNCTION const CDECL char *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
@ -330,7 +332,7 @@ namespace ActorFunctions
* \param slot The slot of the equipment item.
* \return The item count.
*/
extern "C" int GetActorEquipmentItemCount(unsigned int index, unsigned short slot) noexcept;
EXPORT_APIFUNCTION 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
@ -340,7 +342,7 @@ namespace ActorFunctions
* \param slot The slot of the equipment item.
* \return The charge.
*/
extern "C" int GetActorEquipmentItemCharge(unsigned int index, unsigned short slot) noexcept;
EXPORT_APIFUNCTION 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
@ -350,7 +352,7 @@ namespace ActorFunctions
* \param slot The slot of the equipment item.
* \return The enchantment charge.
*/
extern "C" double GetActorEquipmentItemEnchantmentCharge(unsigned int index, unsigned short slot) noexcept;
EXPORT_APIFUNCTION 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.
@ -358,7 +360,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return Whether the actor was killed by a player.
*/
extern "C" bool DoesActorHavePlayerKiller(unsigned int index) noexcept;
EXPORT_APIFUNCTION 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.
@ -366,7 +368,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The player ID of the killer.
*/
extern "C" int GetActorKillerPid(unsigned int index) noexcept;
EXPORT_APIFUNCTION 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.
@ -374,7 +376,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The refId of the killer.
*/
extern "C" const char *GetActorKillerRefId(unsigned int index) noexcept;
EXPORT_APIFUNCTION const CDECL char *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.
@ -382,7 +384,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The refNum of the killer.
*/
extern "C" unsigned int GetActorKillerRefNum(unsigned int index) noexcept;
EXPORT_APIFUNCTION unsigned CDECL int 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.
@ -390,7 +392,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The mpNum of the killer.
*/
extern "C" unsigned int GetActorKillerMpNum(unsigned int index) noexcept;
EXPORT_APIFUNCTION unsigned CDECL int 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.
@ -398,7 +400,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return The name of the killer.
*/
extern "C" const char *GetActorKillerName(unsigned int index) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetActorKillerName(unsigned int index) noexcept;
/**
* \brief Check whether there is any positional data for the actor at a certain index in
@ -409,7 +411,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return Whether the read actor list contains positional data.
*/
extern "C" bool DoesActorHavePosition(unsigned int index) noexcept;
EXPORT_APIFUNCTION bool CDECL DoesActorHavePosition(unsigned int index) noexcept;
/**
* \brief Check whether there is any dynamic stats data for the actor at a certain index in
@ -420,7 +422,7 @@ namespace ActorFunctions
* \param index The index of the actor.
* \return Whether the read actor list contains dynamic stats data.
*/
extern "C" bool DoesActorHaveStatsDynamic(unsigned int index) noexcept;
EXPORT_APIFUNCTION bool CDECL DoesActorHaveStatsDynamic(unsigned int index) noexcept;
/**
* \brief Set the cell of the temporary actor list stored on the server.
@ -431,7 +433,7 @@ namespace ActorFunctions
* \param cellDescription The description of the cell.
* \return void
*/
extern "C" void SetActorListCell(const char* cellDescription) noexcept;
EXPORT_APIFUNCTION void CDECL SetActorListCell(const char* cellDescription) noexcept;
/**
* \brief Set the action type of the temporary actor list stored on the server.
@ -439,7 +441,7 @@ namespace ActorFunctions
* \param action The action type (0 for SET, 1 for ADD, 2 for REMOVE, 3 for REQUEST).
* \return void
*/
extern "C" void SetActorListAction(unsigned char action) noexcept;
EXPORT_APIFUNCTION void CDECL SetActorListAction(unsigned char action) noexcept;
/**
* \brief Set the cell of the temporary actor stored on the server.
@ -453,7 +455,7 @@ namespace ActorFunctions
* \param cellDescription The description of the cell.
* \return void
*/
extern "C" void SetActorCell(const char* cellDescription) noexcept;
EXPORT_APIFUNCTION void CDECL SetActorCell(const char* cellDescription) noexcept;
/**
* \brief Set the refId of the temporary actor stored on the server.
@ -461,7 +463,7 @@ namespace ActorFunctions
* \param refId The refId.
* \return void
*/
extern "C" void SetActorRefId(const char* refId) noexcept;
EXPORT_APIFUNCTION void CDECL SetActorRefId(const char* refId) noexcept;
/**
* \brief Set the refNum of the temporary actor stored on the server.
@ -469,7 +471,7 @@ namespace ActorFunctions
* \param refNum The refNum.
* \return void
*/
extern "C" void SetActorRefNum(int refNum) noexcept;
EXPORT_APIFUNCTION void CDECL SetActorRefNum(int refNum) noexcept;
/**
* \brief Set the mpNum of the temporary actor stored on the server.
@ -477,7 +479,7 @@ namespace ActorFunctions
* \param mpNum The mpNum.
* \return void
*/
extern "C" void SetActorMpNum(int mpNum) noexcept;
EXPORT_APIFUNCTION void CDECL SetActorMpNum(int mpNum) noexcept;
/**
* \brief Set the position of the temporary actor stored on the server.
@ -487,7 +489,7 @@ namespace ActorFunctions
* \param z The Z position.
* \return void
*/
extern "C" void SetActorPosition(double x, double y, double z) noexcept;
EXPORT_APIFUNCTION void CDECL SetActorPosition(double x, double y, double z) noexcept;
/**
* \brief Set the rotation of the temporary actor stored on the server.
@ -497,7 +499,7 @@ namespace ActorFunctions
* \param z The Z rotation.
* \return void
*/
extern "C" void SetActorRotation(double x, double y, double z) noexcept;
EXPORT_APIFUNCTION void CDECL SetActorRotation(double x, double y, double z) noexcept;
/**
* \brief Set the base health of the temporary actor stored on the server.
@ -505,7 +507,7 @@ namespace ActorFunctions
* \param value The new value.
* \return void
*/
extern "C" void SetActorHealthBase(double value) noexcept;
EXPORT_APIFUNCTION void CDECL SetActorHealthBase(double value) noexcept;
/**
* \brief Set the current health of the temporary actor stored on the server.
@ -513,7 +515,7 @@ namespace ActorFunctions
* \param value The new value.
* \return void
*/
extern "C" void SetActorHealthCurrent(double value) noexcept;
EXPORT_APIFUNCTION void CDECL SetActorHealthCurrent(double value) noexcept;
/**
* \brief Set the modified health of the temporary actor stored on the server.
@ -521,7 +523,7 @@ namespace ActorFunctions
* \param value The new value.
* \return void
*/
extern "C" void SetActorHealthModified(double value) noexcept;
EXPORT_APIFUNCTION void CDECL SetActorHealthModified(double value) noexcept;
/**
* \brief Set the base magicka of the temporary actor stored on the server.
@ -529,7 +531,7 @@ namespace ActorFunctions
* \param value The new value.
* \return void
*/
extern "C" void SetActorMagickaBase(double value) noexcept;
EXPORT_APIFUNCTION void CDECL SetActorMagickaBase(double value) noexcept;
/**
* \brief Set the current magicka of the temporary actor stored on the server.
@ -537,7 +539,7 @@ namespace ActorFunctions
* \param value The new value.
* \return void
*/
extern "C" void SetActorMagickaCurrent(double value) noexcept;
EXPORT_APIFUNCTION void CDECL SetActorMagickaCurrent(double value) noexcept;
/**
* \brief Set the modified magicka of the temporary actor stored on the server.
@ -545,7 +547,7 @@ namespace ActorFunctions
* \param value The new value.
* \return void
*/
extern "C" void SetActorMagickaModified(double value) noexcept;
EXPORT_APIFUNCTION void CDECL SetActorMagickaModified(double value) noexcept;
/**
* \brief Set the base fatigue of the temporary actor stored on the server.
@ -553,7 +555,7 @@ namespace ActorFunctions
* \param value The new value.
* \return void
*/
extern "C" void SetActorFatigueBase(double value) noexcept;
EXPORT_APIFUNCTION void CDECL SetActorFatigueBase(double value) noexcept;
/**
* \brief Set the current fatigue of the temporary actor stored on the server.
@ -561,7 +563,7 @@ namespace ActorFunctions
* \param value The new value.
* \return void
*/
extern "C" void SetActorFatigueCurrent(double value) noexcept;
EXPORT_APIFUNCTION void CDECL SetActorFatigueCurrent(double value) noexcept;
/**
* \brief Set the modified fatigue of the temporary actor stored on the server.
@ -569,7 +571,7 @@ namespace ActorFunctions
* \param value The new value.
* \return void
*/
extern "C" void SetActorFatigueModified(double value) noexcept;
EXPORT_APIFUNCTION void CDECL SetActorFatigueModified(double value) noexcept;
/**
* \brief Set the sound of the temporary actor stored on the server.
@ -577,7 +579,7 @@ namespace ActorFunctions
* \param sound The sound.
* \return void
*/
extern "C" void SetActorSound(const char* sound) noexcept;
EXPORT_APIFUNCTION void CDECL SetActorSound(const char* sound) noexcept;
/**
* \brief Set the AI action of the temporary actor stored on the server.
@ -585,7 +587,7 @@ namespace ActorFunctions
* \param action The new action.
* \return void
*/
extern "C" void SetActorAIAction(unsigned int action) noexcept;
EXPORT_APIFUNCTION void CDECL SetActorAIAction(unsigned int action) noexcept;
/**
* \brief Set a player as the AI target of the temporary actor stored on the server.
@ -593,7 +595,7 @@ namespace ActorFunctions
* \param pid The player ID.
* \return void
*/
extern "C" void SetActorAITargetToPlayer(unsigned short pid) noexcept;
EXPORT_APIFUNCTION void CDECL SetActorAITargetToPlayer(unsigned short pid) noexcept;
/**
* \brief Set another object as the AI target of the temporary actor stored on the server.
@ -602,7 +604,7 @@ namespace ActorFunctions
* \param mpNum The mpNum of the target object.
* \return void
*/
extern "C" void SetActorAITargetToObject(int refNum, int mpNum) noexcept;
EXPORT_APIFUNCTION void CDECL SetActorAITargetToObject(int refNum, int mpNum) noexcept;
/**
* \brief Set the coordinates for the AI package associated with the current AI action.
@ -612,7 +614,7 @@ namespace ActorFunctions
* \param z The Z coordinate.
* \return void
*/
extern "C" void SetActorAICoordinates(double x, double y, double z) noexcept;
EXPORT_APIFUNCTION void CDECL SetActorAICoordinates(double x, double y, double z) noexcept;
/**
* \brief Set the distance of the AI package associated with the current AI action.
@ -620,7 +622,7 @@ namespace ActorFunctions
* \param duration The distance of the package.
* \return void
*/
extern "C" void SetActorAIDistance(unsigned int distance) noexcept;
EXPORT_APIFUNCTION void CDECL SetActorAIDistance(unsigned int distance) noexcept;
/**
* \brief Set the duration of the AI package associated with the current AI action.
@ -628,7 +630,7 @@ namespace ActorFunctions
* \param duration The duration of the package.
* \return void
*/
extern "C" void SetActorAIDuration(unsigned int duration) noexcept;
EXPORT_APIFUNCTION void CDECL SetActorAIDuration(unsigned int duration) noexcept;
/**
* \brief Set whether the current AI package should be repeated.
@ -638,7 +640,7 @@ namespace ActorFunctions
* \param shouldRepeat Whether the package should be repeated.
* \return void
*/
extern "C" void SetActorAIRepetition(bool shouldRepeat) noexcept;
EXPORT_APIFUNCTION void CDECL SetActorAIRepetition(bool shouldRepeat) noexcept;
/**
* \brief Equip an item in a certain slot of the equipment of the temporary actor stored
@ -651,7 +653,7 @@ namespace ActorFunctions
* \param enchantmentCharge The enchantment charge of the item.
* \return void
*/
extern "C" void EquipActorItem(unsigned short slot, const char* refId, unsigned int count, int charge, double enchantmentCharge = -1) noexcept;
EXPORT_APIFUNCTION 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
@ -660,7 +662,7 @@ namespace ActorFunctions
* \param slot The equipment slot.
* \return void
*/
extern "C" void UnequipActorItem(unsigned short slot) noexcept;
EXPORT_APIFUNCTION void CDECL UnequipActorItem(unsigned short slot) noexcept;
/**
* \brief Add a copy of the server's temporary actor to the server's temporary actor list.
@ -670,7 +672,7 @@ namespace ActorFunctions
*
* \return void
*/
extern "C" void AddActor() noexcept;
EXPORT_APIFUNCTION void CDECL AddActor() noexcept;
/**
* \brief Send an ActorList packet.
@ -679,7 +681,7 @@ namespace ActorFunctions
*
* \return void
*/
extern "C" void SendActorList() noexcept;
EXPORT_APIFUNCTION void CDECL SendActorList() noexcept;
/**
* \brief Send an ActorAuthority packet.
@ -691,7 +693,7 @@ namespace ActorFunctions
*
* \return void
*/
extern "C" void SendActorAuthority() noexcept;
EXPORT_APIFUNCTION void CDECL SendActorAuthority() noexcept;
/**
* \brief Send an ActorPosition packet.
@ -703,7 +705,7 @@ namespace ActorFunctions
*
* \return void
*/
extern "C" void SendActorPosition(bool sendToOtherVisitors, bool skipAttachedPlayer) noexcept;
EXPORT_APIFUNCTION void CDECL SendActorPosition(bool sendToOtherVisitors, bool skipAttachedPlayer) noexcept;
/**
* \brief Send an ActorStatsDynamic packet.
@ -715,7 +717,7 @@ namespace ActorFunctions
*
* \return void
*/
extern "C" void SendActorStatsDynamic(bool sendToOtherVisitors, bool skipAttachedPlayer) noexcept;
EXPORT_APIFUNCTION void CDECL SendActorStatsDynamic(bool sendToOtherVisitors, bool skipAttachedPlayer) noexcept;
/**
* \brief Send an ActorEquipment packet.
@ -727,7 +729,7 @@ namespace ActorFunctions
*
* \return void
*/
extern "C" void SendActorEquipment(bool sendToOtherVisitors, bool skipAttachedPlayer) noexcept;
EXPORT_APIFUNCTION void CDECL SendActorEquipment(bool sendToOtherVisitors, bool skipAttachedPlayer) noexcept;
/**
* \brief Send an ActorSpeech packet.
@ -738,7 +740,7 @@ namespace ActorFunctions
* to the packet (false by default).
* \return void
*/
extern "C" void SendActorSpeech(bool sendToOtherVisitors, bool skipAttachedPlayer) noexcept;
EXPORT_APIFUNCTION void CDECL SendActorSpeech(bool sendToOtherVisitors, bool skipAttachedPlayer) noexcept;
/**
* \brief Send an ActorAI packet.
@ -749,7 +751,7 @@ namespace ActorFunctions
* to the packet (false by default).
* \return void
*/
extern "C" void SendActorAI(bool sendToOtherVisitors, bool skipAttachedPlayer) noexcept;
EXPORT_APIFUNCTION void CDECL SendActorAI(bool sendToOtherVisitors, bool skipAttachedPlayer) noexcept;
/**
* \brief Send an ActorCellChange packet.
@ -761,17 +763,17 @@ namespace ActorFunctions
*
* \return void
*/
extern "C" void SendActorCellChange(bool sendToOtherVisitors, bool skipAttachedPlayer) noexcept;
EXPORT_APIFUNCTION void CDECL SendActorCellChange(bool sendToOtherVisitors, bool skipAttachedPlayer) noexcept;
// All methods below are deprecated versions of methods from above
extern "C" void ReadLastActorList() noexcept;
extern "C" void InitializeActorList(unsigned short pid) noexcept;
extern "C" void CopyLastActorListToStore() noexcept;
extern "C" unsigned int GetActorRefNumIndex(unsigned int index) noexcept;
extern "C" unsigned int GetActorKillerRefNumIndex(unsigned int index) noexcept;
extern "C" void SetActorRefNumIndex(int refNum) noexcept;
EXPORT_APIFUNCTION void CDECL ReadLastActorList() noexcept;
EXPORT_APIFUNCTION void CDECL InitializeActorList(unsigned short pid) noexcept;
EXPORT_APIFUNCTION void CDECL CopyLastActorListToStore() noexcept;
EXPORT_APIFUNCTION unsigned CDECL int GetActorRefNumIndex(unsigned int index) noexcept;
EXPORT_APIFUNCTION unsigned CDECL int GetActorKillerRefNumIndex(unsigned int index) noexcept;
EXPORT_APIFUNCTION void CDECL SetActorRefNumIndex(int refNum) noexcept;
}

@ -1,6 +1,8 @@
#ifndef OPENMW_BOOKAPI_HPP
#define OPENMW_BOOKAPI_HPP
#include <Script/Platform.hpp>
#define BOOKAPI \
{"ClearBookChanges", BookFunctions::ClearBookChanges},\
\
@ -25,7 +27,7 @@ namespace BookFunctions
* \param pid The player ID whose book changes should be used.
* \return void
*/
extern "C" void ClearBookChanges(unsigned short pid) noexcept;
EXPORT_APIFUNCTION void CDECL ClearBookChanges(unsigned short pid) noexcept;
/**
* \brief Get the number of indexes in a player's latest book changes.
@ -33,7 +35,7 @@ namespace BookFunctions
* \param pid The player ID whose book changes should be used.
* \return The number of indexes.
*/
extern "C" unsigned int GetBookChangesSize(unsigned short pid) noexcept;
EXPORT_APIFUNCTION unsigned CDECL int GetBookChangesSize(unsigned short pid) noexcept;
/**
* \brief Add a new book to the book changes for a player.
@ -42,7 +44,7 @@ namespace BookFunctions
* \param bookId The bookId of the book.
* \return void
*/
extern "C" void AddBook(unsigned short pid, const char* bookId) noexcept;
EXPORT_APIFUNCTION 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.
@ -51,7 +53,7 @@ namespace BookFunctions
* \param index The index of the book.
* \return The bookId.
*/
extern "C" const char *GetBookId(unsigned short pid, unsigned int index) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetBookId(unsigned short pid, unsigned int index) noexcept;
/**
* \brief Send a PlayerBook packet with a player's recorded book changes.
@ -63,11 +65,11 @@ namespace BookFunctions
* to the packet (false by default).
* \return void
*/
extern "C" void SendBookChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
EXPORT_APIFUNCTION void CDECL SendBookChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
// All methods below are deprecated versions of methods from above
extern "C" void InitializeBookChanges(unsigned short pid) noexcept;
EXPORT_APIFUNCTION void CDECL InitializeBookChanges(unsigned short pid) noexcept;
}
#endif //OPENMW_BOOKAPI_HPP

@ -3,6 +3,8 @@
#include "../Types.hpp"
#include <Script/Platform.hpp>
#define CELLAPI \
{"GetCellStateChangesSize", CellFunctions::GetCellStateChangesSize},\
\
@ -31,7 +33,7 @@ namespace CellFunctions
* \param pid The player ID whose cell state changes should be used.
* \return The number of indexes.
*/
extern "C" unsigned int GetCellStateChangesSize(unsigned short pid) noexcept;
EXPORT_APIFUNCTION unsigned CDECL int GetCellStateChangesSize(unsigned short pid) noexcept;
/**
* \brief Get the cell state type at a certain index in a player's latest cell state changes.
@ -40,7 +42,7 @@ namespace CellFunctions
* \param index The index of the cell state.
* \return The cell state type (0 for LOAD, 1 for UNLOAD).
*/
extern "C" unsigned int GetCellStateType(unsigned short pid, unsigned int index) noexcept;
EXPORT_APIFUNCTION unsigned CDECL int 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.
@ -49,7 +51,7 @@ namespace CellFunctions
* \param index The index of the cell state.
* \return The cell description.
*/
extern "C" const char *GetCellStateDescription(unsigned short pid, unsigned int index) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetCellStateDescription(unsigned short pid, unsigned int index) noexcept;
/**
* \brief Get the cell description of a player's cell.
@ -57,7 +59,7 @@ namespace CellFunctions
* \param pid The player ID.
* \return The cell description.
*/
extern "C" const char *GetCell(unsigned short pid) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetCell(unsigned short pid) noexcept;
/**
* \brief Get the X coordinate of the player's exterior cell.
@ -65,7 +67,7 @@ namespace CellFunctions
* \param pid The player ID.
* \return The X coordinate of the cell.
*/
extern "C" int GetExteriorX(unsigned short pid) noexcept;
EXPORT_APIFUNCTION int CDECL GetExteriorX(unsigned short pid) noexcept;
/**
* \brief Get the Y coordinate of the player's exterior cell.
@ -73,7 +75,7 @@ namespace CellFunctions
* \param pid The player ID.
* \return The Y coordinate of the cell.
*/
extern "C" int GetExteriorY(unsigned short pid) noexcept;
EXPORT_APIFUNCTION int CDECL GetExteriorY(unsigned short pid) noexcept;
/**
* \brief Check whether the player is in an exterior cell or not.
@ -81,7 +83,7 @@ namespace CellFunctions
* \param pid The player ID.
* \return Whether the player is in an exterior cell.
*/
extern "C" bool IsInExterior(unsigned short pid) noexcept;
EXPORT_APIFUNCTION bool CDECL IsInExterior(unsigned short pid) noexcept;
/**
* \brief Get the region of the player's exterior cell.
@ -91,7 +93,7 @@ namespace CellFunctions
* \param pid The player ID.
* \return The region.
*/
extern "C" const char *GetRegion(unsigned short pid) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetRegion(unsigned short pid) noexcept;
/**
* \brief Check whether the player's last cell change has involved a region change.
@ -99,7 +101,7 @@ namespace CellFunctions
* \param pid The player ID.
* \return Whether the player has changed their region.
*/
extern "C" bool IsChangingRegion(unsigned short pid) noexcept;
EXPORT_APIFUNCTION bool CDECL IsChangingRegion(unsigned short pid) noexcept;
/**
* \brief Set the cell of a player.
@ -114,7 +116,7 @@ namespace CellFunctions
* \param cellDescription The cell description.
* \return void
*/
extern "C" void SetCell(unsigned short pid, const char *cellDescription) noexcept;
EXPORT_APIFUNCTION void CDECL SetCell(unsigned short pid, const char *cellDescription) noexcept;
/**
* \brief Set the cell of a player to an exterior cell.
@ -127,7 +129,7 @@ namespace CellFunctions
* \param y The Y coordinate of the cell.
* \return void
*/
extern "C" void SetExteriorCell(unsigned short pid, int x, int y) noexcept;
EXPORT_APIFUNCTION void CDECL SetExteriorCell(unsigned short pid, int x, int y) noexcept;
/**
* \brief Send a PlayerCellChange packet about a player.
@ -137,7 +139,7 @@ namespace CellFunctions
* \param pid The player ID.
* \return void
*/
extern "C" void SendCell(unsigned short pid) noexcept;
EXPORT_APIFUNCTION void CDECL SendCell(unsigned short pid) noexcept;
}
#endif //OPENMW_CELLAPI_HPP

@ -7,6 +7,8 @@
#include "../Types.hpp"
#include <Script/Platform.hpp>
#define CHARCLASSAPI \
{"GetDefaultClass", CharClassFunctions::GetDefaultClass},\
{"GetClassName", CharClassFunctions::GetClassName},\
@ -36,7 +38,7 @@ namespace CharClassFunctions
* \param pid The player ID.
* \return The ID of the default class.
*/
extern "C" const char *GetDefaultClass(unsigned short pid) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetDefaultClass(unsigned short pid) noexcept;
/**
* \brief Get the name of the custom class used by a player.
@ -44,7 +46,7 @@ namespace CharClassFunctions
* \param pid The player ID.
* \return The name of the custom class.
*/
extern "C" const char *GetClassName(unsigned short pid) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetClassName(unsigned short pid) noexcept;
/**
* \brief Get the description of the custom class used by a player.
@ -52,7 +54,7 @@ namespace CharClassFunctions
* \param pid The player ID.
* \return The description of the custom class.
*/
extern "C" const char *GetClassDesc(unsigned short pid) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetClassDesc(unsigned short pid) noexcept;
/**
* \brief Get the ID of one of the two major attributes of a custom class used by a player.
@ -61,7 +63,7 @@ namespace CharClassFunctions
* \param slot The slot of the major attribute (0 or 1).
* \return The ID of the major attribute.
*/
extern "C" int GetClassMajorAttribute(unsigned short pid, unsigned char slot) noexcept;
EXPORT_APIFUNCTION int CDECL GetClassMajorAttribute(unsigned short pid, unsigned char slot) noexcept;
/**
* \brief Get the specialization ID of the custom class used by a player.
@ -69,7 +71,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).
*/
extern "C" int GetClassSpecialization(unsigned short pid) noexcept;
EXPORT_APIFUNCTION 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.
@ -78,7 +80,7 @@ namespace CharClassFunctions
* \param slot The slot of the major skill (0 to 4).
* \return The ID of the major skill.
*/
extern "C" int GetClassMajorSkill(unsigned short pid, unsigned char slot) noexcept;
EXPORT_APIFUNCTION 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.
@ -87,7 +89,7 @@ namespace CharClassFunctions
* \param slot The slot of the minor skill (0 to 4).
* \return The ID of the minor skill.
*/
extern "C" int GetClassMinorSkill(unsigned short pid, unsigned char slot) noexcept;
EXPORT_APIFUNCTION 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.
@ -95,7 +97,7 @@ namespace CharClassFunctions
* \param pid The player ID.
* \return Whether the player is using a default class.
*/
extern "C" int IsClassDefault(unsigned short pid) noexcept;
EXPORT_APIFUNCTION int CDECL IsClassDefault(unsigned short pid) noexcept;
/**
* \brief Set the default class used by a player.
@ -106,7 +108,7 @@ namespace CharClassFunctions
* \param id The ID of the default class.
* \return void
*/
extern "C" void SetDefaultClass(unsigned short pid, const char *id) noexcept;
EXPORT_APIFUNCTION void CDECL SetDefaultClass(unsigned short pid, const char *id) noexcept;
/**
* \brief Set the name of the custom class used by a player.
@ -115,7 +117,7 @@ namespace CharClassFunctions
* \param name The name of the custom class.
* \return void
*/
extern "C" void SetClassName(unsigned short pid, const char *name) noexcept;
EXPORT_APIFUNCTION void CDECL SetClassName(unsigned short pid, const char *name) noexcept;
/**
* \brief Set the description of the custom class used by a player.
@ -124,7 +126,7 @@ namespace CharClassFunctions
* \param desc The description of the custom class.
* \return void
*/
extern "C" void SetClassDesc(unsigned short pid, const char *desc) noexcept;
EXPORT_APIFUNCTION 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.
@ -134,7 +136,7 @@ namespace CharClassFunctions
* \param attrId The ID to use for the attribute.
* \return void
*/
extern "C" void SetClassMajorAttribute(unsigned short pid, unsigned char slot, int attrId) noexcept;
EXPORT_APIFUNCTION void CDECL SetClassMajorAttribute(unsigned short pid, unsigned char slot, int attrId) noexcept;
/**
* \brief Set the specialization of the custom class used by a player.
@ -143,7 +145,7 @@ namespace CharClassFunctions
* \param spec The specialization ID to use (0 for Combat, 1 for Magic, 2 for Stealth).
* \return void
*/
extern "C" void SetClassSpecialization(unsigned short pid, int spec) noexcept;
EXPORT_APIFUNCTION 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.
@ -153,7 +155,7 @@ namespace CharClassFunctions
* \param skillId The ID to use for the skill.
* \return void
*/
extern "C" void SetClassMajorSkill(unsigned short pid, unsigned char slot, int skillId) noexcept;
EXPORT_APIFUNCTION 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.
@ -163,7 +165,7 @@ namespace CharClassFunctions
* \param skillId The ID to use for the skill.
* \return void
*/
extern "C" void SetClassMinorSkill(unsigned short pid, unsigned char slot, int skillId) noexcept;
EXPORT_APIFUNCTION void CDECL SetClassMinorSkill(unsigned short pid, unsigned char slot, int skillId) noexcept;
/**
* \brief Send a PlayerCharClass packet about a player.
@ -173,7 +175,7 @@ namespace CharClassFunctions
* \param pid The player ID.
* \return void
*/
extern "C" void SendClass(unsigned short pid) noexcept;
EXPORT_APIFUNCTION void CDECL SendClass(unsigned short pid) noexcept;
}
#endif //OPENMW_CHARCLASSAPI_HPP

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

@ -1,6 +1,8 @@
#ifndef OPENMW_DIALOGUEAPI_HPP
#define OPENMW_DIALOGUEAPI_HPP
#include <Script/Platform.hpp>
#define DIALOGUEAPI \
{"ClearTopicChanges", DialogueFunctions::ClearTopicChanges},\
\
@ -27,7 +29,7 @@ namespace DialogueFunctions
* \param pid The player ID whose topic changes should be used.
* \return void
*/
extern "C" void ClearTopicChanges(unsigned short pid) noexcept;
EXPORT_APIFUNCTION void CDECL ClearTopicChanges(unsigned short pid) noexcept;
/**
* \brief Get the number of indexes in a player's latest topic changes.
@ -35,7 +37,7 @@ namespace DialogueFunctions
* \param pid The player ID whose topic changes should be used.
* \return The number of indexes.
*/
extern "C" unsigned int GetTopicChangesSize(unsigned short pid) noexcept;
EXPORT_APIFUNCTION unsigned CDECL int GetTopicChangesSize(unsigned short pid) noexcept;
/**
* \brief Add a new topic to the topic changes for a player.
@ -44,7 +46,7 @@ namespace DialogueFunctions
* \param topicId The topicId of the topic.
* \return void
*/
extern "C" void AddTopic(unsigned short pid, const char* topicId) noexcept;
EXPORT_APIFUNCTION 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.
@ -53,7 +55,7 @@ namespace DialogueFunctions
* \param index The index of the topic.
* \return The topicId.
*/
extern "C" const char *GetTopicId(unsigned short pid, unsigned int index) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetTopicId(unsigned short pid, unsigned int index) noexcept;
/**
* \brief Send a PlayerTopic packet with a player's recorded topic changes.
@ -65,7 +67,7 @@ namespace DialogueFunctions
* to the packet (false by default).
* \return void
*/
extern "C" void SendTopicChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
EXPORT_APIFUNCTION 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
@ -78,7 +80,7 @@ namespace DialogueFunctions
* \param bool Whether the animation should persist or not.
* \return void
*/
extern "C" void PlayAnimation(unsigned short pid, const char* groupname, int mode, int count, bool persist) noexcept;
EXPORT_APIFUNCTION 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
@ -88,11 +90,11 @@ namespace DialogueFunctions
* \param sound The path of the sound file.
* \return void
*/
extern "C" void PlaySpeech(unsigned short pid, const char* sound) noexcept;
EXPORT_APIFUNCTION void CDECL PlaySpeech(unsigned short pid, const char* sound) noexcept;
// All methods below are deprecated versions of methods from above
extern "C" void InitializeTopicChanges(unsigned short pid) noexcept;
EXPORT_APIFUNCTION void CDECL InitializeTopicChanges(unsigned short pid) noexcept;
}
#endif //OPENMW_DIALOGUEAPI_HPP

@ -1,6 +1,8 @@
#ifndef OPENMW_FACTIONAPI_HPP
#define OPENMW_FACTIONAPI_HPP
#include <Script/Platform.hpp>
#define FACTIONAPI \
{"ClearFactionChanges", FactionFunctions::ClearFactionChanges},\
\
@ -34,7 +36,7 @@ namespace FactionFunctions
* \param pid The player ID whose faction changes should be used.
* \return void
*/
extern "C" void ClearFactionChanges(unsigned short pid) noexcept;
EXPORT_APIFUNCTION void CDECL ClearFactionChanges(unsigned short pid) noexcept;
/**
* \brief Get the number of indexes in a player's latest faction changes.
@ -42,7 +44,7 @@ namespace FactionFunctions
* \param pid The player ID whose faction changes should be used.
* \return The number of indexes.
*/
extern "C" unsigned int GetFactionChangesSize(unsigned short pid) noexcept;
EXPORT_APIFUNCTION unsigned CDECL int GetFactionChangesSize(unsigned short pid) noexcept;
/**
* \brief Get the action type used in a player's latest faction changes.
@ -50,7 +52,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).
*/
extern "C" unsigned char GetFactionChangesAction(unsigned short pid) noexcept;
EXPORT_APIFUNCTION unsigned CDECL char GetFactionChangesAction(unsigned short pid) noexcept;
/**
* \brief Get the factionId at a certain index in a player's latest faction changes.
@ -59,7 +61,7 @@ namespace FactionFunctions
* \param index The index of the faction.
* \return The factionId.
*/
extern "C" const char *GetFactionId(unsigned short pid, unsigned int index) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetFactionId(unsigned short pid, unsigned int index) noexcept;
/**
* \brief Get the rank at a certain index in a player's latest faction changes.
@ -68,7 +70,7 @@ namespace FactionFunctions
* \param index The index of the faction.
* \return The rank.
*/
extern "C" int GetFactionRank(unsigned short pid, unsigned int index) noexcept;
EXPORT_APIFUNCTION 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.
@ -77,7 +79,7 @@ namespace FactionFunctions
* \param index The index of the faction.
* \return The expulsion state.
*/
extern "C" bool GetFactionExpulsionState(unsigned short pid, unsigned int index) noexcept;
EXPORT_APIFUNCTION 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.
@ -86,7 +88,7 @@ namespace FactionFunctions
* \param index The index of the faction.
* \return The reputation.
*/
extern "C" int GetFactionReputation(unsigned short pid, unsigned int index) noexcept;
EXPORT_APIFUNCTION int CDECL GetFactionReputation(unsigned short pid, unsigned int index) noexcept;
/**
* \brief Set the action type in a player's faction changes.
@ -95,7 +97,7 @@ namespace FactionFunctions
* \param action The action (0 for RANK, 1 for EXPULSION, 2 for REPUTATION).
* \return void
*/
extern "C" void SetFactionChangesAction(unsigned short pid, unsigned char action) noexcept;
EXPORT_APIFUNCTION void CDECL SetFactionChangesAction(unsigned short pid, unsigned char action) noexcept;
/**
* \brief Set the factionId of the temporary faction stored on the server.
@ -103,7 +105,7 @@ namespace FactionFunctions
* \param factionId The factionId.
* \return void
*/
extern "C" void SetFactionId(const char* factionId) noexcept;
EXPORT_APIFUNCTION void CDECL SetFactionId(const char* factionId) noexcept;
/**
* \brief Set the rank of the temporary faction stored on the server.
@ -111,7 +113,7 @@ namespace FactionFunctions
* \param rank The rank.
* \return void
*/
extern "C" void SetFactionRank(unsigned int rank) noexcept;
EXPORT_APIFUNCTION void CDECL SetFactionRank(unsigned int rank) noexcept;
/**
* \brief Set the expulsion state of the temporary faction stored on the server.
@ -119,7 +121,7 @@ namespace FactionFunctions
* \param expulsionState The expulsion state.
* \return void
*/
extern "C" void SetFactionExpulsionState(bool expulsionState) noexcept;
EXPORT_APIFUNCTION void CDECL SetFactionExpulsionState(bool expulsionState) noexcept;
/**
* \brief Set the reputation of the temporary faction stored on the server.
@ -127,7 +129,7 @@ namespace FactionFunctions
* \param reputation The reputation.
* \return void
*/
extern "C" void SetFactionReputation(int reputation) noexcept;
EXPORT_APIFUNCTION void CDECL SetFactionReputation(int reputation) noexcept;
/**
* \brief Add the server's temporary faction to the faction changes for a player.
@ -138,7 +140,7 @@ namespace FactionFunctions
* \param pid The player ID whose faction changes should be used.
* \return void
*/
extern "C" void AddFaction(unsigned short pid) noexcept;
EXPORT_APIFUNCTION void CDECL AddFaction(unsigned short pid) noexcept;
/**
* \brief Send a PlayerFaction packet with a player's recorded faction changes.
@ -150,11 +152,11 @@ namespace FactionFunctions
* to the packet (false by default).
* \return void
*/
extern "C" void SendFactionChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
EXPORT_APIFUNCTION void CDECL SendFactionChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
// All methods below are deprecated versions of methods from above
extern "C" void InitializeFactionChanges(unsigned short pid) noexcept;
EXPORT_APIFUNCTION void CDECL InitializeFactionChanges(unsigned short pid) noexcept;
}
#endif //OPENMW_FACTIONAPI_HPP

@ -1,6 +1,8 @@
#ifndef OPENMW_GUIAPI_HPP
#define OPENMW_GUIAPI_HPP
#include <Script/Platform.hpp>
#define GUIAPI \
{"MessageBox", GUIFunctions::_MessageBox},\
{"CustomMessageBox", GUIFunctions::CustomMessageBox},\
@ -39,7 +41,7 @@ namespace GUIFunctions
* \param label The text in the messagebox.
* \return void
*/
extern "C" void _MessageBox(unsigned short pid, int id, const char *label) noexcept;
EXPORT_APIFUNCTION void CDECL _MessageBox(unsigned short pid, int id, const char *label) noexcept;
/**
* \brief Display an interactive messagebox at the center of the screen that
@ -51,7 +53,7 @@ namespace GUIFunctions
* \parm buttons The captions of the buttons, separated by semicolons (e.g. "Yes;No;Maybe").
* \return void
*/
extern "C" void CustomMessageBox(unsigned short pid, int id, const char *label, const char *buttons) noexcept;
EXPORT_APIFUNCTION 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.
@ -62,7 +64,7 @@ namespace GUIFunctions
* \parm note The text at the bottom of the input dialog.
* \return void
*/
extern "C" void InputDialog(unsigned short pid, int id, const char *label, const char *note) noexcept;
EXPORT_APIFUNCTION 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.
@ -76,7 +78,7 @@ namespace GUIFunctions
* \parm note The text at the bottom of the password dialog.
* \return void
*/
extern "C" void PasswordDialog(unsigned short pid, int id, const char *label, const char *note) noexcept;
EXPORT_APIFUNCTION 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
@ -89,7 +91,7 @@ namespace GUIFunctions
* \parm items The items in the listbox, separated by newlines (e.g. "Item 1\nItem 2").
* \return void
*/
extern "C" void ListBox(unsigned short pid, int id, const char *label, const char *items);
EXPORT_APIFUNCTION 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.
@ -99,7 +101,7 @@ namespace GUIFunctions
* \param pid The player ID whose quick key changes should be used.
* \return void
*/
extern "C" void ClearQuickKeyChanges(unsigned short pid) noexcept;
EXPORT_APIFUNCTION void CDECL ClearQuickKeyChanges(unsigned short pid) noexcept;
/**
* \brief Get the number of indexes in a player's latest quick key changes.
@ -107,7 +109,7 @@ namespace GUIFunctions
* \param pid The player ID whose quick key changes should be used.
* \return The number of indexes.
*/
extern "C" unsigned int GetQuickKeyChangesSize(unsigned short pid) noexcept;
EXPORT_APIFUNCTION unsigned CDECL int GetQuickKeyChangesSize(unsigned short pid) noexcept;
/**
* \brief Add a new quick key to the quick key changes for a player.
@ -118,7 +120,7 @@ namespace GUIFunctions
* \param itemId The itemId of the item.
* \return void
*/
extern "C" void AddQuickKey(unsigned short pid, unsigned short slot, int type, const char* itemId = "") noexcept;
EXPORT_APIFUNCTION 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.
@ -127,7 +129,7 @@ namespace GUIFunctions
* \param index The index of the quick key in the quick key changes vector.
* \return The slot.
*/
extern "C" int GetQuickKeySlot(unsigned short pid, unsigned int index) noexcept;
EXPORT_APIFUNCTION 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.
@ -136,7 +138,7 @@ namespace GUIFunctions
* \param index The index of the quick key in the quick key changes vector.
* \return The quick key type.
*/
extern "C" int GetQuickKeyType(unsigned short pid, unsigned int index) noexcept;
EXPORT_APIFUNCTION 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.
@ -145,7 +147,7 @@ namespace GUIFunctions
* \param index The index of the quick key in the quick key changes vector.
* \return The itemId.
*/
extern "C" const char *GetQuickKeyItemId(unsigned short pid, unsigned int index) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetQuickKeyItemId(unsigned short pid, unsigned int index) noexcept;
/**
* \brief Send a PlayerQuickKeys packet with a player's recorded quick key changes.
@ -153,7 +155,7 @@ namespace GUIFunctions
* \param pid The player ID whose quick key changes should be used.
* \return void
*/
extern "C" void SendQuickKeyChanges(unsigned short pid) noexcept;
EXPORT_APIFUNCTION void CDECL SendQuickKeyChanges(unsigned short pid) noexcept;
//state 0 - disallow, 1 - allow
@ -167,7 +169,7 @@ namespace GUIFunctions
* \param state The state of the map marker (false to hide, true to reveal).
* \return void
*/
extern "C" void SetMapVisibility(unsigned short targetPid, unsigned short affectedPid, unsigned short state) noexcept;
EXPORT_APIFUNCTION 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.
@ -178,11 +180,11 @@ namespace GUIFunctions
* \param state The state of the map marker (false to hide, true to reveal).
* \return void
*/
extern "C" void SetMapVisibilityAll(unsigned short targetPid, unsigned short state) noexcept;
EXPORT_APIFUNCTION void CDECL SetMapVisibilityAll(unsigned short targetPid, unsigned short state) noexcept;
// All methods below are deprecated versions of methods from above
extern "C" void InitializeQuickKeyChanges(unsigned short pid) noexcept;
EXPORT_APIFUNCTION void CDECL InitializeQuickKeyChanges(unsigned short pid) noexcept;
}
#endif //OPENMW_GUIAPI_HPP

@ -1,6 +1,8 @@
#ifndef OPENMW_ITEMAPI_HPP
#define OPENMW_ITEMAPI_HPP
#include <Script/Platform.hpp>
#define ITEMAPI \
{"ClearInventoryChanges", ItemFunctions::ClearInventoryChanges},\
\
@ -51,7 +53,7 @@ namespace ItemFunctions
* \param pid The player ID whose inventory changes should be used.
* \return void
*/
extern "C" void ClearInventoryChanges(unsigned short pid) noexcept;
EXPORT_APIFUNCTION void CDECL ClearInventoryChanges(unsigned short pid) noexcept;
/**
* \brief Get the number of slots used for equipment.
@ -60,7 +62,7 @@ namespace ItemFunctions
*
* \return The number of slots.
*/
extern "C" int GetEquipmentSize() noexcept;
EXPORT_APIFUNCTION int CDECL GetEquipmentSize() noexcept;
/**
* \brief Get the number of indexes in a player's latest inventory changes.
@ -68,7 +70,7 @@ namespace ItemFunctions
* \param pid The player ID whose inventory changes should be used.
* \return The number of indexes.
*/
extern "C" unsigned int GetInventoryChangesSize(unsigned short pid) noexcept;
EXPORT_APIFUNCTION unsigned CDECL int GetInventoryChangesSize(unsigned short pid) noexcept;
/**
* \brief Get the action type used in a player's latest inventory changes.
@ -76,7 +78,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).
*/
extern "C" unsigned int GetInventoryChangesAction(unsigned short pid) noexcept;
EXPORT_APIFUNCTION unsigned CDECL int GetInventoryChangesAction(unsigned short pid) noexcept;
/**
* \brief Set the action type in a player's inventory changes.
@ -85,7 +87,7 @@ namespace ItemFunctions
* \param action The action (0 for SET, 1 for ADD, 2 for REMOVE).
* \return void
*/
extern "C" void SetInventoryChangesAction(unsigned short pid, unsigned char action) noexcept;
EXPORT_APIFUNCTION void CDECL SetInventoryChangesAction(unsigned short pid, unsigned char action) noexcept;
/**
* \brief Equip an item in a certain slot of the equipment of a player.
@ -98,7 +100,7 @@ namespace ItemFunctions
* \param enchantmentCharge The enchantment charge of the item.
* \return void
*/
extern "C" void EquipItem(unsigned short pid, unsigned short slot, const char* refId, unsigned int count, int charge,
EXPORT_APIFUNCTION void CDECL EquipItem(unsigned short pid, unsigned short slot, const char* refId, unsigned int count, int charge,
double enchantmentCharge = -1) noexcept;
/**
@ -108,7 +110,7 @@ namespace ItemFunctions
* \param slot The equipment slot.
* \return void
*/
extern "C" void UnequipItem(unsigned short pid, unsigned short slot) noexcept;
EXPORT_APIFUNCTION void CDECL UnequipItem(unsigned short pid, unsigned short slot) noexcept;
/**
* \brief Add an item change to a player's inventory changes.
@ -121,7 +123,7 @@ namespace ItemFunctions
* \param soul The soul of the item.
* \return void
*/
extern "C" void AddItemChange(unsigned short pid, const char* refId, unsigned int count, int charge,
EXPORT_APIFUNCTION void CDECL AddItemChange(unsigned short pid, const char* refId, unsigned int count, int charge,
double enchantmentCharge, const char* soul) noexcept;
/**
@ -131,7 +133,7 @@ namespace ItemFunctions
* \param refId The refId of the item.
* \return Whether the player has the item equipped.
*/
extern "C" bool HasItemEquipped(unsigned short pid, const char* refId);
EXPORT_APIFUNCTION 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.
@ -140,7 +142,7 @@ namespace ItemFunctions
* \param slot The slot of the equipment item.
* \return The refId.
*/
extern "C" const char *GetEquipmentItemRefId(unsigned short pid, unsigned short slot) noexcept;
EXPORT_APIFUNCTION const CDECL char *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.
@ -149,7 +151,7 @@ namespace ItemFunctions
* \param slot The slot of the equipment item.
* \return The item count.
*/
extern "C" int GetEquipmentItemCount(unsigned short pid, unsigned short slot) noexcept;
EXPORT_APIFUNCTION 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.
@ -158,7 +160,7 @@ namespace ItemFunctions
* \param slot The slot of the equipment item.
* \return The charge.
*/
extern "C" int GetEquipmentItemCharge(unsigned short pid, unsigned short slot) noexcept;
EXPORT_APIFUNCTION 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
@ -168,7 +170,7 @@ namespace ItemFunctions
* \param slot The slot of the equipment item.
* \return The enchantment charge.
*/
extern "C" double GetEquipmentItemEnchantmentCharge(unsigned short pid, unsigned short slot) noexcept;
EXPORT_APIFUNCTION 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
@ -178,7 +180,7 @@ namespace ItemFunctions
* \param index The index of the inventory item.
* \return The refId.
*/
extern "C" const char *GetInventoryItemRefId(unsigned short pid, unsigned int index) noexcept;
EXPORT_APIFUNCTION const CDECL char *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
@ -188,7 +190,7 @@ namespace ItemFunctions
* \param index The index of the inventory item.
* \return The item count.
*/
extern "C" int GetInventoryItemCount(unsigned short pid, unsigned int index) noexcept;
EXPORT_APIFUNCTION 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
@ -198,7 +200,7 @@ namespace ItemFunctions
* \param index The index of the inventory item.
* \return The charge.
*/
extern "C" int GetInventoryItemCharge(unsigned short pid, unsigned int index) noexcept;
EXPORT_APIFUNCTION 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
@ -208,7 +210,7 @@ namespace ItemFunctions
* \param index The index of the inventory item.
* \return The enchantment charge.
*/
extern "C" double GetInventoryItemEnchantmentCharge(unsigned short pid, unsigned int index) noexcept;
EXPORT_APIFUNCTION 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
@ -218,7 +220,7 @@ namespace ItemFunctions
* \param index The index of the inventory item.
* \return The soul.
*/
extern "C" const char *GetInventoryItemSoul(unsigned short pid, unsigned int index) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetInventoryItemSoul(unsigned short pid, unsigned int index) noexcept;
/**
* \brief Get the refId of the item last used by a player.
@ -226,7 +228,7 @@ namespace ItemFunctions
* \param pid The player ID.
* \return The refId.
*/
extern "C" const char *GetUsedItemRefId(unsigned short pid) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetUsedItemRefId(unsigned short pid) noexcept;
/**
* \brief Get the count of the item last used by a player.
@ -234,7 +236,7 @@ namespace ItemFunctions
* \param pid The player ID.
* \return The item count.
*/
extern "C" int GetUsedItemCount(unsigned short pid) noexcept;
EXPORT_APIFUNCTION int CDECL GetUsedItemCount(unsigned short pid) noexcept;
/**
* \brief Get the charge of the item last used by a player.
@ -242,7 +244,7 @@ namespace ItemFunctions
* \param pid The player ID.
* \return The charge.
*/
extern "C" int GetUsedItemCharge(unsigned short pid) noexcept;
EXPORT_APIFUNCTION int CDECL GetUsedItemCharge(unsigned short pid) noexcept;
/**
* \brief Get the enchantment charge of the item last used by a player.
@ -250,7 +252,7 @@ namespace ItemFunctions
* \param pid The player ID.
* \return The enchantment charge.
*/
extern "C" double GetUsedItemEnchantmentCharge(unsigned short pid) noexcept;
EXPORT_APIFUNCTION double CDECL GetUsedItemEnchantmentCharge(unsigned short pid) noexcept;
/**
* \brief Get the soul of the item last used by a player.
@ -258,7 +260,7 @@ namespace ItemFunctions
* \param pid The player ID.
* \return The soul.
*/
extern "C" const char *GetUsedItemSoul(unsigned short pid) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetUsedItemSoul(unsigned short pid) noexcept;
/**
* \brief Send a PlayerEquipment packet with a player's equipment.
@ -268,7 +270,7 @@ namespace ItemFunctions
* \param pid The player ID whose equipment should be sent.
* \return void
*/
extern "C" void SendEquipment(unsigned short pid) noexcept;
EXPORT_APIFUNCTION void CDECL SendEquipment(unsigned short pid) noexcept;
/**
* \brief Send a PlayerInventory packet with a player's recorded inventory changes.
@ -280,7 +282,7 @@ namespace ItemFunctions
* to the packet (false by default).
* \return void
*/
extern "C" void SendInventoryChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
EXPORT_APIFUNCTION void CDECL SendInventoryChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
/**
* \brief Send a PlayerItemUse causing a player to use their recorded usedItem.
@ -288,13 +290,13 @@ namespace ItemFunctions
* \param pid The player ID affected.
* \return void
*/
extern "C" void SendItemUse(unsigned short pid) noexcept;
EXPORT_APIFUNCTION void CDECL SendItemUse(unsigned short pid) noexcept;
// All methods below are deprecated versions of methods from above
extern "C" void InitializeInventoryChanges(unsigned short pid) noexcept;
EXPORT_APIFUNCTION void CDECL InitializeInventoryChanges(unsigned short pid) noexcept;
extern "C" void AddItem(unsigned short pid, const char* refId, unsigned int count, int charge,
EXPORT_APIFUNCTION void CDECL AddItem(unsigned short pid, const char* refId, unsigned int count, int charge,
double enchantmentCharge, const char* soul) noexcept;
}

@ -3,6 +3,8 @@
#include "../Types.hpp"
#include <Script/Platform.hpp>
#define MECHANICSAPI \
{"GetMiscellaneousChangeType", MechanicsFunctions::GetMiscellaneousChangeType},\
\
@ -46,7 +48,7 @@ namespace MechanicsFunctions
* \param pid The player ID.
* \return The type.
*/
extern "C" unsigned char GetMiscellaneousChangeType(unsigned short pid) noexcept;
EXPORT_APIFUNCTION unsigned CDECL char GetMiscellaneousChangeType(unsigned short pid) noexcept;
/**
* \brief Get the cell description of a player's Mark cell.
@ -54,7 +56,7 @@ namespace MechanicsFunctions
* \param pid The player ID.
* \return The cell description.
*/
extern "C" const char *GetMarkCell(unsigned short pid) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetMarkCell(unsigned short pid) noexcept;
/**
* \brief Get the X position of a player's Mark.
@ -62,7 +64,7 @@ namespace MechanicsFunctions
* \param pid The player ID.
* \return The X position.
*/
extern "C" double GetMarkPosX(unsigned short pid) noexcept;
EXPORT_APIFUNCTION double CDECL GetMarkPosX(unsigned short pid) noexcept;
/**
* \brief Get the Y position of a player's Mark.
@ -70,7 +72,7 @@ namespace MechanicsFunctions
* \param pid The player ID.
* \return The Y position.
*/
extern "C" double GetMarkPosY(unsigned short pid) noexcept;
EXPORT_APIFUNCTION double CDECL GetMarkPosY(unsigned short pid) noexcept;
/**
* \brief Get the Z position of a player's Mark.
@ -78,7 +80,7 @@ namespace MechanicsFunctions
* \param pid The player ID.
* \return The Z position.
*/
extern "C" double GetMarkPosZ(unsigned short pid) noexcept;
EXPORT_APIFUNCTION double CDECL GetMarkPosZ(unsigned short pid) noexcept;
/**
* \brief Get the X rotation of a player's Mark.
@ -86,7 +88,7 @@ namespace MechanicsFunctions
* \param pid The player ID.
* \return The X rotation.
*/
extern "C" double GetMarkRotX(unsigned short pid) noexcept;
EXPORT_APIFUNCTION double CDECL GetMarkRotX(unsigned short pid) noexcept;
/**
* \brief Get the Z rotation of a player's Mark.
@ -94,7 +96,7 @@ namespace MechanicsFunctions
* \param pid The player ID.
* \return The X rotation.
*/
extern "C" double GetMarkRotZ(unsigned short pid) noexcept;
EXPORT_APIFUNCTION double CDECL GetMarkRotZ(unsigned short pid) noexcept;
/**
* \brief Get the ID of a player's selected spell.
@ -102,7 +104,7 @@ namespace MechanicsFunctions
* \param pid The player ID.
* \return The spell ID.
*/
extern "C" const char *GetSelectedSpellId(unsigned short pid) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetSelectedSpellId(unsigned short pid) noexcept;
/**
* \brief Check whether the killer of a certain player is also a player.
@ -110,7 +112,7 @@ namespace MechanicsFunctions
* \param pid The player ID of the killed player.
* \return Whether the player was killed by another player.
*/
extern "C" bool DoesPlayerHavePlayerKiller(unsigned short pid) noexcept;
EXPORT_APIFUNCTION bool CDECL DoesPlayerHavePlayerKiller(unsigned short pid) noexcept;
/**
* \brief Get the player ID of the killer of a certain player.
@ -118,7 +120,7 @@ namespace MechanicsFunctions
* \param pid The player ID of the killed player.
* \return The player ID of the killer.
*/
extern "C" int GetPlayerKillerPid(unsigned short pid) noexcept;
EXPORT_APIFUNCTION int CDECL GetPlayerKillerPid(unsigned short pid) noexcept;
/**
* \brief Get the refId of the actor killer of a certain player.
@ -126,7 +128,7 @@ namespace MechanicsFunctions
* \param pid The player ID of the killed player.
* \return The refId of the killer.
*/
extern "C" const char *GetPlayerKillerRefId(unsigned short pid) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetPlayerKillerRefId(unsigned short pid) noexcept;
/**
* \brief Get the refNum of the actor killer of a certain player.
@ -134,7 +136,7 @@ namespace MechanicsFunctions
* \param pid The player ID of the killed player.
* \return The refNum of the killer.
*/
extern "C" unsigned int GetPlayerKillerRefNum(unsigned short pid) noexcept;
EXPORT_APIFUNCTION unsigned CDECL int GetPlayerKillerRefNum(unsigned short pid) noexcept;
/**
* \brief Get the mpNum of the actor killer of a certain player.
@ -142,7 +144,7 @@ namespace MechanicsFunctions
* \param pid The player ID of the killed player.
* \return The mpNum of the killer.
*/
extern "C" unsigned int GetPlayerKillerMpNum(unsigned short pid) noexcept;
EXPORT_APIFUNCTION unsigned CDECL int GetPlayerKillerMpNum(unsigned short pid) noexcept;
/**
* \brief Get the name of the actor killer of a certain player.
@ -150,7 +152,7 @@ namespace MechanicsFunctions
* \param pid The player ID of the killed player.
* \return The name of the killer.
*/
extern "C" const char *GetPlayerKillerName(unsigned short pid) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetPlayerKillerName(unsigned short pid) noexcept;
/**
* \brief Get the draw state of a player (0 for nothing, 1 for drawn weapon,
@ -159,7 +161,7 @@ namespace MechanicsFunctions
* \param pid The player ID.
* \return The draw state.
*/
extern "C" unsigned int GetDrawState(unsigned short pid) noexcept;
EXPORT_APIFUNCTION unsigned CDECL int GetDrawState(unsigned short pid) noexcept;
/**
* \brief Get the sneak state of a player.
@ -167,7 +169,7 @@ namespace MechanicsFunctions
* \param pid The player ID.
* \return Whether the player is sneaking.
*/
extern "C" bool GetSneakState(unsigned short pid) noexcept;
EXPORT_APIFUNCTION bool CDECL GetSneakState(unsigned short pid) noexcept;
/**
* \brief Set the Mark cell of a player.
@ -182,7 +184,7 @@ namespace MechanicsFunctions
* \param cellDescription The cell description.
* \return void
*/
extern "C" void SetMarkCell(unsigned short pid, const char *cellDescription) noexcept;
EXPORT_APIFUNCTION void CDECL SetMarkCell(unsigned short pid, const char *cellDescription) noexcept;
/**
* \brief Set the Mark position of a player.
@ -196,7 +198,7 @@ namespace MechanicsFunctions
* \param z The Z position.
* \return void
*/
extern "C" void SetMarkPos(unsigned short pid, double x, double y, double z) noexcept;
EXPORT_APIFUNCTION void CDECL SetMarkPos(unsigned short pid, double x, double y, double z) noexcept;
/**
* \brief Set the Mark rotation of a player.
@ -209,7 +211,7 @@ namespace MechanicsFunctions
* \param z The Z rotation.
* \return void
*/
extern "C" void SetMarkRot(unsigned short pid, double x, double z) noexcept;
EXPORT_APIFUNCTION void CDECL SetMarkRot(unsigned short pid, double x, double z) noexcept;
/**
* \brief Set the ID of a player's selected spell.
@ -221,7 +223,7 @@ namespace MechanicsFunctions
* \param spellId The spell ID.
* \return void
*/
extern "C" void SetSelectedSpellId(unsigned short pid, const char *spellId) noexcept;
EXPORT_APIFUNCTION void CDECL SetSelectedSpellId(unsigned short pid, const char *spellId) noexcept;
/**
* \brief Send a PlayerMiscellaneous packet with a Mark location to a player.
@ -229,7 +231,7 @@ namespace MechanicsFunctions
* \param pid The player ID.
* \return void
*/
extern "C" void SendMarkLocation(unsigned short pid);
EXPORT_APIFUNCTION void CDECL SendMarkLocation(unsigned short pid);
/**
* \brief Send a PlayerMiscellaneous packet with a selected spell ID to a player.
@ -237,7 +239,7 @@ namespace MechanicsFunctions
* \param pid The player ID.
* \return void
*/
extern "C" void SendSelectedSpell(unsigned short pid);
EXPORT_APIFUNCTION void CDECL SendSelectedSpell(unsigned short pid);
/**
* \brief Send a PlayerJail packet about a player.
@ -259,7 +261,7 @@ namespace MechanicsFunctions
* \param jailEndText The text that should be displayed once the jailing period is over.
* \return void
*/
extern "C" void Jail(unsigned short pid, int jailDays, bool ignoreJailTeleportation, bool ignoreJailSkillIncreases,
EXPORT_APIFUNCTION void CDECL Jail(unsigned short pid, int jailDays, bool ignoreJailTeleportation, bool ignoreJailSkillIncreases,
const char* jailProgressText, const char* jailEndText) noexcept;
/**
@ -272,12 +274,12 @@ namespace MechanicsFunctions
* 2 for TRIBUNAL_TEMPLE).
* \return void
*/
extern "C" void Resurrect(unsigned short pid, unsigned int type) noexcept;
EXPORT_APIFUNCTION void CDECL Resurrect(unsigned short pid, unsigned int type) noexcept;
// All methods below are deprecated versions of methods from above
extern "C" const char *GetDeathReason(unsigned short pid) noexcept;
extern "C" unsigned int GetPlayerKillerRefNumIndex(unsigned short pid) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetDeathReason(unsigned short pid) noexcept;
EXPORT_APIFUNCTION unsigned CDECL int GetPlayerKillerRefNumIndex(unsigned short pid) noexcept;
}
#endif //OPENMW_MECHANICSAPI_HPP

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

@ -1,6 +1,8 @@
#ifndef OPENMW_OBJECTAPI_HPP
#define OPENMW_OBJECTAPI_HPP
#include <Script/Platform.hpp>
#define OBJECTAPI \
{"ReadReceivedObjectList", ObjectFunctions::ReadReceivedObjectList},\
\
@ -143,14 +145,14 @@ namespace ObjectFunctions
*
* \return void
*/
extern "C" void ReadReceivedObjectList() noexcept;
EXPORT_APIFUNCTION void CDECL ReadReceivedObjectList() noexcept;
/**
* \brief Clear the data from the object list stored on the server.
*
* \return void
*/
extern "C" void ClearObjectList() noexcept;
EXPORT_APIFUNCTION void CDECL ClearObjectList() noexcept;
/**
* \brief Set the pid attached to the ObjectList.
@ -158,7 +160,7 @@ namespace ObjectFunctions
* \param pid The player ID to whom the object list should be attached.
* \return void
*/
extern "C" void SetObjectListPid(unsigned short pid) noexcept;
EXPORT_APIFUNCTION void CDECL SetObjectListPid(unsigned short pid) noexcept;
/**
* \brief Take the contents of the read-only object list last received by the
@ -167,14 +169,14 @@ namespace ObjectFunctions
*
* \return void
*/
extern "C" void CopyReceivedObjectListToStore() noexcept;
EXPORT_APIFUNCTION void CDECL CopyReceivedObjectListToStore() noexcept;
/**
* \brief Get the number of indexes in the read object list.
*
* \return The number of indexes.
*/
extern "C" unsigned int GetObjectListSize() noexcept;
EXPORT_APIFUNCTION unsigned CDECL int GetObjectListSize() noexcept;
/**
* \brief Get the origin of the read object list.
@ -183,7 +185,7 @@ namespace ObjectFunctions
* CLIENT_DIALOGUE, 3 for CLIENT_SCRIPT_LOCAL, 4 for CLIENT_SCRIPT_GLOBAL,
* 5 for SERVER_SCRIPT).
*/
extern "C" unsigned char GetObjectListOrigin() noexcept;
EXPORT_APIFUNCTION unsigned CDECL char GetObjectListOrigin() noexcept;
/**
* \brief Get the client script that the read object list originated from.
@ -192,21 +194,21 @@ namespace ObjectFunctions
*
* \return The ID of the client script.
*/
extern "C" const char *GetObjectListClientScript() noexcept;
EXPORT_APIFUNCTION const CDECL char *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).
*/
extern "C" unsigned char GetObjectListAction() noexcept;
EXPORT_APIFUNCTION unsigned CDECL char 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).
*/
extern "C" unsigned char GetObjectListContainerSubAction() noexcept;
EXPORT_APIFUNCTION unsigned CDECL char GetObjectListContainerSubAction() noexcept;
/**
* \brief Check whether the object at a certain index in the read object list is a
@ -219,7 +221,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return Whether the object is a player.
*/
extern "C" bool IsObjectPlayer(unsigned int index) noexcept;
EXPORT_APIFUNCTION bool CDECL IsObjectPlayer(unsigned int index) noexcept;
/**
* \brief Get the player ID of the object at a certain index in the read object list,
@ -231,7 +233,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The player ID of the object.
*/
extern "C" int GetObjectPid(unsigned int index) noexcept;
EXPORT_APIFUNCTION int CDECL GetObjectPid(unsigned int index) noexcept;
/**
* \brief Get the refId of the object at a certain index in the read object list.
@ -239,7 +241,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The refId.
*/
extern "C" const char *GetObjectRefId(unsigned int index) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetObjectRefId(unsigned int index) noexcept;
/**
* \brief Get the refNum of the object at a certain index in the read object list.
@ -247,7 +249,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The refNum.
*/
extern "C" unsigned int GetObjectRefNum(unsigned int index) noexcept;
EXPORT_APIFUNCTION unsigned CDECL int GetObjectRefNum(unsigned int index) noexcept;
/**
* \brief Get the mpNum of the object at a certain index in the read object list.
@ -255,7 +257,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The mpNum.
*/
extern "C" unsigned int GetObjectMpNum(unsigned int index) noexcept;
EXPORT_APIFUNCTION unsigned CDECL int GetObjectMpNum(unsigned int index) noexcept;
/**
* \brief Get the count of the object at a certain index in the read object list.
@ -263,7 +265,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The object count.
*/
extern "C" int GetObjectCount(unsigned int index) noexcept;
EXPORT_APIFUNCTION int CDECL GetObjectCount(unsigned int index) noexcept;
/**
* \brief Get the charge of the object at a certain index in the read object list.
@ -271,7 +273,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The charge.
*/
extern "C" int GetObjectCharge(unsigned int index) noexcept;
EXPORT_APIFUNCTION int CDECL GetObjectCharge(unsigned int index) noexcept;
/**
* \brief Get the enchantment charge of the object at a certain index in the read object list.
@ -279,7 +281,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The enchantment charge.
*/
extern "C" double GetObjectEnchantmentCharge(unsigned int index) noexcept;
EXPORT_APIFUNCTION double CDECL GetObjectEnchantmentCharge(unsigned int index) noexcept;
/**
* \brief Get the soul of the object at a certain index in the read object list.
@ -287,7 +289,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The soul.
*/
extern "C" const char *GetObjectSoul(unsigned int index) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetObjectSoul(unsigned int index) noexcept;
/**
* \brief Get the gold value of the object at a certain index in the read object list.
@ -297,7 +299,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The gold value.
*/
extern "C" int GetObjectGoldValue(unsigned int index) noexcept;
EXPORT_APIFUNCTION int CDECL GetObjectGoldValue(unsigned int index) noexcept;
/**
* \brief Get the object scale of the object at a certain index in the read object list.
@ -305,7 +307,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The object scale.
*/
extern "C" double GetObjectScale(unsigned int index) noexcept;
EXPORT_APIFUNCTION double CDECL GetObjectScale(unsigned int index) noexcept;
/**
* \brief Get the object state of the object at a certain index in the read object list.
@ -313,7 +315,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The object state.
*/
extern "C" bool GetObjectState(unsigned int index) noexcept;
EXPORT_APIFUNCTION bool CDECL GetObjectState(unsigned int index) noexcept;
/**
* \brief Get the door state of the object at a certain index in the read object list.
@ -321,7 +323,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The door state.
*/
extern "C" int GetObjectDoorState(unsigned int index) noexcept;
EXPORT_APIFUNCTION int CDECL GetObjectDoorState(unsigned int index) noexcept;
/**
* \brief Get the lock level of the object at a certain index in the read object list.
@ -329,7 +331,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The lock level.
*/
extern "C" int GetObjectLockLevel(unsigned int index) noexcept;
EXPORT_APIFUNCTION int CDECL GetObjectLockLevel(unsigned int index) noexcept;
/**
* \brief Check whether the object at a certain index in the read object list has been
@ -338,7 +340,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return Whether the object has been activated by a player.
*/
extern "C" bool DoesObjectHavePlayerActivating(unsigned int index) noexcept;
EXPORT_APIFUNCTION bool CDECL DoesObjectHavePlayerActivating(unsigned int index) noexcept;
/**
* \brief Get the player ID of the player activating the object at a certain index in the
@ -347,7 +349,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The player ID of the activating player.
*/
extern "C" int GetObjectActivatingPid(unsigned int index) noexcept;
EXPORT_APIFUNCTION int CDECL GetObjectActivatingPid(unsigned int index) noexcept;
/**
* \brief Get the refId of the actor activating the object at a certain index in the read
@ -356,7 +358,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The refId of the activating actor.
*/
extern "C" const char *GetObjectActivatingRefId(unsigned int index) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetObjectActivatingRefId(unsigned int index) noexcept;
/**
* \brief Get the refNum of the actor activating the object at a certain index in the read
@ -365,7 +367,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The refNum of the activating actor.
*/
extern "C" unsigned int GetObjectActivatingRefNum(unsigned int index) noexcept;
EXPORT_APIFUNCTION unsigned CDECL int GetObjectActivatingRefNum(unsigned int index) noexcept;
/**
* \brief Get the mpNum of the actor activating the object at a certain index in the read
@ -374,7 +376,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The mpNum of the activating actor.
*/
extern "C" unsigned int GetObjectActivatingMpNum(unsigned int index) noexcept;
EXPORT_APIFUNCTION unsigned CDECL int GetObjectActivatingMpNum(unsigned int index) noexcept;
/**
* \brief Get the name of the actor activating the object at a certain index in the read
@ -383,7 +385,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The name of the activating actor.
*/
extern "C" const char *GetObjectActivatingName(unsigned int index) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetObjectActivatingName(unsigned int index) noexcept;
/**
* \brief Check whether the object at a certain index in the read object list is a
@ -393,7 +395,7 @@ namespace ObjectFunctions
*
* \return The summon state.
*/
extern "C" bool GetObjectSummonState(unsigned int index) noexcept;
EXPORT_APIFUNCTION bool CDECL GetObjectSummonState(unsigned int index) noexcept;
/**
* \brief Get the summon duration of the object at a certain index in the read object list.
@ -403,7 +405,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The summon duration.
*/
extern "C" double GetObjectSummonDuration(unsigned int index) noexcept;
EXPORT_APIFUNCTION double CDECL GetObjectSummonDuration(unsigned int index) noexcept;
/**
* \brief Check whether the object at a certain index in the read object list has a player
@ -414,7 +416,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return Whether a player is the summoner of the object.
*/
extern "C" bool DoesObjectHavePlayerSummoner(unsigned int index) noexcept;
EXPORT_APIFUNCTION 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
@ -423,7 +425,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The player ID of the summoner.
*/
extern "C" int GetObjectSummonerPid(unsigned int index) noexcept;
EXPORT_APIFUNCTION 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
@ -432,7 +434,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The refId of the summoner.
*/
extern "C" const char *GetObjectSummonerRefId(unsigned int index) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetObjectSummonerRefId(unsigned int index) noexcept;
/**
* \brief Get the refNum of the actor summoner of the object at a certain index in the read object
@ -441,7 +443,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The refNum of the summoner.
*/
extern "C" unsigned int GetObjectSummonerRefNum(unsigned int index) noexcept;
EXPORT_APIFUNCTION unsigned CDECL int 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.
@ -449,7 +451,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The mpNum of the summoner.
*/
extern "C" unsigned int GetObjectSummonerMpNum(unsigned int index) noexcept;
EXPORT_APIFUNCTION unsigned CDECL int GetObjectSummonerMpNum(unsigned int index) noexcept;
/**
* \brief Get the X position of the object at a certain index in the read object list.
@ -457,7 +459,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The X position.
*/
extern "C" double GetObjectPosX(unsigned int index) noexcept;
EXPORT_APIFUNCTION double CDECL GetObjectPosX(unsigned int index) noexcept;
/**
* \brief Get the Y position of the object at a certain index in the read object list.
@ -465,7 +467,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The Y position.
*/
extern "C" double GetObjectPosY(unsigned int index) noexcept;
EXPORT_APIFUNCTION double CDECL GetObjectPosY(unsigned int index) noexcept;
/**
* \brief Get the Z position at a certain index in the read object list.
@ -473,7 +475,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The Z position.
*/
extern "C" double GetObjectPosZ(unsigned int index) noexcept;
EXPORT_APIFUNCTION double CDECL GetObjectPosZ(unsigned int index) noexcept;
/**
* \brief Get the X rotation of the object at a certain index in the read object list.
@ -481,7 +483,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The X rotation.
*/
extern "C" double GetObjectRotX(unsigned int index) noexcept;
EXPORT_APIFUNCTION double CDECL GetObjectRotX(unsigned int index) noexcept;
/**
* \brief Get the Y rotation of the object at a certain index in the read object list.
@ -489,7 +491,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The Y rotation.
*/
extern "C" double GetObjectRotY(unsigned int index) noexcept;
EXPORT_APIFUNCTION double CDECL GetObjectRotY(unsigned int index) noexcept;
/**
* \brief Get the Z rotation of the object at a certain index in the read object list.
@ -497,14 +499,14 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The Z rotation.
*/
extern "C" double GetObjectRotZ(unsigned int index) noexcept;
EXPORT_APIFUNCTION 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.
*/
extern "C" const char *GetVideoFilename(unsigned int index) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetVideoFilename(unsigned int index) noexcept;
/**
* \brief Get the number of container item indexes of the object at a certain index in the
@ -513,7 +515,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return The number of container item indexes.
*/
extern "C" unsigned int GetContainerChangesSize(unsigned int objectIndex) noexcept;
EXPORT_APIFUNCTION unsigned CDECL int GetContainerChangesSize(unsigned int objectIndex) noexcept;
/**
* \brief Get the refId of the container item at a certain itemIndex in the container changes
@ -523,7 +525,7 @@ namespace ObjectFunctions
* \param itemIndex The index of the container item.
* \return The refId.
*/
extern "C" const char *GetContainerItemRefId(unsigned int objectIndex, unsigned int itemIndex) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetContainerItemRefId(unsigned int objectIndex, unsigned int itemIndex) noexcept;
/**
* \brief Get the item count of the container item at a certain itemIndex in the container
@ -533,7 +535,7 @@ namespace ObjectFunctions
* \param itemIndex The index of the container item.
* \return The item count.
*/
extern "C" int GetContainerItemCount(unsigned int objectIndex, unsigned int itemIndex) noexcept;
EXPORT_APIFUNCTION 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
@ -543,7 +545,7 @@ namespace ObjectFunctions
* \param itemIndex The index of the container item.
* \return The charge.
*/
extern "C" int GetContainerItemCharge(unsigned int objectIndex, unsigned int itemIndex) noexcept;
EXPORT_APIFUNCTION 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
@ -553,7 +555,7 @@ namespace ObjectFunctions
* \param itemIndex The index of the container item.
* \return The enchantment charge.
*/
extern "C" double GetContainerItemEnchantmentCharge(unsigned int objectIndex, unsigned int itemIndex) noexcept;
EXPORT_APIFUNCTION 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
@ -563,7 +565,7 @@ namespace ObjectFunctions
* \param itemIndex The index of the container item.
* \return The soul.
*/
extern "C" const char *GetContainerItemSoul(unsigned int objectIndex, unsigned int itemIndex) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetContainerItemSoul(unsigned int objectIndex, unsigned int itemIndex) noexcept;
/**
* \brief Get the action count of the container item at a certain itemIndex in the container
@ -573,7 +575,7 @@ namespace ObjectFunctions
* \param itemIndex The index of the container item.
* \return The action count.
*/
extern "C" int GetContainerItemActionCount(unsigned int objectIndex, unsigned int itemIndex) noexcept;
EXPORT_APIFUNCTION 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.
@ -584,7 +586,7 @@ namespace ObjectFunctions
* \param index The index of the object.
* \return Whether the object has a container.
*/
extern "C" bool DoesObjectHaveContainer(unsigned int index) noexcept;
EXPORT_APIFUNCTION bool CDECL DoesObjectHaveContainer(unsigned int index) noexcept;
/**
* \brief Set the cell of the temporary object list stored on the server.
@ -595,7 +597,7 @@ namespace ObjectFunctions
* \param cellDescription The description of the cell.
* \return void
*/
extern "C" void SetObjectListCell(const char* cellDescription) noexcept;
EXPORT_APIFUNCTION void CDECL SetObjectListCell(const char* cellDescription) noexcept;
/**
* \brief Set the action type of the temporary object list stored on the server.
@ -603,7 +605,7 @@ namespace ObjectFunctions
* \param action The action type (0 for SET, 1 for ADD, 2 for REMOVE, 3 for REQUEST).
* \return void
*/
extern "C" void SetObjectListAction(unsigned char action) noexcept;
EXPORT_APIFUNCTION void CDECL SetObjectListAction(unsigned char action) noexcept;
/**
* \brief Set the console command of the temporary object list stored on the server.
@ -614,7 +616,7 @@ namespace ObjectFunctions
* \param consoleCommand The console command.
* \return void
*/
extern "C" void SetObjectListConsoleCommand(const char* consoleCommand) noexcept;
EXPORT_APIFUNCTION void CDECL SetObjectListConsoleCommand(const char* consoleCommand) noexcept;
/**
* \brief Set the refId of the temporary object stored on the server.
@ -622,7 +624,7 @@ namespace ObjectFunctions
* \param refId The refId.
* \return void
*/
extern "C" void SetObjectRefId(const char* refId) noexcept;
EXPORT_APIFUNCTION void CDECL SetObjectRefId(const char* refId) noexcept;
/**
* \brief Set the refNum of the temporary object stored on the server.
@ -636,7 +638,7 @@ namespace ObjectFunctions
* \param refNum The refNum.
* \return void
*/
extern "C" void SetObjectRefNum(int refNum) noexcept;
EXPORT_APIFUNCTION void CDECL SetObjectRefNum(int refNum) noexcept;
/**
* \brief Set the mpNum of the temporary object stored on the server.
@ -651,7 +653,7 @@ namespace ObjectFunctions
* \param mpNum The mpNum.
* \return void
*/
extern "C" void SetObjectMpNum(int mpNum) noexcept;
EXPORT_APIFUNCTION void CDECL SetObjectMpNum(int mpNum) noexcept;
/**
* \brief Set the object count of the temporary object stored on the server.
@ -661,7 +663,7 @@ namespace ObjectFunctions
* \param count The object count.
* \return void
*/
extern "C" void SetObjectCount(int count) noexcept;
EXPORT_APIFUNCTION void CDECL SetObjectCount(int count) noexcept;
/**
* \brief Set the charge of the temporary object stored on the server.
@ -671,7 +673,7 @@ namespace ObjectFunctions
* \param charge The charge.
* \return void
*/
extern "C" void SetObjectCharge(int charge) noexcept;
EXPORT_APIFUNCTION void CDECL SetObjectCharge(int charge) noexcept;
/**
* \brief Set the enchantment charge of the temporary object stored on the server.
@ -681,7 +683,7 @@ namespace ObjectFunctions
* \param charge The enchantment charge.
* \return void
*/
extern "C" void SetObjectEnchantmentCharge(double enchantmentCharge) noexcept;
EXPORT_APIFUNCTION void CDECL SetObjectEnchantmentCharge(double enchantmentCharge) noexcept;
/**
* \brief Set the soul of the temporary object stored on the server.
@ -689,7 +691,7 @@ namespace ObjectFunctions
* \param refId The soul.
* \return void
*/
extern "C" void SetObjectSoul(const char* soul) noexcept;
EXPORT_APIFUNCTION void CDECL SetObjectSoul(const char* soul) noexcept;
/**
* \brief Set the gold value of the temporary object stored on the server.
@ -699,7 +701,7 @@ namespace ObjectFunctions
* \param goldValue The gold value.
* \return void
*/
extern "C" void SetObjectGoldValue(int goldValue) noexcept;
EXPORT_APIFUNCTION void CDECL SetObjectGoldValue(int goldValue) noexcept;
/**
* \brief Set the scale of the temporary object stored on the server.
@ -709,7 +711,7 @@ namespace ObjectFunctions
* \param scale The scale.
* \return void
*/
extern "C" void SetObjectScale(double scale) noexcept;
EXPORT_APIFUNCTION void CDECL SetObjectScale(double scale) noexcept;
/**
* \brief Set the object state of the temporary object stored on the server.
@ -719,7 +721,7 @@ namespace ObjectFunctions
* \param objectState The object state.
* \return void
*/
extern "C" void SetObjectState(bool objectState) noexcept;
EXPORT_APIFUNCTION void CDECL SetObjectState(bool objectState) noexcept;
/**
* \brief Set the lock level of the temporary object stored on the server.
@ -727,7 +729,7 @@ namespace ObjectFunctions
* \param lockLevel The lock level.
* \return void
*/
extern "C" void SetObjectLockLevel(int lockLevel) noexcept;
EXPORT_APIFUNCTION void CDECL SetObjectLockLevel(int lockLevel) noexcept;
/**
* \brief Set the summon duration of the temporary object stored on the server.
@ -735,7 +737,7 @@ namespace ObjectFunctions
* \param summonDuration The summon duration.
* \return void
*/
extern "C" void SetObjectSummonDuration(float summonDuration) noexcept;
EXPORT_APIFUNCTION void CDECL SetObjectSummonDuration(float summonDuration) noexcept;
/**
* \brief Set the disarm state of the temporary object stored on the server.
@ -743,7 +745,7 @@ namespace ObjectFunctions
* \param disarmState The disarmState.
* \return void
*/
extern "C" void SetObjectDisarmState(bool disarmState) noexcept;
EXPORT_APIFUNCTION void CDECL SetObjectDisarmState(bool disarmState) noexcept;
/**
* \brief Set the summon state of the temporary object stored on the server.
@ -754,7 +756,7 @@ namespace ObjectFunctions
* \param summonState The summon state.
* \return void
*/
extern "C" void SetObjectSummonState(bool summonState) noexcept;
EXPORT_APIFUNCTION void CDECL SetObjectSummonState(bool summonState) noexcept;
/**
* \brief Set the position of the temporary object stored on the server.
@ -764,7 +766,7 @@ namespace ObjectFunctions
* \param z The Z position.
* \return void
*/
extern "C" void SetObjectPosition(double x, double y, double z) noexcept;
EXPORT_APIFUNCTION void CDECL SetObjectPosition(double x, double y, double z) noexcept;
/**
* \brief Set the rotation of the temporary object stored on the server.
@ -774,7 +776,7 @@ namespace ObjectFunctions
* \param z The Z rotation.
* \return void
*/
extern "C" void SetObjectRotation(double x, double y, double z) noexcept;
EXPORT_APIFUNCTION 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
@ -783,7 +785,7 @@ namespace ObjectFunctions
* \param pid The pid of the player.
* \return void
*/
extern "C" void SetObjectActivatingPid(unsigned short pid) noexcept;
EXPORT_APIFUNCTION void CDECL SetObjectActivatingPid(unsigned short pid) noexcept;
/**
* \brief Set the door state of the temporary object stored on the server.
@ -793,7 +795,7 @@ namespace ObjectFunctions
* \param doorState The door state.
* \return void
*/
extern "C" void SetObjectDoorState(int doorState) noexcept;
EXPORT_APIFUNCTION void CDECL SetObjectDoorState(int doorState) noexcept;
/**
* \brief Set the teleport state of the temporary object stored on the server.
@ -804,7 +806,7 @@ namespace ObjectFunctions
* \param teleportState The teleport state.
* \return void
*/
extern "C" void SetObjectDoorTeleportState(bool teleportState) noexcept;
EXPORT_APIFUNCTION void CDECL SetObjectDoorTeleportState(bool teleportState) noexcept;
/**
* \brief Set the door destination cell of the temporary object stored on the server.
@ -815,7 +817,7 @@ namespace ObjectFunctions
* \param cellDescription The description of the cell.
* \return void
*/
extern "C" void SetObjectDoorDestinationCell(const char* cellDescription) noexcept;
EXPORT_APIFUNCTION void CDECL SetObjectDoorDestinationCell(const char* cellDescription) noexcept;
/**
* \brief Set the door destination position of the temporary object stored on the server.
@ -825,7 +827,7 @@ namespace ObjectFunctions
* \param z The Z position.
* \return void
*/
extern "C" void SetObjectDoorDestinationPosition(double x, double y, double z) noexcept;
EXPORT_APIFUNCTION void CDECL SetObjectDoorDestinationPosition(double x, double y, double z) noexcept;
/**
* \brief Set the door destination rotation of the temporary object stored on the server.
@ -837,7 +839,7 @@ namespace ObjectFunctions
* \param z The Z rotation.
* \return void
*/
extern "C" void SetObjectDoorDestinationRotation(double x, double z) noexcept;
EXPORT_APIFUNCTION void CDECL SetObjectDoorDestinationRotation(double x, double z) noexcept;
/**
* \brief Set a player as the object in the temporary object stored on the server.
@ -846,7 +848,7 @@ namespace ObjectFunctions
* \param pid The pid of the player.
* \return void
*/
extern "C" void SetPlayerAsObject(unsigned short pid) noexcept;
EXPORT_APIFUNCTION void CDECL SetPlayerAsObject(unsigned short pid) noexcept;
/**
* \brief Set the refId of the temporary container item stored on the server.
@ -854,7 +856,7 @@ namespace ObjectFunctions
* \param refId The refId.
* \return void
*/
extern "C" void SetContainerItemRefId(const char* refId) noexcept;
EXPORT_APIFUNCTION void CDECL SetContainerItemRefId(const char* refId) noexcept;
/**
* \brief Set the item count of the temporary container item stored on the server.
@ -862,7 +864,7 @@ namespace ObjectFunctions
* \param count The item count.
* \return void
*/
extern "C" void SetContainerItemCount(int count) noexcept;
EXPORT_APIFUNCTION void CDECL SetContainerItemCount(int count) noexcept;
/**
* \brief Set the charge of the temporary container item stored on the server.
@ -870,7 +872,7 @@ namespace ObjectFunctions
* \param charge The charge.
* \return void
*/
extern "C" void SetContainerItemCharge(int charge) noexcept;
EXPORT_APIFUNCTION void CDECL SetContainerItemCharge(int charge) noexcept;
/**
* \brief Set the enchantment charge of the temporary container item stored on the server.
@ -878,7 +880,7 @@ namespace ObjectFunctions
* \param charge The enchantment charge.
* \return void
*/
extern "C" void SetContainerItemEnchantmentCharge(double enchantmentCharge) noexcept;
EXPORT_APIFUNCTION void CDECL SetContainerItemEnchantmentCharge(double enchantmentCharge) noexcept;
/**
* \brief Set the soul of the temporary container item stored on the server.
@ -886,7 +888,7 @@ namespace ObjectFunctions
* \param refId The soul.
* \return void
*/
extern "C" void SetContainerItemSoul(const char* soul) noexcept;
EXPORT_APIFUNCTION void CDECL SetContainerItemSoul(const char* soul) noexcept;
/**
* \brief Set the action count of the container item at a certain itemIndex in the container
@ -901,7 +903,7 @@ namespace ObjectFunctions
* \param actionCount The action count.
* \return void
*/
extern "C" void SetContainerItemActionCountByIndex(unsigned int objectIndex, unsigned int itemIndex, int actionCount) noexcept;
EXPORT_APIFUNCTION 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
@ -912,7 +914,7 @@ namespace ObjectFunctions
*
* \return void
*/
extern "C" void AddObject() noexcept;
EXPORT_APIFUNCTION void CDECL AddObject() noexcept;
/**
* \brief Add a copy of the server's temporary container item to the container changes of the
@ -923,7 +925,7 @@ namespace ObjectFunctions
*
* \return void
*/
extern "C" void AddContainerItem() noexcept;
EXPORT_APIFUNCTION void CDECL AddContainerItem() noexcept;
/**
* \brief Send an ObjectActivate packet.
@ -934,7 +936,7 @@ namespace ObjectFunctions
* to the packet (false by default).
* \return void
*/
extern "C" void SendObjectActivate(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
EXPORT_APIFUNCTION void CDECL SendObjectActivate(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
/**
* \brief Send an ObjectPlace packet.
@ -945,7 +947,7 @@ namespace ObjectFunctions
* to the packet (false by default).
* \return void
*/
extern "C" void SendObjectPlace(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
EXPORT_APIFUNCTION void CDECL SendObjectPlace(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
/**
* \brief Send an ObjectSpawn packet.
@ -956,7 +958,7 @@ namespace ObjectFunctions
* to the packet (false by default).
* \return void
*/
extern "C" void SendObjectSpawn(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
EXPORT_APIFUNCTION void CDECL SendObjectSpawn(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
/**
* \brief Send an ObjectDelete packet.
@ -966,7 +968,7 @@ namespace ObjectFunctions
*
* \return void
*/
extern "C" void SendObjectDelete(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
EXPORT_APIFUNCTION void CDECL SendObjectDelete(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
/**
* \brief Send an ObjectLock packet.
@ -977,7 +979,7 @@ namespace ObjectFunctions
* to the packet (false by default).
* \return void
*/
extern "C" void SendObjectLock(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
EXPORT_APIFUNCTION void CDECL SendObjectLock(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
/**
* \brief Send an ObjectTrap packet.
@ -987,7 +989,7 @@ namespace ObjectFunctions
*
* \return void
*/
extern "C" void SendObjectTrap(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
EXPORT_APIFUNCTION void CDECL SendObjectTrap(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
/**
* \brief Send an ObjectScale packet.
@ -998,7 +1000,7 @@ namespace ObjectFunctions
* to the packet (false by default).
* \return void
*/
extern "C" void SendObjectScale(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
EXPORT_APIFUNCTION void CDECL SendObjectScale(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
/**
* \brief Send an ObjectState packet.
@ -1009,7 +1011,7 @@ namespace ObjectFunctions
* to the packet (false by default).
* \return void
*/
extern "C" void SendObjectState(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
EXPORT_APIFUNCTION void CDECL SendObjectState(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
/**
* \brief Send a DoorState packet.
@ -1020,7 +1022,7 @@ namespace ObjectFunctions
* to the packet (false by default).
* \return void
*/
extern "C" void SendDoorState(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
EXPORT_APIFUNCTION void CDECL SendDoorState(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
/**
* \brief Send a DoorDestination packet.
@ -1031,7 +1033,7 @@ namespace ObjectFunctions
* to the packet (false by default).
* \return void
*/
extern "C" void SendDoorDestination(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
EXPORT_APIFUNCTION void CDECL SendDoorDestination(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
/**
* \brief Send a Container packet.
@ -1042,7 +1044,7 @@ namespace ObjectFunctions
* to the packet (false by default).
* \return void
*/
extern "C" void SendContainer(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
EXPORT_APIFUNCTION void CDECL SendContainer(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
/**
* \brief Send a VideoPlay packet.
@ -1053,7 +1055,7 @@ namespace ObjectFunctions
* to the packet (false by default).
* \return void
*/
extern "C" void SendVideoPlay(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
EXPORT_APIFUNCTION void CDECL SendVideoPlay(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
/**
* \brief Send a ConsoleCommand packet.
@ -1064,26 +1066,26 @@ namespace ObjectFunctions
* to the packet (false by default).
* \return void
*/
extern "C" void SendConsoleCommand(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
EXPORT_APIFUNCTION void CDECL SendConsoleCommand(bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
// All methods below are deprecated versions of methods from above
extern "C" void ReadLastObjectList() noexcept;
extern "C" void ReadLastEvent() noexcept;
extern "C" void InitializeObjectList(unsigned short pid) noexcept;
extern "C" void InitializeEvent(unsigned short pid) noexcept;
extern "C" void CopyLastObjectListToStore() noexcept;
extern "C" unsigned int GetObjectChangesSize() noexcept;
extern "C" unsigned char GetEventAction() noexcept;
extern "C" unsigned char GetEventContainerSubAction() noexcept;
extern "C" unsigned int GetObjectRefNumIndex(unsigned int index) noexcept;
extern "C" unsigned int GetObjectSummonerRefNumIndex(unsigned int index) noexcept;
extern "C" void SetEventCell(const char* cellDescription) noexcept;
extern "C" void SetEventAction(unsigned char action) noexcept;
extern "C" void SetEventConsoleCommand(const char* consoleCommand) noexcept;
extern "C" void SetObjectRefNumIndex(int refNum) noexcept;
extern "C" void AddWorldObject() noexcept;
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 CDECL int GetObjectChangesSize() noexcept;
EXPORT_APIFUNCTION unsigned CDECL char GetEventAction() noexcept;
EXPORT_APIFUNCTION unsigned CDECL char GetEventContainerSubAction() noexcept;
EXPORT_APIFUNCTION unsigned CDECL int GetObjectRefNumIndex(unsigned int index) noexcept;
EXPORT_APIFUNCTION unsigned CDECL int 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;
}

@ -3,6 +3,8 @@
#include "../Types.hpp"
#include <Script/Platform.hpp>
#define POSITIONAPI \
{"GetPos", PositionFunctions::GetPos},\
{"GetPosX", PositionFunctions::GetPosX},\
@ -37,7 +39,7 @@ namespace PositionFunctions
* \param z The variable for the Z position.
* \return void
*/
extern "C" void GetPos(unsigned short pid, float *x, float *y, float *z) noexcept;
EXPORT_APIFUNCTION void CDECL GetPos(unsigned short pid, float *x, float *y, float *z) noexcept;
/**
* \brief Get the X position of a player.
@ -45,7 +47,7 @@ namespace PositionFunctions
* \param pid The player ID.
* \return The X position.
*/
extern "C" double GetPosX(unsigned short pid) noexcept;
EXPORT_APIFUNCTION double CDECL GetPosX(unsigned short pid) noexcept;
/**
* \brief Get the Y position of a player.
@ -53,7 +55,7 @@ namespace PositionFunctions
* \param pid The player ID.
* \return The Y position.
*/
extern "C" double GetPosY(unsigned short pid) noexcept;
EXPORT_APIFUNCTION double CDECL GetPosY(unsigned short pid) noexcept;
/**
* \brief Get the Z position of a player.
@ -61,7 +63,7 @@ namespace PositionFunctions
* \param pid The player ID.
* \return The Z position.
*/
extern "C" double GetPosZ(unsigned short pid) noexcept;
EXPORT_APIFUNCTION double CDECL GetPosZ(unsigned short pid) noexcept;
/**
* \brief Get the X position of a player from before their latest cell change.
@ -69,7 +71,7 @@ namespace PositionFunctions
* \param pid The player ID.
* \return The X position.
*/
extern "C" double GetPreviousCellPosX(unsigned short pid) noexcept;
EXPORT_APIFUNCTION double CDECL GetPreviousCellPosX(unsigned short pid) noexcept;
/**
* \brief Get the Y position of a player from before their latest cell change.
@ -77,7 +79,7 @@ namespace PositionFunctions
* \param pid The player ID.
* \return The Y position.
*/
extern "C" double GetPreviousCellPosY(unsigned short pid) noexcept;
EXPORT_APIFUNCTION double CDECL GetPreviousCellPosY(unsigned short pid) noexcept;
/**
* \brief Get the Z position of a player from before their latest cell change.
@ -85,7 +87,7 @@ namespace PositionFunctions
* \param pid The player ID.
* \return The Z position.
*/
extern "C" double GetPreviousCellPosZ(unsigned short pid) noexcept;
EXPORT_APIFUNCTION double CDECL GetPreviousCellPosZ(unsigned short pid) noexcept;
/**
* \brief Assign the player's rotational coordinate values to the variables passed as
@ -97,7 +99,7 @@ namespace PositionFunctions
* \param z The variable for the Z rotation.
* \return void
*/
extern "C" void GetRot(unsigned short pid, float *x, float *y, float *z) noexcept;
EXPORT_APIFUNCTION void CDECL GetRot(unsigned short pid, float *x, float *y, float *z) noexcept;
/**
* \brief Get the X rotation of a player.
@ -105,7 +107,7 @@ namespace PositionFunctions
* \param pid The player ID.
* \return The X rotation.
*/
extern "C" double GetRotX(unsigned short pid) noexcept;
EXPORT_APIFUNCTION double CDECL GetRotX(unsigned short pid) noexcept;
/**
* \brief Get the Z rotation of a player.
@ -113,7 +115,7 @@ namespace PositionFunctions
* \param pid The player ID.
* \return The Z rotation.
*/
extern "C" double GetRotZ(unsigned short pid) noexcept;
EXPORT_APIFUNCTION double CDECL GetRotZ(unsigned short pid) noexcept;
/**
* \brief Set the position of a player.
@ -127,7 +129,7 @@ namespace PositionFunctions
* \param z The Z position.
* \return void
*/
extern "C" void SetPos(unsigned short pid, double x, double y, double z) noexcept;
EXPORT_APIFUNCTION void CDECL SetPos(unsigned short pid, double x, double y, double z) noexcept;
/**
* \brief Set the rotation of a player.
@ -142,7 +144,7 @@ namespace PositionFunctions
* \param z The Z position.
* \return void
*/
extern "C" void SetRot(unsigned short pid, double x, double z) noexcept;
EXPORT_APIFUNCTION void CDECL SetRot(unsigned short pid, double x, double z) noexcept;
/**
* \brief Set the momentum of a player.
@ -156,7 +158,7 @@ namespace PositionFunctions
* \param z The Z momentum.
* \return void
*/
extern "C" void SetMomentum(unsigned short pid, double x, double y, double z) noexcept;
EXPORT_APIFUNCTION void CDECL SetMomentum(unsigned short pid, double x, double y, double z) noexcept;
/**
* \brief Send a PlayerPosition packet about a player.
@ -166,7 +168,7 @@ namespace PositionFunctions
* \param pid The player ID.
* \return void
*/
extern "C" void SendPos(unsigned short pid) noexcept;
EXPORT_APIFUNCTION void CDECL SendPos(unsigned short pid) noexcept;
/**
* \brief Send a PlayerMomentum packet about a player.
@ -176,7 +178,7 @@ namespace PositionFunctions
* \param pid The player ID.
* \return void
*/
extern "C" void SendMomentum(unsigned short pid) noexcept;
EXPORT_APIFUNCTION void CDECL SendMomentum(unsigned short pid) noexcept;
}
#endif //OPENMW_POSITIONAPI_HPP

@ -1,6 +1,8 @@
#ifndef OPENMW_QUESTAPI_HPP
#define OPENMW_QUESTAPI_HPP
#include <Script/Platform.hpp>
#define QUESTAPI \
{"ClearJournalChanges", QuestFunctions::ClearJournalChanges},\
{"ClearKillChanges", QuestFunctions::ClearKillChanges},\
@ -41,7 +43,7 @@ namespace QuestFunctions
* \param pid The player ID whose journal changes should be used.
* \return void
*/
extern "C" void ClearJournalChanges(unsigned short pid) noexcept;
EXPORT_APIFUNCTION void CDECL ClearJournalChanges(unsigned short pid) noexcept;
/**
* \brief Clear the last recorded kill count changes for a player.
@ -51,7 +53,7 @@ namespace QuestFunctions
* \param pid The player ID whose kill count changes should be used.
* \return void
*/
extern "C" void ClearKillChanges(unsigned short pid) noexcept;
EXPORT_APIFUNCTION void CDECL ClearKillChanges(unsigned short pid) noexcept;
/**
* \brief Get the number of indexes in a player's latest journal changes.
@ -59,7 +61,7 @@ namespace QuestFunctions
* \param pid The player ID whose journal changes should be used.
* \return The number of indexes.
*/
extern "C" unsigned int GetJournalChangesSize(unsigned short pid) noexcept;
EXPORT_APIFUNCTION unsigned CDECL int GetJournalChangesSize(unsigned short pid) noexcept;
/**
* \brief Get the number of indexes in a player's latest kill count changes.
@ -67,7 +69,7 @@ namespace QuestFunctions
* \param pid The player ID whose kill count changes should be used.
* \return The number of indexes.
*/
extern "C" unsigned int GetKillChangesSize(unsigned short pid) noexcept;
EXPORT_APIFUNCTION unsigned CDECL int GetKillChangesSize(unsigned short pid) noexcept;
/**
* \brief Add a new journal item of type ENTRY to the journal changes for a player,
@ -79,7 +81,7 @@ namespace QuestFunctions
* \param actorRefId The actor refId of the journal item.
* \return void
*/
extern "C" void AddJournalEntry(unsigned short pid, const char* quest, unsigned int index, const char* actorRefId) noexcept;
EXPORT_APIFUNCTION 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,
@ -94,7 +96,7 @@ namespace QuestFunctions
* \param The day of the month for the journal item.
* \return void
*/
extern "C" void AddJournalEntryWithTimestamp(unsigned short pid, const char* quest, unsigned int index, const char* actorRefId,
EXPORT_APIFUNCTION 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;
/**
@ -105,7 +107,7 @@ namespace QuestFunctions
* \param index The quest index of the journal item.
* \return void
*/
extern "C" void AddJournalIndex(unsigned short pid, const char* quest, unsigned int index) noexcept;
EXPORT_APIFUNCTION 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.
@ -115,7 +117,7 @@ namespace QuestFunctions
* \param number The number of kills in the kill count.
* \return void
*/
extern "C" void AddKill(unsigned short pid, const char* refId, int number) noexcept;
EXPORT_APIFUNCTION void CDECL AddKill(unsigned short pid, const char* refId, int number) noexcept;
/**
* \brief Set the reputation of a certain player.
@ -124,7 +126,7 @@ namespace QuestFunctions
* \param value The reputation.
* \return void
*/
extern "C" void SetReputation(unsigned short pid, int value) noexcept;
EXPORT_APIFUNCTION void CDECL SetReputation(unsigned short pid, int value) noexcept;
/**
* \brief Get the quest at a certain index in a player's latest journal changes.
@ -133,7 +135,7 @@ namespace QuestFunctions
* \param index The index of the journalItem.
* \return The quest.
*/
extern "C" const char *GetJournalItemQuest(unsigned short pid, unsigned int index) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetJournalItemQuest(unsigned short pid, unsigned int index) noexcept;
/**
* \brief Get the quest index at a certain index in a player's latest journal changes.
@ -142,7 +144,7 @@ namespace QuestFunctions
* \param index The index of the journalItem.
* \return The quest index.
*/
extern "C" int GetJournalItemIndex(unsigned short pid, unsigned int index) noexcept;
EXPORT_APIFUNCTION 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.
@ -151,7 +153,7 @@ namespace QuestFunctions
* \param index The index of the journalItem.
* \return The type (0 for ENTRY, 1 for INDEX).
*/
extern "C" int GetJournalItemType(unsigned short pid, unsigned int index) noexcept;
EXPORT_APIFUNCTION 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.
@ -162,7 +164,7 @@ namespace QuestFunctions
* \param index The index of the journalItem.
* \return The actor refId.
*/
extern "C" const char *GetJournalItemActorRefId(unsigned short pid, unsigned int index) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetJournalItemActorRefId(unsigned short pid, unsigned int index) noexcept;
/**
* \brief Get the refId at a certain index in a player's latest kill count changes.
@ -171,7 +173,7 @@ namespace QuestFunctions
* \param index The index of the kill count.
* \return The refId.
*/
extern "C" const char *GetKillRefId(unsigned short pid, unsigned int index) noexcept;
EXPORT_APIFUNCTION const CDECL char *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.
@ -180,7 +182,7 @@ namespace QuestFunctions
* \param index The index of the kill count.
* \return The number of kills.
*/
extern "C" int GetKillNumber(unsigned short pid, unsigned int index) noexcept;
EXPORT_APIFUNCTION int CDECL GetKillNumber(unsigned short pid, unsigned int index) noexcept;
/**
* \brief Get the a certain player's reputation.
@ -188,7 +190,7 @@ namespace QuestFunctions
* \param pid The player ID.
* \return The reputation.
*/
extern "C" int GetReputation(unsigned short pid) noexcept;
EXPORT_APIFUNCTION int CDECL GetReputation(unsigned short pid) noexcept;
/**
* \brief Send a PlayerJournal packet with a player's recorded journal changes.
@ -200,7 +202,7 @@ namespace QuestFunctions
* to the packet (false by default).
* \return void
*/
extern "C" void SendJournalChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
EXPORT_APIFUNCTION void CDECL SendJournalChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
/**
* \brief Send a WorldKillCount packet with a player's recorded kill count changes.
@ -212,7 +214,7 @@ namespace QuestFunctions
* to the packet (false by default).
* \return void
*/
extern "C" void SendKillChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
EXPORT_APIFUNCTION void CDECL SendKillChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
/**
* \brief Send a PlayerReputation packet with a player's recorded reputation.
@ -224,12 +226,12 @@ namespace QuestFunctions
* to the packet (false by default).
* \return void
*/
extern "C" void SendReputation(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
EXPORT_APIFUNCTION void CDECL SendReputation(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
// All methods below are deprecated versions of methods from above
extern "C" void InitializeJournalChanges(unsigned short pid) noexcept;
extern "C" void InitializeKillChanges(unsigned short pid) noexcept;
EXPORT_APIFUNCTION void CDECL InitializeJournalChanges(unsigned short pid) noexcept;
EXPORT_APIFUNCTION void CDECL InitializeKillChanges(unsigned short pid) noexcept;
}
#endif //OPENMW_QUESTAPI_HPP

@ -3,6 +3,8 @@
#include "../Types.hpp"
#include <Script/Platform.hpp>
#define RECORDSDYNAMICAPI \
{"ClearRecords", RecordsDynamicFunctions::ClearRecords},\
\
@ -117,7 +119,7 @@ namespace RecordsDynamicFunctions
*
* \return void
*/
extern "C" void ClearRecords() noexcept;
EXPORT_APIFUNCTION void CDECL ClearRecords() noexcept;
/**
* \brief Get the type of records in the read worldstate's dynamic records.
@ -125,14 +127,14 @@ namespace RecordsDynamicFunctions
* \return The type of records (0 for SPELL, 1 for POTION, 2 for ENCHANTMENT,
* 3 for NPC).
*/
extern "C" unsigned short GetRecordType() noexcept;
EXPORT_APIFUNCTION unsigned CDECL short GetRecordType() noexcept;
/**
* \brief Get the number of records in the read worldstate's dynamic records.
*
* \return The number of records.
*/
extern "C" unsigned int GetRecordCount() noexcept;
EXPORT_APIFUNCTION unsigned CDECL int GetRecordCount() noexcept;
/**
* \brief Get the number of effects for the record at a certain index in the read
@ -141,7 +143,7 @@ namespace RecordsDynamicFunctions
* \param recordIndex The index of the record.
* \return The number of effects.
*/
extern "C" unsigned int GetRecordEffectCount(unsigned int recordIndex) noexcept;
EXPORT_APIFUNCTION unsigned CDECL int GetRecordEffectCount(unsigned int recordIndex) noexcept;
/**
* \brief Get the id of the record at a certain index in the read worldstate's
@ -150,7 +152,7 @@ namespace RecordsDynamicFunctions
* \param index The index of the record.
* \return The id of the record.
*/
extern "C" const char *GetRecordId(unsigned int index) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetRecordId(unsigned int index) noexcept;
/**
* \brief Get the base id (i.e. the id this record should inherit default
@ -160,7 +162,7 @@ namespace RecordsDynamicFunctions
* \param index The index of the record.
* \return The base id of the record.
*/
extern "C" const char *GetRecordBaseId(unsigned int index) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetRecordBaseId(unsigned int index) noexcept;
/**
* \brief Get the subtype of the record at a certain index in the read worldstate's
@ -169,7 +171,7 @@ namespace RecordsDynamicFunctions
* \param index The index of the record.
* \return The type of the record.
*/
extern "C" int GetRecordSubtype(unsigned int index) noexcept;
EXPORT_APIFUNCTION int CDECL GetRecordSubtype(unsigned int index) noexcept;
/**
* \brief Get the name of the record at a certain index in the read worldstate's
@ -178,7 +180,7 @@ namespace RecordsDynamicFunctions
* \param index The index of the record.
* \return The name of the record.
*/
extern "C" const char *GetRecordName(unsigned int index) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetRecordName(unsigned int index) noexcept;
/**
* \brief Get the model of the record at a certain index in the read worldstate's
@ -187,7 +189,7 @@ namespace RecordsDynamicFunctions
* \param index The index of the record.
* \return The model of the record.
*/
extern "C" const char *GetRecordModel(unsigned int index) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetRecordModel(unsigned int index) noexcept;
/**
* \brief Get the icon of the record at a certain index in the read worldstate's
@ -196,7 +198,7 @@ namespace RecordsDynamicFunctions
* \param index The index of the record.
* \return The icon of the record.
*/
extern "C" const char *GetRecordIcon(unsigned int index) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetRecordIcon(unsigned int index) noexcept;
/**
* \brief Get the script of the record at a certain index in the read worldstate's
@ -205,7 +207,7 @@ namespace RecordsDynamicFunctions
* \param index The index of the record.
* \return The script of the record.
*/
extern "C" const char *GetRecordScript(unsigned int index) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetRecordScript(unsigned int index) noexcept;
/**
* \brief Get the enchantment id of the record at a certain index in the read
@ -214,7 +216,7 @@ namespace RecordsDynamicFunctions
* \param index The index of the record.
* \return The enchantment id of the record.
*/
extern "C" const char *GetRecordEnchantmentId(unsigned int index) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetRecordEnchantmentId(unsigned int index) noexcept;
/**
* \brief Get the enchantment charge of the record at a certain index in
@ -223,7 +225,7 @@ namespace RecordsDynamicFunctions
* \param index The index of the record.
* \return The enchantment charge of the record.
*/
extern "C" int GetRecordEnchantmentCharge(unsigned int index) noexcept;
EXPORT_APIFUNCTION int CDECL GetRecordEnchantmentCharge(unsigned int index) noexcept;
/**
* \brief Get the auto-calculation flag value of the record at a certain index in
@ -232,7 +234,7 @@ namespace RecordsDynamicFunctions
* \param index The index of the record.
* \return The auto-calculation flag value of the record.
*/
extern "C" int GetRecordAutoCalc(unsigned int index) noexcept;
EXPORT_APIFUNCTION int CDECL GetRecordAutoCalc(unsigned int index) noexcept;
/**
* \brief Get the charge of the record at a certain index in the read worldstate's
@ -241,7 +243,7 @@ namespace RecordsDynamicFunctions
* \param index The index of the record.
* \return The charge of the record.
*/
extern "C" int GetRecordCharge(unsigned int index) noexcept;
EXPORT_APIFUNCTION int CDECL GetRecordCharge(unsigned int index) noexcept;
/**
* \brief Get the cost of the record at a certain index in the read worldstate's
@ -250,7 +252,7 @@ namespace RecordsDynamicFunctions
* \param index The index of the record.
* \return The cost of the record.
*/
extern "C" int GetRecordCost(unsigned int index) noexcept;
EXPORT_APIFUNCTION int CDECL GetRecordCost(unsigned int index) noexcept;
/**
* \brief Get the flags of the record at a certain index in the read worldstate's
@ -259,7 +261,7 @@ namespace RecordsDynamicFunctions
* \param index The index of the record.
* \return The flags of the spell as an integer.
*/
extern "C" int GetRecordFlags(unsigned int index) noexcept;
EXPORT_APIFUNCTION int CDECL GetRecordFlags(unsigned int index) noexcept;
/**
* \brief Get the value of the record at a certain index in the read worldstate's
@ -268,7 +270,7 @@ namespace RecordsDynamicFunctions
* \param index The index of the record.
* \return The value of the record.
*/
extern "C" int GetRecordValue(unsigned int index) noexcept;
EXPORT_APIFUNCTION int CDECL GetRecordValue(unsigned int index) noexcept;
/**
* \brief Get the weight of the record at a certain index in the read worldstate's
@ -277,7 +279,7 @@ namespace RecordsDynamicFunctions
* \param index The index of the record.
* \return The weight of the record.
*/
extern "C" double GetRecordWeight(unsigned int index) noexcept;
EXPORT_APIFUNCTION double CDECL GetRecordWeight(unsigned int index) noexcept;
/**
* \brief Get the ID of the effect at a certain index in the read worldstate's
@ -287,7 +289,7 @@ namespace RecordsDynamicFunctions
* \param effectIndex The index of the effect.
* \return The ID of the effect.
*/
extern "C" unsigned int GetRecordEffectId(unsigned int recordIndex, unsigned int effectIndex) noexcept;
EXPORT_APIFUNCTION unsigned CDECL int 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
@ -297,7 +299,7 @@ namespace RecordsDynamicFunctions
* \param effectIndex The index of the effect.
* \return The attribute ID for the effect.
*/
extern "C" int GetRecordEffectAttribute(unsigned int recordIndex, unsigned int effectIndex) noexcept;
EXPORT_APIFUNCTION 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
@ -307,7 +309,7 @@ namespace RecordsDynamicFunctions
* \param effectIndex The index of the effect.
* \return The skill ID for the effect.
*/
extern "C" int GetRecordEffectSkill(unsigned int recordIndex, unsigned int effectIndex) noexcept;
EXPORT_APIFUNCTION 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
@ -317,7 +319,7 @@ namespace RecordsDynamicFunctions
* \param effectIndex The index of the effect.
* \return The range of the effect.
*/
extern "C" unsigned int GetRecordEffectRangeType(unsigned int recordIndex, unsigned int effectIndex) noexcept;
EXPORT_APIFUNCTION unsigned CDECL int 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
@ -327,7 +329,7 @@ namespace RecordsDynamicFunctions
* \param effectIndex The index of the effect.
* \return The area of the effect.
*/
extern "C" int GetRecordEffectArea(unsigned int recordIndex, unsigned int effectIndex) noexcept;
EXPORT_APIFUNCTION 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
@ -337,7 +339,7 @@ namespace RecordsDynamicFunctions
* \param effectIndex The index of the effect.
* \return The duration of the effect.
*/
extern "C" int GetRecordEffectDuration(unsigned int recordIndex, unsigned int effectIndex) noexcept;
EXPORT_APIFUNCTION 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
@ -347,7 +349,7 @@ namespace RecordsDynamicFunctions
* \param effectIndex The index of the effect.
* \return The maximum magnitude of the effect.
*/
extern "C" int GetRecordEffectMagnitudeMax(unsigned int recordIndex, unsigned int effectIndex) noexcept;
EXPORT_APIFUNCTION 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
@ -357,7 +359,7 @@ namespace RecordsDynamicFunctions
* \param effectIndex The index of the effect.
* \return The minimum magnitude of the effect.
*/
extern "C" int GetRecordEffectMagnitudeMin(unsigned int recordIndex, unsigned int effectIndex) noexcept;
EXPORT_APIFUNCTION int CDECL GetRecordEffectMagnitudeMin(unsigned int recordIndex, unsigned int effectIndex) noexcept;
/**
* \brief Set which type of temporary records stored on the server should have
@ -366,7 +368,7 @@ namespace RecordsDynamicFunctions
* \param type The type of records.
* \return void
*/
extern "C" void SetRecordType(unsigned int type) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordType(unsigned int type) noexcept;
/**
* \brief Set the id of the temporary record stored on the server for the
@ -375,7 +377,7 @@ namespace RecordsDynamicFunctions
* \param id The id of the record.
* \return void
*/
extern "C" void SetRecordId(const char* id) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordId(const char* id) noexcept;
/**
* \brief Set the base id (i.e. the id this record should inherit default
@ -385,7 +387,7 @@ namespace RecordsDynamicFunctions
* \param baseId The baseId of the record.
* \return void
*/
extern "C" void SetRecordBaseId(const char* baseId) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordBaseId(const char* baseId) noexcept;
/**
* \brief Set the inventory base id (i.e. the id this record should inherit
@ -395,7 +397,7 @@ namespace RecordsDynamicFunctions
* \param inventoryBaseId The inventoryBaseId of the record.
* \return void
*/
extern "C" void SetRecordInventoryBaseId(const char* inventoryBaseId) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordInventoryBaseId(const char* inventoryBaseId) noexcept;
/**
* \brief Set the subtype of the temporary record stored on the server for
@ -404,7 +406,7 @@ namespace RecordsDynamicFunctions
* \param type The spell type.
* \return void
*/
extern "C" void SetRecordSubtype(unsigned int subtype) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordSubtype(unsigned int subtype) noexcept;
/**
* \brief Set the name of the temporary record stored on the server for the
@ -413,7 +415,7 @@ namespace RecordsDynamicFunctions
* \param name The name of the record.
* \return void
*/
extern "C" void SetRecordName(const char* name) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordName(const char* name) noexcept;
/**
* \brief Set the model of the temporary record stored on the server for the
@ -422,7 +424,7 @@ namespace RecordsDynamicFunctions
* \param model The model of the record.
* \return void
*/
extern "C" void SetRecordModel(const char* model) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordModel(const char* model) noexcept;
/**
* \brief Set the icon of the temporary record stored on the server for the
@ -431,7 +433,7 @@ namespace RecordsDynamicFunctions
* \param icon The icon of the record.
* \return void
*/
extern "C" void SetRecordIcon(const char* icon) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordIcon(const char* icon) noexcept;
/**
* \brief Set the script of the temporary record stored on the server for the
@ -440,7 +442,7 @@ namespace RecordsDynamicFunctions
* \param script The script of the record.
* \return void
*/
extern "C" void SetRecordScript(const char* script) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordScript(const char* script) noexcept;
/**
* \brief Set the enchantment id of the temporary record stored on the server
@ -449,7 +451,7 @@ namespace RecordsDynamicFunctions
* \param enchantmentId The enchantment id of the record.
* \return void
*/
extern "C" void SetRecordEnchantmentId(const char* enchantmentId) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordEnchantmentId(const char* enchantmentId) noexcept;
/**
* \brief Set the enchantment charge of the temporary record stored on the server
@ -458,7 +460,7 @@ namespace RecordsDynamicFunctions
* \param enchantmentCharge The enchantmentCharge of the record.
* \return void
*/
extern "C" void SetRecordEnchantmentCharge(int enchantmentCharge) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordEnchantmentCharge(int enchantmentCharge) noexcept;
/**
* \brief Set the auto-calculation flag value of the temporary record stored
@ -467,7 +469,7 @@ namespace RecordsDynamicFunctions
* \param autoCalc The auto-calculation flag value of the record.
* \return void
*/
extern "C" void SetRecordAutoCalc(int autoCalc) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordAutoCalc(int autoCalc) noexcept;
/**
* \brief Set the charge of the temporary record stored on the server for the
@ -476,7 +478,7 @@ namespace RecordsDynamicFunctions
* \param charge The charge of the record.
* \return void
*/
extern "C" void SetRecordCharge(int charge) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordCharge(int charge) noexcept;
/**
* \brief Set the cost of the temporary record stored on the server for the
@ -485,7 +487,7 @@ namespace RecordsDynamicFunctions
* \param cost The cost of the record.
* \return void
*/
extern "C" void SetRecordCost(int cost) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordCost(int cost) noexcept;
/**
* \brief Set the flags of the temporary record stored on the server for the
@ -494,7 +496,7 @@ namespace RecordsDynamicFunctions
* \param flags The flags of the record.
* \return void
*/
extern "C" void SetRecordFlags(int flags) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordFlags(int flags) noexcept;
/**
* \brief Set the value of the temporary record stored on the server for the
@ -503,7 +505,7 @@ namespace RecordsDynamicFunctions
* \param value The value of the record.
* \return void
*/
extern "C" void SetRecordValue(int value) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordValue(int value) noexcept;
/**
* \brief Set the weight of the temporary record stored on the server for the
@ -512,7 +514,7 @@ namespace RecordsDynamicFunctions
* \param weight The weight of the record.
* \return void
*/
extern "C" void SetRecordWeight(double weight) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordWeight(double weight) noexcept;
/**
* \brief Set the armor rating of the temporary record stored on the server
@ -521,7 +523,7 @@ namespace RecordsDynamicFunctions
* \param armorRating The armor rating of the record.
* \return void
*/
extern "C" void SetRecordArmorRating(int armorRating) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordArmorRating(int armorRating) noexcept;
/**
* \brief Set the health of the temporary record stored on the server for the
@ -530,7 +532,7 @@ namespace RecordsDynamicFunctions
* \param health The health of the record.
* \return void
*/
extern "C" void SetRecordHealth(int health) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordHealth(int health) noexcept;
/**
* \brief Set the chop damage of the temporary record stored on the server for the
@ -540,7 +542,7 @@ namespace RecordsDynamicFunctions
* \param maxDamage The maximum damage of the record.
* \return void
*/
extern "C" void SetRecordDamageChop(unsigned int minDamage, unsigned int maxDamage) noexcept;
EXPORT_APIFUNCTION 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
@ -550,7 +552,7 @@ namespace RecordsDynamicFunctions
* \param maxDamage The maximum damage of the record.
* \return void
*/
extern "C" void SetRecordDamageSlash(unsigned int minDamage, unsigned int maxDamage) noexcept;
EXPORT_APIFUNCTION 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
@ -560,7 +562,7 @@ namespace RecordsDynamicFunctions
* \param maxDamage The maximum damage of the record.
* \return void
*/
extern "C" void SetRecordDamageThrust(unsigned int minDamage, unsigned int maxDamage) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordDamageThrust(unsigned int minDamage, unsigned int maxDamage) noexcept;
/**
* \brief Set the reach of the temporary record stored on the server for the
@ -569,7 +571,7 @@ namespace RecordsDynamicFunctions
* \param reach The reach of the record.
* \return void
*/
extern "C" void SetRecordReach(double reach) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordReach(double reach) noexcept;
/**
* \brief Set the speed of the temporary record stored on the server for the
@ -578,7 +580,7 @@ namespace RecordsDynamicFunctions
* \param speed The speed of the record.
* \return void
*/
extern "C" void SetRecordSpeed(double speed) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordSpeed(double speed) noexcept;
/**
* \brief Set whether the temporary record stored on the server for the
@ -589,7 +591,7 @@ namespace RecordsDynamicFunctions
* \param keyState Whether the record is a key.
* \return void
*/
extern "C" void SetRecordKeyState(bool keyState) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordKeyState(bool keyState) noexcept;
/**
* \brief Set whether the temporary record stored on the server for the
@ -600,7 +602,7 @@ namespace RecordsDynamicFunctions
* \param scrollState Whether the record is a scroll.
* \return void
*/
extern "C" void SetRecordScrollState(bool scrollState) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordScrollState(bool scrollState) noexcept;
/**
* \brief Set the skill ID of the temporary record stored on the server for the
@ -609,7 +611,7 @@ namespace RecordsDynamicFunctions
* \param skillId The skill ID of the record.
* \return void
*/
extern "C" void SetRecordSkillId(int skillId) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordSkillId(int skillId) noexcept;
/**
* \brief Set the text of the temporary record stored on the server for the
@ -618,7 +620,7 @@ namespace RecordsDynamicFunctions
* \param text The text of the record.
* \return void
*/
extern "C" void SetRecordText(const char* text) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordText(const char* text) noexcept;
/**
* \brief Set the hair of the temporary record stored on the server for the
@ -627,7 +629,7 @@ namespace RecordsDynamicFunctions
* \param hair The hair of the record.
* \return void
*/
extern "C" void SetRecordHair(const char* hair) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordHair(const char* hair) noexcept;
/**
* \brief Set the head of the temporary record stored on the server for the
@ -636,7 +638,7 @@ namespace RecordsDynamicFunctions
* \param hair The head of the record.
* \return void
*/
extern "C" void SetRecordHead(const char* head) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordHead(const char* head) noexcept;
/**
* \brief Set the gender of the temporary record stored on the server for the
@ -645,7 +647,7 @@ namespace RecordsDynamicFunctions
* \param hair The race of the record.
* \return void
*/
extern "C" void SetRecordGender(unsigned int gender) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordGender(unsigned int gender) noexcept;
/**
* \brief Set the race of the temporary record stored on the server for the
@ -654,7 +656,7 @@ namespace RecordsDynamicFunctions
* \param hair The race of the record.
* \return void
*/
extern "C" void SetRecordRace(const char* race) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordRace(const char* race) noexcept;
/**
* \brief Set the character class of the temporary record stored on the server
@ -663,7 +665,7 @@ namespace RecordsDynamicFunctions
* \param hair The character class of the record.
* \return void
*/
extern "C" void SetRecordClass(const char* charClass) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordClass(const char* charClass) noexcept;
/**
* \brief Set the faction of the temporary record stored on the server for the
@ -672,7 +674,7 @@ namespace RecordsDynamicFunctions
* \param faction The faction of the record.
* \return void
*/
extern "C" void SetRecordFaction(const char* faction) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordFaction(const char* faction) noexcept;
/**
* \brief Set the level of the temporary record stored on the server for the
@ -681,7 +683,7 @@ namespace RecordsDynamicFunctions
* \param level The level of the record.
* \return void
*/
extern "C" void SetRecordLevel(int level) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordLevel(int level) noexcept;
/**
* \brief Set the magicka of the temporary record stored on the server for the
@ -690,7 +692,7 @@ namespace RecordsDynamicFunctions
* \param magicka The magicka of the record.
* \return void
*/
extern "C" void SetRecordMagicka(int magicka) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordMagicka(int magicka) noexcept;
/**
* \brief Set the fatigue of the temporary record stored on the server for the
@ -699,7 +701,7 @@ namespace RecordsDynamicFunctions
* \param fatigue The fatigue of the record.
* \return void
*/
extern "C" void SetRecordFatigue(int fatigue) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordFatigue(int fatigue) noexcept;
/**
* \brief Set the AI fight value of the temporary record stored on the server for the
@ -708,7 +710,7 @@ namespace RecordsDynamicFunctions
* \param aiFight The AI fight value of the record.
* \return void
*/
extern "C" void SetRecordAIFight(int aiFight) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordAIFight(int aiFight) noexcept;
/**
* \brief Set the id of the record at a certain index in the records stored on the server.
@ -720,7 +722,7 @@ namespace RecordsDynamicFunctions
* \param id The id of the record.
* \return void
*/
extern "C" void SetRecordIdByIndex(unsigned int index, const char* id) noexcept;
EXPORT_APIFUNCTION 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
@ -733,7 +735,7 @@ namespace RecordsDynamicFunctions
* \param enchantmentId The enchantment id of the record.
* \return void
*/
extern "C" void SetRecordEnchantmentIdByIndex(unsigned int index, const char* enchantmentId) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordEnchantmentIdByIndex(unsigned int index, const char* enchantmentId) noexcept;
/**
* \brief Set the ID of the temporary effect stored on the server.
@ -741,7 +743,7 @@ namespace RecordsDynamicFunctions
* \param effectId The ID of the effect.
* \return void
*/
extern "C" void SetRecordEffectId(unsigned int effectId) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordEffectId(unsigned int effectId) noexcept;
/**
* \brief Set the ID of the attribute modified by the temporary effect stored on
@ -750,7 +752,7 @@ namespace RecordsDynamicFunctions
* \param attributeId The ID of the attribute.
* \return void
*/
extern "C" void SetRecordEffectAttribute(int attributeId) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordEffectAttribute(int attributeId) noexcept;
/**
* \brief Set the ID of the skill modified by the temporary effect stored on the
@ -759,7 +761,7 @@ namespace RecordsDynamicFunctions
* \param skillId The ID of the skill.
* \return void
*/
extern "C" void SetRecordEffectSkill(int skillId) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordEffectSkill(int skillId) noexcept;
/**
* \brief Set the range type of the temporary effect stored on the server (0 for
@ -768,7 +770,7 @@ namespace RecordsDynamicFunctions
* \param rangeType The range type of the effect.
* \return void
*/
extern "C" void SetRecordEffectRangeType(unsigned int rangeType) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordEffectRangeType(unsigned int rangeType) noexcept;
/**
* \brief Set the area of the temporary effect stored on the server.
@ -776,7 +778,7 @@ namespace RecordsDynamicFunctions
* \param area The area of the effect.
* \return void
*/
extern "C" void SetRecordEffectArea(int area) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordEffectArea(int area) noexcept;
/**
* \brief Set the duration of the temporary effect stored on the server.
@ -784,7 +786,7 @@ namespace RecordsDynamicFunctions
* \param duration The duration of the effect.
* \return void
*/
extern "C" void SetRecordEffectDuration(int duration) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordEffectDuration(int duration) noexcept;
/**
* \brief Set the maximum magnitude of the temporary effect stored on the server.
@ -792,7 +794,7 @@ namespace RecordsDynamicFunctions
* \param magnitudeMax The maximum magnitude of the effect.
* \return void
*/
extern "C" void SetRecordEffectMagnitudeMax(int magnitudeMax) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordEffectMagnitudeMax(int magnitudeMax) noexcept;
/**
* \brief Set the minimum magnitude of the temporary effect stored on the server.
@ -800,7 +802,7 @@ namespace RecordsDynamicFunctions
* \param magnitudeMin The minimum magnitude of the effect.
* \return void
*/
extern "C" void SetRecordEffectMagnitudeMin(int magnitudeMin) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordEffectMagnitudeMin(int magnitudeMin) noexcept;
/**
* \brief Set the type of the temporary body part stored on the server.
@ -808,7 +810,7 @@ namespace RecordsDynamicFunctions
* \param partType The type of the body part.
* \return void
*/
extern "C" void SetRecordBodyPartType(unsigned int partType) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordBodyPartType(unsigned int partType) noexcept;
/**
* \brief Set the id of the male version of the temporary body part stored on the
@ -817,7 +819,7 @@ namespace RecordsDynamicFunctions
* \param partId The id of the body part.
* \return void
*/
extern "C" void SetRecordBodyPartIdForMale(const char* partId) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordBodyPartIdForMale(const char* partId) noexcept;
/**
* \brief Set the id of the female version of the temporary body part stored on the
@ -826,7 +828,7 @@ namespace RecordsDynamicFunctions
* \param partId The id of the body part.
* \return void
*/
extern "C" void SetRecordBodyPartIdForFemale(const char* partId) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordBodyPartIdForFemale(const char* partId) noexcept;
/**
* \brief Set the id of the of the temporary inventory item stored on the server.
@ -834,7 +836,7 @@ namespace RecordsDynamicFunctions
* \param partId The id of the inventory item.
* \return void
*/
extern "C" void SetRecordInventoryItemId(const char* itemId) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordInventoryItemId(const char* itemId) noexcept;
/**
* \brief Set the count of the of the temporary inventory item stored on the server.
@ -842,7 +844,7 @@ namespace RecordsDynamicFunctions
* \param count The count of the inventory item.
* \return void
*/
extern "C" void SetRecordInventoryItemCount(unsigned int count) noexcept;
EXPORT_APIFUNCTION void CDECL SetRecordInventoryItemCount(unsigned int count) noexcept;
/**
* \brief Add a copy of the server's temporary record of the current specified
@ -853,7 +855,7 @@ namespace RecordsDynamicFunctions
*
* \return void
*/
extern "C" void AddRecord() noexcept;
EXPORT_APIFUNCTION void CDECL AddRecord() noexcept;
/**
* \brief Add a copy of the server's temporary effect to the temporary record
@ -864,7 +866,7 @@ namespace RecordsDynamicFunctions
*
* \return void
*/
extern "C" void AddRecordEffect() noexcept;
EXPORT_APIFUNCTION void CDECL AddRecordEffect() noexcept;
/**
* \brief Add a copy of the server's temporary body part to the temporary record
@ -875,7 +877,7 @@ namespace RecordsDynamicFunctions
*
* \return void
*/
extern "C" void AddRecordBodyPart() noexcept;
EXPORT_APIFUNCTION void CDECL AddRecordBodyPart() noexcept;
/**
* \brief Add a copy of the server's temporary inventory item to the temporary record
@ -889,7 +891,7 @@ namespace RecordsDynamicFunctions
*
* \return void
*/
extern "C" void AddRecordInventoryItem() noexcept;
EXPORT_APIFUNCTION void CDECL AddRecordInventoryItem() noexcept;
/**
* \brief Send a RecordDynamic packet with the current specified record type.
@ -901,7 +903,7 @@ namespace RecordsDynamicFunctions
* to the packet (false by default).
* \return void
*/
extern "C" void SendRecordDynamic(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
EXPORT_APIFUNCTION void CDECL SendRecordDynamic(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
}
#endif //OPENMW_RECORDSDYNAMICAPI_HPP

@ -3,6 +3,10 @@
#include "../Types.hpp"
#include <Script/Platform.hpp>
#include <Script/Platform.hpp>
#define SERVERAPI \
{"StopServer", ServerFunctions::StopServer},\
\
@ -40,7 +44,7 @@ namespace ServerFunctions
* \param code The shutdown code.
* \return void
*/
extern "C" void StopServer(int code) noexcept;
EXPORT_APIFUNCTION void CDECL StopServer(int code) noexcept;
/**
* \brief Kick a certain player from the server.
@ -48,7 +52,7 @@ namespace ServerFunctions
* \param pid The player ID.
* \return void
*/
extern "C" void Kick(unsigned short pid) noexcept;
EXPORT_APIFUNCTION void CDECL Kick(unsigned short pid) noexcept;
/**
* \brief Ban a certain IP address from the server.
@ -56,7 +60,7 @@ namespace ServerFunctions
* \param ipAddress The IP address.
* \return void
*/
extern "C" void BanAddress(const char *ipAddress) noexcept;
EXPORT_APIFUNCTION void CDECL BanAddress(const char *ipAddress) noexcept;
/**
* \brief Unban a certain IP address from the server.
@ -64,7 +68,7 @@ namespace ServerFunctions
* \param ipAddress The IP address.
* \return void
*/
extern "C" void UnbanAddress(const char *ipAddress) noexcept;
EXPORT_APIFUNCTION void CDECL UnbanAddress(const char *ipAddress) noexcept;
/**
* \brief Get the type of the operating system used by the server.
@ -89,14 +93,14 @@ namespace ServerFunctions
*
* \return The server version.
*/
extern "C" const char *GetServerVersion() noexcept;
EXPORT_APIFUNCTION const CDECL char *GetServerVersion() noexcept;
/**
* \brief Get the protocol version of the server.
*
* \return The protocol version.
*/
extern "C" const char *GetProtocolVersion() noexcept;
EXPORT_APIFUNCTION const CDECL char *GetProtocolVersion() noexcept;
/**
* \brief Get the average ping of a certain player.
@ -104,7 +108,7 @@ namespace ServerFunctions
* \param pid The player ID.
* \return The average ping.
*/
extern "C" int GetAvgPing(unsigned short pid) noexcept;
EXPORT_APIFUNCTION int CDECL GetAvgPing(unsigned short pid) noexcept;
/**
* \brief Get the IP address of a certain player.
@ -112,28 +116,28 @@ namespace ServerFunctions
* \param pid The player ID.
* \return The IP address.
*/
extern "C" const char* GetIP(unsigned short pid) noexcept;
EXPORT_APIFUNCTION const CDECL char* GetIP(unsigned short pid) noexcept;
/**
* \brief Get the port used by the server.
*
* \return Port
*/
extern "C" unsigned short GetPort() noexcept;
EXPORT_APIFUNCTION unsigned CDECL short GetPort() noexcept;
/**
* \brief Get the maximum number of players.
*
* \return Max players
*/
extern "C" unsigned int GetMaxPlayers() noexcept;
EXPORT_APIFUNCTION unsigned CDECL int GetMaxPlayers() noexcept;
/**
* \brief Checking if the server requires a password to connect.
*
* @return
*/
extern "C" bool HasPassword() noexcept;
EXPORT_APIFUNCTION bool CDECL HasPassword() noexcept;
/**
* \brief Get the plugin enforcement state of the server.
@ -142,7 +146,7 @@ namespace ServerFunctions
*
* \return The enforcement state.
*/
extern "C" bool GetPluginEnforcementState() noexcept;
EXPORT_APIFUNCTION bool CDECL GetPluginEnforcementState() noexcept;
/**
* \brief Get the script error ignoring state of the server.
@ -151,7 +155,7 @@ namespace ServerFunctions
*
* \return The script error ignoring state.
*/
extern "C" bool GetScriptErrorIgnoringState() noexcept;
EXPORT_APIFUNCTION bool CDECL GetScriptErrorIgnoringState() noexcept;
/**
* \brief Set the game mode of the server, as displayed in the server browser.
@ -159,7 +163,7 @@ namespace ServerFunctions
* \param name The new game mode.
* \return void
*/
extern "C" void SetGameMode(const char* gameMode) noexcept;
EXPORT_APIFUNCTION void CDECL SetGameMode(const char* gameMode) noexcept;
/**
* \brief Set the name of the server, as displayed in the server browser.
@ -167,7 +171,7 @@ namespace ServerFunctions
* \param name The new name.
* \return void
*/
extern "C" void SetHostname(const char* name) noexcept;
EXPORT_APIFUNCTION void CDECL SetHostname(const char* name) noexcept;
/**
* \brief Set the password required to join the server.
@ -175,7 +179,7 @@ namespace ServerFunctions
* \param password The password.
* \return void
*/
extern "C" void SetServerPassword(const char *password) noexcept;
EXPORT_APIFUNCTION void CDECL SetServerPassword(const char *password) noexcept;
/**
* \brief Set the plugin enforcement state of the server.
@ -185,7 +189,7 @@ namespace ServerFunctions
* \param state The new enforcement state.
* \return void
*/
extern "C" void SetPluginEnforcementState(bool state) noexcept;
EXPORT_APIFUNCTION void CDECL SetPluginEnforcementState(bool state) noexcept;
/**
* \brief Set whether script errors should be ignored or not.
@ -197,7 +201,7 @@ namespace ServerFunctions
* \param state The new script error ignoring state.
* \return void
*/
extern "C" void SetScriptErrorIgnoringState(bool state) noexcept;
EXPORT_APIFUNCTION void CDECL SetScriptErrorIgnoringState(bool state) noexcept;
/**
* \brief Set a rule string for the server details displayed in the server browser.
@ -206,7 +210,7 @@ namespace ServerFunctions
* \param value The string value of the rule.
* \return void
*/
extern "C" void SetRuleString(const char *key, const char *value) noexcept;
EXPORT_APIFUNCTION void CDECL SetRuleString(const char *key, const char *value) noexcept;
/**
* \brief Set a rule value for the server details displayed in the server browser.
@ -215,16 +219,16 @@ namespace ServerFunctions
* \param value The numerical value of the rule.
* \return void
*/
extern "C" void SetRuleValue(const char *key, double value) noexcept;
EXPORT_APIFUNCTION 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
*/
extern "C" void AddPluginHash(const char *pluginName, const char *hash) noexcept;
EXPORT_APIFUNCTION void CDECL AddPluginHash(const char *pluginName, const char *hash) noexcept;
extern "C" const char *GetModDir() noexcept;
EXPORT_APIFUNCTION const char *CDECL GetModDir() noexcept;
}
#endif //OPENMW_SERVERAPI_HPP

@ -3,6 +3,8 @@
#include "../Types.hpp"
#include <Script/Platform.hpp>
#define SETTINGSAPI \
{"SetDifficulty", SettingFunctions::SetDifficulty},\
{"SetEnforcedLogLevel", SettingFunctions::SetEnforcedLogLevel},\
@ -27,7 +29,7 @@ namespace SettingFunctions
* \param difficulty The difficulty.
* \return void
*/
extern "C" void SetDifficulty(unsigned short pid, int difficulty);
EXPORT_APIFUNCTION void CDECL SetDifficulty(unsigned short pid, int difficulty);
/**
* \brief Set the client log level enforced for a player.
@ -45,7 +47,7 @@ namespace SettingFunctions
* \param enforcedLogLevel The enforced log level.
* \return void
*/
extern "C" void SetEnforcedLogLevel(unsigned short pid, int enforcedLogLevel);
EXPORT_APIFUNCTION void CDECL SetEnforcedLogLevel(unsigned short pid, int enforcedLogLevel);
/**
* \brief Set the physics framerate for a player.
@ -57,7 +59,7 @@ namespace SettingFunctions
* \param physicsFramerate The physics framerate.
* \return void
*/
extern "C" void SetPhysicsFramerate(unsigned short pid, double physicsFramerate);
EXPORT_APIFUNCTION void CDECL SetPhysicsFramerate(unsigned short pid, double physicsFramerate);
/**
* \brief Set whether the console is allowed for a player.
@ -69,7 +71,7 @@ namespace SettingFunctions
* \param state The console permission state.
* \return void
*/
extern "C" void SetConsoleAllowed(unsigned short pid, bool state);
EXPORT_APIFUNCTION void CDECL SetConsoleAllowed(unsigned short pid, bool state);
/**
* \brief Set whether resting in beds is allowed for a player.
@ -81,7 +83,7 @@ namespace SettingFunctions
* \param state The resting permission state.
* \return void
*/
extern "C" void SetBedRestAllowed(unsigned short pid, bool state);
EXPORT_APIFUNCTION void CDECL SetBedRestAllowed(unsigned short pid, bool state);
/**
* \brief Set whether resting in the wilderness is allowed for a player.
@ -93,7 +95,7 @@ namespace SettingFunctions
* \param state The resting permission state.
* \return void
*/
extern "C" void SetWildernessRestAllowed(unsigned short pid, bool state);
EXPORT_APIFUNCTION void CDECL SetWildernessRestAllowed(unsigned short pid, bool state);
/**
* \brief Set whether waiting is allowed for a player.
@ -105,7 +107,7 @@ namespace SettingFunctions
* \param state The waiting permission state.
* \return void
*/
extern "C" void SetWaitAllowed(unsigned short pid, bool state);
EXPORT_APIFUNCTION void CDECL SetWaitAllowed(unsigned short pid, bool state);
/**
* \brief Send a PlayerSettings packet to the player affected by it.
@ -113,7 +115,7 @@ namespace SettingFunctions
* \param pid The player ID to send it to.
* \return void
*/
extern "C" void SendSettings(unsigned short pid) noexcept;
EXPORT_APIFUNCTION void CDECL SendSettings(unsigned short pid) noexcept;
}
#endif //OPENMW_SETTINGSAPI_HPP

@ -3,6 +3,8 @@
#include "../Types.hpp"
#include <Script/Platform.hpp>
#define SHAPESHIFTAPI \
{"GetScale", ShapeshiftFunctions::GetScale},\
{"IsWerewolf", ShapeshiftFunctions::IsWerewolf},\
@ -24,7 +26,7 @@ namespace ShapeshiftFunctions
* \param pid The player ID.
* \return The scale.
*/
extern "C" double GetScale(unsigned short pid) noexcept;
EXPORT_APIFUNCTION double CDECL GetScale(unsigned short pid) noexcept;
/**
* \brief Check whether a player is a werewolf.
@ -34,7 +36,7 @@ namespace ShapeshiftFunctions
* \param pid The player ID.
* \return The werewolf state.
*/
extern "C" bool IsWerewolf(unsigned short pid) noexcept;
EXPORT_APIFUNCTION bool CDECL IsWerewolf(unsigned short pid) noexcept;
/**
* \brief Get the refId of the creature the player is disguised as.
@ -42,7 +44,7 @@ namespace ShapeshiftFunctions
* \param pid The player ID.
* \return The creature refId.
*/
extern "C" const char *GetCreatureRefId(unsigned short pid) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetCreatureRefId(unsigned short pid) noexcept;
/**
* \brief Check whether a player's name is replaced by that of the creature they are
@ -53,7 +55,7 @@ namespace ShapeshiftFunctions
* \param pid The player ID.
* \return The creature name display state.
*/
extern "C" bool GetCreatureNameDisplayState(unsigned short pid) noexcept;
EXPORT_APIFUNCTION bool CDECL GetCreatureNameDisplayState(unsigned short pid) noexcept;
/**
* \brief Set the scale of a player.
@ -65,7 +67,7 @@ namespace ShapeshiftFunctions
* \param scale The new scale.
* \return void
*/
extern "C" void SetScale(unsigned short pid, double scale) noexcept;
EXPORT_APIFUNCTION void CDECL SetScale(unsigned short pid, double scale) noexcept;
/**
* \brief Set the werewolf state of a player.
@ -77,7 +79,7 @@ namespace ShapeshiftFunctions
* \param isWerewolf The new werewolf state.
* \return void
*/
extern "C" void SetWerewolfState(unsigned short pid, bool isWerewolf) noexcept;
EXPORT_APIFUNCTION void CDECL SetWerewolfState(unsigned short pid, bool isWerewolf) noexcept;
/**
* \brief Set the refId of the creature a player is disguised as.
@ -91,7 +93,7 @@ namespace ShapeshiftFunctions
* when hovered over by others.
* \return void
*/
extern "C" void SetCreatureRefId(unsigned short pid, const char *refId) noexcept;
EXPORT_APIFUNCTION 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
@ -101,7 +103,7 @@ namespace ShapeshiftFunctions
* \param displayState The creature name display state.
* \return void
*/
extern "C" void SetCreatureNameDisplayState(unsigned short pid, bool displayState) noexcept;
EXPORT_APIFUNCTION void CDECL SetCreatureNameDisplayState(unsigned short pid, bool displayState) noexcept;
/**
* \brief Send a PlayerShapeshift packet about a player.
@ -112,7 +114,7 @@ namespace ShapeshiftFunctions
* \param pid The player ID.
* \return void
*/
extern "C" void SendShapeshift(unsigned short pid);
EXPORT_APIFUNCTION void CDECL SendShapeshift(unsigned short pid);
}
#endif //OPENMW_SHAPESHIFTAPI_HPP

@ -1,6 +1,8 @@
#ifndef OPENMW_SPELLAPI_HPP
#define OPENMW_SPELLAPI_HPP
#include <Script/Platform.hpp>
#define SPELLAPI \
{"ClearSpellbookChanges", SpellFunctions::ClearSpellbookChanges},\
\
@ -26,7 +28,7 @@ namespace SpellFunctions
* \param pid The player ID whose spellbook changes should be used.
* \return void
*/
extern "C" void ClearSpellbookChanges(unsigned short pid) noexcept;
EXPORT_APIFUNCTION void CDECL ClearSpellbookChanges(unsigned short pid) noexcept;
/**
* \brief Get the number of indexes in a player's latest spellbook changes.
@ -34,7 +36,7 @@ namespace SpellFunctions
* \param pid The player ID whose spellbook changes should be used.
* \return The number of indexes.
*/
extern "C" unsigned int GetSpellbookChangesSize(unsigned short pid) noexcept;
EXPORT_APIFUNCTION unsigned CDECL int GetSpellbookChangesSize(unsigned short pid) noexcept;
/**
* \brief Get the action type used in a player's latest spellbook changes.
@ -42,7 +44,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).
*/
extern "C" unsigned int GetSpellbookChangesAction(unsigned short pid) noexcept;
EXPORT_APIFUNCTION unsigned CDECL int GetSpellbookChangesAction(unsigned short pid) noexcept;
/**
* \brief Set the action type in a player's spellbook changes.
@ -51,7 +53,7 @@ namespace SpellFunctions
* \param action The action (0 for SET, 1 for ADD, 2 for REMOVE).
* \return void
*/
extern "C" void SetSpellbookChangesAction(unsigned short pid, unsigned char action) noexcept;
EXPORT_APIFUNCTION void CDECL SetSpellbookChangesAction(unsigned short pid, unsigned char action) noexcept;
/**
* \brief Add a new spell to the spellbook changes for a player.
@ -60,7 +62,7 @@ namespace SpellFunctions
* \param spellId The spellId of the spell.
* \return void
*/
extern "C" void AddSpell(unsigned short pid, const char* spellId) noexcept;
EXPORT_APIFUNCTION 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.
@ -69,7 +71,7 @@ namespace SpellFunctions
* \param index The index of the spell.
* \return The spellId.
*/
extern "C" const char *GetSpellId(unsigned short pid, unsigned int index) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetSpellId(unsigned short pid, unsigned int index) noexcept;
/**
* \brief Send a PlayerSpellbook packet with a player's recorded spellbook changes.
@ -81,11 +83,11 @@ namespace SpellFunctions
* to the packet (false by default).
* \return void
*/
extern "C" void SendSpellbookChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
EXPORT_APIFUNCTION void CDECL SendSpellbookChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept;
// All methods below are deprecated versions of methods from above
extern "C" void InitializeSpellbookChanges(unsigned short pid) noexcept;
EXPORT_APIFUNCTION void CDECL InitializeSpellbookChanges(unsigned short pid) noexcept;
}
#endif //OPENMW_SPELLAPI_HPP

@ -1,6 +1,8 @@
#ifndef OPENMW_STATAPI_HPP
#define OPENMW_STATAPI_HPP
#include <Script/Platform.hpp>
#define STATAPI \
{"GetAttributeCount", StatsFunctions::GetAttributeCount},\
{"GetSkillCount", StatsFunctions::GetSkillCount},\
@ -84,7 +86,7 @@ namespace StatsFunctions
*
* \return The number of attributes.
*/
extern "C" int GetAttributeCount() noexcept;
EXPORT_APIFUNCTION int CDECL GetAttributeCount() noexcept;
/**
* \brief Get the number of skills.
@ -93,7 +95,7 @@ namespace StatsFunctions
*
* \return The number of skills.
*/
extern "C" int GetSkillCount() noexcept;
EXPORT_APIFUNCTION int CDECL GetSkillCount() noexcept;
/**
* \brief Get the numerical ID of an attribute with a certain name.
@ -103,7 +105,7 @@ namespace StatsFunctions
* \param name The name of the attribute.
* \return The ID of the attribute.
*/
extern "C" int GetAttributeId(const char *name) noexcept;
EXPORT_APIFUNCTION int CDECL GetAttributeId(const char *name) noexcept;
/**
* \brief Get the numerical ID of a skill with a certain name.
@ -113,7 +115,7 @@ namespace StatsFunctions
* \param name The name of the skill.
* \return The ID of the skill.
*/
extern "C" int GetSkillId(const char *name) noexcept;
EXPORT_APIFUNCTION int CDECL GetSkillId(const char *name) noexcept;
/**
* \brief Get the name of the attribute with a certain numerical ID.
@ -123,7 +125,7 @@ namespace StatsFunctions
* \param attributeId The ID of the attribute.
* \return The name of the attribute.
*/
extern "C" const char *GetAttributeName(unsigned short attributeId) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetAttributeName(unsigned short attributeId) noexcept;
/**
* \brief Get the name of the skill with a certain numerical ID.
@ -133,7 +135,7 @@ namespace StatsFunctions
* \param skillId The ID of the skill.
* \return The name of the skill.
*/
extern "C" const char *GetSkillName(unsigned short skillId) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetSkillName(unsigned short skillId) noexcept;
/**
* \brief Get the name of a player.
@ -141,7 +143,7 @@ namespace StatsFunctions
* \param pid The player ID.
* \return The name of the player.
*/
extern "C" const char *GetName(unsigned short pid) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetName(unsigned short pid) noexcept;
/**
* \brief Get the race of a player.
@ -149,7 +151,7 @@ namespace StatsFunctions
* \param pid The player ID.
* \return The race of the player.
*/
extern "C" const char *GetRace(unsigned short pid) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetRace(unsigned short pid) noexcept;
/**
* \brief Get the head mesh used by a player.
@ -157,7 +159,7 @@ namespace StatsFunctions
* \param pid The player ID.
* \return The head mesh of the player.
*/
extern "C" const char *GetHead(unsigned short pid) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetHead(unsigned short pid) noexcept;
/**
* \brief Get the hairstyle mesh used by a player.
@ -165,7 +167,7 @@ namespace StatsFunctions
* \param pid The player ID.
* \return The hairstyle mesh of the player.
*/
extern "C" const char *GetHairstyle(unsigned short pid) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetHairstyle(unsigned short pid) noexcept;
/**
* \brief Check whether a player is male or not.
@ -173,7 +175,7 @@ namespace StatsFunctions
* \param pid The player ID.
* \return Whether the player is male.
*/
extern "C" int GetIsMale(unsigned short pid) noexcept;
EXPORT_APIFUNCTION int CDECL GetIsMale(unsigned short pid) noexcept;
/**
* \brief Get the birthsign of a player.
@ -181,7 +183,7 @@ namespace StatsFunctions
* \param pid The player ID.
* \return The birthsign of the player.
*/
extern "C" const char *GetBirthsign(unsigned short pid) noexcept;
EXPORT_APIFUNCTION const CDECL char *GetBirthsign(unsigned short pid) noexcept;
/**
* \brief Get the character level of a player.
@ -189,7 +191,7 @@ namespace StatsFunctions
* \param pid The player ID.
* \return The level of the player.
*/
extern "C" int GetLevel(unsigned short pid) noexcept;
EXPORT_APIFUNCTION int CDECL GetLevel(unsigned short pid) noexcept;
/**
* \brief Get the player's progress to their next character level.
@ -197,7 +199,7 @@ namespace StatsFunctions
* \param pid The player ID.
* \return The level progress.
*/
extern "C" int GetLevelProgress(unsigned short pid) noexcept;
EXPORT_APIFUNCTION int CDECL GetLevelProgress(unsigned short pid) noexcept;
/**
* \brief Get the base health of the player.
@ -205,7 +207,7 @@ namespace StatsFunctions
* \param pid The player ID.
* \return The base health.
*/
extern "C" double GetHealthBase(unsigned short pid) noexcept;
EXPORT_APIFUNCTION double CDECL GetHealthBase(unsigned short pid) noexcept;
/**
* \brief Get the current health of the player.
@ -213,7 +215,7 @@ namespace StatsFunctions
* \param pid The player ID.
* \return The current health.
*/
extern "C" double GetHealthCurrent(unsigned short pid) noexcept;
EXPORT_APIFUNCTION double CDECL GetHealthCurrent(unsigned short pid) noexcept;
/**
* \brief Get the base magicka of the player.
@ -221,7 +223,7 @@ namespace StatsFunctions
* \param pid The player ID.
* \return The base magicka.
*/
extern "C" double GetMagickaBase(unsigned short pid) noexcept;
EXPORT_APIFUNCTION double CDECL GetMagickaBase(unsigned short pid) noexcept;
/**
* \brief Get the current magicka of the player.
@ -229,7 +231,7 @@ namespace StatsFunctions
* \param pid The player ID.
* \return The current magicka.
*/
extern "C" double GetMagickaCurrent(unsigned short pid) noexcept;
EXPORT_APIFUNCTION double CDECL GetMagickaCurrent(unsigned short pid) noexcept;
/**
* \brief Get the base fatigue of the player.
@ -237,7 +239,7 @@ namespace StatsFunctions
* \param pid The player ID.
* \return The base fatigue.
*/
extern "C" double GetFatigueBase(unsigned short pid) noexcept;
EXPORT_APIFUNCTION double CDECL GetFatigueBase(unsigned short pid) noexcept;
/**
* \brief Get the current fatigue of the player.
@ -245,7 +247,7 @@ namespace StatsFunctions
* \param pid The player ID.
* \return The current fatigue.
*/
extern "C" double GetFatigueCurrent(unsigned short pid) noexcept;
EXPORT_APIFUNCTION double CDECL GetFatigueCurrent(unsigned short pid) noexcept;
/**
* \brief Get the base value of a player's attribute.
@ -254,7 +256,7 @@ namespace StatsFunctions
* \param attributeId The attribute ID.
* \return The base value of the attribute.
*/
extern "C" int GetAttributeBase(unsigned short pid, unsigned short attributeId) noexcept;
EXPORT_APIFUNCTION int CDECL GetAttributeBase(unsigned short pid, unsigned short attributeId) noexcept;
/**
* \brief Get the modifier value of a player's attribute.
@ -263,7 +265,7 @@ namespace StatsFunctions
* \param attributeId The attribute ID.
* \return The modifier value of the attribute.
*/
extern "C" int GetAttributeModifier(unsigned short pid, unsigned short attributeId) noexcept;
EXPORT_APIFUNCTION int CDECL GetAttributeModifier(unsigned short pid, unsigned short attributeId) noexcept;
/**
* \brief Get the base value of a player's skill.
@ -272,7 +274,7 @@ namespace StatsFunctions
* \param skillId The skill ID.
* \return The base value of the skill.
*/
extern "C" int GetSkillBase(unsigned short pid, unsigned short skillId) noexcept;
EXPORT_APIFUNCTION int CDECL GetSkillBase(unsigned short pid, unsigned short skillId) noexcept;
/**
* \brief Get the modifier value of a player's skill.
@ -281,7 +283,7 @@ namespace StatsFunctions
* \param skillId The skill ID.
* \return The modifier value of the skill.
*/
extern "C" int GetSkillModifier(unsigned short pid, unsigned short skillId) noexcept;
EXPORT_APIFUNCTION 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.
@ -290,7 +292,7 @@ namespace StatsFunctions
* \param skillId The skill ID.
* \return The skill progress.
*/
extern "C" double GetSkillProgress(unsigned short pid, unsigned short skillId) noexcept;
EXPORT_APIFUNCTION 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
@ -302,7 +304,7 @@ namespace StatsFunctions
* \param skillId The attribute ID.
* \return The increase in the attribute caused by skills.
*/
extern "C" int GetSkillIncrease(unsigned short pid, unsigned int attributeId) noexcept;
EXPORT_APIFUNCTION int CDECL GetSkillIncrease(unsigned short pid, unsigned int attributeId) noexcept;
/**
* \brief Get the bounty of the player.
@ -310,7 +312,7 @@ namespace StatsFunctions
* \param pid The player ID.
* \return The bounty.
*/
extern "C" int GetBounty(unsigned short pid) noexcept;
EXPORT_APIFUNCTION int CDECL GetBounty(unsigned short pid) noexcept;
/**
* \brief Set the name of a player.
@ -319,7 +321,7 @@ namespace StatsFunctions
* \param name The new name of the player.
* \return void
*/
extern "C" void SetName(unsigned short pid, const char *name) noexcept;
EXPORT_APIFUNCTION void CDECL SetName(unsigned short pid, const char *name) noexcept;
/**
* \brief Set the race of a player.
@ -328,7 +330,7 @@ namespace StatsFunctions
* \param race The new race of the player.
* \return void
*/
extern "C" void SetRace(unsigned short pid, const char *race) noexcept;
EXPORT_APIFUNCTION void CDECL SetRace(unsigned short pid, const char *race) noexcept;
/**
* \brief Set the head mesh used by a player.
@ -337,7 +339,7 @@ namespace StatsFunctions
* \param head The new head mesh of the player.
* \return void
*/
extern "C" void SetHead(unsigned short pid, const char *head) noexcept;
EXPORT_APIFUNCTION void CDECL SetHead(unsigned short pid, const char *head) noexcept;
/**
* \brief Set the hairstyle mesh used by a player.
@ -346,7 +348,7 @@ namespace StatsFunctions
* \param hairstyle The new hairstyle mesh of the player.
* \return void
*/
extern "C" void SetHairstyle(unsigned short pid, const char *hairstyle) noexcept;
EXPORT_APIFUNCTION void CDECL SetHairstyle(unsigned short pid, const char *hairstyle) noexcept;
/**
* \brief Set whether a player is male or not.
@ -355,7 +357,7 @@ namespace StatsFunctions
* \param state Whether the player is male.
* \return void
*/
extern "C" void SetIsMale(unsigned short pid, int state) noexcept;
EXPORT_APIFUNCTION void CDECL SetIsMale(unsigned short pid, int state) noexcept;
/**
* \brief Set the birthsign of a player.
@ -364,7 +366,7 @@ namespace StatsFunctions
* \param name The new birthsign of the player.
* \return void
*/
extern "C" void SetBirthsign(unsigned short pid, const char *name) noexcept;
EXPORT_APIFUNCTION void CDECL SetBirthsign(unsigned short pid, const char *name) noexcept;
/**
* \brief Set whether the player's stats should be reset based on their
@ -377,7 +379,7 @@ namespace StatsFunctions
* \param resetStats The stat reset state.
* \return void
*/
extern "C" void SetResetStats(unsigned short pid, bool resetStats) noexcept;
EXPORT_APIFUNCTION void CDECL SetResetStats(unsigned short pid, bool resetStats) noexcept;
/**
* \brief Set the character level of a player.
@ -386,7 +388,7 @@ namespace StatsFunctions
* \param value The new level of the player.
* \return void
*/
extern "C" void SetLevel(unsigned short pid, int value) noexcept;
EXPORT_APIFUNCTION void CDECL SetLevel(unsigned short pid, int value) noexcept;
/**
* \brief Set the player's progress to their next character level.
@ -395,7 +397,7 @@ namespace StatsFunctions
* \param value The new level progress of the player.
* \return void
*/
extern "C" void SetLevelProgress(unsigned short pid, int value) noexcept;
EXPORT_APIFUNCTION void CDECL SetLevelProgress(unsigned short pid, int value) noexcept;
/**
* \brief Set the base health of a player.
@ -404,7 +406,7 @@ namespace StatsFunctions
* \param name The new base health of the player.
* \return void
*/
extern "C" void SetHealthBase(unsigned short pid, double value) noexcept;
EXPORT_APIFUNCTION void CDECL SetHealthBase(unsigned short pid, double value) noexcept;
/**
* \brief Set the current health of a player.
@ -413,7 +415,7 @@ namespace StatsFunctions
* \param name The new current health of the player.
* \return void
*/
extern "C" void SetHealthCurrent(unsigned short pid, double value) noexcept;
EXPORT_APIFUNCTION void CDECL SetHealthCurrent(unsigned short pid, double value) noexcept;
/**
* \brief Set the base magicka of a player.
@ -422,7 +424,7 @@ namespace StatsFunctions
* \param name The new base magicka of the player.
* \return void
*/
extern "C" void SetMagickaBase(unsigned short pid, double value) noexcept;
EXPORT_APIFUNCTION void CDECL SetMagickaBase(unsigned short pid, double value) noexcept;
/**
* \brief Set the current magicka of a player.
@ -431,7 +433,7 @@ namespace StatsFunctions
* \param name The new current magicka of the player.
* \return void
*/
extern "C" void SetMagickaCurrent(unsigned short pid, double value) noexcept;
EXPORT_APIFUNCTION void CDECL SetMagickaCurrent(unsigned short pid, double value) noexcept;
/**
* \brief Set the base fatigue of a player.
@ -440,7 +442,7 @@ namespace StatsFunctions
* \param name The new base fatigue of the player.
* \return void
*/
extern "C" void SetFatigueBase(unsigned short pid, double value) noexcept;
EXPORT_APIFUNCTION void CDECL SetFatigueBase(unsigned short pid, double value) noexcept;
/**
* \brief Set the current fatigue of a player.
@ -449,7 +451,7 @@ namespace StatsFunctions
* \param name The new current fatigue of the player.
* \return void
*/
extern "C" void SetFatigueCurrent(unsigned short pid, double value) noexcept;
EXPORT_APIFUNCTION void CDECL SetFatigueCurrent(unsigned short pid, double value) noexcept;
/**
* \brief Set the base value of a player's attribute.
@ -459,7 +461,7 @@ namespace StatsFunctions
* \param value The new base value of the player's attribute.
* \return void
*/
extern "C" void SetAttributeBase(unsigned short pid, unsigned short attributeId, int value) noexcept;
EXPORT_APIFUNCTION void CDECL SetAttributeBase(unsigned short pid, unsigned short attributeId, int value) noexcept;
/**
* \brief Clear the modifier value of a player's attribute.
@ -473,7 +475,7 @@ namespace StatsFunctions
* \param attributeId The attribute ID.
* \return void
*/
extern "C" void ClearAttributeModifier(unsigned short pid, unsigned short attributeId) noexcept;
EXPORT_APIFUNCTION void CDECL ClearAttributeModifier(unsigned short pid, unsigned short attributeId) noexcept;
/**
* \brief Set the base value of a player's skill.
@ -483,7 +485,7 @@ namespace StatsFunctions
* \param value The new base value of the player's skill.
* \return void
*/
extern "C" void SetSkillBase(unsigned short pid, unsigned short skillId, int value) noexcept;
EXPORT_APIFUNCTION void CDECL SetSkillBase(unsigned short pid, unsigned short skillId, int value) noexcept;
/**
* \brief Clear the modifier value of a player's skill.
@ -497,7 +499,7 @@ namespace StatsFunctions
* \param skillId The skill ID.
* \return void
*/
extern "C" void ClearSkillModifier(unsigned short pid, unsigned short skillId) noexcept;
EXPORT_APIFUNCTION 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.
@ -507,7 +509,7 @@ namespace StatsFunctions
* \param value The progress value.
* \return void
*/
extern "C" void SetSkillProgress(unsigned short pid, unsigned short skillId, double value) noexcept;
EXPORT_APIFUNCTION 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
@ -520,7 +522,7 @@ namespace StatsFunctions
* \param value The increase in the attribute caused by skills.
* \return void
*/
extern "C" void SetSkillIncrease(unsigned short pid, unsigned int attributeId, int value) noexcept;
EXPORT_APIFUNCTION void CDECL SetSkillIncrease(unsigned short pid, unsigned int attributeId, int value) noexcept;
/**
* \brief Set the bounty of a player.
@ -529,7 +531,7 @@ namespace StatsFunctions
* \param value The new bounty.
* \return void
*/
extern "C" void SetBounty(unsigned short pid, int value) noexcept;
EXPORT_APIFUNCTION void CDECL SetBounty(unsigned short pid, int value) noexcept;
/**
* \brief Set the current and ending stages of character generation for a player.
@ -541,7 +543,7 @@ namespace StatsFunctions
* \param endStage The new ending stage.
* \return void
*/
extern "C" void SetCharGenStage(unsigned short pid, int currentStage, int endStage) noexcept;
EXPORT_APIFUNCTION void CDECL SetCharGenStage(unsigned short pid, int currentStage, int endStage) noexcept;
/**
* \brief Send a PlayerBaseInfo packet with a player's name, race, head mesh,
@ -552,7 +554,7 @@ namespace StatsFunctions
* \param pid The player ID.
* \return void
*/
extern "C" void SendBaseInfo(unsigned short pid) noexcept;
EXPORT_APIFUNCTION void CDECL SendBaseInfo(unsigned short pid) noexcept;
/**
* \brief Send a PlayerStatsDynamic packet with a player's dynamic stats (health,
@ -563,7 +565,7 @@ namespace StatsFunctions
* \param pid The player ID.
* \return void
*/
extern "C" void SendStatsDynamic(unsigned short pid) noexcept;
EXPORT_APIFUNCTION void CDECL SendStatsDynamic(unsigned short pid) noexcept;
/**
* \brief Send a PlayerAttribute packet with a player's attributes and bonuses
@ -575,7 +577,7 @@ namespace StatsFunctions
* \param pid The player ID.
* \return void
*/
extern "C" void SendAttributes(unsigned short pid) noexcept;
EXPORT_APIFUNCTION void CDECL SendAttributes(unsigned short pid) noexcept;
/**
* \brief Send a PlayerSkill packet with a player's skills.
@ -585,7 +587,7 @@ namespace StatsFunctions
* \param pid The player ID.
* \return void
*/
extern "C" void SendSkills(unsigned short pid) noexcept;
EXPORT_APIFUNCTION void CDECL SendSkills(unsigned short pid) noexcept;
/**
* \brief Send a PlayerLevel packet with a player's character level and
@ -596,7 +598,7 @@ namespace StatsFunctions
* \param pid The player ID.
* \return void
*/
extern "C" void SendLevel(unsigned short pid) noexcept;
EXPORT_APIFUNCTION void CDECL SendLevel(unsigned short pid) noexcept;
/**
* \brief Send a PlayerBounty packet with a player's bounty.
@ -606,7 +608,7 @@ namespace StatsFunctions
* \param pid The player ID.
* \return void
*/
extern "C" void SendBounty(unsigned short pid) noexcept;
EXPORT_APIFUNCTION void CDECL SendBounty(unsigned short pid) noexcept;
}
#endif //OPENMW_STATAPI_HPP

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

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

@ -5,16 +5,24 @@
#ifndef PLATFORM_HPP
#define PLATFORM_HPP
#if _MSC_VER
#ifdef _MSC_VER
#ifdef _M_X86
#define ARCH_X86
#endif
#endif
#if __GNUC__
#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"
#define CDECL
#endif
#endif //PLATFORM_HPP

Loading…
Cancel
Save