Exemplo n.º 1
0
 private void OnCommandComplete(GetContentResponse response, object cookie)
 {
     this.response = response;
     this.options  = new ContentManagerOptions();
     if (response.CdnRoots.Count > 0 && !string.IsNullOrEmpty(response.CdnRoots[0]) && !string.IsNullOrEmpty(response.ManifestVersion) && !string.IsNullOrEmpty(response.ManifestPath))
     {
         this.options.ManifestVersion = int.Parse(response.ManifestVersion);
         this.options.ManifestPath    = response.ManifestPath;
         this.options.ContentBaseUrl  = response.CdnRoots[0];
         this.options.Env             = response.Environment;
         ContentManagerMode mode = ContentManagerMode.Remote;
         this.options.Mode = mode;
         this.LoadContentManager();
         Service.CurrentPlayer.Patches = response.Patches;
         return;
     }
     Service.Logger.Error("Content is not initialized");
     AlertScreen.ShowModalWithBI(true, null, "The server was unable to deliver content initialization data. Please try again soon.", "Connection error!");
 }
Exemplo n.º 2
0
        public void Load(ManagerLoadDelegate onSuccess, ManagerLoadDelegate onFailure, WebManager webManager)
        {
            this.onSuccess = onSuccess;
            this.onFailure = onFailure;
            IManifestLoader    manifestLoader = null;
            ContentManagerMode mode           = this.Options.Mode;

            if (mode != ContentManagerMode.Remote)
            {
                if (mode == ContentManagerMode.Local)
                {
                    manifestLoader = new LocalManifestLoader();
                }
            }
            else
            {
                manifestLoader = new RemoteManifestLoader(webManager);
            }
            manifestLoader.Load(this.Options, new ManifestLoadDelegate(this.OnManifestSuccess), new ManifestLoadDelegate(this.OnManifestFailure));
        }