예제 #1
0
        /// <summary>指令处理</summary>
        public ASObject Switch(int moduleNumber, int commandNumber, TGGSession session, ASObject data)
        {
#if DEBUG
            var sw = Stopwatch.StartNew();
#endif
            var aso = new ASObject();
            //指令匹配
            switch (commandNumber)
            {
            case (int)TGG.Core.Enum.Command.PrisonCommand.CHECK:
            {
                aso = CHECK.getInstance().CommandStart(session, data);
                break;
            }

            case (int)TGG.Core.Enum.Command.PrisonCommand.MESSAGE_PAGE:
            {
                aso = MESSAGE_PAGE.GetInstance().CommandStart(session, data);
                break;
            }

            case (int)TGG.Core.Enum.Command.PrisonCommand.MOVING:
            {
                aso = MOVING.getInstance().CommandStart(session, data);
                break;
            }
            }
#if DEBUG
            sw.Stop();
            XTrace.WriteLine("指令 {1} 运行总耗时:{0} 毫秒", sw.ElapsedMilliseconds.ToString(), GetType().Namespace);
#endif
            return(aso);
        }
예제 #2
0
        /// <summary>指令处理</summary>
        public ASObject Switch(int moduleNumber, int commandNumber, TGGSession session, ASObject data)
        {
#if DEBUG
            var sw = Stopwatch.StartNew();
#endif
            if (!CommonHelper.IsOpen(session.Player.Role.Kind.role_level, (int)OpenModelType.美浓))
            {
                return(CommonHelper.ErrorResult(ResultType.BASE_PLAYER_LEVEL_ERROR));
            }

            var aso = new ASObject();

            //指令匹配
            switch (commandNumber)
            {
            case (int)SiegeCommand.ENTER: { aso = ENTER.GetInstance().CommandStart(session, data); break; }

            case (int)SiegeCommand.MAKE_LADDER: { aso = MAKE_LADDER.GetInstance().CommandStart(session, data); break; }

            case (int)SiegeCommand.ENTER_ENTRY_POINT: { aso = ENTER_ENTRY_POINT.GetInstance().CommandStart(session, data); break; }

            case (int)SiegeCommand.DEFEND: { aso = DEFEND.GetInstance().CommandStart(session, data); break; }

            case (int)SiegeCommand.ATTACK_BOSS: { aso = ATTACK_BOSS.GetInstance().CommandStart(session, data); break; }

            case (int)SiegeCommand.BROKEN_BASE: { aso = BROKEN_BASE.GetInstance().CommandStart(session, data); break; }

            case (int)SiegeCommand.EXIT: { aso = EXIT.GetInstance().CommandStart(session); break; }

            case (int)SiegeCommand.MOVING: { aso = MOVING.GetInstance().CommandStart(session, data); break; }

            case (int)SiegeCommand.ATTACK_GATE: { aso = ATTACK_GATE.GetInstance().CommandStart(session, data); break; }

            case (int)SiegeCommand.GO_BACK: { aso = GO_BACK.GetInstance().CommandStart(session, data); break; }

            default: break;
            }
#if DEBUG
            sw.Stop();
            XTrace.WriteLine("指令 {1} 运行总耗时:{0} 毫秒", sw.ElapsedMilliseconds.ToString(), GetType().Namespace);
#endif
            return(aso);
        }
예제 #3
0
        /// <summary>指令处理</summary>
        public ASObject Switch(int moduleNumber, int commandNumber, TGGSession session, ASObject data)
        {
#if DEBUG
            var sw = Stopwatch.StartNew();
#endif
            var aso = new ASObject();
            //指令匹配
            switch (commandNumber)
            {
            case (int)SceneCommand.LOGIN_ENTER_SCENE: { aso = LOGIN_ENTER_SCENE.GetInstance().CommandStart(session, data); break; }

            case (int)SceneCommand.MOVING: { aso = MOVING.GetInstance().CommandStart(session, data); break; }

            case (int)SceneCommand.ENTER_SCENE: { aso = ENTER_SCENE.GetInstance().CommandStart(session, data); break; }
            }
#if DEBUG
            sw.Stop();
            XTrace.WriteLine("指令 {1} 运行总耗时:{0} 毫秒", sw.ElapsedMilliseconds.ToString(), GetType().Namespace);
#endif
            return(aso);
        }
예제 #4
0
        /// <summary>指令处理</summary>
        public ASObject Switch(int moduleNumber, int commandNumber, TGGSession session, ASObject data)
        {
#if DEBUG
            var sw = Stopwatch.StartNew();
#endif
            if (!CommonHelper.IsOpen(session.Player.Role.Kind.role_level, (int)OpenModelType.一夜))
            {
                return(CommonHelper.ErrorResult(ResultType.BASE_PLAYER_LEVEL_ERROR));
            }
            var aso = new ASObject();
            //指令匹配
            switch (commandNumber)
            {
            case (int)BuildingCommand.ENTER:
            {
                aso = ENTER.GetInstance().CommandStart(session, data);
                break;
            }

            case (int)BuildingCommand.GET_WOOD:
            {
                aso = GET_WOOD.GetInstance().CommandStart(session, data);
                break;
            }

            case (int)BuildingCommand.TORCH:
            {
                aso = TORCH.GetInstance().CommandStart(session, data);
                break;
            }

            case (int)BuildingCommand.MAKE_BUILD:
            {
                aso = MAKE_BUILD.GetInstance().CommandStart(session, data);
                break;
            }

            case (int)BuildingCommand.BUILDING:
            {
                aso = BUILDING.GetInstance().CommandStart(session, data);
                break;
            }

            case (int)BuildingCommand.FIRE:
            {
                aso = FIRE.GetInstance().CommandStart(session, data);
                break;
            }

            case (int)BuildingCommand.EXIT:
            {
                aso = EXIT.GetInstance().CommandStart(session, data);
                break;
            }

            case (int)BuildingCommand.MOVING:
            {
                aso = MOVING.getInstance().CommandStart(session, data);
                break;
            }

            case (int)BuildingCommand.KILL_BOSS:
            {
                aso = KILL_BOSS.GetInstance().CommandStart(session, data);
                break;
            }

            case (int)BuildingCommand.BACK_POINT:
            {
                aso = BACK_POINT.GetInstance().CommandStart(session, data);
                break;
            }
            }
#if DEBUG
            sw.Stop();
            XTrace.WriteLine("指令 {1} 运行总耗时:{0} 毫秒", sw.ElapsedMilliseconds.ToString(), GetType().Namespace);
#endif
            return(aso);
        }