From 962529e4459b98a43d983e476d0f7720f166e373 Mon Sep 17 00:00:00 2001 From: Dawid Bepierszcz <41084667+daffyyyy@users.noreply.github.com> Date: Thu, 16 May 2024 22:40:14 +0200 Subject: [PATCH] 1.4.4b - Fix - Fixed admins / group loading --- CS2-SimpleAdmin.cs | 2 +- Commands/basecommands.cs | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/CS2-SimpleAdmin.cs b/CS2-SimpleAdmin.cs index dbcb460..11525f6 100644 --- a/CS2-SimpleAdmin.cs +++ b/CS2-SimpleAdmin.cs @@ -66,7 +66,7 @@ public override void Unload(bool hotReload) public override void OnAllPluginsLoaded(bool hotReload) { - AddTimer(0.2f, () => ReloadAdmins(null)); + AddTimer(3.0f, () => ReloadAdmins(null)); } public void OnConfigParsed(CS2_SimpleAdminConfig config) diff --git a/Commands/basecommands.cs b/Commands/basecommands.cs index a458869..576c4ee 100644 --- a/Commands/basecommands.cs +++ b/Commands/basecommands.cs @@ -316,16 +316,14 @@ public void ReloadAdmins(CCSPlayerController? caller) Task.Run(async () => { + await adminManager.CrateGroupsJsonFile(); await adminManager.CreateAdminsJsonFile(); await Server.NextFrameAsync(() => { - AddTimer(0.1f, () => - { - AdminManager.LoadAdminData(ModuleDirectory + "/data/admins.json"); - AdminManager.LoadAdminGroups(ModuleDirectory + "/data/groups.json"); - }); + AdminManager.LoadAdminData(ModuleDirectory + "/data/admins.json"); + AddTimer(1.0f, () => AdminManager.LoadAdminGroups(ModuleDirectory + "/data/groups.json")); }); });