2018-05-15 17:58:09 +00:00
|
|
|
#ifndef OPENMW_WORLDSTATEAPI_HPP
|
|
|
|
#define OPENMW_WORLDSTATEAPI_HPP
|
|
|
|
|
|
|
|
#include "../Types.hpp"
|
|
|
|
|
|
|
|
#define WORLDSTATEAPI \
|
2018-05-27 13:05:40 +00:00
|
|
|
{"SetHour", WorldstateFunctions::SetHour},\
|
|
|
|
{"SetDay", WorldstateFunctions::SetDay},\
|
|
|
|
{"SetMonth", WorldstateFunctions::SetMonth},\
|
|
|
|
{"SetYear", WorldstateFunctions::SetYear},\
|
|
|
|
{"SetDaysPassed", WorldstateFunctions::SetDaysPassed},\
|
|
|
|
{"SetTimeScale", WorldstateFunctions::SetTimeScale},\
|
2018-05-25 00:33:12 +00:00
|
|
|
\
|
2018-05-27 13:05:40 +00:00
|
|
|
{"SetPlayerCollisionState", WorldstateFunctions::SetPlayerCollisionState},\
|
|
|
|
{"SetActorCollisionState", WorldstateFunctions::SetActorCollisionState},\
|
|
|
|
{"SetPlacedObjectCollisionState", WorldstateFunctions::SetPlacedObjectCollisionState},\
|
|
|
|
{"UseActorCollisionForPlacedObjects", WorldstateFunctions::UseActorCollisionForPlacedObjects},\
|
2018-05-24 06:38:06 +00:00
|
|
|
\
|
2018-05-27 13:05:40 +00:00
|
|
|
{"SendWorldTime", WorldstateFunctions::SendWorldTime},\
|
|
|
|
{"SendWorldCollisionOverride", WorldstateFunctions::SendWorldCollisionOverride}
|
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;
|
|
|
|
|
2018-05-27 13:05:40 +00:00
|
|
|
/**
|
|
|
|
* \brief Set the collision state for other players.
|
|
|
|
*
|
|
|
|
* \param state The collision state.
|
|
|
|
* \return void
|
|
|
|
*/
|
|
|
|
static void SetPlayerCollisionState(bool state) noexcept;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Set the collision state for actors.
|
|
|
|
*
|
|
|
|
* \param state The collision state.
|
|
|
|
* \return void
|
|
|
|
*/
|
|
|
|
static void SetActorCollisionState(bool state) noexcept;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Set the collision state for placed objects.
|
|
|
|
*
|
|
|
|
* \param state The collision state.
|
|
|
|
* \return void
|
|
|
|
*/
|
|
|
|
static void SetPlacedObjectCollisionState(bool state) noexcept;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Whether placed objects with collision turned on should use
|
|
|
|
* actor collision, i.e. whether they should be slippery
|
|
|
|
* and prevent players from standing on them.
|
|
|
|
*
|
|
|
|
* \param useActorCollision Whether to use actor collision.
|
|
|
|
* \return void
|
|
|
|
*/
|
|
|
|
static void UseActorCollisionForPlacedObjects(bool useActorCollision) noexcept;
|
|
|
|
|
2018-05-24 06:38:06 +00:00
|
|
|
/**
|
|
|
|
* \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
|
|
|
|
2018-05-27 13:05:40 +00:00
|
|
|
/**
|
|
|
|
* \brief Send a WorldCollisionOverride packet with the current collision overrides
|
|
|
|
* to a specific player or to all players.
|
|
|
|
*
|
|
|
|
* \param pid The player ID.
|
|
|
|
* \return void
|
|
|
|
*/
|
|
|
|
static void SendWorldCollisionOverride(unsigned short pid, bool toOthers = false) noexcept;
|
|
|
|
|
2018-05-15 17:58:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif //OPENMW_WORLDSTATEAPI_HPP
|