mirror of
https://github.com/daffyyyy/CS2-SimpleAdmin.git
synced 2026-02-24 20:26:51 +00:00
Compare commits
12 Commits
84d2197317
...
CS2-Simple
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1d65d4be78 | ||
|
|
ca61d8b79a | ||
|
|
4e578747e3 | ||
|
|
a643f7aea9 | ||
|
|
8e9f10132f | ||
|
|
3e19408416 | ||
|
|
d25056864d | ||
|
|
6e3a328344 | ||
|
|
b0bf000b96 | ||
|
|
fdcb47330f | ||
|
|
d8b7a46519 | ||
|
|
38f1f0c782 |
@@ -1 +1 @@
|
||||
1.7.7-alpha-2
|
||||
1.7.7-alpha-9
|
||||
|
||||
16
CS2-SimpleAdminApi/CS2-SimpleAdminApi.csproj
Normal file
16
CS2-SimpleAdminApi/CS2-SimpleAdminApi.csproj
Normal file
@@ -0,0 +1,16 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<RootNamespace>CS2_SimpleAdminApi</RootNamespace>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.340" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.4-beta1" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
33
CS2-SimpleAdminApi/ICS2-SimpleAdminApi.cs
Normal file
33
CS2-SimpleAdminApi/ICS2-SimpleAdminApi.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using CounterStrikeSharp.API.Core;
|
||||
using CounterStrikeSharp.API.Core.Capabilities;
|
||||
using CounterStrikeSharp.API.Modules.Commands;
|
||||
using CounterStrikeSharp.API.Modules.Entities;
|
||||
|
||||
namespace CS2_SimpleAdminApi;
|
||||
|
||||
public interface ICS2_SimpleAdminApi
|
||||
{
|
||||
public static readonly PluginCapability<ICS2_SimpleAdminApi?> PluginCapability = new("simpleadmin:api");
|
||||
|
||||
public PlayerInfo GetPlayerInfo(CCSPlayerController player);
|
||||
|
||||
public string GetConnectionString();
|
||||
public string GetServerAddress();
|
||||
public int? GetServerId();
|
||||
|
||||
public Dictionary<PenaltyType, List<(DateTime EndDateTime, int Duration, bool Passed)>> GetPlayerMuteStatus(CCSPlayerController player);
|
||||
|
||||
public event Action<PlayerInfo, PlayerInfo?, PenaltyType, string, int, int?, int?>? OnPlayerPenaltied;
|
||||
public event Action<SteamID, PlayerInfo?, PenaltyType, string, int, int?, int?>? OnPlayerPenaltiedAdded;
|
||||
public event Action<string, string?, bool, object>? OnAdminShowActivity;
|
||||
public event Action<int, bool>? OnAdminToggleSilent;
|
||||
|
||||
public void IssuePenalty(CCSPlayerController player, CCSPlayerController? admin, PenaltyType penaltyType, string reason, int duration = -1);
|
||||
public void IssuePenalty(SteamID steamid, CCSPlayerController? admin, PenaltyType penaltyType, string reason, int duration = -1);
|
||||
public void LogCommand(CCSPlayerController? caller, string command);
|
||||
public void LogCommand(CCSPlayerController? caller, CommandInfo command);
|
||||
public void ShowAdminActivity(string messageKey, string? callerName = null, bool dontPublish = false, params object[] messageArgs);
|
||||
|
||||
public bool IsAdminSilent(CCSPlayerController player);
|
||||
public HashSet<int> ListSilentAdminsSlots();
|
||||
}
|
||||
11
CS2-SimpleAdminApi/PenaltyType.cs
Normal file
11
CS2-SimpleAdminApi/PenaltyType.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace CS2_SimpleAdminApi;
|
||||
|
||||
public enum PenaltyType
|
||||
{
|
||||
Ban = 0,
|
||||
Kick,
|
||||
Mute,
|
||||
Gag,
|
||||
Silence,
|
||||
Warn
|
||||
}
|
||||
40
CS2-SimpleAdminApi/PlayerInfo.cs
Normal file
40
CS2-SimpleAdminApi/PlayerInfo.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System.Numerics;
|
||||
using CounterStrikeSharp.API.Modules.Entities;
|
||||
|
||||
namespace CS2_SimpleAdminApi;
|
||||
|
||||
public class PlayerInfo(
|
||||
int? userId,
|
||||
int slot,
|
||||
SteamID steamId,
|
||||
string name,
|
||||
string? ipAddress,
|
||||
int totalBans = 0,
|
||||
int totalMutes = 0,
|
||||
int totalGags = 0,
|
||||
int totalSilences = 0,
|
||||
int totalWarns = 0)
|
||||
{
|
||||
public int? UserId { get; } = userId;
|
||||
public int Slot { get; } = slot;
|
||||
public SteamID SteamId { get; } = steamId;
|
||||
public string Name { get; } = name;
|
||||
public string? IpAddress { get; } = ipAddress;
|
||||
public int TotalBans { get; set; } = totalBans;
|
||||
public int TotalMutes { get; set; } = totalMutes;
|
||||
public int TotalGags { get; set; } = totalGags;
|
||||
public int TotalSilences { get; set; } = totalSilences;
|
||||
public int TotalWarns { get; set; } = totalWarns;
|
||||
public bool WaitingForKick { get; set; } = false;
|
||||
public List<(ulong SteamId, string PlayerName)> AccountsAssociated { get; set; } = [];
|
||||
public DiePosition? DiePosition { get; set; }
|
||||
public bool IsLoaded { get; set; }
|
||||
}
|
||||
|
||||
public class DiePosition(Vector3 position, Vector3 angle)
|
||||
{
|
||||
public Vector3 Position { get; } = position;
|
||||
public Vector3 Angle { get; } = angle;
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user