public void AddBan(string mask) { if (!Bans.Contains(mask)) { Bans.Add(mask); } }
private void BanHero(Hero hero) { if (hero == null) { return; } if (PickedAllies.Any(h => h.Hero == hero) || PickedEnemies.Any(h => h.Hero == hero) || Bans.Any(h => h == hero)) { return; } for (int i = 0; i < AvailableAllies.Count; i++) { if (AvailableAllies[i].Hero == hero) { AvailableAllies.RemoveAt(i); break; } } for (int i = 0; i < AvailableEnemies.Count; i++) { if (AvailableEnemies[i].Hero == hero) { AvailableEnemies.RemoveAt(i); break; } } Bans.Add(hero); }
private void Blwvm_CloseView() { using (MyDBContext db = new MyDBContext()) { var res = (from b in db.Bans select new BanVM() { ban = b }).LastOrDefault(); if (res != Bans.LastOrDefault()) { Bans.Add(res); } } }
public virtual bool Ban(PlayerMobile user, TimeSpan duration, bool kick = true, bool message = true) { if (kick) { Kick(user, false, message); } if (Bans.ContainsKey(user)) { Bans[user] = duration <= TimeSpan.Zero ? DateTime.MaxValue : DateTime.Now + duration; return(false); } Bans.Add(user, duration <= TimeSpan.Zero ? DateTime.MaxValue : DateTime.Now + duration); if (message) { InternalMessage(user, "You have been banned from the channel '{0}' until {1}", Name, Bans[user].ToSimpleString()); } OnBanned(user, message); return(true); }
/// <summary> /// Bans the user with a specific ban object. /// </summary> public void Ban(ClientBan ban) { Bans.Add(ban); }
public override Task DivideLine(string line) { if (line.Contains(" CITC ")) { CitC.Add(line); } else if (line.Contains(" LOGIN: "******" LOGIN MISC: ")) { LoginMisc.Add(line); } else if (line.Contains(" QUIT MISC: ")) { QuitMisc.Add(line); } else if (line.Contains(" (AA)(BAN) ")) { Bans.Add(line); } else if (line.Contains(" (AA)(MUTE) ")) { Mutes.Add(line); } else if (line.Contains(" (AA)(JAIL) ")) { Jails.Add(line); } else if (line.Contains(" (AA)(CONTACTADMIN) ")) { Cad.Add(line); } else if (line.Contains(" (AA)(SUPPORT) ")) { Support.Add(line); } else if (line.Contains(" opened '") && line.Contains(" ms")) { LogsFetched.Add(line); } else if (line.Contains(" [CM] ") && line.Contains(" set ")) { Reports.Add(line); } else if (line.Contains("[Complaint ID") && line.Contains(" replied with ")) { Reports.Add(line); } else if (line.Contains(" warped to ") || line.Contains(" WL: ")) { if (line.Contains("WL: 0") || line.Contains("with 0 stars Dim: 0")) { PossibleAbuse.Add(line); } else { RegisteredAbuse.Add(line); } } /*else if (line.Contains(" warped to ") && !line.Contains(" WL: 0") && !line.Contains(" (EM) ")) * RegisteredAbuse.Add(line); * else if (line.Contains(" warped to ") && line.Contains(" WL: 0") && !line.Contains(" (EM) ")) * PossibleAbuse.Add(line); * else if (line.Contains(" ST ") && (!line.Contains("from 0") && line.Contains("wanted points."))) * RegisteredAbuse.Add(line);*/ else if (line.Contains(" ST ") && line.Contains("from 0 wanted points.")) { PossibleAbuse.Add(line); } else if (line.Contains("abuse") || line.Contains("recommendation") || line.Contains("leak") || line.Contains("bias") || line.Contains("accept") || line.Contains("jcm") || line.Contains("rcm") || line.Contains("scm") ) { PossibleAbuse.Add(line); } else if (line.Contains("object. ID:")) { DutyRelated.Add(line); } else if (line.Contains("changed account:")) { DutyRelated.Add(line); } else if (line.Contains("changed the password of account")) { DutyRelated.Add(line); } else if (line.Contains("checked the PIN code of account")) { DutyRelated.Add(line); } else if (line.Contains("zone 0 p")) { DutyRelated.Add(line); } else if (line.Contains(" (PP) ")) { PendingPunishments.Add(line); } else { Other.Add(line); } return(Task.CompletedTask); }
public void Add(Ban item) => Bans.Add(item);
public void AddBan(Ban ban) { Bans.Add(ban); }