mirror of
https://github.com/daffyyyy/CS2-SimpleAdmin.git
synced 2026-11-07 12:07:05 +01:00
Replace MenuManagerCS2 with Panorama UI Kit for the admin menus and css_vote. Layout names (menu, vote, banner, toast) are configurable under MenuConfig and preloaded on startup; MenuType is removed and ConfigVersion bumped to 26. - Drop MenuManagerApi.dll and the old chat menu classes - Reference PanoramaUiKit.Shared.dll, bump CounterStrikeSharp to 1.0.376 - Add .editorconfig and CODING_CONVENTIONS.md, apply them codebase-wide - Remove the CS2-SimpleAdmin-docs site - Rewrite README for the fork
79 lines
2.9 KiB
C#
79 lines
2.9 KiB
C#
using System.Collections.Concurrent;
|
|
using CounterStrikeSharp.API.Core;
|
|
using CounterStrikeSharp.API.Modules.Memory.DynamicFunctions;
|
|
using CS2_SimpleAdmin.Database;
|
|
using CS2_SimpleAdmin.Managers;
|
|
using CS2_SimpleAdmin.Models;
|
|
using CS2_SimpleAdminApi;
|
|
using Microsoft.Extensions.Localization;
|
|
using Microsoft.Extensions.Logging;
|
|
using Timer = CounterStrikeSharp.API.Modules.Timers.Timer;
|
|
|
|
namespace CS2_SimpleAdmin;
|
|
|
|
public partial class CS2_SimpleAdmin
|
|
{
|
|
// Config
|
|
public CS2_SimpleAdminConfig Config { get; set; } = new();
|
|
|
|
// HttpClient
|
|
internal static readonly HttpClient HttpClient = new();
|
|
|
|
// Paths
|
|
internal static readonly string ConfigDirectory =
|
|
Path.Combine(Application.RootDirectory, "configs/plugins/CS2-SimpleAdmin");
|
|
|
|
// Localization
|
|
public static IStringLocalizer? _localizer;
|
|
|
|
// Voting System
|
|
public static bool VoteInProgress;
|
|
|
|
// Command and Server Settings
|
|
public static readonly bool UnlockedCommands = CoreConfig.UnlockConCommands;
|
|
internal static string IpAddress = string.Empty;
|
|
internal static bool ServerLoaded;
|
|
internal static int? ServerId = null;
|
|
internal static readonly HashSet<ulong> AdminDisabledJoinComms = [];
|
|
|
|
// Player Management
|
|
internal static readonly HashSet<int> SilentPlayers = [];
|
|
internal static readonly Dictionary<ulong, string> RenamedPlayers = [];
|
|
internal static readonly ConcurrentDictionary<ulong, PlayerInfo> PlayersInfo = [];
|
|
internal static readonly List<CCSPlayerController> CachedPlayers = [];
|
|
internal static readonly List<CCSPlayerController> BotPlayers = [];
|
|
private static readonly List<DisconnectedPlayer> DisconnectedPlayers = [];
|
|
|
|
// Discord Integration
|
|
internal static DiscordManager? DiscordWebhookClientLog;
|
|
|
|
// Database Settings
|
|
internal string DbConnectionString = string.Empty;
|
|
// internal static Database.Database? Database;
|
|
internal static IDatabaseProvider? DatabaseProvider;
|
|
|
|
// Logger
|
|
internal static ILogger? _logger;
|
|
|
|
// Memory Function (Game-related)
|
|
private static MemoryFunctionVoid<CBasePlayerController, CCSPlayerPawn, bool, bool>?
|
|
_cBasePlayerControllerSetPawnFunc;
|
|
|
|
// Shared API
|
|
internal static Api.CS2_SimpleAdminApi? SimpleAdminApi { get; private set; }
|
|
|
|
// Managers
|
|
internal PermissionManager PermissionManager = new(DatabaseProvider);
|
|
internal BanManager BanManager = new(DatabaseProvider);
|
|
internal MuteManager MuteManager = new(DatabaseProvider);
|
|
internal WarnManager WarnManager = new(DatabaseProvider);
|
|
internal CacheManager? CacheManager = new();
|
|
internal static readonly PlayerManager PlayerManager = new();
|
|
|
|
// Timers
|
|
internal Timer? PlayersTimer = null;
|
|
|
|
// Funny list
|
|
private readonly List<string> _requiredPlugins = ["PanoramaUiKit"];
|
|
private readonly List<string> _requiredShared = ["PanoramaUiKit.Shared", "CS2-SimpleAdminApi"];
|
|
}
|