예제 #1
0
        public static bool OnProcessCmd(DebugUI.Command cmd)
        {
            DebugUI debugUI = MainGame.DebugUI;

            string main = cmd.main;

            if (main.ToLower() [0] == 'c' && main.ToLower() [1] == ':')
            {
                if (((int)xc.Game.GetInstance().GameMode & (int)xc.Game.EGameMode.GM_Net) == (int)xc.Game.EGameMode.GM_Net)
                {
                    SendGMCommandForDebugUI(cmd);
                }
                else
                {
                    debugUI.PushLog("非联网模式无法发送聊天");
                    debugUI.PushLog(main.ToLower());
                }
                return(true);
            }

            if (main.ToLower()[0] == 'x' && main.ToLower()[1] == ':')
            {
                if (((int)xc.Game.GetInstance().GameMode & (int)xc.Game.EGameMode.GM_Net) == (int)xc.Game.EGameMode.GM_Net)
                {
                    SendGMCommandThroughMajorConnect(cmd);
                }
            }


            return(ToProcessCommand(main, cmd.paramArray, debugUI));
        }
예제 #2
0
        // 开始游戏状态
        void StateEnter_InPlay(xc.Machine.State s)
        {
            DebugUI.Command cmd = new DebugUI.Command();
            cmd.main       = "localplayer";
            cmd.paramArray = new List <string>();
            cmd.paramArray.Add("101");  //619.2289 155.3159 576.4397
            cmd.paramArray.Add("60");   //x
            cmd.paramArray.Add("12.5"); //y
            cmd.paramArray.Add("70");   //z
            DebugCommand.OnProcessCmd(cmd);

            //测试关卡
            LevelManager.Instance.LoadLevelFile(6000, false);
        }
예제 #3
0
        /// <summary>
        /// 通过主链接发送GM指令
        /// </summary>
        /// <param name="cmd"></param>
        public static void SendGMCommandThroughMajorConnect(DebugUI.Command cmd)
        {
            string str = "";

            for (int i = 2; i < cmd.main.ToLower().Length; i++)
            {
                str = str + cmd.main.ToLower()[i];
            }

            C2SChatCommon data = new C2SChatCommon();

            data.type         = GameConst.CHAT_BCAST_ALL;
            data.info.content = System.Text.Encoding.UTF8.GetBytes(str);

            NetClient.GetBaseClient().SendData <C2SChatCommon>(NetMsg.MSG_CHAT_COMMON, data);
        }