Skip to content

Conversation

@xezon
Copy link

@xezon xezon commented Oct 23, 2025

Merge with Rebase

This change merges GameNetwork, GameSpy and adjacent code.

Only GUIUtil.cpp is not merged, because it has Generals Challenge dependencies and perhaps requires some extra care. Can be done another time.

Changes to Generals

  • Network, GameSpy: Adds new game room options: Restrict Superweapons, Start Cash, Limit Factions, Use Stats. The game room options cannot are not available in the Generals UI
  • GameSpy: Block duplicate messages in Online Chat
  • GameSpy: Remove superfluous network messages after connection failure

Changes to Zero Hour

  • Network: Bugfix with message LANMessage::MSG_REQUEST_GAME_LEAVE in LANAPI::RequestGameLeave()
  • GameSpy: Bugfix with string format in GameSpyStagingRoom::generateLadderGameResultsPacket()

TODO

  • Add pull id to commits
  • Test Network
  • List changes to Generals and Zero Hour

@xezon xezon added this to the Code foundation build up milestone Oct 23, 2025
@xezon xezon added Gen Relates to Generals ZH Relates to Zero Hour Unify Unifies code between Generals and Zero Hour labels Oct 23, 2025
@xezon xezon force-pushed the xezon/unify-gamenetwork branch from 45d2a7e to 889d140 Compare October 25, 2025 10:50
@xezon
Copy link
Author

xezon commented Oct 25, 2025

List of changes to Generals and Zero Hour added.

Did another pass on the merge and fixed a few things.

@xezon xezon requested a review from bobtista October 25, 2025 11:06
if( m_money.countMoney() == 0 )
{
m_money.deposit( TheGlobalData->m_defaultStartingCash, FALSE );
// TheSuperHacker @bugfix Now correctly deposits the money and fixes its audio and academy issues.

Choose a reason for hiding this comment

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

nit: TheSuperHackers

Copy link
Author

Choose a reason for hiding this comment

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

Fixed

return true;
}
}
s_prevMsg = message;

Choose a reason for hiding this comment

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

Wouldn't this set prevMsg to empty message? I think we can remove this, it's probably better to keep the last not empty message.

Copy link
Author

Choose a reason for hiding this comment

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

If it is a bug then it would have to be fixed outside the merging. We are just copying the bugs to Generals :)

TheGameSpyPeerMessageQueue->addRequest(req);
}

s_prevMsg = message;

Choose a reason for hiding this comment

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

This still sets prevMsg even if nothing is sent - eg if names isEmpty, maybe move this line into if (!names.isEmpty())?

Copy link
Author

Choose a reason for hiding this comment

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

If it is a bug then it would have to be fixed outside the merging. We are just copying the bugs to Generals :)

slot->getNATBehavior() );
//make sure name doesn't cause overflow of m_lanMaxOptionsLength
int lenCur = tmp.getLength() + optionsString.getLength() + 2; //+2 for H and trailing ;
int lenRem = m_lanMaxOptionsLength - lenCur; //length remaining before overflowing

Choose a reason for hiding this comment

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

Can this be negative? Maybe use int lenMax = max(0, lenRem / (MAX_SLOTS - i));

Copy link
Author

Choose a reason for hiding this comment

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

slurmlord has a pending change where he reworks this because it is bugged.

Copy link

@Skyaero42 Skyaero42 left a comment

Choose a reason for hiding this comment

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

Merger looks good. Tested Generals and seems to run fine.

@xezon xezon force-pushed the xezon/unify-gamenetwork branch from 889d140 to 49ca656 Compare October 25, 2025 20:29
@xezon xezon added the Approved Pull Request was approved label Oct 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Approved Pull Request was approved Gen Relates to Generals Unify Unifies code between Generals and Zero Hour ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants