Exemplo n.º 1
0
        private bool HotloadPackage(PublishedFileId packageId)
        {
            try
            {
                Profiler.Info("Loading Package {0}", packageId);
                PackageManager.instance.LoadPackages(packageId);
                var package = PackageManager.GetPackage(packageId.ToString());

                if (package == null)
                {
                    return(false);
                }
                //Profiler.Dump( package );
                return(AssetLoader.instance.LoadCustomContent(package.FilterAssets(UserAssetType.CustomAssetMetaData).ToList()));
            }
            catch (Exception ex)
            {
                Profiler.Error("Error loading package " + packageId.ToString(), ex);
                return(false);
            }
        }
 public static void AddSubscription(PublishedFileId id)
 {
     try
     {
         lock (instance.threadLock)
         {
             if (!instance.SubscriptionCandidates.Contains(id))
             {
                 Profiler.Trace("Adding subscription {0}", id.ToString());
                 instance.SubscriptionCandidates.Add(id);
                 instance.WorkToDo = true;
             }
         }
     }
     catch (Exception ex)
     {
         Profiler.Error("SubscriptionManager.AddSubscription", ex);
     }
 }
Exemplo n.º 3
0
        private async Task DeleteWorkshopItem(PublishedFileId fileID)
        {
            var result = await SteamUGC.DeleteFileAsync(fileID);

            if (result)
            {
                // Delete preview files etc.
                foreach (string file in SteamRemoteStorage.Files)
                {
                    if (file.Contains(fileID.ToString()))
                    {
                        SteamRemoteStorage.FileDelete(file);
                    }
                }

                MessageBox.Show($"The workshop item with the id '{fileID}' was successfully deleted!", "Workshop Item Deleted", MessageBoxButtons.OK, MessageBoxIcon.Information);
                StartQuerry();
            }
            else
            {
                MessageBox.Show($"Can't delete workshop item with the id '{fileID}'!\n\nMaybe you don't own this file.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }