Hotfix - server loading

- Fix for server loading
This commit is contained in:
Dawid Bepierszcz
2024-11-22 23:01:31 +01:00
parent b2ebe136c3
commit 2defb2fe14
3 changed files with 15 additions and 6 deletions

View File

@@ -17,6 +17,8 @@ namespace CS2_SimpleAdmin;
public partial class CS2_SimpleAdmin
{
private bool _serverLoading;
private void RegisterEvents()
{
RegisterListener<Listeners.OnMapStart>(OnMapStart);
@@ -49,6 +51,10 @@ public partial class CS2_SimpleAdmin
private void OnGameServerSteamAPIActivated()
{
if (_serverLoading)
return;
_serverLoading = true;
new ServerManager().LoadServerData();
}
@@ -330,11 +336,11 @@ public partial class CS2_SimpleAdmin
if (Config.OtherSettings.ReloadAdminsEveryMapChange && ServerLoaded && ServerId != null)
AddTimer(3.0f, () => ReloadAdmins(null));
AddTimer(34, () =>
{
if (!ServerLoaded)
OnGameServerSteamAPIActivated();
});
// AddTimer(34, () =>
// {
// if (!ServerLoaded)
// OnGameServerSteamAPIActivated();
// });
GodPlayers.Clear();
SilentPlayers.Clear();