Skip to content
This repository was archived by the owner on Mar 20, 2025. It is now read-only.

Commit 4598c90

Browse files
committed
Use 'sam_strGameName' in Query directly instead of the shell command.
1 parent 5d5c2c2 commit 4598c90

4 files changed

Lines changed: 10 additions & 7 deletions

File tree

Query/DarkPlacesQuery.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ void DarkPlaces_BuildQCStatus(CTString &strStatus)
4141
{
4242
INDEX ctFreeSlots = _pNetwork->ga_sesSessionState.ses_ctMaxPlayers - GetClientCount();
4343

44-
strStatus.PrintF("%s:%s:P%d:S%d:F%d:M%s::score!!", _getCurrentGameTypeName(), "0.8.2", 0, ctFreeSlots, 0, _pShell->GetString("sam_strGameName"));
44+
strStatus.PrintF("%s:%s:P%d:S%d:F%d:M%s::score!!", _getCurrentGameTypeName(), "0.8.2", 0, ctFreeSlots, 0, sam_strGameName);
4545
}
4646

4747
// Builds status string.
@@ -62,7 +62,7 @@ void DarkPlaces_BuildStatusResponse(const char* challenge, CTString &strPacket,
6262
"%s",
6363
bFullStatus ? "statusResponse" : "infoResponse",
6464
// [Cecil] "$version" -> _SE_VER_STRING
65-
_pShell->GetString("sam_strGameName"), "", _SE_VER_STRING, ctMaxPlayers,
65+
sam_strGameName, "", _SE_VER_STRING, ctMaxPlayers,
6666
GetClientCount(), 0, _pNetwork->ga_World.wo_strName, _pPatchAPI->GetSessionName(), DP_NET_PROTOCOL_VERSION,
6767
"\\qcstatus\\", strStatus,
6868
challenge ? "\\challenge\\" : "", challenge ? challenge : "",
@@ -395,7 +395,7 @@ void CDarkPlacesQuery::EnumTrigger(BOOL bInternet)
395395
_bInitialized = TRUE;
396396

397397
CTString strPacket;
398-
strPacket.PrintF("\xFF\xFF\xFF\xFFgetservers %s %u empty full", _pShell->GetString("sam_strGameName"), DP_NET_PROTOCOL_VERSION);
398+
strPacket.PrintF("\xFF\xFF\xFF\xFFgetservers %s %u empty full", sam_strGameName, DP_NET_PROTOCOL_VERSION);
399399
_sendPacket(strPacket); // Send enumeration packet to masterserver.
400400

401401
_setStatus(".");

Query/GameAgentQuery.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ void CGameAgentQuery::BuildHearthbeatPacket(CTString &strPacket, INDEX iChalleng
3737
_pNetwork->ga_World.wo_strName,
3838
_getCurrentGameTypeName(),
3939
_SE_VER_STRING,
40-
_pShell->GetString("sam_strGameName"));
40+
sam_strGameName);
4141
}
4242

4343
void CGameAgentQuery::ServerParsePacket(INDEX iLength)
@@ -63,7 +63,7 @@ void CGameAgentQuery::ServerParsePacket(INDEX iLength)
6363
_pNetwork->ga_World.wo_strName,
6464
_getCurrentGameTypeName(),
6565
_SE_VER_STRING,
66-
_pShell->GetString("sam_strGameName"),
66+
sam_strGameName,
6767
_pPatchAPI->GetSessionName());
6868
_sendPacketTo(strPacket, &_sinFrom);
6969
break;

Query/LegacyServerQuery.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ void CLegacyQuery::ServerParsePacket(INDEX iLength)
110110
}
111111

112112
strPacket.PrintF( PCKQUERY,
113-
_pShell->GetString("sam_strGameName"),
113+
sam_strGameName,
114114
_SE_VER_STRING,
115115
//_pShell->GetString("net_strLocalHost"),
116116
strLocation,
@@ -183,7 +183,7 @@ void CLegacyQuery::ServerParsePacket(INDEX iLength)
183183
strLocation = "Heartland";
184184
}
185185
strPacket.PrintF( PCKBASIC,
186-
_pShell->GetString("sam_strGameName"),
186+
sam_strGameName,
187187
_SE_VER_STRING,
188188
//_pShell->GetString("net_strLocalHost"));
189189
strLocation);

Query/QueryMgr.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
1919
#pragma once
2020
#endif
2121

22+
// [Cecil] Get game name directly
23+
extern CTString sam_strGameName;
24+
2225
extern CTString ms_strGameAgentMS;
2326
extern CTString ms_strMSLegacy;
2427
extern CTString ms_strDarkPlacesMS;

0 commit comments

Comments
 (0)