예제 #1
0
        public void RunCommand(string[] Command)
        {
            string  ReadCommand;
            GPlayer P;

            if (Command.Length > 1)
            {
                ReadCommand = Command[1];
            }
            else
            {
                ReadCommand = "";
            }
            switch (Command[0])
            {
            case "cls":
            case "limpar":
            case "clear":
            {
                Console.Clear();
            }
            break;

            case "kickuid":
            {
                P = (GPlayer)GetPlayerByUID(uint.Parse(ReadCommand.ToString()));
                if (P == null)
                {
                    WriteConsole.WriteLine("[SYSTEM_COMMAND]: THIS UID IS NOT ONLINE!", ConsoleColor.Red);
                    break;
                }
                DisconnectPlayer(P);
            }
            break;

            case "kickname":
            {
                P = (GPlayer)GetPlayerByNickname(ReadCommand);
                if (P == null)
                {
                    WriteConsole.WriteLine("[SYSTEM_COMMAND]: THIS NICKNAME IS NOT ONLINE!", ConsoleColor.Red);
                    return;
                }
                DisconnectPlayer(P);
            }
            break;

            case "kickuser":
            {
                P = (GPlayer)GetPlayerByUsername(ReadCommand);
                if (P == null)
                {
                    WriteConsole.WriteLine("[SYSTEM_COMMAND]: THIS USERNAME IS NOT ONLINE!", ConsoleColor.Red);
                    return;
                }
                DisconnectPlayer(P);
            }
            break;

            case "topnotice":
            {
                if (ReadCommand.Length > 0)
                {
                    Notice(ReadCommand);
                }
            }
            break;

            case "lobby":
            case "listalobby":
            case "canais":
            case "listacanais":
            case "showlobby":
            case "showchannel":
            {
                LobbyList.ShowChannel();
            }
            break;

            case "comandos":
            case "commands":
            case "ajuda":
            case "help":
            {
                ShowHelp();
            }
            break;

            default:
            {
                WriteConsole.WriteLine("[SYSTEM_COMMAND]: Sorry Unknown Command, type 'help' to get the list of commands", ConsoleColor.Red);
            }
            break;
            }
        }
예제 #2
0
        public override void RunCommand(string[] Command)
        {
            string  ReadCommand;
            GPlayer P;

            if (Command.Length > 1)
            {
                ReadCommand = Command[1];
            }
            else
            {
                ReadCommand = "";
            }
            switch (Command[0])
            {
            case "cls":
            case "limpar":
            case "clear":
            {
                Console.Clear();
            }
            break;

            case "kickuid":
            {
                P = (GPlayer)GetPlayerByUID(uint.Parse(ReadCommand.ToString()));
                if (P == null)
                {
                    WriteConsole.WriteLine("[SYSTEM_COMMAND]: THIS UID IS NOT ONLINE!", ConsoleColor.Red);
                    break;
                }
                DisconnectPlayer(P);
            }
            break;

            case "kickname":
            {
                P = (GPlayer)GetPlayerByNickname(ReadCommand);
                if (P == null)
                {
                    WriteConsole.WriteLine("[SYSTEM_COMMAND]: THIS NICKNAME IS NOT ONLINE!", ConsoleColor.Red);
                    return;
                }
                DisconnectPlayer(P);
            }
            break;

            case "kickuser":
            {
                P = (GPlayer)GetPlayerByUsername(ReadCommand);
                if (P == null)
                {
                    WriteConsole.WriteLine("[SYSTEM_COMMAND]: THIS USERNAME IS NOT ONLINE!", ConsoleColor.Red);
                    return;
                }
                DisconnectPlayer(P);
            }
            break;

            case "topnotice":
            {
                if (ReadCommand.Length > 0)
                {
                    Notice(ReadCommand);
                }
            }
            break;

            case "lobby":
            case "listalobby":
            case "canais":
            case "listacanais":
            case "showlobby":
            case "showchannel":
            {
                LobbyList.ShowChannel();
            }
            break;

            case "comandos":
            case "commands":
            case "ajuda":
            case "help":
            {
                ShowHelp();
            }
            break;

            case "reload":
            case "reconfigurar":
            case "reconfig":
            {
                Ini  = new IniFile(ConfigurationManager.AppSettings["ServerConfig"]);
                Data = new ServerSettings
                {
                    Name            = Ini.ReadString("Config", "Name", "Pippin"),
                    Version         = Ini.ReadString("Config", "Version", "SV_GS_Release_2.0"),
                    UID             = Ini.ReadUInt32("Config", "UID", 20201),
                    MaxPlayers      = Ini.ReadUInt32("Config", "MaxPlayers", 3000),
                    Port            = Ini.ReadUInt32("Config", "Port", 20201),
                    IP              = Ini.ReadString("Config", "IP", "127.0.0.1"),
                    Property        = Ini.ReadUInt32("Config", "Property", 2048),
                    BlockFunc       = Ini.ReadInt64("Config", "BlockFuncSystem", 0),
                    EventFlag       = Ini.ReadInt16("Config", "EventFlag", 0),
                    ImgNo           = Ini.ReadInt16("Config", "Icon", 1),
                    GameVersion     = "824.00",
                    Type            = AuthClientTypeEnum.GameServer,
                    AuthServer_Ip   = Ini.ReadString("Config", "AuthServer_IP", "127.0.0.1"),
                    AuthServer_Port = Ini.ReadInt32("Config", "AuthServer_Port", 7997),
                    Key             = "3493ef7ca4d69f54de682bee58be4f93"
                };
                ShowLog          = Ini.ReadBool("Config", "PacketLog", false);
                Messenger_Active = Ini.ReadBool("Config", "Messenger_Server", false);

                var packet = new AuthPacket()
                {
                    ID      = AuthPacketEnum.SERVER_UPDATE,
                    Message = new
                    {
                        _data = Data
                    }
                };


                this.AuthServer.Send(packet);
            }
            break;

            default:
            {
                WriteConsole.WriteLine("[SYSTEM_COMMAND]: Sorry Unknown Command, type 'help' to get the list of commands", ConsoleColor.Red);
            }
            break;
            }
        }
