Refactor database layer and add module/plugin improvements

Reworked the database layer to support both MySQL and SQLite via new provider classes and migration scripts for each backend. Updated the build workflow to support building and packaging additional modules, including StealthModule and BanSoundModule, and improved artifact handling. Refactored command registration to allow dynamic registration/unregistration and improved API event handling. Updated dependencies, project structure, and configuration checks for better reliability and extensibility. Added new language files, updated versioning, and removed obsolete files.

**⚠️ Warning: SQLite support is currently experimental.
Using this version requires reconfiguration of your database settings!
Plugin now uses UTC time. Please adjust your configurations accordingly!
**
This commit is contained in:
Dawid Bepierszcz
2025-10-03 01:37:03 +02:00
parent b97426313b
commit 5701455de0
111 changed files with 5387 additions and 2871 deletions

View File

@@ -0,0 +1,31 @@
using CounterStrikeSharp.API;
using CounterStrikeSharp.API.Core;
namespace CS2_SimpleAdmin_StealthModule;
public static class Extensions
{
public static CCSPlayerController? GetSpectatingPlayer(this CCSPlayerController player)
{
if (player.Pawn.Value is not { IsValid: true } pawn)
return null;
if (player.ControllingBot)
return null;
if (pawn.ObserverServices is not { } observerServices)
return null;
if (observerServices.ObserverTarget?.Value?.As<CCSPlayerPawn>() is not { IsValid: true } observerPawn)
return null;
return observerPawn.OriginalController.Value is not { IsValid: true } observerController ? null : observerController;
}
public static List<CCSPlayerController> GetSpectators(this CCSPlayerController player)
{
return CS2_SimpleAdmin_StealthModule.Players
.Where(p => p.GetSpectatingPlayer()?.Slot == player.Slot)
.ToList();
}
}