Fix admin queue bypass

This commit is contained in:
Morb0
2024-02-29 21:04:14 +03:00
parent e5c96d6c1e
commit 3f33c064d2

View File

@@ -236,11 +236,13 @@ namespace Content.Server.Connection
// 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