StAC-tf2 icon indicating copy to clipboard operation
StAC-tf2 copied to clipboard

[Feature Request] Cvar for allowing the plugin to be used on sv_cheats 1 servers.

Open Gamecube762 opened this issue 2 years ago • 8 comments

Many custom maps require sv_cheats 1 to work properly, having a cvar to enable the anti-cheat(even with limited feature set) would be very appreciated.

Gamecube762 avatar Jun 22 '22 23:06 Gamecube762

Fuck i forgot abt this, gimme a bit

sapphonie avatar Jul 05 '22 17:07 sapphonie

@Gamecube762 #118

sapphonie avatar Jul 23 '22 06:07 sapphonie

Many thanks

Gamecube762 avatar Jul 24 '22 02:07 Gamecube762

ConVarRef replay_enabled doesn't point to an existing ConVar
[StAC]

----> StAC version [5.4.1] loaded

ConVarRef room_type doesn't point to an existing ConVar
Executing dedicated server config file server.cfg
Using map cycle file 'cfg/mapcycle_default.txt'.  ('cfg/mapcycle.txt' was not found.)
Set motd from file 'cfg/motd_default.txt'.  ('cfg/motd.txt' was not found.)
Set motd_text from file 'cfg/motd_text_default.txt'.  ('cfg/motd_text.txt' was not found.)
SV_ActivateServer: setting tickrate to 66.7
Connection to game coordinator established.
'pl_badwater.cfg' not present; not executing.
Server is hibernating
Connection to Steam servers successful.
   Public IP to Steam is [].
Assigned anonymous gameserver Steam ID [A:1:3492844553:20991].
VAC secure mode is activated.
Received 6077649 bytes item schema version 4B7F92F6 direct data; update is queued.
sm plugins list
[SM] Listing 18 plugins:
  01 <Failed> "Steph's AntiCheat [StAC]" (5.4.1) by https://sappho.io
  02 "Reserved Slots" (1.11.0.6911) by AlliedModders LLC
  03 "Basic Info Triggers" (1.11.0.6911) by AlliedModders LLC
  04 "Sound Commands" (1.11.0.6911) by AlliedModders LLC
  05 "Anti-Flood" (1.11.0.6911) by AlliedModders LLC
  06 "Basic Votes" (1.11.0.6911) by AlliedModders LLC
  07 "Nextmap" (1.11.0.6911) by AlliedModders LLC
  08 "Basic Chat" (1.11.0.6911) by AlliedModders LLC
  09 "Basic Comm Control" (1.11.0.6911) by AlliedModders LLC
  10 "Client Preferences" (1.11.0.6911) by AlliedModders LLC
  11 "Admin Menu" (1.11.0.6911) by AlliedModders LLC
  12 "Admin File Reader" (1.11.0.6911) by AlliedModders LLC
  13 "Admin Help" (1.11.0.6911) by AlliedModders LLC
  14 "Fun Votes" (1.11.0.6911) by AlliedModders LLC
  15 "Basic Ban Commands" (1.11.0.6911) by AlliedModders LLC
  16 "Basic Commands" (1.11.0.6911) by AlliedModders LLC
  17 "Fun Commands" (1.11.0.6911) by AlliedModders LLC
  18 "Player Commands" (1.11.0.6911) by AlliedModders LLC
