Skip to content

Commit

Permalink
Fix race condition causing disconnected admins to appear in adminwho (s…
Browse files Browse the repository at this point in the history
  • Loading branch information
PJB3005 authored Dec 24, 2024
1 parent 2c4be6b commit 285e934
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Content.Server/Administration/Managers/AdminManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,17 @@ private async void LoginAdminMaybe(ICommonSession session)
}

private async Task<(AdminData dat, int? rankId, bool specialLogin)?> LoadAdminData(ICommonSession session)
{
var result = await LoadAdminDataCore(session);

// Make sure admin didn't disconnect while data was loading.
if (session.Status != SessionStatus.InGame)
return null;

return result;
}

private async Task<(AdminData dat, int? rankId, bool specialLogin)?> LoadAdminDataCore(ICommonSession session)
{
var promoteHost = IsLocal(session) && _cfg.GetCVar(CCVars.ConsoleLoginLocal)
|| _promotedPlayers.Contains(session.UserId)
Expand Down

0 comments on commit 285e934

Please sign in to comment.