예제 #1
0
        private void HandleStartGameResult(int id, JsonData msg)
        {
            int    sceneType = msg.GetInt("m_SceneType");
            uint   key       = msg.GetUint("m_Key");
            string ip        = msg.GetString("m_ServerIp");
            int    port      = msg.GetInt("m_ServerPort");
            int    heroId    = msg.GetInt("m_HeroId");
            int    campId    = msg.GetInt("m_CampId");
            int    weaponId  = msg.GetInt("m_WeaponId");
            int    sceneId   = msg.GetInt("m_SceneType");

            Data_SceneConfig cfg = SceneConfigProvider.Instance.GetSceneConfigById(sceneType);

            if (null == cfg || cfg.m_Type == (int)SceneTypeEnum.TYPE_PVE)
            {
                NetworkSystem.Instance.HeroId  = heroId;
                NetworkSystem.Instance.CampId  = campId;
                NetworkSystem.Instance.SceneId = sceneId;
            }
            else
            {
                NetworkSystem.Instance.Start(key, ip, port, heroId, campId, sceneId);
            }
            GameControler.ChangeScene((int)msg["m_SceneType"]);

            GfxSystem.GfxLog("HandleStartGameResult");
        }
예제 #2
0
        private void HandleStartGameResult(JsonMessage msg)
        {
            LCJsonMsgStartGameResult lcMsg = msg as LCJsonMsgStartGameResult;

            if (lcMsg != null)
            {
                GfxSystem.GfxLog("!!!!! Start Game Args:{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}",
                                 lcMsg.m_Guid, lcMsg.m_ServerIp, lcMsg.m_ServerPort, lcMsg.m_Key, lcMsg.m_CampId, lcMsg.m_HeroId, lcMsg.m_WeaponId, lcMsg.m_SceneType);

                GfxSystem.LoadScene("Test");
                NetWorkSystem.Instance.Start(lcMsg.m_Key, lcMsg.m_ServerIp, (int)lcMsg.m_ServerPort, lcMsg.m_HeroId, lcMsg.m_CampId);
                GameControler.ChangeScene(lcMsg.m_SceneType);
            }
        }