예제 #3
0
        public override void RunCommand(string[] Command)
        {
            string  ReadCommand;
            LPlayer P;

            if (Command.Length > 1)
            {
                ReadCommand = Command[1];
            }
            else
            {
                ReadCommand = "";
            }
            switch (Command[0])
            {
            case "cls":
            case "limpar":
            case "clear":
            {
                Console.Clear();
            }
            break;

            case "kickuid":
            {
                P = (LPlayer)GetPlayerByUID(uint.Parse(ReadCommand.ToString()));
                if (P == null)
                {
                    WriteConsole.WriteLine("[SYSTEM_COMMAND]: THIS UID IS NOT ONLINE!", ConsoleColor.Red);
                    break;
                }
                DisconnectPlayer(P);
            }
            break;

            case "kickname":
            {
                P = (LPlayer)GetPlayerByNickname(ReadCommand);
                if (P == null)
                {
                    WriteConsole.WriteLine("[SYSTEM_COMMAND]: THIS NICKNAME IS NOT ONLINE!", ConsoleColor.Red);
                    return;
                }
                DisconnectPlayer(P);
            }
            break;

            case "kickuser":
            {
                P = (LPlayer)GetPlayerByUsername(ReadCommand);
                if (P == null)
                {
                    WriteConsole.WriteLine("[SYSTEM_COMMAND]: THIS USERNAME IS NOT ONLINE!", ConsoleColor.Red);
                    return;
                }
                DisconnectPlayer(P);
            }
            break;

            case "topnotice":
            {
                if (ReadCommand.Length > 0)
                {
                    Notice(ReadCommand);
                }
            }
            break;

            case "stop":
                OpenServer = false;
                WriteConsole.WriteLine("[SYSTEM_COMMAND]: Server is Close");
                break;

            case "start":
                OpenServer = true;
                WriteConsole.WriteLine("[SYSTEM_COMMAND]: Server is Open");
                break;

            case "comandos":
            case "commands":
            case "ajuda":
            case "help":
            {
                ShowHelp();
            }
            break;

            case "quit":
            case "exit":
            case "close":
            case "sair":
            case "fechar":
            {
                Console.WriteLine("The server was stopped!");
                Environment.Exit(1);
            }
            break;

            default:
            {
                WriteConsole.WriteLine("[SYSTEM_COMMAND]: Sorry Unknown Command, type 'help' to get the list of commands", ConsoleColor.Red);
            }
            break;
            }
        }