2018-05-15 17:58:09 +00:00
|
|
|
#ifndef OPENMW_WORLDSTATEAPI_HPP
|
|
|
|
#define OPENMW_WORLDSTATEAPI_HPP
|
|
|
|
|
|
|
|
#include "../Types.hpp"
|
|
|
|
|
|
|
|
#define WORLDSTATEAPI \
|
|
|
|
{"SetHour", WorldstateFunctions::SetHour},\
|
2018-05-23 05:31:25 +00:00
|
|
|
{"SetDay", WorldstateFunctions::SetDay},\
|
2018-05-15 17:58:09 +00:00
|
|
|
{"SetMonth", WorldstateFunctions::SetMonth},\
|
2018-05-25 00:33:12 +00:00
|
|
|
{"SetYear", WorldstateFunctions::SetYear},\
|
|
|
|
\
|
2018-05-24 11:02:04 +00:00
|
|
|
{"SetDaysPassed", WorldstateFunctions::SetDaysPassed},\
|
2018-05-24 06:38:06 +00:00
|
|
|
{"SetTimeScale", WorldstateFunctions::SetTimeScale},\
|
|
|
|
\
|
|
|
|
{"SendWorldTime", WorldstateFunctions::SendWorldTime}
|
2018-05-15 17:58:09 +00:00
|
|
|
|
|
|
|
class WorldstateFunctions
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
/**
|
2018-05-24 06:38:06 +00:00
|
|
|
* \brief Set the world's hour in the worldstate stored on the server.
|
2018-05-15 17:58:09 +00:00
|
|
|
*
|
|
|
|
* \param hour The hour.
|
|
|
|
* \return void
|
|
|
|
*/
|
2018-05-24 06:38:06 +00:00
|
|
|
static void SetHour(double hour) noexcept;
|
2018-05-15 17:58:09 +00:00
|
|
|
|
|
|
|
/**
|
2018-05-24 06:38:06 +00:00
|
|
|
* \brief Set the world's day in the worldstate stored on the server.
|
2018-05-23 05:31:25 +00:00
|
|
|
*
|
|
|
|
* \param day The day.
|
|
|
|
* \return void
|
|
|
|
*/
|
2018-05-24 06:38:06 +00:00
|
|
|
static void SetDay(int day) noexcept;
|
2018-05-23 05:31:25 +00:00
|
|
|
|
|
|
|
/**
|
2018-05-24 06:38:06 +00:00
|
|
|
* \brief Set the world's month in the worldstate stored on the server.
|
2018-05-15 17:58:09 +00:00
|
|
|
*
|
|
|
|
* \param month The month.
|
|
|
|
* \return void
|
|
|
|
*/
|
2018-05-24 06:38:06 +00:00
|
|
|
static void SetMonth(int month) noexcept;
|
2018-05-15 17:58:09 +00:00
|
|
|
|
2018-05-25 00:33:12 +00:00
|
|
|
/**
|
|
|
|
* \brief Set the world's year in the worldstate stored on the server.
|
|
|
|
*
|
|
|
|
* \param year The year.
|
|
|
|
* \return void
|
|
|
|
*/
|
|
|
|
static void SetYear(int year) noexcept;
|
|
|
|
|
2018-05-24 11:02:04 +00:00
|
|
|
/**
|
|
|
|
* \brief Set the world's days passed in the worldstate stored on the server.
|
|
|
|
*
|
|
|
|
* \param daysPassed The days passed.
|
|
|
|
* \return void
|
|
|
|
*/
|
|
|
|
static void SetDaysPassed(int daysPassed) noexcept;
|
|
|
|
|
2018-05-15 17:58:09 +00:00
|
|
|
/**
|
2018-05-24 06:38:06 +00:00
|
|
|
* \brief Set the world's time scale in the worldstate stored on the server.
|
2018-05-15 17:58:09 +00:00
|
|
|
*
|
|
|
|
* \param pid The player ID.
|
2018-05-23 05:31:25 +00:00
|
|
|
* \param timeScale The time scale.
|
2018-05-15 17:58:09 +00:00
|
|
|
* \return void
|
|
|
|
*/
|
2018-05-24 06:38:06 +00:00
|
|
|
static void SetTimeScale(double timeScale) noexcept;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Send a WorldTime packet with the current time and time scale
|
|
|
|
* to a specific player or to all players.
|
|
|
|
*
|
|
|
|
* \param pid The player ID.
|
|
|
|
* \return void
|
|
|
|
*/
|
|
|
|
static void SendWorldTime(unsigned short pid, bool toOthers = false) noexcept;
|
2018-05-15 17:58:09 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif //OPENMW_WORLDSTATEAPI_HPP
|