mirror of
https://github.com/daffyyyy/CS2-SimpleAdmin.git
synced 2026-02-17 18:39:07 +00:00
1.4.8b
- Improved admin loading
This commit is contained in:
@@ -39,7 +39,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.8a";
|
||||
public override string ModuleVersion => "1.4.8b";
|
||||
|
||||
public CS2_SimpleAdminConfig Config { get; set; } = new();
|
||||
|
||||
|
||||
@@ -318,7 +318,6 @@ namespace CS2_SimpleAdmin
|
||||
|
||||
Task.Run(async () =>
|
||||
{
|
||||
|
||||
await adminManager.CrateGroupsJsonFile();
|
||||
await adminManager.CreateAdminsJsonFile();
|
||||
|
||||
|
||||
21
Events.cs
21
Events.cs
@@ -22,7 +22,7 @@ public partial class CS2_SimpleAdmin
|
||||
|
||||
private void OnGameServerSteamAPIActivated()
|
||||
{
|
||||
AddTimer(8.5f, () =>
|
||||
AddTimer(3.0f, () =>
|
||||
{
|
||||
if (ServerId != null || _database == null) return;
|
||||
|
||||
@@ -44,8 +44,6 @@ public partial class CS2_SimpleAdmin
|
||||
|
||||
Task.Run(async () =>
|
||||
{
|
||||
PermissionManager adminManager = new(_database);
|
||||
|
||||
try
|
||||
{
|
||||
await using var connection = await _database.GetConnectionAsync();
|
||||
@@ -71,10 +69,16 @@ public partial class CS2_SimpleAdmin
|
||||
new { address });
|
||||
|
||||
ServerId = serverId;
|
||||
|
||||
if (ServerId != null)
|
||||
{
|
||||
Server.NextFrame(() => ReloadAdmins(null));
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger?.LogCritical("Unable to create or get server_id" + ex.Message);
|
||||
_logger?.LogCritical("Unable to create or get server_id: " + ex.Message);
|
||||
}
|
||||
|
||||
if (Config.EnableMetrics)
|
||||
@@ -337,8 +341,8 @@ public partial class CS2_SimpleAdmin
|
||||
|
||||
public void OnMapStart(string mapName)
|
||||
{
|
||||
if (Config.ReloadAdminsEveryMapChange)
|
||||
AddTimer(3.0f, () => ReloadAdmins(null));
|
||||
if (Config.ReloadAdminsEveryMapChange && ServerId != null)
|
||||
AddTimer(2.0f, () => ReloadAdmins(null));
|
||||
|
||||
var path = Path.GetDirectoryName(ModuleDirectory);
|
||||
if (Directory.Exists(path + "/CS2-Tags"))
|
||||
@@ -353,6 +357,7 @@ public partial class CS2_SimpleAdmin
|
||||
|
||||
_database = new Database.Database(_dbConnectionString);
|
||||
|
||||
/*
|
||||
AddTimer(2f, () =>
|
||||
{
|
||||
if (ServerId != null) return;
|
||||
@@ -370,8 +375,6 @@ public partial class CS2_SimpleAdmin
|
||||
|
||||
Task.Run(async () =>
|
||||
{
|
||||
PermissionManager adminManager = new(_database);
|
||||
|
||||
try
|
||||
{
|
||||
await using var connection = await _database.GetConnectionAsync();
|
||||
@@ -419,7 +422,7 @@ public partial class CS2_SimpleAdmin
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
*/
|
||||
AddTimer(61.0f, () =>
|
||||
{
|
||||
#if DEBUG
|
||||
|
||||
Reference in New Issue
Block a user