mirror of
https://github.com/daffyyyy/CS2-SimpleAdmin.git
synced 2026-02-17 10:31:01 +00:00
1.4.4b
- Fetch admins and groups data only once - Added missing migration
This commit is contained in:
@@ -11,7 +11,7 @@ using System.Collections.Concurrent;
|
||||
|
||||
namespace CS2_SimpleAdmin;
|
||||
|
||||
[MinimumApiVersion(225)]
|
||||
[MinimumApiVersion(228)]
|
||||
public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdminConfig>
|
||||
{
|
||||
public static CS2_SimpleAdmin Instance { get; private set; } = new();
|
||||
@@ -37,7 +37,7 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
|
||||
public override string ModuleName => "CS2-SimpleAdmin" + (Helper.IsDebugBuild ? " (DEBUG)" : " (RELEASE)");
|
||||
public override string ModuleDescription => "Simple admin plugin for Counter-Strike 2 :)";
|
||||
public override string ModuleAuthor => "daffyy & Dliix66";
|
||||
public override string ModuleVersion => "1.4.4a";
|
||||
public override string ModuleVersion => "1.4.4b";
|
||||
|
||||
public CS2_SimpleAdminConfig Config { get; set; } = new();
|
||||
|
||||
@@ -63,6 +63,11 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
|
||||
RemoveCommandListener("say", OnCommandSay, HookMode.Post);
|
||||
RemoveCommandListener("say_team", OnCommandTeamSay, HookMode.Post);
|
||||
}
|
||||
|
||||
public override void OnAllPluginsLoaded(bool hotReload)
|
||||
{
|
||||
AddTimer(0.2f, () => ReloadAdmins(null));
|
||||
}
|
||||
|
||||
public void OnConfigParsed(CS2_SimpleAdminConfig config)
|
||||
{
|
||||
|
||||
@@ -321,7 +321,7 @@ namespace CS2_SimpleAdmin
|
||||
|
||||
await Server.NextFrameAsync(() =>
|
||||
{
|
||||
AddTimer(0.2f, () =>
|
||||
AddTimer(0.1f, () =>
|
||||
{
|
||||
AdminManager.LoadAdminData(ModuleDirectory + "/data/admins.json");
|
||||
AdminManager.LoadAdminGroups(ModuleDirectory + "/data/groups.json");
|
||||
|
||||
1
Database/Migrations/008_OnlineTimeInPenalties.sql
Normal file
1
Database/Migrations/008_OnlineTimeInPenalties.sql
Normal file
@@ -0,0 +1 @@
|
||||
ALTER TABLE `sa_mutes` ADD `passed` INT NULL AFTER `duration`;
|
||||
11
Events.cs
11
Events.cs
@@ -20,7 +20,7 @@ public partial class CS2_SimpleAdmin
|
||||
AddCommandListener("say", OnCommandSay);
|
||||
AddCommandListener("say_team", OnCommandTeamSay);
|
||||
}
|
||||
|
||||
|
||||
[GameEventHandler]
|
||||
public HookResult OnClientDisconnect(EventPlayerDisconnect @event, GameEventInfo info)
|
||||
{
|
||||
@@ -331,15 +331,6 @@ public partial class CS2_SimpleAdmin
|
||||
Logger.LogWarning($"Unable to make metrics call: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
//await _adminManager.GiveAllGroupsFlags();
|
||||
//await _adminManager.GiveAllFlags();
|
||||
|
||||
await Server.NextFrameAsync(() =>
|
||||
{
|
||||
ReloadAdmins(null);
|
||||
});
|
||||
|
||||
});
|
||||
}, CounterStrikeSharp.API.Modules.Timers.TimerFlags.STOP_ON_MAPCHANGE);
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ Manage your Counter-Strike 2 server by simple commands :)
|
||||
```js
|
||||
- css_addadmin <steamid> <name> <flags/groups> <immunity> [time in minutes] - Add admin by steamid // @css/root
|
||||
- css_deladmin <steamid> - Delete admin by steamid // @css/root
|
||||
- css_reladmin - Reload sql admins // @css/root
|
||||
- css_reloadadmins - Reload sql admins // @css/root
|
||||
- css_hide - Hide admin on scoreboard and commands action // @css/kick
|
||||
- css_admin - Display all admin commands // @css/generic
|
||||
- css_who <#userid or name> - Display informations about player // @css/generic
|
||||
@@ -62,7 +62,7 @@ Manage your Counter-Strike 2 server by simple commands :)
|
||||
```
|
||||
|
||||
### Requirements
|
||||
- [CounterStrikeSharp](https://github.com/roflmuffin/CounterStrikeSharp/) **tested on v201**
|
||||
- [CounterStrikeSharp](https://github.com/roflmuffin/CounterStrikeSharp/) **tested on 228**
|
||||
- MySQL **tested on MySQL (MariaDB) Server version: 10.11.4-MariaDB-1~deb12u1 Debian 12**
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user