Errors:
stac.smx (Steph's AntiCheat [StAC]): [StAC] sv_cheats set to 1! Aborting!
stac_work_with_sv_cheats
"stac_work_with_sv_cheats" = "1" ( def. "0" ) min. 0.000000 max. 1.000000
 - [StAC] allow StAC to work when sv_cheats is 1. WARNING; you might get false positives, and I will not provide support for servers running this cvar!
(recommended 0)
sv_cheats
"sv_cheats" = "1" ( def. "0" )
 notify replicated
 - Allow cheats on server

ghost avatar Aug 08 '22 02:08 ghost

Investigating

sapphonie avatar Aug 08 '22 03:08 sapphonie

ConVarRef replay_enabled doesn't point to an existing ConVar
[StAC]

----> StAC version [5.4.1] loaded

ConVarRef room_type doesn't point to an existing ConVar
Executing dedicated server config file server.cfg
Using map cycle file 'cfg/mapcycle_default.txt'.  ('cfg/mapcycle.txt' was not found.)
Set motd from file 'cfg/motd_default.txt'.  ('cfg/motd.txt' was not found.)
Set motd_text from file 'cfg/motd_text_default.txt'.  ('cfg/motd_text.txt' was not found.)
SV_ActivateServer: setting tickrate to 66.7
Connection to game coordinator established.
'pl_badwater.cfg' not present; not executing.
Server is hibernating
Connection to Steam servers successful.
   Public IP to Steam is [].
Assigned anonymous gameserver Steam ID [A:1:3492844553:20991].
VAC secure mode is activated.
Received 6077649 bytes item schema version 4B7F92F6 direct data; update is queued.
sm plugins list
[SM] Listing 18 plugins:
  01 <Failed> "Steph's AntiCheat [StAC]" (5.4.1) by https://sappho.io
  02 "Reserved Slots" (1.11.0.6911) by AlliedModders LLC
  03 "Basic Info Triggers" (1.11.0.6911) by AlliedModders LLC
  04 "Sound Commands" (1.11.0.6911) by AlliedModders LLC
  05 "Anti-Flood" (1.11.0.6911) by AlliedModders LLC
  06 "Basic Votes" (1.11.0.6911) by AlliedModders LLC
  07 "Nextmap" (1.11.0.6911) by AlliedModders LLC
  08 "Basic Chat" (1.11.0.6911) by AlliedModders LLC
  09 "Basic Comm Control" (1.11.0.6911) by AlliedModders LLC
  10 "Client Preferences" (1.11.0.6911) by AlliedModders LLC
  11 "Admin Menu" (1.11.0.6911) by AlliedModders LLC
  12 "Admin File Reader" (1.11.0.6911) by AlliedModders LLC
  13 "Admin Help" (1.11.0.6911) by AlliedModders LLC
  14 "Fun Votes" (1.11.0.6911) by AlliedModders LLC
  15 "Basic Ban Commands" (1.11.0.6911) by AlliedModders LLC
  16 "Basic Commands" (1.11.0.6911) by AlliedModders LLC
  17 "Fun Commands" (1.11.0.6911) by AlliedModders LLC
  18 "Player Commands" (1.11.0.6911) by AlliedModders LLC
Errors:
stac.smx (Steph's AntiCheat [StAC]): [StAC] sv_cheats set to 1! Aborting!
stac_work_with_sv_cheats
"stac_work_with_sv_cheats" = "1" ( def. "0" ) min. 0.000000 max. 1.000000
 - [StAC] allow StAC to work when sv_cheats is 1. WARNING; you might get false positives, and I will not provide support for servers running this cvar!
(recommended 0)
sv_cheats
"sv_cheats" = "1" ( def. "0" )
 notify replicated
 - Allow cheats on server

Can you test #131 ( https://github.com/sapphonie/StAC-tf2/raw/8d41f06ca788cc1877bf536577ccdf1099899478/plugins/stac.smx ) and see if this fixes your issue? Thanks

sapphonie avatar Sep 07 '22 22:09 sapphonie

Can you test https://github.com/sapphonie/StAC-tf2/pull/131 ( https://github.com/sapphonie/StAC-tf2/raw/8d41f06ca788cc1877bf536577ccdf1099899478/plugins/stac.smx ) and see if this fixes your issue? Thanks

[StAC] 

----> StAC version [5.4.2] loaded

ConVarRef room_type doesn't point to an existing ConVar
Executing dedicated server config file server.cfg
Using map cycle file 'cfg/mapcycle_default.txt'.  ('cfg/mapcycle.txt' was not found.)
Set motd from file 'cfg/motd_default.txt'.  ('cfg/motd.txt' was not found.)
Set motd_text from file 'cfg/motd_text_default.txt'.  ('cfg/motd_text.txt' was not found.)
SV_ActivateServer: setting tickrate to 66.7
Connection to game coordinator established.
Current item schema is up-to-date with version 6A365496.

=======server.cfg======= 

L 09/08/2022 - 14:35:40: [SM] Exception reported: [StAC] sv_cheats set to 1! Aborting!
L 09/08/2022 - 14:35:40: [SM] Blaming: external/stac.smx
L 09/08/2022 - 14:35:40: [SM] Call stack trace:
L 09/08/2022 - 14:35:40: [SM]   [0] SetFailState
L 09/08/2022 - 14:35:40: [SM]   [1] Line 592, ./scripting/stac/stac_cvars.sp::GenericCvarChanged

--------------------------------------------------------
sv_pure value unchanged (current value is 0).
--------------------------------------------------------

=======sourcemod/stac.cfg======= 

Server is hibernating
Connection to Steam servers successful.
   Public IP to Steam is Nope.
Assigned anonymous gameserver Steam ID [:::].
VAC secure mode is activated.

=======pvp_enable.cfg======= 

stac_work_with_sv_cheats
"stac_work_with_sv_cheats" = "1" ( def. "0" ) min. 0.000000 max. 1.000000
 - [StAC] allow StAC to work when sv_cheats is 1. WARNING; you might get false positives, and I will not provide support for servers running this cvar!
(recommended 0)
sv_cheats
"sv_cheats" = "1" ( def. "0" )
 - Allow cheats on server

The plugin still aborted itself on my first try, but I found out it's a race-condition. If sv_cheats 1 is ran before stac_work_with_sv_cheats 1 the plugin will abort. cfg/sourcemod/stac.cfg runs very late after server.cfg triggering this race-condition. When testing both Cvars in server.cfg having stac_work_with_sv_cheats 1 before sv_cheats 1 prevents the plugin from aborting.

Gamecube762 avatar Sep 08 '22 21:09 Gamecube762

PRs welcome, otherwise I'll fix it tonight

sapphonie avatar Sep 08 '22 21:09 sapphonie

Didn't fix it ^ obviously. This is an annoying thing to fix, I'm trying to avoid making race conditions with timers to fix other race conditions

sapphonie avatar Dec 04 '22 07:12 sapphonie