From 4420d41048bb9d953dfa349b0fc3195dc15faef1 Mon Sep 17 00:00:00 2001 From: Astra Date: Wed, 7 Oct 2026 09:47:58 +0100 Subject: [PATCH] zio fork 1.8.2b-zio17: no startup version check or banner Removes upstream's PluginInfo: CheckVersion, which fetched upstream's VERSION from GitHub on every load, and ShowAd, the console banner with two encoded lines of personal messages. EnableUpdateCheck stays in the config so existing files load, and does nothing. --- CS2-SimpleAdmin/CS2-SimpleAdmin.cs | 6 +-- CS2-SimpleAdmin/Helper.cs | 68 ------------------------------ README.md | 4 ++ 3 files changed, 7 insertions(+), 71 deletions(-) diff --git a/CS2-SimpleAdmin/CS2-SimpleAdmin.cs b/CS2-SimpleAdmin/CS2-SimpleAdmin.cs index 338a41f..63c23d1 100644 --- a/CS2-SimpleAdmin/CS2-SimpleAdmin.cs +++ b/CS2-SimpleAdmin/CS2-SimpleAdmin.cs @@ -22,7 +22,7 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig "CS2-SimpleAdmin" + (Helper.IsDebugBuild ? " (DEBUG)" : " (RELEASE)"); public override string ModuleDescription => "Simple admin plugin for Counter-Strike 2 :)"; public override string ModuleAuthor => "daffyy"; - public override string ModuleVersion => "1.8.2b-zio16"; + public override string ModuleVersion => "1.8.2b-zio17"; public override void Load(bool hotReload) { @@ -217,8 +217,8 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig await PluginInfo.CheckVersion(ModuleVersion, Logger)); + // zio: no update check or startup banner (upstream's PluginInfo, removed). EnableUpdateCheck + // is left in the config so existing files still load, and does nothing. PermissionManager = new PermissionManager(DatabaseProvider); BanManager = new BanManager(DatabaseProvider); diff --git a/CS2-SimpleAdmin/Helper.cs b/CS2-SimpleAdmin/Helper.cs index 1a04a9c..98d07a9 100644 --- a/CS2-SimpleAdmin/Helper.cs +++ b/CS2-SimpleAdmin/Helper.cs @@ -1006,74 +1006,6 @@ internal static class Helper } -public static class PluginInfo -{ - internal static async Task CheckVersion(string localVersion, ILogger logger) - { - ShowAd(localVersion); - const string versionUrl = "https://raw.githubusercontent.com/daffyyyy/CS2-SimpleAdmin/main/CS2-SimpleAdmin/VERSION"; - var client = CS2_SimpleAdmin.HttpClient; - client.Timeout = TimeSpan.FromSeconds(3); - - try - { - var response = await client.GetAsync(versionUrl); - - if (response.IsSuccessStatusCode) - { - var remoteVersion = await response.Content.ReadAsStringAsync(); - remoteVersion = remoteVersion.Trim(); - - var comparisonResult = string.CompareOrdinal(localVersion, remoteVersion); - - switch (comparisonResult) - { - case < 0: - logger.LogWarning("Plugin is outdated! Check https://github.com/daffyyyy/CS2-SimpleAdmin"); - break; - case > 0: - logger.LogInformation("Probably dev version detected"); - break; - default: - logger.LogInformation("Plugin is up to date"); - break; - } - } - else - { - logger.LogWarning($"Failed to check version. Status Code: {response.StatusCode}"); - } - } - catch (HttpRequestException ex) - { - logger.LogError(ex, "Failed to connect to the version server."); - } - catch (Exception ex) - { - logger.LogError(ex, "An error occurred while checking version."); - } - } - - private static void ShowAd(string moduleVersion) - { - Console.WriteLine(" "); - Console.WriteLine(" _______ ___ __ __ _______ ___ _______ _______ ______ __ __ ___ __ _ "); - Console.WriteLine("| || | | |_| || || | | || _ || | | |_| || | | | | |"); - Console.WriteLine("| _____|| | | || _ || | | ___|| |_| || _ || || | | |_| |"); - Console.WriteLine("| |_____ | | | || |_| || | | |___ | || | | || || | | |"); - Console.WriteLine("|_____ || | | || ___|| |___ | ___|| || |_| || || | | _ |"); - Console.WriteLine(" _____| || | | ||_|| || | | || |___ | _ || || ||_|| || | | | | |"); - Console.WriteLine("|_______||___| |_| |_||___| |_______||_______||__| |__||______| |_| |_||___| |_| |__|"); - Console.WriteLine(" >> Version: " + moduleVersion); - Console.WriteLine(" >> GitHub: https://github.com/daffyyyy/CS2-SimpleAdmin"); - var _m1 = new List { 70,117,99,107,32,121,111,117,32,114,97,118,105,100,44,32,119,104,121,32,121,111,117,32,108,121,105,110,103,32,97,98,111,117,116,32,110,111,32,99,111,110,116,97,99,116,32,119,105,116,104,32,109,101,63,32,74,117,115,116,32,116,101,108,108,32,116,114,117,116,104,44,32,110,105,99,101,32,116,114,121,32,116,111,32,112,114,111,106,101,99,116,32,116,97,107,101,111,118,101,114 }; - var _m2 = new List { 32,32,58,68,32,40,97,108,108,32,119,104,111,32,116,114,105,101,100,32,116,111,32,99,111,110,116,97,99,116,32,119,105,116,104,32,109,101,44,32,106,117,115,116,32,119,114,105,116,101,32,109,101,115,115,97,103,101,32,116,111,32,109,101,32,120,68,41 }; - Console.WriteLine(" >> " + new string(_m1.Select(c => (char)c).ToArray())); - Console.WriteLine(" >> " + new string(_m2.Select(c => (char)c).ToArray())); - Console.WriteLine(" "); - } -} - public class SchemaString(TSchemaClass instance, string member) : NativeObject(Schema.GetSchemaValue(instance.Handle, typeof(TSchemaClass).Name, member)) where TSchemaClass : NativeObject diff --git a/README.md b/README.md index 47b3a1b..6a3254e 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,10 @@ from the `build-1.8.2b` tag). Changes, all marked `zio:` in the code: is picked, and otherwise the reply lists the matches. `css_ungag`, `css_unmute` and `css_unsilence` match online players by part of the name too (upstream needed the full name), falling back to the offline search only when no one online matches. +- No startup version check or banner: upstream's `PluginInfo` (`CheckVersion`, which asked upstream's + GitHub for its `VERSION` on every load, and `ShowAd`, the console banner with two encoded lines + of personal messages) is removed. `EnableUpdateCheck` stays in the config, so existing files + still load, and does nothing. Backported from upstream 1.9.0 (commit `530f603`), not marked `zio:`: