/// <summary> /// Makes sure both clients are added /// </summary> /// <param name="origin"></param> /// <param name="target"></param> /// <returns></returns> private async Task EnsureClientsAdded(EFClient origin, EFClient target) { await Manager.AddPlayer(origin); if (!origin.Equals(target)) { await Manager.AddPlayer(target); } }
/// <summary> /// Indicates if the damage occurs from world (fall damage/certain killstreaks) /// </summary> /// <param name="origin"></param> /// <returns></returns> private bool IsWorldDamage(EFClient origin) => origin?.NetworkId == Utilities.WORLD_ID || origin?.ClientId == Utilities.WORLD_ID;
/// <summary> /// Indicates if the event should be ignored /// (If the client id or target id is not a real client or the target/origin is a bot and ignore bots is turned on) /// </summary> /// <param name="origin"></param> /// <param name="target"></param> /// <returns></returns> private bool ShouldIgnoreEvent(EFClient origin, EFClient target) { return((origin?.NetworkId == Utilities.WORLD_ID && target?.NetworkId == Utilities.WORLD_ID)); }