override protected void _onProcess()
        {
            debug.Log(">>>>>>>>>>>>>>>onJoinWorldRes::" + msgData.dump());

            //Session.S_CACHING_MSG = true;

            //先将场景文件放进协程进行加载,再进行初始化
            SvrMapConfig svrMapConfig = GRClient.instance.g_gameConfM.getObject(OBJECT_NAME.CONF_SERVER_MAP) as SvrMapConfig;
            Variant      map_info     = SvrMapConfig.instance.getSingleMapConf(msgData["mpid"]._uint32);

            if (map_info == null)
            {
                //debug.Log("找不到地图id=" + msgData["mpid"]._uint32.ToString() + "的数据");
            }
            else
            {
                GAMEAPI.LoadAsset_Async(map_info["name"]._str + ".assetbundle", map_info["name"]._str);
                //debug.Log("map_info::" + map_info.dump());
            }

            //不处理,就有被release了的可能,所以要马上处理
            //Stopwatch a1 = new Stopwatch(); a1.Start();//开始计时
            PlayerModel.getInstance().init(msgData);
            //a1.Stop(); debug.Log("cost PlayerModel.getInstance().init time =" + a1.ElapsedMilliseconds);//终止计时

            //a1 = new Stopwatch(); a1.Start();//开始计时
            (session as ClientSession).g_mgr.dispatchEvent(GameEvent.Create(PKG_NAME.S2C_JOIN_WORLD_RES, this, msgData));
            //a1.Stop(); debug.Log("cost S2C_JOIN_WORLD_RES time =" + a1.ElapsedMilliseconds);//终止计时
            //a1 = null;
        }
Ejemplo n.º 2
0
        public void EnterStandalone()
        {
            this.g_mgr.g_sceneM.dispatchEvent(GameEvent.Createimmedi(2181u, this, null, false));
            SvrMapConfig svrMapConfig  = GRClient.instance.g_gameConfM.getObject("SvrMap") as SvrMapConfig;
            uint         num           = 3333u;
            Variant      singleMapConf = svrMapConfig.getSingleMapConf(num);
            Variant      variant       = new Variant();

            variant["conf"]     = singleMapConf;
            variant["mapid"]    = num;
            variant["tmpLinks"] = new Variant();
            base.dispatchEvent(GameEvent.Create(2161u, this, variant, false));
        }
Ejemplo n.º 3
0
        public void EnterStandalone()
        {
            this.g_mgr.g_sceneM.dispatchEvent(GameEvent.Createimmedi(GAME_EVENT.SCENE_CREATE_MAP, this, null));

            SvrMapConfig svrMapConfig = GRClient.instance.g_gameConfM.getObject(OBJECT_NAME.CONF_SERVER_MAP) as SvrMapConfig;

            uint    mapid = 3333;
            Variant conf  = svrMapConfig.getSingleMapConf(mapid);

            Variant einfo = new Variant();

            //einfo["localConf"] = localConf;
            einfo["conf"]     = conf;
            einfo["mapid"]    = mapid;
            einfo["tmpLinks"] = new Variant();

            //Variant einfo = refreshMapInfo();
            //this.dispatchEvent(GameEvent.Create(GAME_EVENT.MAP_INIT, this, einfo));

            this.dispatchEvent(GameEvent.Create(GAME_EVENT.MAP_INIT, this, einfo));
        }
Ejemplo n.º 4
0
 public SvrMapConfig(ClientConfig m) : base(m)
 {
     SvrMapConfig.instance = this;
 }