Skip to content
This repository has been archived by the owner on Sep 1, 2024. It is now read-only.

Commit

Permalink
upgrade: Upgrade API to use latest K4-System
Browse files Browse the repository at this point in the history
  • Loading branch information
K4ryuu committed Apr 11, 2024
1 parent 8644094 commit 26e78d8
Showing 4 changed files with 11 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- 2024. 04. 11 - v1.0.1

- upgrade: Upgrade API to use latest K4-System
Binary file modified src/K4-SharedApi.dll
Binary file not shown.
12 changes: 6 additions & 6 deletions src/K4-System-MMRanks.cs
Original file line number Diff line number Diff line change
@@ -18,12 +18,12 @@ public sealed class PluginConfig : BasePluginConfig
public override int Version { get; set; } = 1;
}

[MinimumApiVersion(198)]
[MinimumApiVersion(200)]
public sealed partial class PluginK4SystemMMRanks : BasePlugin, IPluginConfig<PluginConfig>
{

public override string ModuleName => "K4-System Matchmaking Ranks";
public override string ModuleVersion => "1.0.0";
public override string ModuleVersion => "1.0.1";
public override string ModuleAuthor => "K4ryuu";

public required PluginConfig Config { get; set; } = new PluginConfig();
@@ -38,7 +38,7 @@ public void OnConfigParsed(PluginConfig config)
this.Config = config;
}

public static PlayerCapability<IK4SharedApi> Capability_SharedAPI { get; } = new("k4-system:sharedapi");
public static PlayerCapability<IPlayerAPI> Capability_SharedAPI { get; } = new("k4-system:sharedapi");

public override void Load(bool hotReload)
{
@@ -51,13 +51,13 @@ public override void Load(bool hotReload)
.ToList()
.ForEach(p =>
{
IK4SharedApi? apiHandler = Capability_SharedAPI.Get(p);
IPlayerAPI? apiHandler = Capability_SharedAPI.Get(p);

if (apiHandler == null)
return;

int rankId = apiHandler.PlayerRankID;
int points = apiHandler.PlayerPoints;
int rankId = apiHandler.RankID;
int points = apiHandler.Points;

p.CompetitiveRankType = (sbyte)(Config.Mode == 1 ? 11 : 12);
p.CompetitiveRanking = Config.Mode == 1 ? points : rankId >= 19 ? 18 : rankId;
4 changes: 2 additions & 2 deletions src/K4-System-MMRanks.csproj
Original file line number Diff line number Diff line change
@@ -6,12 +6,12 @@
<PublishDir>./bin/K4-System-MMRanks/</PublishDir>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.198">
<PackageReference Include="CounterStrikeSharp.API" Version="*">
<PrivateAssets>none</PrivateAssets>
<ExcludeAssets>runtime</ExcludeAssets>
<IncludeAssets>compile; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

0 comments on commit 26e78d8

Please sign in to comment.