Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
<PackageReference Include="Dapper" />
<PackageReference Include="ktsu.Extensions" />
<PackageReference Include="ktsu.Semantics.Strings" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" VersionOverride="11.0.0" />
<PackageReference Include="MySqlConnector" />
<PackageReference Include="Polyfill" PrivateAssets="all" />
</ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions CounterStrikeProgression/GameState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
{
// 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<bool>? teammatesAreEnemies;

/// <summary>
/// Gets a value indicating whether the match is in warmup, when nothing counts.
Expand All @@ -43,8 +43,8 @@
{
get
{
teammatesAreEnemies ??= ConVar.Find("mp_teammates_are_enemies");
return teammatesAreEnemies?.GetPrimitiveValue<bool>() ?? false;
teammatesAreEnemies ??= ConVar<bool>.Find("mp_teammates_are_enemies");
return teammatesAreEnemies?.Value ?? false;
}
}

Expand All @@ -64,7 +64,7 @@
{
Vector? from = attacker?.AbsOrigin;
Vector? to = victim?.AbsOrigin;
if ((from is null) || (to is null) || (victim is null))

Check warning on line 67 in CounterStrikeProgression/GameState.cs

View workflow job for this annotation

GitHub Actions / Analyze & Release

Change this condition so that it does not always evaluate to 'False'.

Check warning on line 67 in CounterStrikeProgression/GameState.cs

View workflow job for this annotation

GitHub Actions / Analyze & Release

Change this condition so that it does not always evaluate to 'False'.
{
return 0;
}
Expand Down
10 changes: 5 additions & 5 deletions CounterStrikeProgression/Site/SiteReporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ internal sealed class SiteReporter : IDisposable
private readonly List<ulong> pendingCorrected = [];
private readonly List<KillPoint> pendingKills = [];
private DateTime? mapStartedAt;
private ConVar? gameType;
private ConVar? gameMode;
private ConVar<int>? gameType;
private ConVar<int>? gameMode;
private int batchesSinceReset;

/// <summary>
Expand Down Expand Up @@ -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<int>() ?? 0, gameMode?.GetPrimitiveValue<int>() ?? 0);
gameType ??= ConVar<int>.Find("game_type");
gameMode ??= ConVar<int>.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;
Expand Down
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<PackageVersion Include="Dapper" Version="2.1.89" />
<PackageVersion Include="ktsu.Extensions" Version="1.9.3" />
<PackageVersion Include="ktsu.Semantics.Strings" Version="6.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="11.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.15" />
<PackageVersion Include="MySqlConnector" Version="3.0.0" />
<PackageVersion Include="Polyfill" Version="11.4.5" />
<PackageVersion Include="SkiaSharp" Version="4.156.0" />
Expand Down
Loading