Пример #1
0
        private void AssetSuccess(object asset, object cookie)
        {
            byte[]  binaryContents = Service.Get <AssetManager>().GetBinaryContents(asset);
            JoeFile joe            = new JoeFile(binaryContents);

            this.ProcessJoe(joe, cookie);
        }
Пример #2
0
        public void ParseCatalog(JoeFile joe)
        {
            Sheet[] allSheets = joe.GetAllSheets();
            if (allSheets == null)
            {
                return;
            }
            int i   = 0;
            int num = allSheets.Length;

            while (i < num)
            {
                Sheet  sheet     = allSheets[i];
                string sheetName = sheet.SheetName;
                if (this.sheets.ContainsKey(sheetName))
                {
                    this.sheets[sheetName].PatchRows(sheet);
                }
                else
                {
                    this.sheets.Add(sheetName, sheet);
                }
                i++;
            }
        }
Пример #3
0
 private void ProcessPendingPatches()
 {
     if (this.pendingPatches.Count > 0 && this.pendingPatchesData.ContainsKey(this.pendingPatches[0]))
     {
         string  text = this.pendingPatches[0];
         JoeFile key  = this.pendingPatchesData[text].Key;
         Catalog.CatalogDelegate value = this.pendingPatchesData[text].Value;
         this.ProcessPendingPatch(text, key, value);
     }
 }
Пример #4
0
        private void ProcessJoe(JoeFile joe, object cookie)
        {
            KeyValuePair <string, Catalog.CatalogDelegate> keyValuePair = (KeyValuePair <string, Catalog.CatalogDelegate>)cookie;
            string key = keyValuePair.Key;

            Catalog.CatalogDelegate value = keyValuePair.Value;
            Service.AssetManager.Unload(this.assetHandles[key]);
            this.assetHandles.Remove(key);
            this.ProcessPendingPatch(key, joe, value);
        }
Пример #5
0
        private static void OnLangComplete(object asset, object cookie)
        {
            byte[] binaryContents = Service.Get <AssetManager>().GetBinaryContents(asset);
            if (binaryContents == null)
            {
                AlertScreen.ShowModal(true, null, Service.Get <Lang>().Get(LangUtils.DESYNC_BATCH_MAX_RETRY, new object[0]), null, null);
                return;
            }
            JoeFile joe  = new JoeFile(binaryContents);
            Lang    lang = Service.Get <Lang>();

            lang.AddStringData(joe);
        }
Пример #6
0
        private void ProcessJoe(JoeFile joe, object cookie)
        {
            KeyValuePair <string, Catalog.CatalogDelegate> keyValuePair = (KeyValuePair <string, Catalog.CatalogDelegate>)cookie;
            string text = keyValuePair.get_Key();

            Catalog.CatalogDelegate value = keyValuePair.get_Value();
            Service.Get <AssetManager>().Unload(this.assetHandles[text]);
            this.assetHandles.Remove(text);
            if (joe != null)
            {
                this.ParseCatalog(joe);
            }
            if (value != null)
            {
                text = text.Replace(".json.joe", ".json");
                value(joe != null, text);
            }
        }
Пример #7
0
 private void ProcessPendingPatch(string catalogFile, JoeFile joe, Catalog.CatalogDelegate completeCallback)
 {
     if (joe != null)
     {
         if (this.pendingPatches.Count > 0 && this.pendingPatches[0] != catalogFile)
         {
             this.pendingPatchesData[catalogFile] = new KeyValuePair <JoeFile, Catalog.CatalogDelegate>(joe, completeCallback);
             return;
         }
         this.ParseCatalog(joe);
     }
     this.pendingPatches.Remove(catalogFile);
     this.pendingPatchesData.Remove(catalogFile);
     if (completeCallback != null)
     {
         catalogFile = catalogFile.Replace(".json.joe", ".json");
         completeCallback(joe != null, catalogFile);
     }
     this.ProcessPendingPatches();
 }