示例#1
0
文件: GUIkick.cs 项目: DomiStyle/DaRT
        private void kick_Click(object sender, EventArgs e)
        {
            Kick kick = new Kick(id, name, reason.Text);

            gui.kick(kick);

            this.Close();
        }
示例#2
0
        private void kick_Click(object sender, EventArgs e)
        {
            Kick kick = new Kick(id, name, reason.Text);

            gui.kick(kick);

            this.Close();
        }
示例#3
0
        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);
            }
        }
示例#4
0
文件: RCon.cs 项目: aimrabbit/DaRT
        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);
            }
        }
示例#5
0
文件: RCon.cs 项目: aimrabbit/DaRT
        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;
                }
            }
        }
示例#6
0
文件: RCon.cs 项目: DomiStyle/DaRT
        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);
        }
示例#7
0
文件: GUImain.cs 项目: DomiStyle/DaRT
 public void kick(Kick kick)
 {
     rcon.kick(kick);
 }