mirror of
https://github.com/daffyyyy/CS2-SimpleAdmin.git
synced 2026-03-04 14:44:55 +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;
|
namespace CS2_SimpleAdmin;
|
||||||
|
|
||||||
[MinimumApiVersion(225)]
|
[MinimumApiVersion(228)]
|
||||||
public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdminConfig>
|
public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdminConfig>
|
||||||
{
|
{
|
||||||
public static CS2_SimpleAdmin Instance { get; private set; } = new();
|
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 ModuleName => "CS2-SimpleAdmin" + (Helper.IsDebugBuild ? " (DEBUG)" : " (RELEASE)");
|
||||||
public override string ModuleDescription => "Simple admin plugin for Counter-Strike 2 :)";
|
public override string ModuleDescription => "Simple admin plugin for Counter-Strike 2 :)";
|
||||||
public override string ModuleAuthor => "daffyy & Dliix66";
|
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();
|
public CS2_SimpleAdminConfig Config { get; set; } = new();
|
||||||
|
|
||||||
@@ -64,6 +64,11 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
|
|||||||
RemoveCommandListener("say_team", OnCommandTeamSay, 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)
|
public void OnConfigParsed(CS2_SimpleAdminConfig config)
|
||||||
{
|
{
|
||||||
if (config.DatabaseHost.Length < 1 || config.DatabaseName.Length < 1 || config.DatabaseUser.Length < 1)
|
if (config.DatabaseHost.Length < 1 || config.DatabaseName.Length < 1 || config.DatabaseUser.Length < 1)
|
||||||
|
|||||||
@@ -321,7 +321,7 @@ namespace CS2_SimpleAdmin
|
|||||||
|
|
||||||
await Server.NextFrameAsync(() =>
|
await Server.NextFrameAsync(() =>
|
||||||
{
|
{
|
||||||
AddTimer(0.2f, () =>
|
AddTimer(0.1f, () =>
|
||||||
{
|
{
|
||||||
AdminManager.LoadAdminData(ModuleDirectory + "/data/admins.json");
|
AdminManager.LoadAdminData(ModuleDirectory + "/data/admins.json");
|
||||||
AdminManager.LoadAdminGroups(ModuleDirectory + "/data/groups.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`;
|
||||||
@@ -331,15 +331,6 @@ public partial class CS2_SimpleAdmin
|
|||||||
Logger.LogWarning($"Unable to make metrics call: {ex.Message}");
|
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);
|
}, CounterStrikeSharp.API.Modules.Timers.TimerFlags.STOP_ON_MAPCHANGE);
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ Manage your Counter-Strike 2 server by simple commands :)
|
|||||||
```js
|
```js
|
||||||
- css_addadmin <steamid> <name> <flags/groups> <immunity> [time in minutes] - Add admin by steamid // @css/root
|
- 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_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_hide - Hide admin on scoreboard and commands action // @css/kick
|
||||||
- css_admin - Display all admin commands // @css/generic
|
- css_admin - Display all admin commands // @css/generic
|
||||||
- css_who <#userid or name> - Display informations about player // @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
|
### 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**
|
- MySQL **tested on MySQL (MariaDB) Server version: 10.11.4-MariaDB-1~deb12u1 Debian 12**
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user