Skip to content

Commit

Permalink
Fix admin queue bypass
Browse files Browse the repository at this point in the history
  • Loading branch information
Morb0 committed Feb 29, 2024
1 parent e5c96d6 commit 3f33c06
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Content.Server/Connection/ConnectionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,13 @@ private async Task NetMgrOnConnecting(NetConnectingArgs e)
// Corvax-Queue-Start: Make these conditions in one place, for checks in the connection and in the queue
public async Task<bool> HavePrivilegedJoin(NetUserId userId)
{
var isAdmin = await _dbManager.GetAdminDataForAsync(userId) != null;
var havePriorityJoin = _sponsorsMgr != null && _sponsorsMgr.HavePriorityJoin(userId); // Corvax-Sponsors
var wasInGame = EntitySystem.TryGet<GameTicker>(out var ticker) &&
ticker.PlayerGameStatuses.TryGetValue(userId, out var status) &&
status == PlayerGameStatus.JoinedGame;
return havePriorityJoin || // Corvax-Sponsors
return isAdmin ||
havePriorityJoin || // Corvax-Sponsors
wasInGame;
}
// Corvax-Queue-End
Expand Down

0 comments on commit 3f33c06

Please sign in to comment.