From 1b97e2860338ee8fa8c7194e0aedaa2cd6e5092e Mon Sep 17 00:00:00 2001 From: F2 <916098+F2@users.noreply.github.com> Date: Fri, 25 Jul 2025 22:43:58 +0200 Subject: [PATCH 1/2] Fixed unnecessary tournament restart when someone gets kicked with 1 player on the server --- includes/match.inc | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/includes/match.inc b/includes/match.inc index c4ce71f..b7a78ec 100644 --- a/includes/match.inc +++ b/includes/match.inc @@ -83,7 +83,7 @@ void Match_OnPluginStart() { // A player disconnected // Purpose: When all players have disconnected, call ResetMatch - HookEvent("player_disconnect", Match_Event_player_disconnect, EventHookMode_PostNoCopy); + HookEvent("player_disconnect", Match_Event_player_disconnect, EventHookMode_Post); // Hook mp_tournament_restart // Purpose: Call ResetMatch when the tournament mode was reset @@ -209,8 +209,20 @@ public void Match_Event_player_team_post(any data) { public void Match_Event_player_disconnect(Event event, const char[] name, bool dontBroadcast) { - int count = GetRealPlayerCount(); - if (count <= 1) { + int userid = event.GetInt("userid"); + int client = GetClientOfUserId(userid); + + bool anyPlayersLeftOnServer = false; + for (int c = 1; c <= MaxClients; c++) { + if (c == client) + continue; + if (IsRealPlayer2(c)) { + anyPlayersLeftOnServer = true; + break; + } + } + + if (!anyPlayersLeftOnServer) { // The server is really weird in this case. // If one team readies up, the server empties, and then you connect and join the other team and ready up, nothing happens. // But if you unready the same team and ready again, it works. From 18e5f6932068dc683f5bd4ffc2a91b3231c797fb Mon Sep 17 00:00:00 2001 From: F2 <916098+F2@users.noreply.github.com> Date: Sun, 27 Jul 2025 18:54:44 +0200 Subject: [PATCH 2/2] Bumped versions --- afk/afk.sp | 6 +++++- afk/update.txt | 6 +++--- classwarning/classwarning.sp | 6 +++++- classwarning/update.txt | 6 +++--- logstf/logstf.sp | 6 +++++- logstf/update.txt | 6 +++--- recordstv/recordstv.sp | 6 +++++- recordstv/update.txt | 6 +++--- supstats2/supstats2.sp | 6 +++++- supstats2/update.txt | 6 +++--- waitforstv/update.txt | 6 +++--- waitforstv/waitforstv.sp | 6 +++++- 12 files changed, 48 insertions(+), 24 deletions(-) diff --git a/afk/afk.sp b/afk/afk.sp index f9c2603..fdbd506 100644 --- a/afk/afk.sp +++ b/afk/afk.sp @@ -21,6 +21,10 @@ Release notes: - Updated code to be compatible with SourceMod 1.12 +---- 1.1.3 (27/07/2025) ---- +- Fixed unnecessary tournament restart when server is almost empty + + */ #pragma semicolon 1 @@ -33,7 +37,7 @@ Release notes: #undef REQUIRE_PLUGIN #include -#define PLUGIN_VERSION "1.1.2" +#define PLUGIN_VERSION "1.1.3" #define UPDATE_URL "https://sourcemod.krus.dk/afk/update.txt" diff --git a/afk/update.txt b/afk/update.txt index 1694993..ee3c55a 100644 --- a/afk/update.txt +++ b/afk/update.txt @@ -4,11 +4,11 @@ { "Version" { - "Latest" "1.1.2" + "Latest" "1.1.3" } - "Notes" "Changes in 1.1.2:" - "Notes" "- Updated code to be compatible with SourceMod 1.12" + "Notes" "Changes in 1.1.3:" + "Notes" "- Fixed unnecessary tournament restart when server is almost empty" } "Files" diff --git a/classwarning/classwarning.sp b/classwarning/classwarning.sp index b605d21..53fa5c2 100644 --- a/classwarning/classwarning.sp +++ b/classwarning/classwarning.sp @@ -18,6 +18,10 @@ Release notes: ---- 1.1.2 (10/07/2025) ---- - Updated code to be compatible with SourceMod 1.12 + +---- 1.1.3 (27/07/2025) ---- +- Fixed unnecessary tournament restart when server is almost empty + */ #pragma semicolon 1 @@ -32,7 +36,7 @@ Release notes: #undef REQUIRE_PLUGIN #include -#define PLUGIN_VERSION "1.1.2" +#define PLUGIN_VERSION "1.1.3" #define UPDATE_URL "https://sourcemod.krus.dk/classwarning/update.txt" diff --git a/classwarning/update.txt b/classwarning/update.txt index 5cd7ca7..ff599e4 100644 --- a/classwarning/update.txt +++ b/classwarning/update.txt @@ -4,11 +4,11 @@ { "Version" { - "Latest" "1.1.2" + "Latest" "1.1.3" } - "Notes" "Changes in 1.1.2:" - "Notes" "- Updated code to be compatible with SourceMod 1.12" + "Notes" "Changes in 1.1.3:" + "Notes" "- Fixed unnecessary tournament restart when server is almost empty" } "Files" diff --git a/logstf/logstf.sp b/logstf/logstf.sp index da0fca7..2c82fab 100644 --- a/logstf/logstf.sp +++ b/logstf/logstf.sp @@ -129,6 +129,10 @@ Release notes: - Changed match title trimming logic +---- 2.7.1 (27/07/2025) ---- +- Fixed unnecessary tournament restart when server is almost empty + + TODO: - Some people run multiple instances of the same server (located in the same directory). This is a problem, because they all write to the same logstf.log file. Make the logstf.log and -partial files have dynamic names, and don't forget to clean them up. - Sanitize names for < and >, since logs.tf doesn't like those @@ -150,7 +154,7 @@ TODO: #undef REQUIRE_PLUGIN #include -#define PLUGIN_VERSION "2.7.0" +#define PLUGIN_VERSION "2.7.1" #define UPDATE_URL "https://sourcemod.krus.dk/logstf/update.txt" #define LOG_PATH "logstf.log" diff --git a/logstf/update.txt b/logstf/update.txt index 6acda97..3f7ca2f 100644 --- a/logstf/update.txt +++ b/logstf/update.txt @@ -4,11 +4,11 @@ { "Version" { - "Latest" "2.7.0" + "Latest" "2.7.1" } - "Notes" "Changes in 2.7.0:" - "Notes" "- Changed match title trimming logic" + "Notes" "Changes in 2.7.1:" + "Notes" "- Fixed unnecessary tournament restart when server is almost empty" } "Files" diff --git a/recordstv/recordstv.sp b/recordstv/recordstv.sp index 819c9e8..874e9b0 100644 --- a/recordstv/recordstv.sp +++ b/recordstv/recordstv.sp @@ -19,6 +19,10 @@ Release notes: - Updated code to be compatible with SourceMod 1.12 +---- 1.1.3 (27/07/2025) ---- +- Fixed unnecessary tournament restart when server is almost empty + + TODO: - Automatic zipping of match*.dem files @@ -36,7 +40,7 @@ TODO: #include -#define PLUGIN_VERSION "1.1.2" +#define PLUGIN_VERSION "1.1.3" #define UPDATE_URL "https://sourcemod.krus.dk/recordstv/update.txt" diff --git a/recordstv/update.txt b/recordstv/update.txt index f2f1bf1..03b9b74 100644 --- a/recordstv/update.txt +++ b/recordstv/update.txt @@ -4,11 +4,11 @@ { "Version" { - "Latest" "1.1.2" + "Latest" "1.1.3" } - "Notes" "Changes in 1.1.2:" - "Notes" "- Updated code to be compatible with SourceMod 1.12" + "Notes" "Changes in 1.1.3:" + "Notes" "- Fixed unnecessary tournament restart when server is almost empty" } "Files" diff --git a/supstats2/supstats2.sp b/supstats2/supstats2.sp index 80c693d..993312a 100644 --- a/supstats2/supstats2.sp +++ b/supstats2/supstats2.sp @@ -95,6 +95,10 @@ Release notes: - Log meta data at the start of the match (matchid, map, title) +---- 2.6.1 (27/07/2025) ---- +- Fixed unnecessary tournament restart when server is almost empty + + TODO: - Use GetGameTime() instead of GetEngineTime()? - Write comments in code :D @@ -116,7 +120,7 @@ TODO: #undef REQUIRE_PLUGIN #include -#define PLUGIN_VERSION "2.6.0" +#define PLUGIN_VERSION "2.6.1" #define UPDATE_URL "https://sourcemod.krus.dk/supstats2/update.txt" #define NAMELEN 64 diff --git a/supstats2/update.txt b/supstats2/update.txt index 36a3087..4d35ace 100644 --- a/supstats2/update.txt +++ b/supstats2/update.txt @@ -4,11 +4,11 @@ { "Version" { - "Latest" "2.6.0" + "Latest" "2.6.1" } - "Notes" "Changes in 2.6.0:" - "Notes" "- Log meta data at the start of the match (matchid, map, title)" + "Notes" "Changes in 2.6.1:" + "Notes" "- Fixed unnecessary tournament restart when server is almost empty" } "Files" diff --git a/waitforstv/update.txt b/waitforstv/update.txt index 48c7690..31d154c 100644 --- a/waitforstv/update.txt +++ b/waitforstv/update.txt @@ -4,11 +4,11 @@ { "Version" { - "Latest" "1.1.2" + "Latest" "1.1.3" } - "Notes" "Changes in 1.1.2:" - "Notes" "- Updated code to be compatible with SourceMod 1.12" + "Notes" "Changes in 1.1.3:" + "Notes" "- Fixed unnecessary tournament restart when server is almost empty" } "Files" diff --git a/waitforstv/waitforstv.sp b/waitforstv/waitforstv.sp index 21d006e..3618fbd 100644 --- a/waitforstv/waitforstv.sp +++ b/waitforstv/waitforstv.sp @@ -28,6 +28,10 @@ Release notes: - Updated code to be compatible with SourceMod 1.12 +---- 1.1.3 (27/07/2025) ---- +- Fixed unnecessary tournament restart when server is almost empty + + BUG: - When using sm_map twice during a match, you cannot override the 90secs delay [Not a problem with waitforstv - ForceLevelChange simply doesn't call changelevel more than once per map.] @@ -46,7 +50,7 @@ BUG: #include -#define PLUGIN_VERSION "1.1.2" +#define PLUGIN_VERSION "1.1.3" #define UPDATE_URL "https://sourcemod.krus.dk/waitforstv/update.txt"