Skip to content

Commit ebfe555

Browse files
authored
Merge branch 'ReactiveDrop:reactivedrop_beta' into cvars_0
2 parents 8eabc0e + 2082539 commit ebfe555

7 files changed

Lines changed: 5 additions & 76 deletions

File tree

src/game/server/gameinterface.cpp

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@
111111
#include "missionchooser/iasw_mission_chooser_source.h"
112112
#include "matchmaking/swarm/imatchext_swarm.h"
113113
#include "asw_gamerules.h"
114-
#include "asw_player.h"
115114
#include "asw_util_shared.h"
116115
#include "iconsistency.h"
117116
#endif
@@ -614,16 +613,6 @@ static bool InitGameSystems( CreateInterfaceFn appSystemFactory )
614613

615614
CServerGameDLL g_ServerGameDLL;
616615
EXPOSE_SINGLE_INTERFACE_GLOBALVAR(CServerGameDLL, IServerGameDLL, INTERFACEVERSION_SERVERGAMEDLL, g_ServerGameDLL);
617-
// Crash fix/hardening: the engine can call into game code during lobby soft-close -> restart
618-
// before Steam is fully activated for the new session. Track activation so code can safely
619-
// skip Steam calls until the engine signals readiness.
620-
static bool g_bRDSteamAPIActivated = false;
621-
static float g_flNextDeferredSteamStatsRequestTime = 0.0f;
622-
623-
bool RD_IsSteamAPIActivated()
624-
{
625-
return g_bRDSteamAPIActivated;
626-
}
627616

