2017-05-18 17:56:50 +00:00
|
|
|
#ifndef OPENMW_FACTIONAPI_HPP
|
|
|
|
#define OPENMW_FACTIONAPI_HPP
|
|
|
|
|
2019-01-15 12:26:11 +00:00
|
|
|
#include "../api.h"
|
2019-01-15 11:41:58 +00:00
|
|
|
|
2019-01-15 12:26:11 +00:00
|
|
|
NAMESPACE_BEGIN(FactionFunctions)
|
2017-07-19 17:40:51 +00:00
|
|
|
/**
|
|
|
|
* \brief Clear the last recorded faction changes for a player.
|
|
|
|
*
|
|
|
|
* This is used to initialize the sending of new PlayerFaction packets.
|
|
|
|
*
|
|
|
|
* \param pid The player ID whose faction changes should be used.
|
|
|
|
* \return void
|
|
|
|
*/
|
2019-01-16 15:52:22 +00:00
|
|
|
API_FUNCTION void CDECL ClearFactionChanges(PlayerId pid) NOEXCEPT;
|
2017-07-07 06:25:48 +00:00
|
|
|
|
2017-07-19 17:40:51 +00:00
|
|
|
/**
|
|
|
|
* \brief Get the number of indexes in a player's latest faction changes.
|
|
|
|
*
|
|
|
|
* \param pid The player ID whose faction changes should be used.
|
|
|
|
* \return The number of indexes.
|
|
|
|
*/
|
2019-01-16 15:52:22 +00:00
|
|
|
API_FUNCTION unsigned int CDECL GetFactionChangesSize(PlayerId pid) NOEXCEPT;
|
2017-07-19 17:40:51 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Get the action type used in a player's latest faction changes.
|
|
|
|
*
|
|
|
|
* \param pid The player ID whose faction changes should be used.
|
|
|
|
* \return The action type (0 for RANK, 1 for EXPULSION, 2 for REPUTATION).
|
|
|
|
*/
|
2019-01-16 15:52:22 +00:00
|
|
|
API_FUNCTION unsigned char CDECL GetFactionChangesAction(PlayerId pid) NOEXCEPT;
|
2017-05-18 17:56:50 +00:00
|
|
|
|
2017-07-19 17:40:51 +00:00
|
|
|
/**
|
|
|
|
* \brief Get the factionId at a certain index in a player's latest faction changes.
|
|
|
|
*
|
|
|
|
* \param pid The player ID whose faction changes should be used.
|
2018-07-24 17:14:51 +00:00
|
|
|
* \param index The index of the faction.
|
2017-07-19 17:40:51 +00:00
|
|
|
* \return The factionId.
|
|
|
|
*/
|
2019-01-16 15:52:22 +00:00
|
|
|
API_FUNCTION const char *CDECL GetFactionId(PlayerId pid, unsigned int index) NOEXCEPT;
|
2017-07-19 17:40:51 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Get the rank at a certain index in a player's latest faction changes.
|
|
|
|
*
|
|
|
|
* \param pid The player ID whose faction changes should be used.
|
2018-07-24 17:14:51 +00:00
|
|
|
* \param index The index of the faction.
|
2017-07-19 17:40:51 +00:00
|
|
|
* \return The rank.
|
|
|
|
*/
|
2019-01-16 15:52:22 +00:00
|
|
|
API_FUNCTION int CDECL GetFactionRank(PlayerId pid, unsigned int index) NOEXCEPT;
|
2017-07-19 17:40:51 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Get the expulsion state at a certain index in a player's latest faction changes.
|
|
|
|
*
|
|
|
|
* \param pid The player ID whose faction changes should be used.
|
2018-07-24 17:14:51 +00:00
|
|
|
* \param index The index of the faction.
|
2017-07-19 17:40:51 +00:00
|
|
|
* \return The expulsion state.
|
|
|
|
*/
|
2019-01-16 15:52:22 +00:00
|
|
|
API_FUNCTION bool CDECL GetFactionExpulsionState(PlayerId pid, unsigned int index) NOEXCEPT;
|
2017-07-19 17:40:51 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Get the reputation at a certain index in a player's latest faction changes.
|
|
|
|
*
|
|
|
|
* \param pid The player ID whose faction changes should be used.
|
2018-07-24 17:14:51 +00:00
|
|
|
* \param index The index of the faction.
|
2017-07-19 17:40:51 +00:00
|
|
|
* \return The reputation.
|
|
|
|
*/
|
2019-01-16 15:52:22 +00:00
|
|
|
API_FUNCTION int CDECL GetFactionReputation(PlayerId pid, unsigned int index) NOEXCEPT;
|
2017-05-18 17:56:50 +00:00
|
|
|
|
2017-07-19 17:40:51 +00:00
|
|
|
/**
|
|
|
|
* \brief Set the action type in a player's faction changes.
|
|
|
|
*
|
|
|
|
* \param pid The player ID whose faction changes should be used.
|
|
|
|
* \param action The action (0 for RANK, 1 for EXPULSION, 2 for REPUTATION).
|
|
|
|
* \return void
|
|
|
|
*/
|
2019-01-16 15:52:22 +00:00
|
|
|
API_FUNCTION void CDECL SetFactionChangesAction(PlayerId pid, unsigned char action) NOEXCEPT;
|
2017-07-19 17:40:51 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Set the factionId of the temporary faction stored on the server.
|
|
|
|
*
|
|
|
|
* \param factionId The factionId.
|
|
|
|
* \return void
|
|
|
|
*/
|
2019-01-16 15:52:22 +00:00
|
|
|
API_FUNCTION void CDECL SetFactionId(const char* factionId) NOEXCEPT;
|
2017-07-19 17:40:51 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Set the rank of the temporary faction stored on the server.
|
|
|
|
*
|
|
|
|
* \param rank The rank.
|
|
|
|
* \return void
|
|
|
|
*/
|
2019-01-16 15:52:22 +00:00
|
|
|
API_FUNCTION void CDECL SetFactionRank(unsigned int rank) NOEXCEPT;
|
2017-07-19 17:40:51 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Set the expulsion state of the temporary faction stored on the server.
|
|
|
|
*
|
|
|
|
* \param expulsionState The expulsion state.
|
|
|
|
* \return void
|
|
|
|
*/
|
2019-01-16 15:52:22 +00:00
|
|
|
API_FUNCTION void CDECL SetFactionExpulsionState(bool expulsionState) NOEXCEPT;
|
2017-07-19 17:40:51 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Set the reputation of the temporary faction stored on the server.
|
|
|
|
*
|
|
|
|
* \param reputation The reputation.
|
|
|
|
* \return void
|
|
|
|
*/
|
2019-01-16 15:52:22 +00:00
|
|
|
API_FUNCTION void CDECL SetFactionReputation(int reputation) NOEXCEPT;
|
2017-07-13 10:36:00 +00:00
|
|
|
|
2017-07-19 17:40:51 +00:00
|
|
|
/**
|
|
|
|
* \brief Add the server's temporary faction to the faction changes for a player.
|
|
|
|
*
|
2017-07-23 18:59:33 +00:00
|
|
|
* In the process, the server's temporary faction will automatically be cleared so a new one
|
|
|
|
* can be set up.
|
|
|
|
*
|
2017-07-19 17:40:51 +00:00
|
|
|
* \param pid The player ID whose faction changes should be used.
|
|
|
|
* \return void
|
|
|
|
*/
|
2019-01-16 15:52:22 +00:00
|
|
|
API_FUNCTION void CDECL AddFaction(PlayerId pid) NOEXCEPT;
|
2017-07-07 06:25:48 +00:00
|
|
|
|
2017-07-19 17:40:51 +00:00
|
|
|
/**
|
|
|
|
* \brief Send a PlayerFaction packet with a player's recorded faction changes.
|
|
|
|
*
|
|
|
|
* \param pid The player ID whose faction changes should be used.
|
2018-07-07 15:29:31 +00:00
|
|
|
* \param sendToOtherPlayers Whether this packet should be sent to players other than the
|
|
|
|
* player attached to the packet (false by default).
|
2018-07-07 17:16:36 +00:00
|
|
|
* \param skipAttachedPlayer Whether the packet should skip being sent to the player attached
|
|
|
|
* to the packet (false by default).
|
2017-07-19 17:40:51 +00:00
|
|
|
* \return void
|
|
|
|
*/
|
2019-01-16 15:52:22 +00:00
|
|
|
API_FUNCTION void CDECL SendFactionChanges(PlayerId pid, bool sendToOtherPlayers, bool skipAttachedPlayer) NOEXCEPT;
|
2018-10-02 23:26:47 +00:00
|
|
|
|
|
|
|
// All methods below are deprecated versions of methods from above
|
|
|
|
|
2019-01-16 15:52:22 +00:00
|
|
|
API_FUNCTION void CDECL InitializeFactionChanges(PlayerId pid) NOEXCEPT;
|
2019-01-15 12:26:11 +00:00
|
|
|
NAMESPACE_END()
|
2017-05-18 17:56:50 +00:00
|
|
|
|
|
|
|
#endif //OPENMW_FACTIONAPI_HPP
|