Exemplo n.º 1
0
        public override void OnSuccess(WWWResult www)
        {
            WebAPI.JSON_BodyResponse <FlowNode_CheckVersion.Json_VersionInfo> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_CheckVersion.Json_VersionInfo> >(www.text);
            DebugUtility.Assert(jsonObject != null, "res == null");
            if (Network.IsError)
            {
                if (Network.ErrCode == Network.EErrCode.NoVersion)
                {
                    this.ActivateOutputLinks(13);
                    Network.RemoveAPI();
                    ((Behaviour)this).set_enabled(false);
                }
                else
                {
                    this.OnRetry();
                }
            }
            else if (jsonObject.body == null || jsonObject.body.host_ap == null)
            {
                this.OnRetry();
            }
            else
            {
                Network.SetHost(jsonObject.body.host_ap);
                Network.SetDLHost(jsonObject.body.host_dl);
                Network.SetSiteHost(jsonObject.body.host_site);
                Network.SetNewsHost(jsonObject.body.host_news);
                Network.RemoveAPI();
                if (jsonObject.body.tz != int.MaxValue)
                {
                    TimeManager.UTC2LOCAL = (long)jsonObject.body.tz;
                }
                if (!string.IsNullOrEmpty(jsonObject.body.assets))
                {
                    string assets = jsonObject.body.assets;
                    Network.AssetVersion         = assets;
                    AssetDownloader.DownloadURL  = jsonObject.body.host_dl + "/assets/" + assets + "/";
                    AssetDownloader.StreamingURL = jsonObject.body.host_dl + "/";
                }
                this.checkNewsDisplay(jsonObject);
                MonoSingleton <GameManager> .Instance.InitAlterHash(jsonObject.body.digest);

                this.ActivateOutputLinks(10);
                ((Behaviour)this).set_enabled(false);
            }
        }