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 PluginCapability = new("simpleadmin:api"); /// /// Gets player information associated with the specified player controller. /// /// The player controller. /// PlayerInfo object representing player data. public PlayerInfo GetPlayerInfo(CCSPlayerController player); /// /// Returns the database connection string used by the plugin. /// public string GetConnectionString(); /// /// Returns the configured server IP address with port. /// public string GetServerAddress(); /// /// Returns the internal server ID assigned in the plugin's database. /// public int? GetServerId(); /// /// Returns mute-related penalties for the specified player. /// /// The player controller. /// A dictionary mapping penalty types to lists of penalties with end date, duration, and pass state. public Dictionary> GetPlayerMuteStatus(CCSPlayerController player); /// /// Event fired when a player receives a penalty. /// public event Action? OnPlayerPenaltied; /// /// Event fired when a penalty is added to a player by SteamID. /// public event Action? OnPlayerPenaltiedAdded; /// /// Event to show admin activity messages. /// public event Action? OnAdminShowActivity; /// /// Event fired when an admin toggles silent mode. /// public event Action? OnAdminToggleSilent; /// /// Issues a penalty to a player controller with specified type, reason, and optional duration. /// public void IssuePenalty(CCSPlayerController player, CCSPlayerController? admin, PenaltyType penaltyType, string reason, int duration = -1); /// /// Issues a penalty to a player identified by SteamID with specified type, reason, and optional duration. /// public void IssuePenalty(SteamID steamid, CCSPlayerController? admin, PenaltyType penaltyType, string reason, int duration = -1); /// /// Logs a command invoked by a caller with the command string. /// public void LogCommand(CCSPlayerController? caller, string command); /// /// Logs a command invoked by a caller with the command info object. /// public void LogCommand(CCSPlayerController? caller, CommandInfo command); /// /// Shows an admin activity message, optionally suppressing broadcasting. /// public void ShowAdminActivity(string messageKey, string? callerName = null, bool dontPublish = false, params object[] messageArgs); /// /// Returns true if the specified admin player is in silent mode (not broadcasting activity). /// public bool IsAdminSilent(CCSPlayerController player); /// /// Returns a set of player slots representing admins currently in silent mode. /// public HashSet ListSilentAdminsSlots(); /// /// Registers a new command with the specified name, description, and callback. /// public void RegisterCommand(string name, string? description, CommandInfo.CommandCallback callback); /// /// Unregisters an existing command by its name. /// public void UnRegisterCommand(string name); }