private void kick_Click(object sender, EventArgs e) { Kick kick = new Kick(id, name, reason.Text); gui.kick(kick); this.Close(); }
public void kick(Kick kick) { string name = ""; if (!string.IsNullOrEmpty(Settings.Default.name)) { name = "[" + Settings.Default.name + "] "; } _client.SendCommand(BattlEyeCommand.Kick, kick.id + " " + name + kick.reason); if (_form != null) { _form.Log("Kicked " + kick.name + " from the server!", LogType.Console, false); } }
public void kick(Kick kick) { string name = ""; if (!string.IsNullOrEmpty(Settings.Default.name)) { name = "[" + Settings.Default.name + "] "; } _client.SendCommand(BattlEyeCommand.Kick, kick.id + " " + name + kick.reason); if (_form != null) { _form.Log(String.Format(Resources.Strings.Kicked, kick.name), LogType.Console, false); } }
private void checkMessage(string message, bool ban) { string[] check; if (ban) { check = new string[Settings.Default.autoBan.Count]; Settings.Default.autoBan.CopyTo(check, 0); } else { check = new string[Settings.Default.autoKick.Count]; Settings.Default.autoKick.CopyTo(check, 0); } foreach (string item in check) { bool found = false; string msg = ""; try { System.Text.RegularExpressions.Match r = new System.Text.RegularExpressions.Regex(item.ToLower()).Match(message.ToLower()); found = item.Length > 3 && r.Success; if (found && r.Groups.Count > 1) { msg = r.Groups[1].Value; } else { msg = r.Value; } } catch { found = false; } if (found) { string name = message.Split(' ')[1].Replace(":", ""); Player player = null; foreach (Player p in _players) { if (!name.Equals("") && p.name.Equals(name)) { player = p; break; } } if (player != null) { if (ban) { _form.Log(String.Format(Resources.Strings.Autoban_for, player.name, item), LogType.Console, true); Ban _ban = new Ban(player.number, player.name, player.guid, "", 0, String.Format(Resources.Strings.Autoban_for, "", msg), true); this.Ban(_ban); } else { _form.Log(String.Format(Resources.Strings.Autokick_for, player.name, item), LogType.Console, true); Kick _kick = new Kick(player.number, player.name, String.Format(Resources.Strings.Autokick_for, "", msg)); this.kick(_kick); } } break; } } }
public void kick(Kick kick) { string name = ""; if (!string.IsNullOrEmpty(Settings.Default.name)) name = "[" + Settings.Default.name + "] "; _client.SendCommand(BattlEyeCommand.Kick, kick.id + " " + name + kick.reason); if (_form != null) _form.Log("Kicked " + kick.name + " from the server!", LogType.Console, false); }
public void kick(Kick kick) { rcon.kick(kick); }