628617
bool CServerGameDLL::DLLInit( CreateInterfaceFn appSystemFactory,
629618
CreateInterfaceFn physicsFactory, CreateInterfaceFn fileSystemFactory,
@@ -1075,7 +1064,6 @@ bool CServerGameDLL::SupportsSaveRestore()
10751064
bool CServerGameDLL::LevelInit( const char *pMapName, char const *pMapEntities, char const *pOldLevel, char const *pLandmarkName, bool loadGame, bool background )
10761065
{
10771066
VPROF("CServerGameDLL::LevelInit");
1078-
g_bRDSteamAPIActivated = false;
10791067
ResetWindspeed();
10801068
UpdateChapterRestrictions( pMapName );
10811069

@@ -1278,11 +1266,6 @@ void CServerGameDLL::ServerActivate( edict_t *pEdictList, int edictCount, int cl
12781266
void CServerGameDLL::GameServerSteamAPIActivated( void )
12791267
{
12801268
// the Steam API pointers used to be initialized here, but that happens automatically now.
1281-
// Crash fix/hardening: mark Steam as activated so code can safely call Steam APIs.
1282-
g_bRDSteamAPIActivated = true;
1283-
1284-
// If any players tried to request XP before Steam activation (restart/join window), retry now.
1285-
g_flNextDeferredSteamStatsRequestTime = 0.0f;
12861269
}
12871270

12881271
//-----------------------------------------------------------------------------
@@ -1298,42 +1281,6 @@ void CServerGameDLL::GameFrame( bool simulating )
12981281
if ( g_InRestore )
12991282
return;
13001283

1301-
// Crash fix/hardening: if we deferred any Steam stats requests because Steam wasn't activated
1302-
// yet (e.g. lobby soft-close -> restart), retry them once Steam is ready.
1303-
static const float k_flDeferredSteamStatsRequestTimeout = 30.0f;
1304-
if ( g_bRDSteamAPIActivated && gpGlobals && gpGlobals->curtime >= g_flNextDeferredSteamStatsRequestTime )
1305-
{
1306-
g_flNextDeferredSteamStatsRequestTime = gpGlobals->curtime + 1.0f;
1307-
for ( int i = 1; i <= gpGlobals->maxClients; i++ )
1308-
{
1309-
CASW_Player *pPlayer = ToASW_Player( UTIL_PlayerByIndex( i ) );
1310-
if ( !pPlayer )
1311-
continue;
1312-
1313-
if ( pPlayer->m_bDeferredSteamStatsRequest && !pPlayer->m_bPendingSteamStats )
1314-
{
1315-
if ( pPlayer->m_flDeferredSteamStatsRequestStart < 0.0f )
1316-
{
1317-
pPlayer->m_flDeferredSteamStatsRequestStart = gpGlobals->curtime;
1318-
}
1319-
1320-
if ( ( gpGlobals->curtime - pPlayer->m_flDeferredSteamStatsRequestStart ) > k_flDeferredSteamStatsRequestTimeout )
1321-
{
1322-
pPlayer->m_bDeferredSteamStatsRequest = false;
1323-
pPlayer->m_flDeferredSteamStatsRequestStart = -1.0f;
1324-
continue;
1325-
}
1326-
1327-
pPlayer->RequestExperience();
1328-
if ( pPlayer->m_bPendingSteamStats )
1329-
{
1330-
pPlayer->m_bDeferredSteamStatsRequest = false;
1331-
pPlayer->m_flDeferredSteamStatsRequestStart = -1.0f;
1332-
}
1333-
}
1334-
}
1335-
}
1336-
13371284
#ifndef NO_STEAM
13381285
// All the calls to us from the engine prior to gameframe (like LevelInit & ServerActivate)
13391286
// are done before the engine has got the Steam API connected, so we have to wait until now to connect ourselves.
@@ -1571,7 +1518,6 @@ void CServerGameDLL::LevelShutdown( void )
15711518
MDLCACHE_CRITICAL_SECTION();
15721519
IGameSystem::LevelShutdownPreEntityAllSystems();
15731520

1574-
g_bRDSteamAPIActivated = false;
15751521
// YWB:
15761522
// This entity pointer is going away now and is corrupting memory on level transitions/restarts
15771523
CSoundEnt::ShutdownSoundEnt();

src/game/server/gameinterface.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//========= Copyright 1996-2005, Valve Corporation, All rights reserved. ============//
1+
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
22
//
33
// Purpose: Expose things from GameInterface.cpp. Mostly the engine interfaces.
44
//
@@ -211,11 +211,6 @@ class CMapLoadEntityFilter : public IMapEntityFilter
211211

212212
bool IsEngineThreaded();
213213

214-
// Crash fix support: during lobby soft-close -> restart, the engine can call into game code
215-
// (including PlayerSpawn) before Steam is fully activated for the new session.
216-
// This helper lets server-side code skip Steam calls until GameServerSteamAPIActivated fires.
217-
bool RD_IsSteamAPIActivated();
218-
219214
class CServerGameTags : public IServerGameTags
220215
{
221216
public:

src/game/server/swarm/asw_player.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,8 +407,6 @@ CASW_Player::CASW_Player()
407407

408408
m_bPendingSteamStats = false;
409409
m_flPendingSteamStatsStart = 0.0f;
410-
m_bDeferredSteamStatsRequest = false;
411-
m_flDeferredSteamStatsRequestStart = -1.0f;
412410

413411
m_bWelcomed = false;
414412

src/game/server/swarm/asw_player.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,6 @@ class CASW_Player : public CBaseMultiplayerPlayer, public IASWPlayerAnimStateHel
278278
bool m_bHasAwardedXP;
279279
bool m_bPendingSteamStats;
280280
float m_flPendingSteamStatsStart;
281-
bool m_bDeferredSteamStatsRequest;
282-
float m_flDeferredSteamStatsRequestStart;
283281
bool m_bSentPromotedMessage;
284282

285283
// static inventory (medals)

src/game/shared/swarm/asw_gamerules.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,9 @@ ConVar asw_marine_ff_absorption( "asw_marine_ff_absorption", "1", FCVAR_REPLICAT
613613
ConVar asw_horde_override( "asw_horde_override", "0", FCVAR_REPLICATED, "Forces hordes to spawn", UpdateMatchmakingTagsCallback );
614614
ConVar asw_wanderer_override( "asw_wanderer_override", "0", FCVAR_REPLICATED, "Forces wanderers to spawn", UpdateMatchmakingTagsCallback );
615615
ConVar rd_challenge( "rd_challenge", "0", FCVAR_REPLICATED | FCVAR_DEMO, "Activates a challenge by ID", UpdateMatchmakingTagsCallback );
616-
ConVar rd_challenge_changing( "rd_challenge_changing", "0", FCVAR_GAMEDLL | FCVAR_CHEAT | FCVAR_HIDDEN, "Internally used for diagnostics during challenge transitions" );
616+
#ifdef GAME_DLL
617+
ConVar rd_challenge_changing( "rd_challenge_changing", "0", FCVAR_CHEAT | FCVAR_HIDDEN, "Internally used for diagnostics during challenge transitions" );
618+
#endif
617619
ConVar rd_lock_difficulty( "rd_lock_difficulty", "0", FCVAR_REPLICATED, "If 1, the lobby leader cannot change the difficulty level." );
618620
ConVar rd_lock_onslaught( "rd_lock_onslaught", "0", FCVAR_REPLICATED, "If 1, the lobby leader cannot change the onslaught setting." );
619621
ConVar rd_lock_hardcoreff( "rd_lock_hardcoreff", "0", FCVAR_REPLICATED, "If 1, the lobby leader cannot change the hardcore friendly fire setting." );

src/game/shared/swarm/asw_player_experience.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -467,16 +467,6 @@ void CASW_Player::RequestExperience()
467467
#else
468468
if ( engine->IsDedicatedServer() )
469469
{
470-
// Crash fix/hardening: during lobby soft-close -> restart, PlayerSpawn can run before
471-
// Steam is activated for the new session. Avoid calling RequestUserStats until the
472-
// engine signals Steam readiness (GameServerSteamAPIActivated).
473-
if ( !RD_IsSteamAPIActivated() )
474-
{
475-
// Defer rather than skip: once Steam is activated, game code will retry this request.
476-
m_bDeferredSteamStatsRequest = true;
477-
return;
478-
}
479-
480470
Assert( SteamGameServerStats() );
481471
if ( SteamGameServerStats() )
482472
{

src/game/shared/swarm/rd_lobby_utils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ static void DebugSpewLobby( CSteamID lobby )
349349
#define LOBBY_SEARCH_INTERVAL 30.0f
350350

351351
ConVar rd_lobby_search_debug( "rd_lobby_search_debug", "0" );
352-
ConVar rd_lobby_query_servers( "rd_lobby_query_servers", "0" );
352+
ConVar rd_lobby_query_servers( "rd_lobby_query_servers", "1" );
353353

354354
CReactiveDropLobbySearch::CReactiveDropLobbySearch( const char *pszDebugName ) :
355355
m_DistanceFilter{ k_ELobbyDistanceFilterWorldwide },

0 commit comments

Comments
 (0)