Repository navigation
Conversation
Replicate fire state, building warnings and home health summaries in bounded batches. Bind client snapshots to building lifetimes and reject mismatched protocol versions to prevent stale or incompatible updates. Keep host authority during client building simulation and reset caches on connection and level transitions. Add local diagnostics and 16 regression groups covering serialization, identity, recovery and patch target metadata. Validation: Release build and all regression groups pass. In-game multiplayer validation: user confirmed the preview works correctly.
|
ci is failing prior to my changes also should refrence #125 "The different errors/issues a building can have" |
kaenganxt
left a comment
There was a problem hiding this comment.
Thank you very much for your contribution! This is really appreciated. I didn't have time to test yet, but could you please take a look at these two comments?
There was a problem hiding this comment.
As far as I can see, this file is about building and running the test. Could you please integrate this with the other script (build.ps1) to not repeat the logic of copying assemblies and also support other operating systems.
| public List<string> Mods { get; set; } | ||
|
|
||
| [ProtoMember(9)] | ||
| public int BuildingStatusProtocol { get; set; } |
There was a problem hiding this comment.
What is this protocol field for? The existing ModVersion field already takes care that only compatible game versions can play together.
|
thanks for the review! ill get those fixes pushed here maybe today or so! |
- Remove BuildingStatusProtocol from the connection handshake. The existing ModVersion check already rejects mismatched CSM builds. - Replace scripts/test-building-sync.ps1 with a -Test switch in build.ps1, reusing its -Update assembly copy and MSBuild detection and running the test runner through mono on Linux/macOS. - Resolve Harmony for the tests through NuGet instead of a custom lookup in project.assets.json. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Merged the script into build.ps1 as -Test (it reuses -Update for the assemblies and runs through mono on Linux/macOS). I've play-tested this as well. If you'd rather not keep a test project in the repo, I'm happy to drop tests/ entirely. forgot to remove claude from commit 😭 sorry as disclosure: anything else lmk |
| if (batch.Count != 0) | ||
| Send(batch); | ||
| } | ||
| else if (Command.CurrentRole == MultiplayerRole.Client) |
There was a problem hiding this comment.
Why are there both server-sent building status updates on sweep ids and also status requests on random sweep ids from the client?
| public bool AbandonmentDisabled; | ||
| } | ||
|
|
||
| public static IEnumerable<MethodBase> TargetMethods() |
There was a problem hiding this comment.
Did you check the performance impact of this? The additional logic for every building simulation step could be a lot of computation time.
| public override void OnBeforeSimulationTick() | ||
| { | ||
| base.OnBeforeSimulationTick(); | ||
| RefreshBuildingStatusConnection(); |
There was a problem hiding this comment.
Is this really necessary to run twice on every tick. That could also be a significant performance impact. Could you not use a OnClientConnect callback of the handlers?
| } | ||
|
|
||
| RefreshBuildingStatusConnection(); | ||
| BuildingStatusSync.SimulationStep(); |
There was a problem hiding this comment.
The packets (e.g. BuildingStatusCommand) are exchanged even when the game is paused. This should not be necessary, right? Could you please change that to only run when the game is running?
Summary
Clients can miss building fires or show different sickness counts and warning icons from the host. Correcting these differences currently requires a full
/sync, which interrupts gameplay.This PR makes the host authoritative for building conditions and keeps clients updated automatically, reducing the need for manual synchronization.
Changes
/building-syncfor local diagnostics.Validation
Reverse engineering assisted by GPT Sol 6.1 High.