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:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user