Skip to content

Reimplement host synchronization checks and periodic messages - #223

Open
Krarilotus wants to merge 1 commit into
sourcehold:mainfrom
Krarilotus:feat/native-sync-checking
Open

Reimplement host synchronization checks and periodic messages#223
Krarilotus wants to merge 1 commit into
sourcehold:mainfrom
Krarilotus:feat/native-sync-checking

Conversation

@Krarilotus

Copy link
Copy Markdown
Contributor

Reimplements how the host decides that players have gone out of sync and when the game sends its regular synchronization messages. It also adds the unit-buffer hash helper, providing tested C++ counterparts for three native routines used in network and replay investigations.

  • checkGameSync waits for usable samples from participating peers and compares hashes only at equal advertised match times. It preserves the global host/queue receiver, per-instance state, command54, countdown/delay behavior and acknowledgement resets.
  • sendPeriodicSyncMessages preserves the signed wrapping clock comparisons: packet126 after more than1800ms, the other sync message at180ms, and countdown updates after the send callback.
  • computeSomeHashOnUnitArray delegates the full unit array to the existing hash resolver. It is distinct from the canonical per-domain multiplayer hash calculation.

Validation:

  • Normal full OpenSHC.dll CMake build passed, using MSVC2005 SP1 and a Microsoft-signed Windows SDK manifest tool. The older bundled manifest tool crashes on this machine. No DLL was deployed.
  • All 397 +91 +21 function bytes match the original Crusader after binding native resolver addresses. Verified address/layout translation also matches the three original Extreme routines; this is not an Extreme OpenSHC DLL build.
  • 9,380 differential x86 cases passed, including peer/time/hash gates, independent receiver/global objects, timer boundaries/wrap, callback mutation, delegated hash arguments/return values, memory writes and ABI. The clock, message delivery and delegated hash are controlled boundaries; transport and full-world hash generation are not exercised.
  • Linked reccmp scores: host check 98.02%, periodic sends 92.59%, unit-buffer helper 60.00%. These reflect the actual linked resolver/symbol differences and are separate from native-bound byte matches.
  • Reproducible validation scripts and their boundaries are included in tools/validation/README.md.

Based on upstream main; existing generated headers and activation flags are unchanged. This does not finish resynchronization, fix the observed TCP hosting hang, or enable multiplayer replay. It complements #222's synchronization command implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant