Event-driven world time sync (timeSync flag)

Introduce an optional timeSync field and event-driven time pushes so host time is only re-applied on connect, resume-from-freeze, or large jumps while weather continues on ~1 Hz heartbeats. Added IsGameTimeFrozen detection and client buffering of latest host time; clients apply host time only when timeSync is true or when gameplay just resumed. Updated networking to read/write timeSync, adjusted F4TWorldStateSync logic (separate time vs weather send/apply paths, changed function signatures and behavior), and updated protocol/docs/changelog and fake_client logging to reflect the new field and behavior.
This commit is contained in:
2026-06-23 15:55:05 +12:00
parent 87a264da80
commit 70933db6e5
10 changed files with 185 additions and 41 deletions
+2 -1
View File
@@ -33,5 +33,6 @@ namespace F4T::Networking
float a_gameHour,
float a_gameDaysPassed,
bool a_hasWeatherFormId,
std::uint32_t a_weatherFormId);
std::uint32_t a_weatherFormId,
bool a_timeSync = false);
}
+1
View File
@@ -12,6 +12,7 @@ namespace F4T::WorldStateSync
float gameDaysPassed{ 0.0F };
std::optional<std::uint32_t> weatherFormId;
bool hasWeatherFormId{ false };
bool applyTime{ false };
};
bool IsWorldStateHost();