Skip to content

Commit 87193b6

Browse files
committed
Added product info setter functions.
1 parent fedb4a6 commit 87193b6

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,9 @@ class LANAPI : public LANAPIInterface
260260
void addGame(LANGameInfo *game);
261261
AsciiString createSlotString( void );
262262

263+
void setProductInfoFromLocalData(GameSlot *slot);
264+
void setProductInfoFromMessage(LANMessage *msg, GameSlot *slot);
265+
263266
// Functions to handle incoming messages -----------------------------------
264267
void handleRequestLocations( LANMessage *msg, UnsignedInt senderIP );
265268
void handleGameAnnounce( LANMessage *msg, UnsignedInt senderIP );

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,30 @@
4141
#include "GameNetwork/LANAPICallbacks.h"
4242
#include "GameClient/MapUtil.h"
4343

44+
void LANAPI::setProductInfoFromLocalData(GameSlot *slot)
45+
{
46+
GameSlot::ProductInfo productInfo;
47+
productInfo.exeCRC = TheGlobalData->m_exeCRC;
48+
productInfo.iniCRC = TheGlobalData->m_iniCRC;
49+
productInfo.productVersion = TheVersion->getVersionNumber();
50+
productInfo.gitTagOrHash = TheVersion->getAsciiGitTagOrHash();
51+
productInfo.productName = TheVersion->getUnicodeProductString();
52+
53+
slot->setProductInfo(productInfo);
54+
}
55+
56+
void LANAPI::setProductInfoFromMessage(LANMessage *msg, GameSlot *slot)
57+
{
58+
GameSlot::ProductInfo productInfo;
59+
productInfo.exeCRC = msg->ProductInfo.exeCRC;
60+
productInfo.iniCRC = msg->ProductInfo.iniCRC;
61+
productInfo.productVersion = msg->ProductInfo.productVersion;
62+
productInfo.gitTagOrHash = msg->ProductInfo.gitTagOrHash;
63+
productInfo.productName = msg->ProductInfo.productName;
64+
65+
slot->setProductInfo(productInfo);
66+
}
67+
4468
void LANAPI::sendProductInfoMessage(Int messageType, UnsignedInt senderIP)
4569
{
4670
LANMessage msg;

0 commit comments

Comments
 (0)