Update basecommands.cs

This commit is contained in:
Dawid Bepierszcz 2026-01-27 12:20:29 +01:00 • committed by GitHub
parent 4c43f14c82
commit 4599f08fd7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -507,16 +507,16 @@ public partial class CS2_SimpleAdmin
var adminsFile = await File.ReadAllTextAsync(Instance.ModuleDirectory + "/data/admins.json"); var adminsFile = await File.ReadAllTextAsync(Instance.ModuleDirectory + "/data/admins.json");
var groupsFile = await File.ReadAllTextAsync(Instance.ModuleDirectory + "/data/groups.json"); var groupsFile = await File.ReadAllTextAsync(Instance.ModuleDirectory + "/data/groups.json");
await Server.NextWorldUpdateAsync(() => await Server.NextWorldUpdateAsync(() =>
{ {
AddTimer(1, () => AddTimer(1, () =>
{ {
if (!string.IsNullOrEmpty(adminsFile)) if (!string.IsNullOrEmpty(adminsFile))
AdminManager.LoadAdminData(ModuleDirectory + "/data/admins.json"); AddTimer(2.0f, () => AdminManager.LoadAdminData(ModuleDirectory + "/data/admins.json"));
if (!string.IsNullOrEmpty(groupsFile)) if (!string.IsNullOrEmpty(groupsFile))
AdminManager.LoadAdminGroups(ModuleDirectory + "/data/groups.json"); AddTimer(3.0f, () => AdminManager.LoadAdminGroups(ModuleDirectory + "/data/groups.json"));
if (!string.IsNullOrEmpty(adminsFile)) if (!string.IsNullOrEmpty(adminsFile))
AdminManager.LoadAdminData(ModuleDirectory + "/data/admins.json"); AddTimer(4.0f, () => AdminManager.LoadAdminData(ModuleDirectory + "/data/admins.json"));
_logger?.LogInformation("Loaded admins!"); _logger?.LogInformation("Loaded admins!");
}); });