|
|
|
@ -4,15 +4,20 @@
|
|
|
|
|
#include "../Types.hpp"
|
|
|
|
|
|
|
|
|
|
#define WORLDSTATEAPI \
|
|
|
|
|
{"SetHour", WorldstateFunctions::SetHour},\
|
|
|
|
|
{"SetDay", WorldstateFunctions::SetDay},\
|
|
|
|
|
{"SetMonth", WorldstateFunctions::SetMonth},\
|
|
|
|
|
{"SetYear", WorldstateFunctions::SetYear},\
|
|
|
|
|
{"SetHour", WorldstateFunctions::SetHour},\
|
|
|
|
|
{"SetDay", WorldstateFunctions::SetDay},\
|
|
|
|
|
{"SetMonth", WorldstateFunctions::SetMonth},\
|
|
|
|
|
{"SetYear", WorldstateFunctions::SetYear},\
|
|
|
|
|
{"SetDaysPassed", WorldstateFunctions::SetDaysPassed},\
|
|
|
|
|
{"SetTimeScale", WorldstateFunctions::SetTimeScale},\
|
|
|
|
|
\
|
|
|
|
|
{"SetDaysPassed", WorldstateFunctions::SetDaysPassed},\
|
|
|
|
|
{"SetTimeScale", WorldstateFunctions::SetTimeScale},\
|
|
|
|
|
{"SetPlayerCollisionState", WorldstateFunctions::SetPlayerCollisionState},\
|
|
|
|
|
{"SetActorCollisionState", WorldstateFunctions::SetActorCollisionState},\
|
|
|
|
|
{"SetPlacedObjectCollisionState", WorldstateFunctions::SetPlacedObjectCollisionState},\
|
|
|
|
|
{"UseActorCollisionForPlacedObjects", WorldstateFunctions::UseActorCollisionForPlacedObjects},\
|
|
|
|
|
\
|
|
|
|
|
{"SendWorldTime", WorldstateFunctions::SendWorldTime}
|
|
|
|
|
{"SendWorldTime", WorldstateFunctions::SendWorldTime},\
|
|
|
|
|
{"SendWorldCollisionOverride", WorldstateFunctions::SendWorldCollisionOverride}
|
|
|
|
|
|
|
|
|
|
class WorldstateFunctions
|
|
|
|
|
{
|
|
|
|
@ -67,6 +72,40 @@ public:
|
|
|
|
|
*/
|
|
|
|
|
static void SetTimeScale(double timeScale) noexcept;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \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;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \brief Send a WorldTime packet with the current time and time scale
|
|
|
|
|
* to a specific player or to all players.
|
|
|
|
@ -76,6 +115,15 @@ public:
|
|
|
|
|
*/
|
|
|
|
|
static void SendWorldTime(unsigned short pid, bool toOthers = false) noexcept;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \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;
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif //OPENMW_WORLDSTATEAPI_HPP
|
|
|
|
|