Exemplo n.º 1
0
 private static void triggerInstalled()
 {
     if (DedicatedUGC.installed != null)
     {
         DedicatedUGC.installed();
     }
 }
Exemplo n.º 2
0
 public static void installNextItem()
 {
     if (DedicatedUGC.installing.Count == 0)
     {
         DedicatedUGC.triggerInstalled();
     }
     else
     {
         CommandWindow.Log("Downloading workshop item: " + DedicatedUGC.installing[0]);
         if (!SteamGameServerUGC.DownloadItem((PublishedFileId_t)DedicatedUGC.installing[0], true))
         {
             DedicatedUGC.installing.RemoveAt(0);
             CommandWindow.Log("Unable to download item!");
             DedicatedUGC.installNextItem();
         }
     }
 }
Exemplo n.º 3
0
 private static void onItemDownloaded(DownloadItemResult_t callback)
 {
     if (DedicatedUGC.installing == null || DedicatedUGC.installing.Count == 0)
     {
         return;
     }
     if (!DedicatedUGC.installing.Remove(callback.m_nPublishedFileId.m_PublishedFileId))
     {
         return;
     }
     if (callback.m_eResult == 1)
     {
         CommandWindow.Log("Successfully downloaded workshop item: " + callback.m_nPublishedFileId.m_PublishedFileId);
         ulong  num;
         string text;
         uint   num2;
         if (SteamGameServerUGC.GetItemInstallInfo(callback.m_nPublishedFileId, ref num, ref text, 1024u, ref num2) && ReadWrite.folderExists(text, false))
         {
             if (WorkshopTool.checkMapMeta(text, false))
             {
                 DedicatedUGC.ugc.Add(new SteamContent(callback.m_nPublishedFileId, text, ESteamUGCType.MAP));
                 if (ReadWrite.folderExists(text + "/Bundles", false))
                 {
                     Assets.load(text + "/Bundles", false, false, EAssetOrigin.WORKSHOP);
                 }
             }
             else if (WorkshopTool.checkLocalizationMeta(text, false))
             {
                 DedicatedUGC.ugc.Add(new SteamContent(callback.m_nPublishedFileId, text, ESteamUGCType.LOCALIZATION));
             }
             else if (WorkshopTool.checkObjectMeta(text, false))
             {
                 DedicatedUGC.ugc.Add(new SteamContent(callback.m_nPublishedFileId, text, ESteamUGCType.OBJECT));
                 Assets.load(text, false, false, EAssetOrigin.WORKSHOP);
             }
             else if (WorkshopTool.checkItemMeta(text, false))
             {
                 DedicatedUGC.ugc.Add(new SteamContent(callback.m_nPublishedFileId, text, ESteamUGCType.ITEM));
                 Assets.load(text, false, false, EAssetOrigin.WORKSHOP);
             }
             else if (WorkshopTool.checkVehicleMeta(text, false))
             {
                 DedicatedUGC.ugc.Add(new SteamContent(callback.m_nPublishedFileId, text, ESteamUGCType.VEHICLE));
                 Assets.load(text, false, false, EAssetOrigin.WORKSHOP);
             }
             if (Directory.Exists(text + "/Translations"))
             {
                 Translator.registerTranslationDirectory(text + "/Translations");
             }
             if (Directory.Exists(text + "/Content"))
             {
                 Assets.searchForAndLoadContent(text + "/Content");
             }
         }
     }
     else
     {
         CommandWindow.Log("Failed downloading workshop item: " + callback.m_nPublishedFileId.m_PublishedFileId);
     }
     DedicatedUGC.installNextItem();
 }