Add sm_realclients to FakeClients and update several plugins

FakeClients: sm_realclients, autism bots counted separately.

Updated: Extend, HostnameManager, PlayerRankings_nohlstats.

Add shared include: BotTargeting.
This commit is contained in:
2026-11-24 03:21:45 +00:00
parent dd33584e57
commit 7c111cd0f8
5 changed files with 249 additions and 169 deletions
+15 -1
View File
@@ -49,11 +49,22 @@ public void OnPluginStart()
g_cvMaxLength = CreateConVar("sm_hostname_max_length", "63", "Fold LagCompensation, then NoSteam, out of the hostname while it is longer than this many bytes (the server browser shows at most 63)", 0, true, 1.0, true, 127.0);
g_cvSendToClients = CreateConVar("sm_hostname_send_to_clients", "1", "Send the new hostname to connected clients so their scoreboard updates without a reconnect", 0, true, 0.0, true, 1.0);
g_cvFormattedHostname.AddChangeHook(OnFormatChanged);
g_cvMaxLength.AddChangeHook(OnFormatChanged);
CreateTimer(60.0, TimerRepeat, INVALID_HANDLE, TIMER_REPEAT);
HookEvent("round_start", OnRoundStart, EventHookMode_PostNoCopy);
}
//----------------------------------------------------------------------------------------------------
// Purpose: Apply a new format (e.g. from event_on.cfg) straight away instead of on the next timer.
//----------------------------------------------------------------------------------------------------
public void OnFormatChanged(ConVar convar, const char[] oldValue, const char[] newValue)
{
RefreshHostname();
}
//----------------------------------------------------------------------------------------------------
// Purpose:
//----------------------------------------------------------------------------------------------------
@@ -107,10 +118,12 @@ public void OnLibraryRemoved(const char[] sName)
}
//----------------------------------------------------------------------------------------------------
// Purpose:
// Purpose: Refresh now for anything that changed during the restart, then again once StageDisplay
// has worked out the new stage (it checks 3s after round_start).
//----------------------------------------------------------------------------------------------------
public void OnRoundStart(Event hEvent, const char[] sEvent, bool bDontBroadcast)
{
RefreshHostname();
CreateTimer(5.0, TimerRoundStart, INVALID_HANDLE, TIMER_FLAG_NO_MAPCHANGE);
}
@@ -120,6 +133,7 @@ public void OnRoundStart(Event hEvent, const char[] sEvent, bool bDontBroadcast)
public Action TimerRoundStart(Handle timer)
{
RefreshHostname();
return Plugin_Stop;
}
//----------------------------------------------------------------------------------------------------