Fix GUI weather: valid IDs, defer & reset
Replace invalid Fallout 4 weather form IDs with valid ones (including fixing Clear from 0002852a -> 0002b52a) and update protocol examples and server presets accordingly. Change the plugin to re-queue/defer server weather payloads when the local assigned player ID is not yet available (so early GUI clicks are not dropped) and add a log entry when deferring. Reset player/host assignment on server startup (_next_player_id = 1 and clear _world_state_host_player_id) to avoid stale host IDs after restarts. Also update changelog and developer log entries describing the fixes and recommended manual testing steps.
This commit is contained in:
@@ -205,6 +205,11 @@ class FalloutTogetherServer:
|
||||
self._server_socket = server_socket
|
||||
self._running = True
|
||||
self._started_at = time.time()
|
||||
# Each server run is a fresh session for player/host assignment.
|
||||
# Without this reset, restarts can leave stale host IDs and player IDs
|
||||
# > 1, which breaks weather commands gated to player 1.
|
||||
self._next_player_id = 1
|
||||
self._world_state_host_player_id = None
|
||||
|
||||
self._log(f"Commonwealth Online server listening on {self.host}:{self.port}")
|
||||
self._log(f"LAN discovery listening on UDP port {DISCOVERY_PORT}")
|
||||
|
||||
@@ -6,13 +6,13 @@ from __future__ import annotations
|
||||
# `fw_console_arg` is passed directly to the in-game `fw` command on player 1
|
||||
# (8-digit hex form ID, not an editor name like CommonwealthRain).
|
||||
WEATHER_PRESETS: list[tuple[str, str]] = [
|
||||
("Clear", "00148c3c"),
|
||||
("Cloudy", "00148c42"),
|
||||
("Overcast", "00148c43"),
|
||||
("Fog", "00148c44"),
|
||||
("Rain", "00148c45"),
|
||||
("Radstorm", "00148c47"),
|
||||
("Glowing Sea", "001b9779"),
|
||||
("Clear", "0002b52a"),
|
||||
("Cloudy", "001cc186"),
|
||||
("Overcast", "001c8556"),
|
||||
("Fog", "001c3473"),
|
||||
("Rain", "001ca7e4"),
|
||||
("Radstorm", "001c3d5e"),
|
||||
("Glowing Sea", "000f1033"),
|
||||
]
|
||||
|
||||
# HHmm values for the in-game `set gamehour to HHmm` console command.
|
||||
|
||||
Reference in New Issue
Block a user