2017-06-20 04:24:15 +00:00
|
|
|
#ifndef OPENMW_SETTINGSAPI_HPP
|
|
|
|
#define OPENMW_SETTINGSAPI_HPP
|
|
|
|
|
|
|
|
#include "../Types.hpp"
|
|
|
|
|
|
|
|
#define SETTINGSAPI \
|
|
|
|
{"SetConsoleAllow", SettingFunctions::SetConsoleAllow},\
|
|
|
|
{"SetDifficulty", SettingFunctions::SetDifficulty},\
|
|
|
|
\
|
|
|
|
{"SendSettings", SettingFunctions::SendSettings}
|
|
|
|
|
|
|
|
class SettingFunctions
|
|
|
|
{
|
|
|
|
public:
|
2017-07-19 17:40:51 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Set whether the console is allowed for a player.
|
|
|
|
*
|
|
|
|
* This changes the console permission for that player in the server memory, but does not
|
|
|
|
* by itself send a packet.
|
|
|
|
*
|
2017-07-25 15:07:09 +00:00
|
|
|
* \param pid The player ID.
|
2017-07-19 17:40:51 +00:00
|
|
|
* \param bool The console permission state.
|
|
|
|
* \return void
|
|
|
|
*/
|
2017-06-20 04:24:15 +00:00
|
|
|
static void SetConsoleAllow(unsigned short pid, bool state);
|
2017-07-19 17:40:51 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Set the difficulty for a player.
|
|
|
|
*
|
|
|
|
* This changes the difficulty for that player in the server memory, but does not by itself
|
|
|
|
* send a packet.
|
|
|
|
*
|
2017-07-25 15:07:09 +00:00
|
|
|
* \param pid The player ID.
|
2017-07-19 17:40:51 +00:00
|
|
|
* \param bool The difficulty.
|
|
|
|
* \return void
|
|
|
|
*/
|
2017-06-20 04:24:15 +00:00
|
|
|
static void SetDifficulty(unsigned short pid, int difficulty);
|
|
|
|
|
2017-07-19 17:40:51 +00:00
|
|
|
/**
|
|
|
|
* \brief Send a PlayerSettings packet to the player affected by it.
|
|
|
|
*
|
|
|
|
* \param pid The player ID to send it to.
|
|
|
|
* \return void
|
|
|
|
*/
|
2017-06-20 04:24:15 +00:00
|
|
|
static void SendSettings(unsigned short pid) noexcept;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif //OPENMW_SETTINGSAPI_HPP
|