예제 #1
0
        public void Parse(string command)
        {
            string[] splitCommand = command.Split(' ');

            try{
                switch (splitCommand[0])
                {
                case Send:
                    Debug.Log(splitCommand[1]);
                    break;

                case Close:
                    Network_Server.ShutDown();
                    break;

                case Begin:
                    if (splitCommand[1].Equals("game"))
                    {
                        ServerMasterManager.instance.BeginGame();
                    }
                    break;

                case Hide:
                    ConsoleSystem.Hide();
                    break;

                default:
                    ConsoleMsgQueue.EnqueMsg("Invalid Command");
                    break;
                }
            }catch (Exception e) {
                ConsoleMsgQueue.EnqueMsg(e.Message);
            }
        }
예제 #2
0
    public void Parse(string command)
    {
        string[] splitCommand = command.Split(' ');

        try{
            switch (splitCommand[0])
            {
            case Send:
                Debug.Log(splitCommand[1]);
                break;

            case Disconnect:
                netClient.ShutDown();
                break;

            case Connect:
                if (splitCommand[1].Length < 1)
                {
                    Network_Client.serverAddress = "127.0.0.1";
                }
                else
                {
                    Network_Client.serverAddress = splitCommand[1];
                }
                KingGodClient.instance.Begin();
                break;

            case ConsoleLvl:
                ConsoleMsgQueue.level = int.Parse(splitCommand[1]);
                break;

            case Hide:
                ConsoleSystem.Hide();
                break;

            default:
                ConsoleMsgQueue.EnqueMsg("Invalid Command");
                break;
            }
        }catch (Exception e) {
            ConsoleMsgQueue.EnqueMsg(e.Message);
        }
    }