Files
OldThink/Content.Server/Connection/ConnectionManager.cs

280 lines
12 KiB
C#
Raw Normal View History

using System.Collections.Immutable;
using System.Runtime.InteropServices;
using System.Linq;
using System.Threading.Tasks;
using Content.Server.Database;
using Content.Server.GameTicking;
2021-06-09 22:19:39 +02:00
using Content.Server.Preferences.Managers;
using Content.Server._White.Sponsors;
using Content.Shared.CCVar;
2022-08-14 12:54:49 -07:00
using Content.Shared.GameTicking;
using Content.Shared.Players.PlayTimeTracking;
using Content.Shared._White;
using Robust.Server.Player;
using Robust.Shared.Configuration;
using Robust.Shared.Network;
using Robust.Shared.Timing;
2021-06-09 22:19:39 +02:00
namespace Content.Server.Connection
{
public interface IConnectionManager
{
void Initialize();
Task<bool> HavePrivilegedJoin(NetUserId userId); // WD-EDIT
Merge remote-tracking branch 'upstream/master' into upstream # Conflicts: # Content.Client/Access/AccessOverlay.cs # Content.Client/Access/UI/IdCardConsoleBoundUserInterface.cs # Content.Client/Access/UI/IdCardConsoleWindow.xaml # Content.Client/Access/UI/IdCardConsoleWindow.xaml.cs # Content.Client/Chemistry/UI/InjectorStatusControl.cs # Content.Client/StatusIcon/StatusIconOverlay.cs # Content.Client/Stylesheets/StyleNano.cs # Content.Client/UserInterface/Systems/Chat/ChatUIController.cs # Content.Client/UserInterface/Systems/Chat/Widgets/ChatBox.xaml # Content.Server/Access/Systems/IdCardConsoleSystem.cs # Content.Server/Administration/Commands/AGhost.cs # Content.Server/Chemistry/EntitySystems/ReagentDispenserSystem.cs # Content.Server/Connection/ConnectionManager.cs # Content.Server/DeviceLinking/Systems/SignalTimerSystem.cs # Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs # Content.Server/GameTicking/GameTicker.RoundFlow.cs # Content.Server/GameTicking/GameTicker.Spawning.cs # Content.Server/Humanoid/Systems/HumanoidAppearanceSystem.cs # Content.Server/Resist/EscapeInventorySystem.cs # Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs # Content.Shared/Access/Components/IdCardConsoleComponent.cs # Content.Shared/Anomaly/SharedAnomalySystem.cs # Content.Shared/Bed/Sleep/SharedSleepingSystem.cs # Content.Shared/Humanoid/SharedHumanoidAppearanceSystem.cs # Content.Shared/Lock/LockSystem.cs # Content.Shared/RCD/Systems/RCDSystem.cs # Content.Shared/Roles/JobPrototype.cs # Content.Shared/StatusIcon/StatusIconPrototype.cs # Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs # Resources/Audio/Machines/attributions.yml # Resources/Locale/en-US/rcd/components/rcd-component.ftl # Resources/Maps/reach.yml # Resources/Prototypes/Catalog/Cargo/cargo_vending.yml # Resources/Prototypes/Catalog/Fills/Lockers/heads.yml # Resources/Prototypes/Catalog/Fills/Lockers/security.yml # Resources/Prototypes/Catalog/ReagentDispensers/beverage.yml # Resources/Prototypes/Catalog/VendingMachines/Inventories/boozeomat.yml # Resources/Prototypes/Catalog/VendingMachines/Inventories/cola.yml # Resources/Prototypes/Catalog/VendingMachines/Inventories/lawdrobe.yml # Resources/Prototypes/Catalog/VendingMachines/Inventories/pwrgame.yml # Resources/Prototypes/Catalog/VendingMachines/Inventories/shamblersjuice.yml # Resources/Prototypes/Catalog/VendingMachines/Inventories/soda.yml # Resources/Prototypes/Catalog/VendingMachines/Inventories/spaceup.yml # Resources/Prototypes/Catalog/VendingMachines/Inventories/starkist.yml # Resources/Prototypes/Catalog/VendingMachines/Inventories/theater.yml # Resources/Prototypes/DeviceLinking/sink_ports.yml # Resources/Prototypes/Entities/Clothing/Back/duffel.yml # Resources/Prototypes/Entities/Clothing/Belt/base_clothingbelt.yml # Resources/Prototypes/Entities/Clothing/Neck/misc.yml # Resources/Prototypes/Entities/Clothing/OuterClothing/base_clothingouter.yml # Resources/Prototypes/Entities/Clothing/OuterClothing/wintercoats.yml # Resources/Prototypes/Entities/Mobs/Customization/Markings/gauze.yml # Resources/Prototypes/Entities/Objects/Devices/Electronics/door.yml # Resources/Prototypes/Entities/Objects/Magic/books.yml # Resources/Prototypes/Entities/Objects/Materials/Sheets/glass.yml # Resources/Prototypes/Entities/Objects/Materials/Sheets/metal.yml # Resources/Prototypes/Entities/Objects/Materials/Sheets/other.yml # Resources/Prototypes/Entities/Objects/Misc/tiles.yml # Resources/Prototypes/Entities/Objects/Specific/Medical/morgue.yml # Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/shotgun.yml # Resources/Prototypes/Entities/Objects/Weapons/Melee/e_sword.yml # Resources/Prototypes/Entities/Structures/Doors/Airlocks/airlocks.yml # Resources/Prototypes/Entities/Structures/Doors/Airlocks/base_assembly.yml # Resources/Prototypes/Entities/Structures/Doors/Airlocks/base_structureairlocks.yml # Resources/Prototypes/Entities/Structures/Doors/Airlocks/highsec.yml # Resources/Prototypes/Entities/Structures/Doors/Firelocks/firelock.yml # Resources/Prototypes/Entities/Structures/Doors/Firelocks/frame.yml # Resources/Prototypes/Entities/Structures/Doors/MaterialDoors/material_doors.yml # Resources/Prototypes/Entities/Structures/Doors/SecretDoor/secret_door.yml # Resources/Prototypes/Entities/Structures/Doors/Windoors/assembly.yml # Resources/Prototypes/Entities/Structures/Lighting/base_lighting.yml # Resources/Prototypes/Entities/Structures/Machines/lathe.yml # Resources/Prototypes/Entities/Structures/Power/cable_terminal.yml # Resources/Prototypes/Entities/Structures/Storage/Tanks/base_structuretanks.yml # Resources/Prototypes/Entities/Structures/Walls/grille.yml # Resources/Prototypes/Recipes/Construction/Graphs/structures/shutter.yml # Resources/Prototypes/Recipes/Crafting/Graphs/improvised/flowercrown.yml # Resources/Prototypes/Recipes/Crafting/improvised.yml # Resources/Prototypes/Roles/Jobs/Security/detective.yml # Resources/Prototypes/Roles/Jobs/Security/head_of_security.yml # Resources/Prototypes/Roles/Jobs/Security/security_officer.yml # Resources/Prototypes/Roles/Jobs/Security/warden.yml # Resources/Prototypes/StatusEffects/health.yml # Resources/Prototypes/Voice/speech_emotes.yml # Resources/Prototypes/lobbyscreens.yml # Resources/Textures/Clothing/OuterClothing/Hardsuits/ERTSuits/ertchaplain.rsi/equipped-OUTERCLOTHING-body-slim.png # Resources/Textures/Decals/bricktile.rsi/white_box.png # Resources/Textures/Objects/Misc/books.rsi/meta.json # Resources/migration.yml
2024-04-13 11:29:33 +07:00
/// <summary>
/// Temporarily allow a user to bypass regular connection requirements.
/// </summary>
/// <remarks>
/// The specified user will be allowed to bypass regular player cap,
/// whitelist and panic bunker restrictions for <paramref name="duration"/>.
/// Bans are not bypassed.
/// </remarks>
/// <param name="user">The user to give a temporary bypass.</param>
/// <param name="duration">How long the bypass should last for.</param>
void AddTemporaryConnectBypass(NetUserId user, TimeSpan duration);
}
/// <summary>
/// Handles various duties like guest username assignment, bans, connection logs, etc...
/// </summary>
public sealed class ConnectionManager : IConnectionManager
{
[Dependency] private readonly IServerDbManager _dbManager = default!;
[Dependency] private readonly IPlayerManager _plyMgr = default!;
[Dependency] private readonly IServerNetManager _netMgr = default!;
[Dependency] private readonly IServerDbManager _db = default!;
[Dependency] private readonly IConfigurationManager _cfg = default!;
[Dependency] private readonly ILocalizationManager _loc = default!;
[Dependency] private readonly ServerDbEntryManager _serverDbEntry = default!;
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly ILogManager _logManager = default!;
private readonly Dictionary<NetUserId, TimeSpan> _temporaryBypasses = [];
private ISawmill _sawmill = default!;
//WD-EDIT
[Dependency] private readonly SponsorsManager _sponsorsManager = default!;
//WD-EDIT
public void Initialize()
{
_sawmill = _logManager.GetSawmill("connections");
_netMgr.Connecting += NetMgrOnConnecting;
_netMgr.AssignUserIdCallback = AssignUserIdCallback;
// Approval-based IP bans disabled because they don't play well with Happy Eyeballs.
// _netMgr.HandleApprovalCallback = HandleApproval;
}
public void AddTemporaryConnectBypass(NetUserId user, TimeSpan duration)
{
ref var time = ref CollectionsMarshal.GetValueRefOrAddDefault(_temporaryBypasses, user, out _);
var newTime = _gameTiming.RealTime + duration;
// Make sure we only update the time if we wouldn't shrink it.
if (newTime > time)
time = newTime;
}
/*
private async Task<NetApproval> HandleApproval(NetApprovalEventArgs eventArgs)
{
var ban = await _db.GetServerBanByIpAsync(eventArgs.Connection.RemoteEndPoint.Address);
if (ban != null)
{
var expires = Loc.GetString("ban-banned-permanent");
if (ban.ExpirationTime is { } expireTime)
{
var duration = expireTime - ban.BanTime;
var utc = expireTime.ToUniversalTime();
expires = Loc.GetString("ban-expires", ("duration", duration.TotalMinutes.ToString("N0")), ("time", utc.ToString("f")));
}
var reason = Loc.GetString("ban-banned-1") + "\n" + Loc.GetString("ban-banned-2", ("reason", this.Reason)) + "\n" + expires;;
return NetApproval.Deny(reason);
}
return NetApproval.Allow();
}
*/
private async Task NetMgrOnConnecting(NetConnectingArgs e)
{
var deny = await ShouldDeny(e);
var addr = e.IP.Address;
var userId = e.UserId;
var serverId = (await _serverDbEntry.ServerEntity).Id;
if (deny != null)
{
var (reason, msg, banHits) = deny.Value;
var id = await _db.AddConnectionLogAsync(userId, e.UserName, addr, e.UserData.HWId, reason, serverId);
if (banHits is { Count: > 0 })
await _db.AddServerBanHitsAsync(id, banHits);
var properties = new Dictionary<string, object>();
if (reason == ConnectionDenyReason.Full)
properties["delay"] = _cfg.GetCVar(CCVars.GameServerFullReconnectDelay);
e.Deny(new NetDenyReason(msg, properties));
}
else
{
await _db.AddConnectionLogAsync(userId, e.UserName, addr, e.UserData.HWId, null, serverId);
if (!ServerPreferencesManager.ShouldStorePrefs(e.AuthType))
return;
await _db.UpdatePlayerRecordAsync(userId, e.UserName, addr, e.UserData.HWId);
}
}
private async Task<(ConnectionDenyReason, string, List<ServerBanDef>? bansHit)?> ShouldDeny(
NetConnectingArgs e)
{
// Check if banned.
var addr = e.IP.Address;
var userId = e.UserId;
2021-03-22 01:30:50 +01:00
ImmutableArray<byte>? hwId = e.UserData.HWId;
2021-04-09 19:28:03 +02:00
if (hwId.Value.Length == 0 || !_cfg.GetCVar(CCVars.BanHardwareIds))
2021-03-22 01:30:50 +01:00
{
// HWId not available for user's platform, don't look it up.
2021-04-09 19:28:03 +02:00
// Or hardware ID checks disabled.
2021-03-22 01:30:50 +01:00
hwId = null;
}
var bans = await _db.GetServerBansAsync(addr, userId, hwId, includeUnbanned: false);
Merge remote-tracking branch 'upstream/master' into upstream # Conflicts: # Content.Client/Access/AccessOverlay.cs # Content.Client/Access/UI/IdCardConsoleBoundUserInterface.cs # Content.Client/Access/UI/IdCardConsoleWindow.xaml # Content.Client/Access/UI/IdCardConsoleWindow.xaml.cs # Content.Client/Chemistry/UI/InjectorStatusControl.cs # Content.Client/StatusIcon/StatusIconOverlay.cs # Content.Client/Stylesheets/StyleNano.cs # Content.Client/UserInterface/Systems/Chat/ChatUIController.cs # Content.Client/UserInterface/Systems/Chat/Widgets/ChatBox.xaml # Content.Server/Access/Systems/IdCardConsoleSystem.cs # Content.Server/Administration/Commands/AGhost.cs # Content.Server/Chemistry/EntitySystems/ReagentDispenserSystem.cs # Content.Server/Connection/ConnectionManager.cs # Content.Server/DeviceLinking/Systems/SignalTimerSystem.cs # Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs # Content.Server/GameTicking/GameTicker.RoundFlow.cs # Content.Server/GameTicking/GameTicker.Spawning.cs # Content.Server/Humanoid/Systems/HumanoidAppearanceSystem.cs # Content.Server/Resist/EscapeInventorySystem.cs # Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs # Content.Shared/Access/Components/IdCardConsoleComponent.cs # Content.Shared/Anomaly/SharedAnomalySystem.cs # Content.Shared/Bed/Sleep/SharedSleepingSystem.cs # Content.Shared/Humanoid/SharedHumanoidAppearanceSystem.cs # Content.Shared/Lock/LockSystem.cs # Content.Shared/RCD/Systems/RCDSystem.cs # Content.Shared/Roles/JobPrototype.cs # Content.Shared/StatusIcon/StatusIconPrototype.cs # Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs # Resources/Audio/Machines/attributions.yml # Resources/Locale/en-US/rcd/components/rcd-component.ftl # Resources/Maps/reach.yml # Resources/Prototypes/Catalog/Cargo/cargo_vending.yml # Resources/Prototypes/Catalog/Fills/Lockers/heads.yml # Resources/Prototypes/Catalog/Fills/Lockers/security.yml # Resources/Prototypes/Catalog/ReagentDispensers/beverage.yml # Resources/Prototypes/Catalog/VendingMachines/Inventories/boozeomat.yml # Resources/Prototypes/Catalog/VendingMachines/Inventories/cola.yml # Resources/Prototypes/Catalog/VendingMachines/Inventories/lawdrobe.yml # Resources/Prototypes/Catalog/VendingMachines/Inventories/pwrgame.yml # Resources/Prototypes/Catalog/VendingMachines/Inventories/shamblersjuice.yml # Resources/Prototypes/Catalog/VendingMachines/Inventories/soda.yml # Resources/Prototypes/Catalog/VendingMachines/Inventories/spaceup.yml # Resources/Prototypes/Catalog/VendingMachines/Inventories/starkist.yml # Resources/Prototypes/Catalog/VendingMachines/Inventories/theater.yml # Resources/Prototypes/DeviceLinking/sink_ports.yml # Resources/Prototypes/Entities/Clothing/Back/duffel.yml # Resources/Prototypes/Entities/Clothing/Belt/base_clothingbelt.yml # Resources/Prototypes/Entities/Clothing/Neck/misc.yml # Resources/Prototypes/Entities/Clothing/OuterClothing/base_clothingouter.yml # Resources/Prototypes/Entities/Clothing/OuterClothing/wintercoats.yml # Resources/Prototypes/Entities/Mobs/Customization/Markings/gauze.yml # Resources/Prototypes/Entities/Objects/Devices/Electronics/door.yml # Resources/Prototypes/Entities/Objects/Magic/books.yml # Resources/Prototypes/Entities/Objects/Materials/Sheets/glass.yml # Resources/Prototypes/Entities/Objects/Materials/Sheets/metal.yml # Resources/Prototypes/Entities/Objects/Materials/Sheets/other.yml # Resources/Prototypes/Entities/Objects/Misc/tiles.yml # Resources/Prototypes/Entities/Objects/Specific/Medical/morgue.yml # Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/shotgun.yml # Resources/Prototypes/Entities/Objects/Weapons/Melee/e_sword.yml # Resources/Prototypes/Entities/Structures/Doors/Airlocks/airlocks.yml # Resources/Prototypes/Entities/Structures/Doors/Airlocks/base_assembly.yml # Resources/Prototypes/Entities/Structures/Doors/Airlocks/base_structureairlocks.yml # Resources/Prototypes/Entities/Structures/Doors/Airlocks/highsec.yml # Resources/Prototypes/Entities/Structures/Doors/Firelocks/firelock.yml # Resources/Prototypes/Entities/Structures/Doors/Firelocks/frame.yml # Resources/Prototypes/Entities/Structures/Doors/MaterialDoors/material_doors.yml # Resources/Prototypes/Entities/Structures/Doors/SecretDoor/secret_door.yml # Resources/Prototypes/Entities/Structures/Doors/Windoors/assembly.yml # Resources/Prototypes/Entities/Structures/Lighting/base_lighting.yml # Resources/Prototypes/Entities/Structures/Machines/lathe.yml # Resources/Prototypes/Entities/Structures/Power/cable_terminal.yml # Resources/Prototypes/Entities/Structures/Storage/Tanks/base_structuretanks.yml # Resources/Prototypes/Entities/Structures/Walls/grille.yml # Resources/Prototypes/Recipes/Construction/Graphs/structures/shutter.yml # Resources/Prototypes/Recipes/Crafting/Graphs/improvised/flowercrown.yml # Resources/Prototypes/Recipes/Crafting/improvised.yml # Resources/Prototypes/Roles/Jobs/Security/detective.yml # Resources/Prototypes/Roles/Jobs/Security/head_of_security.yml # Resources/Prototypes/Roles/Jobs/Security/security_officer.yml # Resources/Prototypes/Roles/Jobs/Security/warden.yml # Resources/Prototypes/StatusEffects/health.yml # Resources/Prototypes/Voice/speech_emotes.yml # Resources/Prototypes/lobbyscreens.yml # Resources/Textures/Clothing/OuterClothing/Hardsuits/ERTSuits/ertchaplain.rsi/equipped-OUTERCLOTHING-body-slim.png # Resources/Textures/Decals/bricktile.rsi/white_box.png # Resources/Textures/Objects/Misc/books.rsi/meta.json # Resources/migration.yml
2024-04-13 11:29:33 +07:00
if (bans.Count > 0 && bans.Any(x=> x.ExpirationTime == null)) // Miracle Edit
{
var firstBan = bans[0];
var message = firstBan.FormatBanMessage(_cfg, _loc);
return (ConnectionDenyReason.Ban, message, bans);
}
if (HasTemporaryBypass(userId))
{
_sawmill.Verbose("User {UserId} has temporary bypass, skipping further connection checks", userId);
return null;
}
2022-01-04 06:37:06 -07:00
var adminData = await _dbManager.GetAdminDataForAsync(e.UserId);
if (_cfg.GetCVar(CCVars.PanicBunkerEnabled) && adminData == null)
{
var showReason = _cfg.GetCVar(CCVars.PanicBunkerShowReason);
var customReason = _cfg.GetCVar(CCVars.PanicBunkerCustomReason);
var minMinutesAge = _cfg.GetCVar(CCVars.PanicBunkerMinAccountAge);
var record = await _dbManager.GetPlayerRecordByUserId(userId);
var validAccountAge = record != null &&
record.FirstSeenTime.CompareTo(DateTimeOffset.Now - TimeSpan.FromMinutes(minMinutesAge)) <= 0;
var bypassAllowed = _cfg.GetCVar(CCVars.BypassBunkerWhitelist) && await _db.GetWhitelistStatusAsync(userId);
// Use the custom reason if it exists & they don't have the minimum account age
if (customReason != string.Empty && !validAccountAge && !bypassAllowed)
{
return (ConnectionDenyReason.Panic, customReason, null);
}
if (showReason && !validAccountAge && !bypassAllowed)
{
return (ConnectionDenyReason.Panic,
Loc.GetString("panic-bunker-account-denied-reason",
("reason", Loc.GetString("panic-bunker-account-reason-account", ("minutes", minMinutesAge)))), null);
}
var minOverallHours = _cfg.GetCVar(CCVars.PanicBunkerMinOverallHours);
var overallTime = ( await _db.GetPlayTimes(e.UserId)).Find(p => p.Tracker == PlayTimeTrackingShared.TrackerOverall);
var haveMinOverallTime = overallTime != null && overallTime.TimeSpent.TotalHours > minOverallHours;
2023-01-30 23:57:45 -06:00
// Use the custom reason if it exists & they don't have the minimum time
if (customReason != string.Empty && !haveMinOverallTime && !bypassAllowed)
{
return (ConnectionDenyReason.Panic, customReason, null);
}
if (showReason && !haveMinOverallTime && !bypassAllowed)
{
return (ConnectionDenyReason.Panic,
Loc.GetString("panic-bunker-account-denied-reason",
("reason", Loc.GetString("panic-bunker-account-reason-overall", ("hours", minOverallHours)))), null);
}
2022-11-01 21:17:58 -04:00
if (!validAccountAge || !haveMinOverallTime && !bypassAllowed)
{
return (ConnectionDenyReason.Panic, Loc.GetString("panic-bunker-account-denied"), null);
}
}
//WD-EDIT
var isQueueEnabled = _cfg.GetCVar(WhiteCVars.QueueEnabled);
var isPrivileged = await HavePrivilegedJoin(e.UserId);
if (_plyMgr.PlayerCount >= _cfg.GetCVar(CCVars.SoftMaxPlayers) && !isPrivileged && !isQueueEnabled)
{
return (ConnectionDenyReason.Full, Loc.GetString("soft-player-cap-full"), null);
}
//WD-EDIT
2023-01-30 23:57:45 -06:00
if (_cfg.GetCVar(CCVars.WhitelistEnabled))
2022-01-04 06:37:06 -07:00
{
2023-01-30 23:57:45 -06:00
var min = _cfg.GetCVar(CCVars.WhitelistMinPlayers);
var max = _cfg.GetCVar(CCVars.WhitelistMaxPlayers);
2023-02-19 08:28:14 -06:00
var playerCountValid = _plyMgr.PlayerCount >= min && _plyMgr.PlayerCount < max;
2023-01-30 23:57:45 -06:00
if (playerCountValid && await _db.GetWhitelistStatusAsync(userId) == false
&& adminData is null)
{
var msg = Loc.GetString(_cfg.GetCVar(CCVars.WhitelistReason));
// was the whitelist playercount changed?
if (min > 0 || max < int.MaxValue)
msg += "\n" + Loc.GetString("whitelist-playercount-invalid", ("min", min), ("max", max));
return (ConnectionDenyReason.Whitelist, msg, null);
}
}
return null;
}
private bool HasTemporaryBypass(NetUserId user)
{
return _temporaryBypasses.TryGetValue(user, out var time) && time > _gameTiming.RealTime;
}
private async Task<NetUserId?> AssignUserIdCallback(string name)
{
if (!_cfg.GetCVar(CCVars.GamePersistGuests))
{
return null;
}
var userId = await _db.GetAssignedUserIdAsync(name);
if (userId != null)
{
return userId;
}
var assigned = new NetUserId(Guid.NewGuid());
await _db.AssignUserIdAsync(name, assigned);
return assigned;
}
//WD-EDIT
public async Task<bool> HavePrivilegedJoin(NetUserId userId)
{
var adminData = await _dbManager.GetAdminDataForAsync(userId);
var havePriorityJoin = _sponsorsManager.TryGetInfo(userId, out var sponsorData) && sponsorData.HavePriorityJoin;
2024-04-13 11:58:34 +07:00
var wasInGame = EntitySystem.TryGet<GameTicker>(out var gameTicker) &&
gameTicker.PlayerGameStatuses.TryGetValue(userId, out var status) &&
status == PlayerGameStatus.JoinedGame;
return adminData != null ||
havePriorityJoin ||
wasInGame;
}
//WD-EDIT
}
}