Skip to content

Commit

Permalink
update to disable support for cracked maxplayers servers
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphonie committed May 16, 2023
1 parent caddfac commit c328f7a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 15 deletions.
Binary file modified plugins/stac.smx
Binary file not shown.
29 changes: 17 additions & 12 deletions scripting/stac.sp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
#pragma semicolon 1
#pragma newdecls required

#define PLUGIN_VERSION "6.0.0"
#define PLUGIN_VERSION "6.0.1"

#define UPDATE_URL "https://raw.githubusercontent.com/sapphonie/StAC-tf2/master/updatefile.txt"

Expand Down Expand Up @@ -92,17 +92,7 @@ public void OnPluginStart()
{
StopIncompatPlugins();
StacLog("\n\n----> StAC version [%s] loaded\n", PLUGIN_VERSION);
// check if tf2, unload if not
if (GetEngineVersion() != Engine_TF2)
{
SetFailState("[StAC] This plugin is only supported for TF2! Aborting!");
}

if (MaxClients > TFMAXPLAYERS)
{
SetFailState("[StAC] This plugin (and TF2 in general) does not support more than 33 players (32 + 1 for STV). Aborting!");
}

EngineSanityChecks();
DoStACGamedata();

if (!AddCommandListener(OnAllClientCommands))
Expand Down Expand Up @@ -298,3 +288,18 @@ void StopIncompatPlugins()
delete plugini;

}


void EngineSanityChecks()
{
// check if tf2, unload if not
if (GetEngineVersion() != Engine_TF2)
{
SetFailState("[StAC] This plugin is only supported for TF2! Aborting!");
}

if ( MaxClients > TFMAXPLAYERS || GetMaxHumanPlayers() > (TFMAXPLAYERS - 2) )
{
SetFailState("[StAC] This plugin (and TF2 in general) does not support more than 34 players (32 + 1 for STV + 1 for the Replay bot). Aborting!");
}
}
3 changes: 2 additions & 1 deletion scripting/stac/stac_globals.sp
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#pragma semicolon 1

// we don't need 64 maxplayers because this is only for tf2. saves some memory.
#define TFMAXPLAYERS 33
// 34 == 32 + stv + replay
#define TFMAXPLAYERS 34

/********** GLOBAL VARS **********/
// Regex steamidRegex;
Expand Down
5 changes: 3 additions & 2 deletions updatefile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
{
"Version"
{
"Latest" "6.0.0"
"Latest" "6.0.1"
}

"Notes" "Changes in 6.0.0"
"Notes" "Changes in 6.0.0/6.0.1"
"Notes" "- Too many to count! Read the pull request here:"
"Notes" "https://github.com/sapphonie/StAC-tf2/pull/139"
"Notes" "Of note: StAC now requires 4 extensions and some gamedata to run, to prevent the latest exploits, including server crashers and admin spoofing. These will be automatically downloaded by Updater."
"Notes" "- 6.0.1 properly disables support for servers with more than 32 human players instead of throwing errors and continuing to run."
"Notes" "===== StAC is always looking for feedback! Got an issue, request, or wanna discuss? Open a GitHub issue and join the Discord server linked in the README, on GitHub! ====="
"Notes" "===== Thank you for using StAC. -sappho ===== "
}
Expand Down

0 comments on commit c328f7a

Please sign in to comment.