From 7fa6885e0bb3dd6c15ec97b9d6a2e9cd223235a1 Mon Sep 17 00:00:00 2001 From: Jackzme Date: Tue, 10 Dec 2024 11:59:07 -0600 Subject: [PATCH 1/4] Add some more debug logs --- scripting/adminpanel.sp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/scripting/adminpanel.sp b/scripting/adminpanel.sp index 8af26e3..3929888 100644 --- a/scripting/adminpanel.sp +++ b/scripting/adminpanel.sp @@ -658,13 +658,14 @@ Action Timer_Reconnect(Handle h, int type) { } bool ConnectSocket(bool force = false, int authTry = 0) { - if(g_gameState == State_Hibernating) return false; // ignore when hibernating - if(g_socket == null) { + if(g_gameState == State_Hibernating) { + Debug("ConnectSocket: Server is hibernating, ignoring"); + return false; + } else if(g_socket == null) { LogError("Socket is invalid"); return false; - } - if(g_socket.Connected) { - Debug("Already connected, disconnecting..."); + } else if(g_socket.Connected) { + Debug("ConnectSocket: Already connected, disconnecting..."); g_socket.Disconnect(); authState = Auth_Inactive; } @@ -673,7 +674,10 @@ bool ConnectSocket(bool force = false, int authTry = 0) { return false; } // Do not try to reconnect on auth failure, until token has changed - if(!force && authState == Auth_Fail) return false; + if(!force && authState == Auth_Fail) { + Debug("ConnectSocket: Ignoring request, auth failed"); + return false; + } authState = Auth_Pending; g_socket.Connect(OnSocketConnect, OnSocketReceive, OnSocketDisconnect, serverIp, serverPort); CreateTimer(10.0, Timer_ConnectTimeout, authTry); From ad2c80530826a9873f8b3e8d61734491f68e6ca7 Mon Sep 17 00:00:00 2001 From: Jackzme Date: Tue, 10 Dec 2024 12:01:34 -0600 Subject: [PATCH 2/4] Don't default to hibernate --- scripting/adminpanel.sp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripting/adminpanel.sp b/scripting/adminpanel.sp index 3929888..5996a89 100644 --- a/scripting/adminpanel.sp +++ b/scripting/adminpanel.sp @@ -92,7 +92,7 @@ enum PanelSettings { Setting_None = 0, Setting_DisableWithNoViewers = 1 } -GameState g_gameState = State_Hibernating; +GameState g_gameState = State_None; #define BUFFER_SIZE 2048 Buffer sendBuffer; Buffer receiveBuffer; // Unfortunately there's no easy way to have this not be the same as BUFFER_SIZE From 7424dfbd46bdb8f0eca5e4a705668132e1cbad81 Mon Sep 17 00:00:00 2001 From: Jackzme Date: Tue, 10 Dec 2024 12:06:07 -0600 Subject: [PATCH 3/4] Try to reconnect on socket err --- scripting/adminpanel.sp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripting/adminpanel.sp b/scripting/adminpanel.sp index 5996a89..e363af9 100644 --- a/scripting/adminpanel.sp +++ b/scripting/adminpanel.sp @@ -324,6 +324,11 @@ void OnSocketError(Socket socket, int errorType, int errorNumber, int attempt) { g_socket.SetArg(attempt + 1); CreateTimer(nextAttempt, Timer_Reconnect); } + if(authState == Auth_PendingResponse) { + Debug("Got socket error on auth?, retry"); + g_socket.SetArg(attempt + 1); + ConnectSocket(false, attempt); + } } bool SendFullSync() { From bf8c4e68cbe99d006b163d780809c159b6cc93aa Mon Sep 17 00:00:00 2001 From: Jackz Date: Sun, 5 Jan 2025 23:20:25 -0600 Subject: [PATCH 4/4] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5d114fa..91b65d7 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ This is a collection of sourcemod plugins, most are used on my servers. The majority of the plugins are created by me, but some are modifications of other plugins. Some of the plugins / changes are very specific, but may be useful to someone. +Please note that these plugins are only guaranteed to work on Left 4 Dead **2**. + Not always the latest versions. If you have any interest with a plugin, I can make sure to upload the latest. Useful things: @@ -340,7 +342,7 @@ Any survivor that attacks another survivor 3. If neither #1 or #2, both the victim and the attacker take 1/2 the original damage 4. If victim is in a saferoom, no damage is dealt. -See https://admin.jackz.me/docs/plugins#tkstopper for some more implementation information +See https://jackzie.dev/posts/sourcemod/sm-dev#tkstopper for some more implementation information During any of the above three conditions, if they deal (or attempt to deal) over 75 HP in 15 seconds (configurable) they will be instantly banned for a set period of time (60 minutes). If they are for sure a team killer, it can be extended to a permanent ban.