Пример #1
0
        protected override void OnRconCommand(RconEventArgs e)
        {
            Console.WriteLine($"Received RCON Command: {e.Command}");

            if (e.Command == "sd")
            {
                Client.ShutDown();
                e.Success = true;
                Console.WriteLine("Shutting down client...");
            }

            if (e.Command.StartsWith("msg"))
            {
                var msg = e.Command.Substring(4);

                Console.WriteLine("Received: " + msg);
                msg = new string(msg.Reverse().ToArray());

                Console.WriteLine("Reversed: " + msg);

                e.Success = true;
                Server.Print(msg);
            }

            base.OnRconCommand(e);
        }
Пример #2
0
        internal bool OnRconCommand(string command)
        {
            var args = new RconEventArgs(command);

            OnRconCommand(args);

            return(args.Success);
        }
Пример #3
0
        protected override void OnRconCommand(RconEventArgs e)
        {
            Console.WriteLine($"Received RCON Command: {e.Command}");

            if (e.Command == "speedtest")
            {
                SpeedTest();
                e.Success = true;
            }
            base.OnRconCommand(e);
        }
Пример #4
0
        protected override void OnRconCommand(RconEventArgs e)
        {
            Console.WriteLine("[RCON] {0}", e.Command);
            GtaPlayer.SendClientMessageToAll("Rcon message: {0}", e.Command);

            Console.WriteLine("Throwing exception after a stack filter...");
            StackFiller(1);

            e.Success = false;
            base.OnRconCommand(e);
        }
Пример #5
0
        //Rcon: "rcon challenge "password" command" from "ip:port"  [004.1]
        //Bad Rcon: "rcon challenge "password" command" from "ip:port"  [004.2]
        /// <summary>
        /// Raises the <see cref="RconMsg"/> event.
        /// </summary>
        /// <param name="timestamp">Time at which <see cref="RconMsg"/> event was fired.</param>
        /// <param name="info">Information about <see cref="RconMsg"/> event.</param>
        protected virtual void OnRconMsg(DateTime timestamp, string[] info)
        {
            string[]      s         = info[5].Split(':');
            RconEventArgs eventArgs = new RconEventArgs()
            {
                Timestamp = timestamp,
                IsValid   = info[0] == "Rcon: " ? true : false,
                Challenge = info[1].Split(' ')[1],
                Password  = info[2],
                Command   = info[3],
                Ip        = s[0],
                Port      = ushort.Parse(s[1], CultureInfo.InvariantCulture)
            };

            RconMsg.Fire(ServerEndPoint, eventArgs);
        }