Skip to content

Commit 8caeda6

Browse files
committed
Added product info struct to game slot class.
1 parent f4177d4 commit 8caeda6

File tree

5 files changed

+18
-9
lines changed

5 files changed

+18
-9
lines changed

GeneralsMD/Code/GameEngine/Include/GameNetwork/GameInfo.h

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,15 @@ enum
5757
class GameSlot
5858
{
5959
public:
60+
struct ProductInfo
61+
{
62+
UnsignedInt exeCRC;
63+
UnsignedInt iniCRC;
64+
UnsignedInt productVersion;
65+
AsciiString gitTagOrHash;
66+
UnicodeString productName;
67+
};
68+
6069
GameSlot();
6170
virtual void reset();
6271

@@ -126,8 +135,8 @@ class GameSlot
126135
void mute( Bool isMuted ) { m_isMuted = isMuted; }
127136
Bool isMuted( void ) const { return m_isMuted; }
128137

129-
void setProductVersion(UnsignedInt productVersion) { m_productVersion = productVersion; }
130-
UnsignedInt getProductVersion() const { return m_productVersion; }
138+
void setProductInfo(const ProductInfo& productInfo) { m_productInfo = productInfo; }
139+
const ProductInfo& getProductInfo() const { return m_productInfo; }
131140
protected:
132141
SlotState m_state;
133142
Bool m_isAccepted;
@@ -146,7 +155,7 @@ class GameSlot
146155
FirewallHelperClass::FirewallBehaviorType m_NATBehavior; ///< The NAT behavior for this slot's player.
147156
UnsignedInt m_lastFrameInGame; // only valid for human players
148157
Bool m_disconnected; // only valid for human players
149-
UnsignedInt m_productVersion; ///< Community made product version
158+
ProductInfo m_productInfo; ///< Community made product information
150159
};
151160

152161
/**

GeneralsMD/Code/GameEngine/Source/GameNetwork/GUIUtil.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ void UpdateSlotList( GameInfo *myGame, GameWindow *comboPlayer[],
423423
}
424424
if(slot->isHuman())
425425
{
426-
if (i == myGame->getLocalSlotNum() || myGame->getSlot(i)->getProductVersion() > 0)
426+
if (myGame->getSlot(i)->getProductInfo().productVersion > 0)
427427
{
428428
// TheSuperHackers @feature Caball009 06/11/2025 Set special color for players that are using a patched client version.
429429
GadgetComboBoxSetEnabledTextColors(comboPlayer[i], playerColorPatchVersion, GameMakeColor(0, 0, 0, 255));

GeneralsMD/Code/GameEngine/Source/GameNetwork/GameInfo.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ void GameSlot::reset()
7373
m_origPlayerTemplate = -1;
7474
m_origStartPos = -1;
7575
m_origColor = -1;
76-
m_productVersion = 0;
76+
m_productInfo = ProductInfo();
7777
}
7878

7979
void GameSlot::saveOffOriginalInfo( void )
@@ -1486,9 +1486,9 @@ Bool ParseAsciiStringToGameInfo(GameInfo *game, AsciiString options)
14861486

14871487
for(Int i = 0; i<MAX_SLOTS; i++)
14881488
{
1489-
// retain the patch version if a slot is still occupied by the same player
1489+
// retain the product information if a slot is still occupied by the same player
14901490
if (game->getConstSlot(i)->getState() == SLOT_PLAYER && newSlot[i].getState() == SLOT_PLAYER)
1491-
newSlot[i].setProductVersion(game->getConstSlot(i)->getProductVersion());
1491+
newSlot[i].setProductInfo(game->getConstSlot(i)->getProductInfo());
14921492

14931493
game->setSlot(i,newSlot[i]);
14941494
}

GeneralsMD/Code/GameEngine/Source/GameNetwork/LANAPIhandlers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ void LANAPI::handleMatchProductInfoResponse(LANMessage *msg, UnsignedInt senderI
149149

150150
for (Int i = 0; i < MAX_SLOTS; ++i)
151151
{
152-
if (!m_currentGame->getLANSlot(i)->isHuman() || m_currentGame->getIP(i) != senderIP)
152+
if (!m_currentGame->getConstSlot(i)->isHuman() || m_currentGame->getIP(i) != senderIP)
153153
continue;
154154

155155
// a fellow player in the game has acknowledged our request for product information

GeneralsMD/Code/GameEngine/Source/GameNetwork/LANGameInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ void LANDisplayGameList( GameWindow *gameListbox, LANGameInfo *gameList )
228228
}
229229

230230
// TheSuperHackers @feature Caball009 06/11/2025 Set special color for games that are using a patched client version.
231-
const Color color = (gameList->getSlot(0)->getProductVersion() > 0)
231+
const Color color = (gameList->getSlot(0)->getProductInfo().productVersion > 0)
232232
? ((gameList->isGameInProgress()) ? gameInProgressColorPatchVersion : gameColorPatchVersion)
233233
: ((gameList->isGameInProgress()) ? gameInProgressColor : gameColor);
234234
const Int addedIndex = GadgetListBoxAddEntryText(gameListbox, txtGName, color, -1, -1);

0 commit comments

Comments
 (0)