1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 15:49:56 +00:00
openmw-tes3mp/apps/openmw-mp
David Cernat 892d71ce71 [General] Reimplement weather synchronization to allow soft transitions
Although weather sync was added by Koncord to the rewrite in fd721143e2 in a way that used surprisingly few lines of code, it relied on the server requesting weather states every second from authority players and sending them to non-authority players, while also allowing only very sudden weather transitions across regions, i.e. if there was one player in the Ascadian Isles who had stormy weather, and another player with clear weather in the Bitter Coast Region walked across to the Ascadian Isles, that player was instantly made to have stormy weather with no kind of transition at all.

My approach solves both of those problems. It solves the packet spam by only sending weather updates to the server when weather changes happen or when there are new arrivals to a weather authority's region, and it allows for both sudden weather transitions when players teleport to a region and for soft, gradual transitions when players walk across to a region. It is inspired by my previous actor sync, and uses a WorldRegionAuthority packet to set players as region authorities in a similar way to how ActorAuthority sets players as cell AI authorities. Weather changes are created only by the region authority for a given region, and weather packets are also only sent by that authority.

However, it should be noted that gradual weather transitions are used by default in this implementation. To use sudden weather transitions, the serverside Lua scripts need to forward WorldWeather packets with the forceWeather boolean set to true. That is, however, already handled by our default Lua scripts in situations where it makes sense.
2018-07-21 05:20:26 +03:00
..
processors [General] Reimplement weather synchronization to allow soft transitions 2018-07-21 05:20:26 +03:00
Script [General] Reimplement weather synchronization to allow soft transitions 2018-07-21 05:20:26 +03:00
Cell.cpp [General] Rename all instances of refNumIndex into refNum 2018-07-13 04:12:03 +03:00
Cell.hpp [General] Rename all instances of refNumIndex into refNum 2018-07-13 04:12:03 +03:00
CellController.cpp [Server] Initialize interiors correctly if exterior 0, 0 has been loaded 2017-08-31 14:48:23 +03:00
CellController.hpp [General] Rename Event into ObjectList & WorldObject into BaseObject 2018-05-13 00:42:24 +03:00
CMakeLists.txt [General] Turn GameWeather into WorldWeather, now a WorldstatePacket 2018-07-16 02:20:43 +03:00
main.cpp [General] Move credits integrity error message to new ErrorMessages file 2018-07-16 03:21:14 +03:00
MasterClient.cpp [General] Explicitly use limitations of the master server 2018-07-02 23:29:07 +08:00
MasterClient.hpp [Server] Add and implement PushPlugin method to MasterClient 2017-05-07 02:51:57 +08:00
Networking.cpp [Server] Clarify functions used for getting data in Networking 2018-07-13 02:40:24 +03:00
Networking.hpp [Server] Clarify functions used for getting data in Networking 2018-07-13 02:40:24 +03:00
Player.cpp [Server] Split up handshake handling into multiple functions for debug 2018-04-09 15:25:50 +03:00
Player.hpp [Server] Split up handshake handling into multiple functions for debug 2018-04-09 15:25:50 +03:00
Utils.cpp [Server] Add and use Utils::getCellFromDescription() 2017-04-28 16:33:58 +03:00
Utils.hpp [Server] Add and use Utils::getCellFromDescription() 2017-04-28 16:33:58 +03:00