Use world-state host for server weather actions
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.
This commit is contained in:
@@ -9,6 +9,39 @@ failed experiments, successful tests, and next steps.
|
||||
|
||||
---
|
||||
|
||||
## 2026-06-25 - Weather Host Reassignment Uses `worldStateHostPlayerId`
|
||||
|
||||
### Summary
|
||||
Fixed server weather control after host/client reassignment by removing the hardcoded `playerId == 1` weather gate and using current world-state host ownership instead.
|
||||
|
||||
### Files Changed
|
||||
- `plugin/src/F4TWorldStateSync.cpp`
|
||||
- `changelog.md`
|
||||
- `docs/dev-log.md`
|
||||
|
||||
### Details
|
||||
- `serverWorldState` weather apply now defers until both local player assignment and `worldStateHostPlayerId` are available.
|
||||
- Weather apply now runs only when the local client is the current world-state host (`IsWorldStateHost()`), not when `playerId == 1`.
|
||||
- Host weather execution logs now include local and host player IDs, and host relay uses the same host authority check path.
|
||||
|
||||
### Testing
|
||||
- Not re-tested in-game in this session.
|
||||
- Recommended manual checks:
|
||||
- Start server and connect two clients.
|
||||
- Confirm the initial host can change weather/time from server GUI.
|
||||
- Disconnect the original host; verify server logs host reassignment.
|
||||
- On remaining client (now host), change weather/time again.
|
||||
- Verify outgoing host world-state fields are sent and server relays them.
|
||||
- Verify remote proxy/world-state result matches expected weather/time in game.
|
||||
|
||||
### Known Issues
|
||||
- None currently known.
|
||||
|
||||
### Next Steps
|
||||
- Rebuild plugin and run a two-client disconnect/reassign session while monitoring `CommonwealthOnline.log` for host reassignment and weather relay logs.
|
||||
|
||||
---
|
||||
|
||||
## 2026-06-24 - Convert `HHmm` Time to Game-Hour Float
|
||||
|
||||
### Summary
|
||||
|
||||
Reference in New Issue
Block a user