From 5bbc051662c3fd9986dff4639319661c8c262070 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 11 Nov 2026 18:30:44 +0000 Subject: [PATCH 1/2] Read the game-mode and teammate cvars through the typed ConVar API [patch] CounterStrikeSharp 1.0.379 marks the untyped ConVar obsolete, so a Debug build of the plugin failed with 6 x CS0618. Look up mp_teammates_are_enemies as ConVar and game_type / game_mode as ConVar, the cvars' native types in CS2, and read them through Value. Fixes ktsu-dev/CounterStrikeProgression#83 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_017vfJW4d7dbQrUhkrt4JoGT --- CounterStrikeProgression/GameState.cs | 6 +++--- CounterStrikeProgression/Site/SiteReporter.cs | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CounterStrikeProgression/GameState.cs b/CounterStrikeProgression/GameState.cs index c1c0adc..1372ef4 100644 --- a/CounterStrikeProgression/GameState.cs +++ b/CounterStrikeProgression/GameState.cs @@ -18,7 +18,7 @@ internal static class GameState { // Finding the game rules walks every entity, so it's done once per map rather than on every shot. private static CCSGameRulesProxy? gameRules; - private static ConVar? teammatesAreEnemies; + private static ConVar? teammatesAreEnemies; /// /// Gets a value indicating whether the match is in warmup, when nothing counts. @@ -43,8 +43,8 @@ public static bool TeammatesAreEnemies { get { - teammatesAreEnemies ??= ConVar.Find("mp_teammates_are_enemies"); - return teammatesAreEnemies?.GetPrimitiveValue() ?? false; + teammatesAreEnemies ??= ConVar.Find("mp_teammates_are_enemies"); + return teammatesAreEnemies?.Value ?? false; } } diff --git a/CounterStrikeProgression/Site/SiteReporter.cs b/CounterStrikeProgression/Site/SiteReporter.cs index 06cc7da..306dc32 100644 --- a/CounterStrikeProgression/Site/SiteReporter.cs +++ b/CounterStrikeProgression/Site/SiteReporter.cs @@ -36,8 +36,8 @@ internal sealed class SiteReporter : IDisposable private readonly List pendingCorrected = []; private readonly List pendingKills = []; private DateTime? mapStartedAt; - private ConVar? gameType; - private ConVar? gameMode; + private ConVar? gameType; + private ConVar? gameMode; private int batchesSinceReset; /// @@ -196,9 +196,9 @@ public void Corrected(ulong steamId) private void CollectBatch() { - gameType ??= ConVar.Find("game_type"); - gameMode ??= ConVar.Find("game_mode"); - string mode = GameModes.Name(gameType?.GetPrimitiveValue() ?? 0, gameMode?.GetPrimitiveValue() ?? 0); + gameType ??= ConVar.Find("game_type"); + gameMode ??= ConVar.Find("game_mode"); + string mode = GameModes.Name(gameType?.Value ?? 0, gameMode?.Value ?? 0); ServerSnapshot snapshot = new(DateTime.UtcNow, Server.MapName ?? string.Empty, mode, Server.MaxPlayers, ReadPlayers(), mapStartedAt); int fullResendEvery = pluginConfig.Site.FullResendEvery; From fdf43ba5752014a12e5423e43d479db8737746ba Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 11 Nov 2026 18:28:13 +0000 Subject: [PATCH 2/2] Drop Core's stray Logging.Abstractions 11 reference so the Site builds again [patch] Dependabot #81 bumped Microsoft.Extensions.Logging.Abstractions to 11.0.0 and added a direct reference to it in Core, which doesn't use it. The reference flowed into the Site and replaced the ASP.NET Core 10 shared-framework copy, so ktsu.Sdk failed the Site build with KTSU0006. Remove the reference, put the central version back to 10.0.0 to match the host and the framework, and keep Dependabot from proposing major bumps of Microsoft.Extensions.* on their own. Fixes ktsu-dev/CounterStrikeProgression#82 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_017vfJW4d7dbQrUhkrt4JoGT --- .github/dependabot.yml | 5 +++++ .../CounterStrikeProgression.Core.csproj | 1 - Directory.Packages.props | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 5c156b4..391c60c 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -10,6 +10,11 @@ updates: # 3.x (the last license-key-free line); still allow 3.1.x patch/minor bumps. - dependency-name: "SixLabors.ImageSharp" update-types: ["version-update:semver-major"] + # Microsoft.Extensions.* majors track the target framework: the Site gets them + # from the ASP.NET Core shared framework and the plugin from the CounterStrikeSharp + # host. A lone major bump replaces those copies and breaks the build (#82). + - dependency-name: "Microsoft.Extensions.*" + update-types: ["version-update:semver-major"] groups: ktsu: patterns: diff --git a/CounterStrikeProgression.Core/CounterStrikeProgression.Core.csproj b/CounterStrikeProgression.Core/CounterStrikeProgression.Core.csproj index 8f6f7cd..08448d5 100644 --- a/CounterStrikeProgression.Core/CounterStrikeProgression.Core.csproj +++ b/CounterStrikeProgression.Core/CounterStrikeProgression.Core.csproj @@ -15,7 +15,6 @@ - diff --git a/Directory.Packages.props b/Directory.Packages.props index 0c3e39c..3b8c06c 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -7,7 +7,7 @@ - +