Add serverWorldState packet and GUI controls

Introduce a server-authoritative world-state packet to control weather and time from the dev server GUI. Adds protocol docs and message type (serverWorldState), a new Weather/Time tab in dev_server_app.py, server-side broadcasting in server_core.py, and preset utilities in server/world_state_presets.py. Plugin changes (F4TNetworking.cpp, F4TWorldStateSync.*) queue and apply incoming serverWorldState on the game thread, run `set gamehour` for all clients, and run `fw <8-digit-id>` on the assigned player 1 then force the host to relay a worldState snapshot. Also includes parsing/validation of hex form IDs, logging improvements, and minimal fake client handling. This ensures consistent server-driven time/weather and documents usage and presets.
This commit is contained in:
2026-06-23 23:03:34 +12:00
parent 70933db6e5
commit 4c17e70620
14 changed files with 757 additions and 3 deletions
+8
View File
@@ -15,11 +15,19 @@ namespace F4T::WorldStateSync
bool applyTime{ false };
};
struct PendingServerWorldState
{
std::optional<std::string> timeHHmm;
std::optional<std::string> weatherFormId;
std::optional<std::string> weatherConsoleArg;
};
bool IsWorldStateHost();
std::optional<std::uint32_t> GetWorldStateHostPlayerId();
void SetWorldStateHostPlayerId(std::uint32_t a_hostPlayerId);
void Reset();
void SetPendingWorldState(PendingWorldState a_state);
void SetPendingServerWorldState(PendingServerWorldState a_state);
void PollHostCapture();
void ApplyPendingState();
}