Skip to content

Reimplement 29 Synchrony and Game functions at 100% - #403

Open
6and8 wants to merge 13 commits into
sourcehold:mainfrom
6and8:pr-sync-100
Open

6and8 wants to merge 13 commits into
sourcehold:mainfrom
6and8:pr-sync-100

Conversation

@6and8

@6and8 6and8 commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Reimplements 29 Synchrony and Game functions, all at 100%:

  • Synchrony::Actions (14): GateOpenOrClose, OpenOrCloseDrawbridge, ProcessAllyAcceptsRequest, ProcessAllyDeniesRequest, ProcessAllyDeniesRequest2, ProcessAllyGoodsRequest, ProcessAllyRequestAttackDefense, ProcessAllyRequestingGoods, ProcessBuildingSleepUpdate, ProcessBuyOrSell, ProcessRecruitUnit, ProcessReleaseDogs, ProcessTowerRepair, TryAcquireAmmunitionOrPlanToBuyStone
  • Synchrony (8): ClickDestroyBuilding, DirectPlayModemRelated_MemoryAllocationCallback, EnumDisplayModesCallback, MemCopyFromParameter, PutPlayerIntoRandomSlot, ResetAiVariationArrayValue, SetAIPlayerNickNames, SyncPlayerGroupArrays
  • Game::Skirmish (5): RecalculateAllies, SetupSkirmishBalanceAndOrIntensity, SkirmishLobbySetupStructure::commitSkirmishSettings, StoreCurrentGameIntoTemporarySKMasterEntry, StoreLocalTime
  • Game::ScenarioEvents::InGameEventUnionVersion (2): initializeScenarioEvent, resetEvent

Two declaration fixes, in their own commit:

  • Game::Skirmish::StoreLocalTime returns void (was int): the original ends with a plain ret and sets no return value. Main's two callers ignore the result.
  • Synchrony::DirectPlayModemRelated_MemoryAllocationCallback takes a 4th argument: it is a __stdcall LPDPENUMADDRESSCALLBACK and the original returns with ret 0x10. Main's caller passes it through a cast, unchanged.

The only status lines touched are these 29.

Checked with a build of this branch on top of main, containing every source file of the touched folders plus main's three callers of the changed declarations (41 files): all 29 functions match. 28 measure 100%; MemCopyFromParameter measures 96.7% because reccmp leaves the security cookie and __security_check_cookie unnamed in the original, which is the only difference. Main's own 12 functions keep their scores: createDirectPlayInterfaceModem (96.1%) and MenuView_MissionFinishedTransition_Prepare (99.0%) also differ only in those cookie names and, for the first, the DirectPlayCreate import thunk.

🤖 Generated with Claude Code

loamifi-jake and others added 2 commits November 13, 2026 06:33
…es 4 arguments

The original ends StoreLocalTime with a plain ret and no return value, and the callback with ret 0x10.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the declaration/type change This requires changes to the generated/exported types or definitions. label Nov 13, 2026
@github-actions

Copy link
Copy Markdown

Style guide reading (advisory, posted once)

9 possible deviation(s) from REIMPLEMENTATION_STYLE_GUIDE.md across 9 of the 29 reimplemented .cpp file(s) in this PR.

The match comes first. Where the ugly form is what matched, it stays -- that is the guide's own overriding rule, and rule 21 asks for a one-line comment saying what was measured so the next reader does not retry it. This report is posted once, when the PR opens, and is not repeated on later pushes.

rule what it asks hits
9 Prefer for over while/do 1
14 The shape of a file 7
22 Prefer descriptive code 1
Where

Rule 9 — Prefer for over while/do

  • src/OpenSHC/Synchrony/DirectPlayModemRelated_MemoryAllocationCallback.cpp:22 — while-loop; the guide asks for a for

Rule 14 — The shape of a file

  • src/OpenSHC/Synchrony/Actions/GateOpenOrClose.cpp:1 — first include is not Actions; the folder is the class
  • src/OpenSHC/Synchrony/Actions/OpenOrCloseDrawbridge.cpp:1 — first include is not Actions; the folder is the class
  • src/OpenSHC/Synchrony/Actions/ProcessBuildingSleepUpdate.cpp:1 — first include is not Actions; the folder is the class
  • src/OpenSHC/Synchrony/Actions/ProcessBuyOrSell.cpp:1 — first include is not Actions; the folder is the class
  • src/OpenSHC/Synchrony/Actions/ProcessTowerRepair.cpp:1 — first include is not Actions; the folder is the class
  • src/OpenSHC/Synchrony/Actions/TryAcquireAmmunitionOrPlanToBuyStone.cpp:1 — first include is not Actions; the folder is the class
  • src/OpenSHC/Synchrony/MemCopyFromParameter.cpp:1 — first include is not Synchrony; the folder is the class

Rule 22 — Prefer descriptive code

  • src/OpenSHC/Synchrony/ResetAiVariationArrayValue.cpp:10 — unsigned range trick; spell the two bounds out

gynt added a commit that referenced this pull request Nov 13, 2026
loamifi-jake and others added 11 commits November 15, 2026 20:55
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…AllyGoodsRequest parameter names, DAT_LastTeamMemberIndex is an int

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ntext), ProcessReleaseDogs takes the display colour

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…check, TRUE for the resolution flags, BT_CESSPIT, named parameters, no needless casts

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cmp symbol and costs RecalculateAllies 5 points); keep its casts

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… RAT = 1)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…goodsRequestAmountByPlayer)

Both live in the asked player's data and are indexed by the requesting player:
resource type (0 = no request) and amount. Field rename only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ays a while

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@TheRedDaemon TheRedDaemon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing from my side remains. Once the headers fit, it can be merged.

This branch has not been deployed

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

Labels

declaration/type change This requires changes to the generated/exported types or definitions.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants