Skip to content

Commit

Permalink
1.4.4b - Fix
Browse files Browse the repository at this point in the history
- Fixed admins / group loading
  • Loading branch information
daffyyyy committed May 16, 2024
1 parent 873fed1 commit 962529e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CS2-SimpleAdmin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 3 additions & 5 deletions Commands/basecommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
});
});

Expand Down

0 comments on commit 962529e

Please sign in to comment.