Skip to content

tweak: Remove obsolete preorder code - #3690

Open
BAzili073 wants to merge 4 commits into
TheSuperHackers:mainfrom
BAzili073:refactor/remove-preorder-code
Open

BAzili073 wants to merge 4 commits into
TheSuperHackers:mainfrom
BAzili073:refactor/remove-preorder-code

Conversation

@BAzili073

@BAzili073 BAzili073 commented Nov 16, 2026 •

Copy link
Copy Markdown

Closes #3680

Removed the GameSpy preorder functionality from the main code, as well as the Officer's Club icon in the lobby. This functionality is no longer needed.

The PreorderCreate module and MODELCONDITION_PREORDER remain, because the game data and mods use them. Dummy fields also remain in the save data (Player, SkirmishGameInfo), so old saves still load.

Made with the help of the Opus 5.5 agent.

Tested only by building on Linux in Docker. Compiled and tested on Windows.

@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Explain Change →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

Preorder state, retrieval, network exchange, gameplay checks, and client presentation are removed across both game variants. Player saves retain legacy preorder-field transfer for versions 7–8. Non-retail-compatible player saves use version 9, while the skirmish transfer retains the previous mask position using a zero value.

Changes

Preorder handling removal

Layer / File(s) Summary
Remove preorder network data and retrieval
Core/GameEngine/Include/GameNetwork/*, Core/GameEngine/Source/GameNetwork/GameInfo.cpp, Core/GameEngine/Source/GameNetwork/GameSpy/*
Network interfaces, peer messages, and published player statistics no longer include preorder state. The CD-key persistent-storage request and response path for retrieving preorder status is removed. The skirmish transfer writes a zero value at the former preorder-mask position.
Remove player state and retain legacy save transfer
Generals/Code/GameEngine/Include/Common/Player.h, Generals/Code/GameEngine/Include/Common/WellKnownKeys.h, Generals/Code/GameEngine/Source/Common/RTS/Player.cpp, GeneralsMD/Code/GameEngine/Include/Common/Player.h, GeneralsMD/Code/GameEngine/Include/Common/WellKnownKeys.h, GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp
Player preorder fields, accessors, and property keys are removed in both variants. Player transfer uses version 8 for retail-compatible saves and version 9 otherwise; versions 7–8 continue to transfer the legacy field through a temporary value.
Remove gameplay preorder checks
Generals/Code/GameEngine/Include/GameLogic/Module/PreorderCreate.h, Generals/Code/GameEngine/Source/GameLogic/{Object/Create/PreorderCreate.cpp,System/GameLogic.cpp}, GeneralsMD/Code/GameEngine/Include/GameLogic/Module/PreorderCreate.h, GeneralsMD/Code/GameEngine/Source/GameLogic/{Object/Create/PreorderCreate.cpp,System/GameLogic.cpp}
Player setup no longer adds the preorder property to side dictionaries. PreorderCreate::onBuildComplete always clears the preorder model condition. The module comments state that preorder is unsupported and the module remains because game data uses it.
Remove preorder client presentation
Core/GameEngine/Source/GameClient/GUI/LoadScreen.cpp, Generals/Code/GameEngine/{Include/Common/BattleHonors.h,Source/GameClient/GUI/GUICallbacks/Menus/*}, GeneralsMD/Code/GameEngine/{Include/Common/BattleHonors.h,Source/GameClient/GUI/GUICallbacks/Menus/*}
Client code no longer processes preorder responses, adds the Officers Club honor, displays its tooltip or image, or copies preorder fields into player information. The load screen still displays rank and favorite-side information and clears the officer-medal image.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Refactor

Suggested reviewers: xezon, bobtista

Merge Risk: Minimal · previous review 70bc3

This change removes obsolete preorder code and the Officer's Club lobby icon. Old saves are still handled, and no concrete merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title 'tweak: Remove obsolete preorder code' matches the main change. The PR removes the GameSpy preorder functionality and the Officer's Club lobby icon across the GameNetwork, GameClient, GameLo…
Linked Issues check Passed Issue #3680 asks to remove preorder code, or to place it behind RETAIL_COMPATIBLE_DATA when retail compatibility needs it. The whole-PR summary (merge base e655cb2 to head 70bc3ce) shows both action…
Out of Scope Changes check Passed All summarized changes relate to preorder removal, the retail compatibility guard, or the lobby rank image that replaces the Officers Club icon:

- Player::xfer (Generals and GeneralsMD): version 9 wh…
Description check Passed The description states the PR removes GameSpy preorder functionality from the main code and the Officer's Club lobby icon. It also explains that the PreorderCreate module, MODELCONDITION_PREORDER, and…
Full details: Title check

Explanation

The title 'tweak: Remove obsolete preorder code' matches the main change. The PR removes the GameSpy preorder functionality and the Officer's Club lobby icon across the GameNetwork, GameClient, GameLogic, and Player code in both Generals and GeneralsMD. The 'tweak:' prefix is a conventional commit type and does not affect the assessment.

Full details: Linked Issues check

Explanation

Issue #3680 asks to remove preorder code, or to place it behind RETAIL_COMPATIBLE_DATA when retail compatibility needs it. The whole-PR summary (merge base e655cb2 to head 70bc3ce) shows both actions:

  • Removed: the preorder query and marking methods in GameInfo, GameSpyInfo, GameSpyInfoInterface, and Player (Generals and GeneralsMD). Also removed the preorder fields in PlayerInfo, PeerRequest/PeerResponse, and PSRequest/PSResponse, the TheKey_playerIsPreorder key, BATTLE_HONOR_OFFICERSCLUB, the CD-key stats read path in PersistentStorageThread, the lobby Officers Club icon and tooltip, and the preorder checks in PopupPlayerInfo, SkirmishGameOptionsMenu, WOLGameSetupMenu, WOLLobbyMenu, StagingRoomGameInfo, and GameLogic.
  • Retained: PreorderCreate remains registered and its comment states that game data still uses it. Its onBuildComplete no longer checks preorder state. The PR description and the reply in the objectives state that the module is now always registered. This is a deprecation that the issue allows.

The current head changes this module's registration compared with the previous review, which guarded it by RETAIL_COMPATIBLE_DATA. The issue accepts either removal or deprecation, so this change does not fail the requirement.

Uncertainty: the issue cites 100+ references. The summary does not show a full enumeration of remaining references, and no repository search was run for them. The listed requirement is met for the changed code paths. The reported crash at ThingTemplate.cpp lines 625-627 with RETAIL_COMPATIBLE_DATA=0 is not addressed by any summarized hunk. The objectives state that the always-registered module resolves it, and this assessment relies on that statement, not on a source inspection.

Full details: Out of Scope Changes check

Explanation

All summarized changes relate to preorder removal, the retail compatibility guard, or the lobby rank image that replaces the Officers Club icon:

  • Player::xfer (Generals and GeneralsMD): version 9 when RETAIL_COMPATIBLE_XFER_SAVE is disabled, version 8 otherwise. Versions 7 to 8 read the removed preorder field into a temporary value, so older saves still load. This follows from removing the field. It is a save-format behavior change that the reviewer should confirm.
  • SkirmishGameInfo::xfer writes a local zero value in place of m_preorderMask. This keeps the save layout stable and is tied to the removal.
  • WOLLobbyMenu insertPlayerInListbox uses a fixed 26-pixel rank image capped by column width. This replaces the Officers Club image sizing and is tied to the icon removal. It is a visible layout change that the reviewer should confirm.
  • LoadScreen explicitly clears the officer-medal image. This is tied to the removed icon.

No unrelated changes appear in the summary.

Full details: Description check

Explanation

The description states the PR removes GameSpy preorder functionality from the main code and the Officer's Club lobby icon. It also explains that the PreorderCreate module, MODELCONDITION_PREORDER, and dummy save-data fields remain, and it notes the build and test scope. The raw summary confirms these same changes across the GameNetwork, GameClient, GameLogic, and Common files.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 295d8a53-8e85-4bb7-b6df-cc64de40029e
Commits

Reviewing files that changed from the base of the PR and between d0b471b and 70bc3ce.

Files selected for processing: 2

  • Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp
  • GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

@greptile-apps

greptile-apps Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5 · The PR appears safe to merge.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Removes obsolete preorder checks, GameSpy messages, and Officer’s Club icons while keeping the data names and save fields needed for compatibility.

  • GameSpy player records no longer carry preorder status.
  • Player screens show rank images without the Officer’s Club badge.
  • Game setup ignores preorder status but keeps old save fields readable.

Reviews (5) · Last reviewed commit: "tweak: Keep the obsolete preorder flag i..." · Reviewed by Greptile

@Skyaero42 Skyaero42 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice cleanup

@Caball009

Copy link
Copy Markdown

With RETAIL_COMPATIBLE_DATA (0) and standard game files, the game crashes silently here now:

ModuleData* data = TheModuleFactory->newModuleDataFromINI(ini, tokenStr, type, moduleTagStr);
if (data->isAiModuleData())

@BAzili073

Copy link
Copy Markdown
Author

With RETAIL_COMPATIBLE_DATA (0) and standard game files, the game crashes silently here now:

ModuleData* data = TheModuleFactory->newModuleDataFromINI(ini, tokenStr, type, moduleTagStr);
if (data->isAiModuleData())

The module is now always registered, so references to it in the game data no longer break anything.

//Int h = (preorderImg)?preorderImg->getImageHeight():10;
w = min(GadgetListBoxGetColumnWidth(listboxLobbyPlayers, 0), w);
// TheSuperHackers @refactor The list box image size was taken from the 26x26 Officer's Club image. The small rank images are 26x26 too.
const Int imageSize = 26;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What happens if a mod changes the image sizes? Will this hardcoded size break?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Nothing will break. The images are already scaled now; the size just used to come from OfficersClubsmall, and now it comes from a constant. If it is important that the size adapts to mods, it would probably be better to take it from one of the rank images, for example Private-N. But i think that could be done in a separate PR.

@CryoTheRenegade CryoTheRenegade left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The code looks correct. The description says "Some parts remain that are needed for legacy code. They are guarded by the RETAIL_COMPATIBLE_DATA define", but the diff no longer has a RETAIL_COMPATIBLE_DATA guard, because PreorderCreate is now always registered. Can that sentence be updated to say PreorderCreate and MODELCONDITION_PREORDER stay because game data and mods use them?

{

// version
#if RETAIL_COMPATIBLE_XFER_SAVE

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

SkirmishGameInfo::xfer keeps the old preorder mask as a dummy 0, while Player::xfer bumps the version to drop the byte. Could both use the same approach? A dummy Bool here would remove the version 9 and the #if. Same in GeneralsMD.

};
char valueStrings[6][20];
char *values[6] = {
char valueStrings[ARRAY_SIZE(keys)][20];

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This branch still hardcodes 20 here and in the snprintf calls below. sizeof(valueStrings[0]) would match the ValBufSize change in the broadcast branch.

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.

Remove / deprecate all preorder code

5 participants