1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-27 09:39:40 +00:00

[Server] Make it possible to resend received worldstates

This commit is contained in:
David Cernat 2018-06-27 02:00:16 +03:00
parent 7060ff59c5
commit 15bfa30070
2 changed files with 16 additions and 0 deletions

View file

@ -18,6 +18,11 @@ void WorldstateFunctions::ReadLastWorldstate() noexcept
readWorldstate = mwmp::Networking::getPtr()->getLastWorldstate();
}
void WorldstateFunctions::CopyLastWorldstateToStore() noexcept
{
writeWorldstate = *readWorldstate;
}
void WorldstateFunctions::ClearMapChanges() noexcept
{
writeWorldstate.mapChanges.mapTiles.clear();

View file

@ -6,6 +6,8 @@
#define WORLDSTATEAPI \
{"ReadLastWorldstate", WorldstateFunctions::ReadLastWorldstate},\
\
{"CopyLastWorldstateToStore", WorldstateFunctions::CopyLastWorldstateToStore},\
\
{"ClearMapChanges", WorldstateFunctions::ClearMapChanges},\
\
{"GetMapChangesSize", WorldstateFunctions::GetMapChangesSize},\
@ -43,6 +45,15 @@ public:
*/
static void ReadLastWorldstate() noexcept;
/**
* \brief Take the contents of the read-only worldstate last received by the
* server from a player and move its contents to the stored worldstate
* that can be sent by the server.
*
* \return void
*/
static void CopyLastWorldstateToStore() noexcept;
/**
* \brief Clear the map changes for the write-only worldstate.
*