1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-20 13:53:52 +00:00
openmw-tes3mp/apps/openmw-mp/Script/Functions
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
..
Actors.cpp [General] Rename all instances of refNumIndex into refNum 2018-07-13 04:12:03 +03:00
Actors.hpp [General] Rename all instances of refNumIndex into refNum 2018-07-13 04:12:03 +03:00
Books.cpp [Server] Turn sendToAttachedPlayer into skipAttachedPlayer 2018-07-07 20:08:59 +03:00
Books.hpp [Server] Bring comments up-to-date for packet-sending script functions 2018-07-07 20:16:36 +03:00
Cells.cpp [Server] Use consistent arguments for script functions that send packets 2018-07-07 18:29:31 +03:00
Cells.hpp [General] Turn PlayerMap into WorldMap, now a Worldstate packet 2018-06-07 12:51:45 +03:00
CharClass.cpp [Server] Use consistent arguments for script functions that send packets 2018-07-07 18:29:31 +03:00
CharClass.hpp [Server] Document script functions, part 3 2017-07-25 18:07:09 +03:00
Chat.cpp [Server] Turn sendToAttachedPlayer into skipAttachedPlayer 2018-07-07 20:08:59 +03:00
Chat.hpp [Server] Bring comments up-to-date for packet-sending script functions 2018-07-07 20:16:36 +03:00
Dialogue.cpp [Server] Turn sendToAttachedPlayer into skipAttachedPlayer 2018-07-07 20:08:59 +03:00
Dialogue.hpp [Server] Add missing descriptions for PlayAnimation() and PlaySpeech() 2018-07-08 02:03:33 +03:00
Factions.cpp [Server] Turn sendToAttachedPlayer into skipAttachedPlayer 2018-07-07 20:08:59 +03:00
Factions.hpp [Server] Bring comments up-to-date for packet-sending script functions 2018-07-07 20:16:36 +03:00
GUI.cpp [Server] Use consistent arguments for script functions that send packets 2018-07-07 18:29:31 +03:00
GUI.hpp [General] Add notes for InputDialogs in GUIBoxes packet 2018-05-25 05:28:22 +03:00
Items.cpp [General] Implement ActorAI packet, part 3 2018-07-10 05:07:58 +03:00
Items.hpp [Server] Bring comments up-to-date for packet-sending script functions 2018-07-07 20:16:36 +03:00
Mechanics.cpp [General] Rename all instances of refNumIndex into refNum 2018-07-13 04:12:03 +03:00
Mechanics.hpp [General] Rename all instances of refNumIndex into refNum 2018-07-13 04:12:03 +03:00
Miscellaneous.cpp [Server] Add DoesFileExist() script function 2018-05-04 03:09:54 +03:00
Miscellaneous.hpp [Server] Add DoesFileExist() script function 2018-05-04 03:09:54 +03:00
Objects.cpp [General] Implement ObjectActivate packet & associated script functions 2018-07-15 03:16:04 +03:00
Objects.hpp [General] Implement ObjectActivate packet & associated script functions 2018-07-15 03:16:04 +03:00
Positions.cpp [Server] Use consistent arguments for script functions that send packets 2018-07-07 18:29:31 +03:00
Positions.hpp [General] Implement PlayerMomentum packet & associated script functions 2018-04-29 23:47:17 +03:00
Quests.cpp [General] Rename PlayerKillCount into WorldKillCount 2018-07-15 05:34:59 +03:00
Quests.hpp [General] Rename PlayerKillCount into WorldKillCount 2018-07-15 05:34:59 +03:00
Server.cpp [Server] Move server administration functions to ServerFunctions class 2018-07-07 19:40:22 +03:00
Server.hpp [Server] Move server administration functions to ServerFunctions class 2018-07-07 19:40:22 +03:00
Settings.cpp [Server] Use consistent arguments for script functions that send packets 2018-07-07 18:29:31 +03:00
Settings.hpp [General] Add SetResetStats server script function 2018-04-09 19:24:24 +03:00
Shapeshift.cpp [Server] Use consistent arguments for script functions that send packets 2018-07-07 18:29:31 +03:00
Shapeshift.hpp [Server] Create ShapeshiftFunctions and move relevant functions there 2018-04-18 10:45:39 +03:00
Spells.cpp [Server] Turn sendToAttachedPlayer into skipAttachedPlayer 2018-07-07 20:08:59 +03:00
Spells.hpp [Server] Bring comments up-to-date for packet-sending script functions 2018-07-07 20:16:36 +03:00
Stats.cpp [Server] Use consistent arguments for script functions that send packets 2018-07-07 18:29:31 +03:00
Stats.hpp [General] Replace deathReason in death packets with a killer variable 2018-07-05 22:24:51 +03:00
Timer.cpp [Server] Simplify native CallPublic & CreateTimerEx 2017-06-30 17:59:50 +08:00
Worldstate.cpp [General] Reimplement weather synchronization to allow soft transitions 2018-07-21 05:20:26 +03:00
Worldstate.hpp [General] Reimplement weather synchronization to allow soft transitions 2018-07-21 05:20:26 +03:00