Esempio n. 1
0
 public static void StopLogic()
 {
     LogicSystem.LogFromGfx("GameControler.StopLogic");
     s_LogicThread.Stop();
     LobbyNetworkSystem.Instance.QuitClient();
     NetworkSystem.Instance.QuitClient();
 }
Esempio n. 2
0
        public static void Init(string logPath, string dataPath)
        {
            s_IsInited = true;
            s_LogicLogger.Init(logPath);
            HomePath.CurHomePath             = dataPath;
            GlobalVariables.Instance.IsDebug = false;

            FileReaderProxy.MakeSureAllHandlerRegistered();

            LogSystem.OnOutput = (Log_Type type, string msg) =>
            {
                s_LogicLogger.Log("{0}", msg);
            };

            // GfxSystem
            GfxSystem.Init();
            GfxSystem.SetLogicInvoker(s_LogicThread);
            GfxSystem.SetLogicLogCallback((bool isError, string format, object[] args) =>
            {
                if (isError)
                {
                    LogSystem.Error(format, args);
                }
                else
                {
                    LogSystem.Info(format, args);
                }
            });

            LogicSystem.LogFromGfx("GameControler.Init");

            GfxSystem.SetGameLogicNotification(GameLogicNotification.Instance);
            GfxModule.Skill.GfxSkillSystem.Instance.Init();
        }
Esempio n. 3
0
        public static void Release()
        {
            LogicSystem.LogFromGfx("GameControler.Release");

            WorldSystem.Instance.Release();
            EntityManager.Instance.Release();
            NetworkSystem.Instance.Release();
            GfxSystem.Release();
            s_LogicLogger.Dispose();
        }
Esempio n. 4
0
        public static void InitLogic()
        {
            LogicSystem.LogFromGfx("GameControler.InitLogic");

            EntityManager.Instance.Init();
            WorldSystem.Instance.Init();

            ArkProfiler.Start("WorldSystem.Instance.LoadData");
            WorldSystem.Instance.LoadData();
            ArkProfiler.Stop("WorldSystem.Instance.LoadData");

            GfxModule.Impact.GfxImpactSystem.Instance.Init();

            ClientScriptSystem.Instance.Init();
            //GmCommands.ClientGmStorySystem.Instance.Init();

            PlayerControl.Instance.Init();
            LobbyNetworkSystem.Instance.Init(s_LogicThread);
            NetworkSystem.Instance.Init();
            AiViewManager.Instance.Init();
            SceneLogicViewManager.Instance.Init();
            ImpactViewManager.Instance.Init();
        }
Esempio n. 5
0
 private void TouchHandle(int what, GestureArgs e)
 {
     try
     {
         UserInfo playerself = WorldSystem.Instance.GetPlayerSelf();
         if (null == playerself || null == e)
         {
             return;
         }
         CharacterView view = EntityManager.Instance.GetUserViewById(playerself.GetId());
         if (null != playerself.SkillController &&
             playerself.SkillController.GetSkillControlMode() != SkillControlMode.kTouch)
         {
             return;
         }
         if ((int)TouchEvent.Cesture == what)
         {
             string ename = e.name;
             if (GestureEvent.OnSingleTap.ToString() == ename)
             {
                 if (EnableMoveInput)
                 {
                     if (WorldSystem.Instance.IsPureClientScene() || WorldSystem.Instance.IsPveScene())
                     {
                         if (e.selectedObjID < 0)
                         {
                             playerself.SkillController.AddBreakSkillTask();
                             if (InputType.Touch == e.inputType)
                             {
                                 FindPath(new Vector3(e.airWelGamePosX, e.airWelGamePosY, e.airWelGamePosZ));
                             }
                             else if (InputType.Joystick == e.inputType)
                             {
                                 UpdateMoveState(playerself, new Vector3(e.airWelGamePosX, e.airWelGamePosY, e.airWelGamePosZ), e.towards);
                             }
                             UpdateTowards(playerself, e.towards);
                         }
                         else
                         {
                             Combat(playerself, e.selectedObjID, e.attackRange);
                         }
                         m_lastSelectObjId = e.selectedObjID;
                         ///
                         // GfxSystem.PublishGfxEvent("Op_InputEffect", "Input", GestureEvent.OnSingleTap, e.airWelGamePosX, e.airWelGamePosY, e.airWelGamePosZ, e.selectedObjID < 0 ? false : true, true);
                     }
                     else if (WorldSystem.Instance.IsPvpScene() || WorldSystem.Instance.IsMultiPveScene())
                     {
                         if (e.selectedObjID < 0)
                         {
                             if (InputType.Touch == e.inputType)
                             {
                                 NetworkSystem.Instance.SyncPlayerMoveToPos(new Vector3(e.airWelGamePosX, e.airWelGamePosY, e.airWelGamePosZ));
                             }
                             else if (InputType.Joystick == e.inputType)
                             {
                                 UpdateMoveState(playerself, new Vector3(e.airWelGamePosX, e.airWelGamePosY, e.airWelGamePosZ), e.towards);
                                 playerself.SkillController.AddBreakSkillTask();
                             }
                         }
                         else
                         {
                             NetworkSystem.Instance.SyncPlayerMoveToAttack(e.selectedObjID, e.attackRange);
                         }
                     }
                 }
             }
             else if (GestureEvent.OnFingerMove.ToString() == ename)
             {
                 if (EnableMoveInput)
                 {
                     if (view.ObjectInfo.IsGfxMoveControl && !view.ObjectInfo.IsGfxRotateControl)
                     {
                         UpdateTowards(playerself, e.towards);
                     }
                 }
             }
             else if (GestureEvent.OnSkillStart.ToString() == ename)
             {
                 if (null != playerself)
                 {
                     UserAiStateInfo info = playerself.GetAiStateInfo();
                     if ((int)AiStateId.Move == info.CurState)
                     {
                         StopFindPath(playerself, info);
                     }
                 }
             }
             else if (GestureEvent.OnEasyGesture.ToString() == ename)
             {
                 Vector3 targetpos = new Vector3(e.startGamePosX, e.startGamePosY, e.startGamePosZ);
                 if (Vector3.Zero != targetpos)
                 {
                     PushSkill(playerself, targetpos, e.attackRange);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         LogicSystem.LogFromGfx("[Error]:Exception:{0}\n{1}", ex.Message, ex.StackTrace);
     }
 }
Esempio n. 6
0
 public static void StartLogic()
 {
     LogicSystem.LogFromGfx("GameControler.StartLogic");
     s_LogicThread.Start();
 }