Stop hardcoding player 1 for server-initiated weather/time and instead use the current world-state host. Plugin code now defers weather commands until GetWorldStateHostPlayerId() is available, uses IsWorldStateHost() to gate execution, logs local/host IDs, and requeues when host assignment is missing. Relay logic now attempts ForceHostWorldStateBroadcast and logs if relay fails. Updated protocol docs, dev server UI tooltips, presets comment, changelog, and dev log to reflect world-state host terminology and behavior. This ensures weather/time control survives host reassignment and avoids dropped commands on reconnect/restart.
2.2 KiB
2.2 KiB
Server World State Packet
Server-authoritative weather and time control from the dev server GUI.
Authority
- Time (
timeHHmm): sent to all clients; each convertsHHmmto Fallout game-hour float (for example2200 -> 22.0,1830 -> 18.5) before applying. - Weather (
weatherConsoleArg): sent to all clients, but only the current world-state host runsfw <8-digit-id>. The host then relays usualworldStateupdates to other clients.
Packet Format
Time-only (all clients):
{
"type": "serverWorldState",
"timeHHmm": "1900",
"serverTime": 1780212128.301
}
Weather (all clients receive; only world-state host acts):
{
"type": "serverWorldState",
"weatherConsoleArg": "001ca7e4",
"weatherFormId": "001CA7E4",
"serverTime": 1780212128.301
}
Field Definitions
| Field | Type | Required | Description |
|---|---|---|---|
type |
string | yes | Must be "serverWorldState" |
timeHHmm |
string | no | 24-hour clock value (HHmm) converted client-side to game-hour float for set gamehour to <float> |
weatherConsoleArg |
string | no | Exact argument for fw on the current world-state host (8-digit lowercase hex) |
weatherFormId |
string | no | Relay form ID used in host worldState broadcast |
serverTime |
number (double) | no | Relay timestamp |
Client Apply Rules
- Time: all clients convert
timeHHmmto game-hour float and applyset gamehour to <float>on the game thread. - Weather: only the current world-state host runs
fw <weatherConsoleArg>. - Weather commands are scheduled on the F4SE game thread from the network receive path.
- After the host runs
fw, it immediately relaysworldStatewithweatherFormId.
Edit server/world_state_presets.py so each preset uses the exact fw ID that works in your console (for example 0000015e).
Preset Weather Console Args
| Label | Default fw arg |
|---|---|
| Clear | 0002b52a |
| Cloudy | 001cc186 |
| Overcast | 001c8556 |
| Fog | 001c3473 |
| Rain | 001ca7e4 |
| Radstorm | 001c3d5e |
| Glowing Sea | 000f1033 |
Backward Compatibility
Older clients that do not handle serverWorldState ignore the packet safely.