From e0f369d0617cfce4480bfd6c088cbb854e0cd8ee Mon Sep 17 00:00:00 2001 From: ChocoTaco Date: Sat, 8 Jun 2019 01:40:09 -0400 Subject: [PATCH] Client Specific AFK Timeout Too many schedules for all clients --- Classic/prefs/serverPrefs.cs | 2 +- Classic/scripts/autoexec/zDarkTigerAFK.cs | 27 +++++++++++++++++++---- Classic/scripts/serverDefaults.cs | 2 +- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/Classic/prefs/serverPrefs.cs b/Classic/prefs/serverPrefs.cs index 860452f..1082de7 100644 --- a/Classic/prefs/serverPrefs.cs +++ b/Classic/prefs/serverPrefs.cs @@ -8,6 +8,7 @@ $Host::AllowMapScript = "True"; $Host::AnimateWithTransitions = 0; $Host::AntiCloakEnable = 1; $Host::AntiCloakPlayerCount = 6; +$Host::AFKTimeout = 3; $Host::BanTime = 2147483647; $Host::BotCount = 2; $Host::BotsEnabled = 0; @@ -164,7 +165,6 @@ $Host::EvoTKWarn2 = 6; $Host::EvoTourneySameMap = 1; $Host::EvoUseHighPerformanceCounter = 0; $Host::FloodProtectionEnabled = 1; -$Host::AFKTime = 1; $Host::GameName = "Discord PU"; $Host::HiVisibility = "1"; $Host::holoName1 = "Storm"; diff --git a/Classic/scripts/autoexec/zDarkTigerAFK.cs b/Classic/scripts/autoexec/zDarkTigerAFK.cs index fd352cb..a631292 100644 --- a/Classic/scripts/autoexec/zDarkTigerAFK.cs +++ b/Classic/scripts/autoexec/zDarkTigerAFK.cs @@ -1,12 +1,15 @@ -//Observer AFK +//AFK Timeout //Script BY: DarkTiger // //TacoServer: //Change to how many minutes to set forced Observer for AFK players //Setting to 0 disables this feature -//$Host::AFKTime = 1; +//$Host::AFKTimeout = 1; +// +//Client specific to save on schedules +//Add clients who are normally AFK -$dtVar::AFKtime = 60000 * $Host::AFKTime;//if player is afk specific amount of time, force them into observer +$dtVar::AFKtime = 60000 * $Host::AFKTimeout;//if player is afk specific amount of time, force them into observer $dtVar::AFKloop = 1000 * 30;//loop check timer currently set to 30 secs //////////////////////////////////////////////////////////////////////////////// @@ -18,8 +21,24 @@ function GameConnection::onConnect(%client, %name, %raceGender, %skin, %voice, % { Parent::onConnect( %client, %name, %raceGender, %skin, %voice, %voicePitch ); + %guid = %client.guid; + + //Add clients here + %AFKWatchList1 = ""; + %AFKWatchList2 = ""; + %AFKWatchList3 = ""; + %AFKWatchList4 = ""; + if($dtVar::AFKtime > 0) - %client.afkLoopCheck();// starts it + { + if(%guid $= %AFKWatchList1 || %guid $= %AFKWatchList2 || %guid $= %AFKWatchList3 || %guid $= %AFKWatchList4 ) + { + if(%guid $= "") + return; + + %client.afkLoopCheck();// starts it + } + } } }; diff --git a/Classic/scripts/serverDefaults.cs b/Classic/scripts/serverDefaults.cs index 3e64c85..6600ff3 100644 --- a/Classic/scripts/serverDefaults.cs +++ b/Classic/scripts/serverDefaults.cs @@ -203,7 +203,7 @@ $Host::loadingmsgline3 = "Required Mappacks: "; //Loading screen msg lin $Host::loadingmsgline3content = "S5 S8 TWL TWL2"; //Loading screen msg content 3 $Host::loadingmsgline4 = "Hosted by: "; //Loading screen msg line 4 $Host::loadingmsgline4content = "Branzone"; //Loading screen msg content 4 -$Host::AFKTime = 1; //Time in minutes to put AFK player in observer mode, 0 disables it +$Host::AFKTimeout = 3; //Time in minutes to put AFK player in observer mode, 0 disables it //LakRabbit $Host::EnableLakUnlimitedDJ = 1; //Unlimited disc-jumps if enabled $Host::LakRabbitNoSplashDamage = 0; //Splash Damage enabled or not