4141#include " GameNetwork/LANAPICallbacks.h"
4242#include " GameClient/MapUtil.h"
4343
44- void LANAPI::handlePatchInfo (Int messageType, UnsignedInt senderIP, UnicodeString gameName )
44+ void LANAPI::sendProductInfoMessage (Int messageType, UnsignedInt senderIP)
4545{
4646 LANMessage msg;
4747 fillInLANMessage (&msg);
4848 msg.messageType = (LANMessage::Type)messageType;
49- wcslcpy (msg.PatchInfo .gameName , gameName.str (), ARRAY_SIZE (msg.PatchInfo .gameName ));
50- msg.PatchInfo .patchVersion = TheVersion->getVersionNumber ();
49+
50+ msg.ProductInfo .exeHash = TheGlobalData->m_exeCRC ;
51+ msg.ProductInfo .iniHash = TheGlobalData->m_iniCRC ;
52+ msg.ProductInfo .productVersion = TheVersion->getVersionNumber ();
53+ strlcpy (msg.ProductInfo .gitTagOrHash , TheVersion->getAsciiGitTagOrHash ().str (), ARRAY_SIZE (msg.ProductInfo .gitTagOrHash ));
54+ wcslcpy (msg.ProductInfo .productName , TheVersion->getUnicodeProductString ().str (), ARRAY_SIZE (msg.ProductInfo .productName ));
5155
5256 sendMessage (&msg, senderIP);
5357}
5458
55- void LANAPI::handleGameRequestPatchInfo (LANMessage *msg, UnsignedInt senderIP)
59+ void LANAPI::handleGameProductInfoRequest (LANMessage *msg, UnsignedInt senderIP)
5660{
5761 if (!AmIHost ())
5862 return ;
5963
60- // acknowledge as game host a request for patch information by a player in the lobby
61- handlePatchInfo (LANMessage::MSG_GAME_ACKNOWLEDGE_PATCH_INFO , senderIP, m_currentGame-> getName () );
64+ // acknowledge as game host a request for product information by a player in the lobby
65+ sendProductInfoMessage (LANMessage::MSG_GAME_RESPONSE_PRODUCT_INFO , senderIP);
6266}
6367
64- void LANAPI::handleGameAcknowledgePatchInfo (LANMessage *msg, UnsignedInt senderIP)
68+ void LANAPI::handleGameProductInfoResponse (LANMessage *msg, UnsignedInt senderIP)
6569{
6670 if (!m_inLobby)
6771 return ;
6872
69- LANGameInfo *game = LookupGame ( UnicodeString (msg-> GameInfo . gameName ) );
73+ LANGameInfo *game = LookupGameByHost (senderIP );
7074 if (!game)
7175 return ;
7276
73- if (game->getIP (0 ) != senderIP)
74- return ;
75-
76- // a game host has acknowledged our request for patch information
77- game->getSlot (0 )->setPatchVersion (msg->PatchInfo .patchVersion );
77+ // a game host has acknowledged our request for product information
78+ game->getSlot (0 )->setProductVersion (msg->ProductInfo .productVersion );
7879
7980 // update game list with colored names
8081 OnGameList (m_games);
8182}
8283
83- void LANAPI::handleLobbyRequestPatchInfo (LANMessage *msg, UnsignedInt senderIP)
84+ void LANAPI::handleLobbyProductInfoRequest (LANMessage *msg, UnsignedInt senderIP)
8485{
8586 if (!m_inLobby)
8687 return ;
8788
88- // acknowledge a request for patch information by a fellow player in the lobby
89- handlePatchInfo (LANMessage::MSG_LOBBY_ACKNOWLEDGE_PATCH_INFO , senderIP, UnicodeString () );
89+ // acknowledge a request for product information by a fellow player in the lobby
90+ sendProductInfoMessage (LANMessage::MSG_LOBBY_RESPONSE_PRODUCT_INFO , senderIP);
9091}
9192
92- void LANAPI::handleLobbyAcknowledgePatchInfo (LANMessage *msg, UnsignedInt senderIP)
93+ void LANAPI::handleLobbyProductInfoResponse (LANMessage *msg, UnsignedInt senderIP)
9394{
9495 if (!m_inLobby)
9596 return ;
@@ -98,26 +99,26 @@ void LANAPI::handleLobbyAcknowledgePatchInfo(LANMessage *msg, UnsignedInt sender
9899 if (!player)
99100 return ;
100101
101- // a fellow player in the lobby has acknowledged our request for patch information
102- player->setPatchVersion (msg->PatchInfo . patchVersion );
102+ // a fellow player in the lobby has acknowledged our request for product information
103+ player->setProductVersion (msg->ProductInfo . productVersion );
103104
104105 // update player list with colored names
105106 OnPlayerList (m_lobbyPlayers);
106107}
107108
108- void LANAPI::handleMatchRequestPatchInfo (LANMessage *msg, UnsignedInt senderIP)
109+ void LANAPI::handleMatchProductInfoRequest (LANMessage *msg, UnsignedInt senderIP)
109110{
110111 if (!m_currentGame)
111112 return ;
112113
113- // acknowledge a request for patch information by a fellow player in the game
114- handlePatchInfo (LANMessage::MSG_MATCH_ACKNOWLEDGE_PATCH_INFO , senderIP, m_currentGame-> getName () );
114+ // acknowledge a request for product information by a fellow player in the game
115+ sendProductInfoMessage (LANMessage::MSG_MATCH_RESPONSE_PRODUCT_INFO , senderIP);
115116
116- // treat request for patch information as acknowledgement
117- handleMatchAcknowledgePatchInfo (msg, senderIP);
117+ // treat request for product information as acknowledgement
118+ handleMatchProductInfoResponse (msg, senderIP);
118119}
119120
120- void LANAPI::handleMatchAcknowledgePatchInfo (LANMessage *msg, UnsignedInt senderIP)
121+ void LANAPI::handleMatchProductInfoResponse (LANMessage *msg, UnsignedInt senderIP)
121122{
122123 if (!m_currentGame)
123124 return ;
@@ -127,8 +128,8 @@ void LANAPI::handleMatchAcknowledgePatchInfo(LANMessage *msg, UnsignedInt sender
127128 if (!m_currentGame->getLANSlot (i)->isHuman () || m_currentGame->getIP (i) != senderIP)
128129 continue ;
129130
130- // a fellow player in the game has acknowledged our request for patch information
131- m_currentGame->getSlot (i)->setPatchVersion (msg->PatchInfo . patchVersion );
131+ // a fellow player in the game has acknowledged our request for product information
132+ m_currentGame->getSlot (i)->setProductVersion (msg->ProductInfo . productVersion );
132133
133134 // update player list with colored names
134135 lanUpdateSlotList ();
@@ -237,8 +238,8 @@ void LANAPI::handleGameAnnounce( LANMessage *msg, UnsignedInt senderIP )
237238 game->setName (UnicodeString (msg->GameInfo .gameName ));
238239 addGame (game);
239240
240- // TheSuperHackers @feature Caball009 06/11/2025 Request a game host to send patch information.
241- handlePatchInfo (LANMessage::MSG_GAME_REQUEST_PATCH_INFO , senderIP, game-> getName () );
241+ // TheSuperHackers @feature Caball009 06/11/2025 Request a game host to send product information.
242+ sendProductInfoMessage (LANMessage::MSG_GAME_REQUEST_PRODUCT_INFO , senderIP);
242243 }
243244 Bool success = ParseGameOptionsString (game,AsciiString (msg->GameInfo .options ));
244245 game->setGameInProgress (msg->GameInfo .inProgress );
@@ -266,8 +267,8 @@ void LANAPI::handleLobbyAnnounce( LANMessage *msg, UnsignedInt senderIP )
266267 player = NEW LANPlayer;
267268 player->setIP (senderIP);
268269
269- // TheSuperHackers @feature Caball009 06/11/2025 Request a player in the lobby to send patch information.
270- handlePatchInfo (LANMessage::MSG_LOBBY_REQUEST_PATCH_INFO , senderIP, UnicodeString () );
270+ // TheSuperHackers @feature Caball009 06/11/2025 Request a player in the lobby to send product information.
271+ sendProductInfoMessage (LANMessage::MSG_LOBBY_REQUEST_PRODUCT_INFO , senderIP);
271272 }
272273 else
273274 {
@@ -505,8 +506,8 @@ void LANAPI::handleJoinAccept( LANMessage *msg, UnsignedInt senderIP )
505506 // DEBUG_ASSERTCRASH(false, ("setting host to %ls@%ls", m_currentGame->getLANSlot(0)->getUser()->getLogin().str(),
506507 // m_currentGame->getLANSlot(0)->getUser()->getHost().str()));
507508
508- // TheSuperHackers @feature Caball009 06/11/2025 Request players in the match to send patch information.
509- handlePatchInfo (LANMessage::MSG_MATCH_REQUEST_PATCH_INFO , 0 , m_currentGame-> getName () );
509+ // TheSuperHackers @feature Caball009 06/11/2025 Request players in the match to send product information.
510+ sendProductInfoMessage (LANMessage::MSG_MATCH_REQUEST_PRODUCT_INFO , 0 );
510511 }
511512 m_pendingAction = ACT_NONE;
512513 m_expiration = 0 ;
0 commit comments