Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
ABKAM2023 authored Mar 11, 2024
1 parent 086fdde commit a07dbe2
Show file tree
Hide file tree
Showing 14 changed files with 4,552 additions and 0 deletions.
Binary file added source/EN/API source/CounterStrikeSharp.API.dll
Binary file not shown.
40 changes: 40 additions & 0 deletions source/EN/API source/LevelsRanks.API.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using CounterStrikeSharp.API;
using CounterStrikeSharp.API.Core;
using System.Collections.Generic;
using System.IO;
using System.Text.Json;
using MySqlConnector;
using Dapper;

namespace LevelsRanks.API
{
public interface IPointsManager
{
int AddOrRemovePoints(string steamId, int points, CCSPlayerController playerController, string reason, string messageColor);
List<RankConfig> LoadRanksConfig();
RankConfig? GetCurrentRank(string steamID64);
string GetConnectionString();
DatabaseConfig GetDatabaseConfig();
}
public class RankConfig
{
public int Id { get; set; }
public string? Name { get; set; }
public int MinExperience { get; set; }
}
public class DatabaseConfig
{
public string DbHost { get; set; }
public string DbUser { get; set; }
public string DbPassword { get; set; }
public string DbName { get; set; }
public string DbPort { get; set; }
public string Name { get; set; }

public static DatabaseConfig ReadFromJsonFile(string filePath)
{
string jsonConfig = File.ReadAllText(filePath);
return JsonSerializer.Deserialize<DatabaseConfig>(jsonConfig) ?? new DatabaseConfig();
}
}
}
19 changes: 19 additions & 0 deletions source/EN/API source/LevelsRanks.API.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Platforms>AnyCPU;x86</Platforms>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Reference Include="CounterStrikeSharp.API">
<HintPath>..\CounterStrikeSharp.API.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Dapper" Version="2.1.24" />
<PackageReference Include="MySqlConnector" Version="2.3.1" />
</ItemGroup>

</Project>
Binary file added source/EN/CounterStrikeSharp.API.dll
Binary file not shown.
Binary file added source/EN/LevelsRanks.API.dll
Binary file not shown.
2,185 changes: 2,185 additions & 0 deletions source/EN/[Levels Ranks] Core.cs

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions source/EN/[Levels Ranks] Core.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Platforms>AnyCPU;x86</Platforms>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<Reference Include="CounterStrikeSharp.API">
<HintPath>..\CounterStrikeSharp.API.dll</HintPath>
</Reference>
<Reference Include="LevelsRanks.API.dll">
<HintPath>..\LevelsRanks.API.dll</HintPath>
</Reference>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Dapper" Version="2.1.24" />
<PackageReference Include="MySqlConnector" Version="2.3.1" />
<PackageReference Include="YamlDotNet" Version="9.1.4" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
</Project>
Binary file added source/RU/API source/CounterStrikeSharp.API.dll
Binary file not shown.
40 changes: 40 additions & 0 deletions source/RU/API source/LevelsRanks.API.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using CounterStrikeSharp.API;
using CounterStrikeSharp.API.Core;
using System.Collections.Generic;
using System.IO;
using System.Text.Json;
using MySqlConnector;
using Dapper;

namespace LevelsRanks.API
{
public interface IPointsManager
{
int AddOrRemovePoints(string steamId, int points, CCSPlayerController playerController, string reason, string messageColor);
List<RankConfig> LoadRanksConfig();
RankConfig? GetCurrentRank(string steamID64);
string GetConnectionString();
DatabaseConfig GetDatabaseConfig();
}
public class RankConfig
{
public int Id { get; set; }
public string? Name { get; set; }
public int MinExperience { get; set; }
}
public class DatabaseConfig
{
public string DbHost { get; set; }
public string DbUser { get; set; }
public string DbPassword { get; set; }
public string DbName { get; set; }
public string DbPort { get; set; }
public string Name { get; set; }

public static DatabaseConfig ReadFromJsonFile(string filePath)
{
string jsonConfig = File.ReadAllText(filePath);
return JsonSerializer.Deserialize<DatabaseConfig>(jsonConfig) ?? new DatabaseConfig();
}
}
}
19 changes: 19 additions & 0 deletions source/RU/API source/LevelsRanks.API.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Platforms>AnyCPU;x86</Platforms>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Reference Include="CounterStrikeSharp.API">
<HintPath>..\CounterStrikeSharp.API.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Dapper" Version="2.1.24" />
<PackageReference Include="MySqlConnector" Version="2.3.1" />
</ItemGroup>

</Project>
Binary file added source/RU/CounterStrikeSharp.API.dll
Binary file not shown.
Binary file added source/RU/LevelsRanks.API.dll
Binary file not shown.
Loading

0 comments on commit a07dbe2

Please sign in to comment.