示例#1
0
 private void ProcessArchiveExitStatus(int exitCode)
 {
     if (exitCode == -1)
     {
         workshopTextBox1.PrintNewLine();
         workshopTextBox1.PrintLine(string.Format("  Archive.exe failed."));
         if (!bDontDeleteTempFiles)
         {
             CConfig.DeleteDirectory(TempFolder);
         }
         workshopTextBox1.PrintPrompt();
     }
     else if (bIsExecutingCreateCommand)
     {
         if (!bDontDeleteTempFiles)
         {
             File.Delete(ArchiveCommands[archive_index].buildfilename);
         }
         archive_index++;
         if (archive_index < ArchiveCommands.Count)
         {
             RunArchiveForArchiveIndex();
         }
         else
         {
             workshopTextBox1.PrintNewLine();
             workshopTextBox1.PrintLine(string.Format("Creating new item on Steam Workshop..."));
             CSteamInterface.CreateItem(Game_AppId, ItemCreated);
         }
     }
     else
     {
         if (bIsExecutingUpdateCommand)
         {
             if (!bDontDeleteTempFiles)
             {
                 File.Delete(ArchiveCommands[archive_index].buildfilename);
             }
             archive_index++;
             if (archive_index < ArchiveCommands.Count)
             {
                 RunArchiveForArchiveIndex();
                 return;
             }
             workshopTextBox1.PrintNewLine();
             workshopTextBox1.PrintLine(string.Format("Updating item on Steam Workshop..."));
             if (CSteamInterface.UpdateItem(Game_AppId, updateItemFileId, false, TempFolder, CConfig.previewImageFilename, CConfig.title, CConfig.tags, CConfig.description, ItemUpdated))
             {
                 bIsUploadInProgress = true;
                 return;
             }
             workshopTextBox1.PrintLine(string.Format("  Steam update item failed: {0}", CSteamInterface.ErrorMessage));
             if (!bDontDeleteTempFiles)
             {
                 CConfig.DeleteDirectory(TempFolder);
             }
         }
         workshopTextBox1.PrintPrompt();
     }
 }
示例#2
0
 private void ItemCreated(EResult Result, bool bNeedsToAcceptWorkshopLegalAgreement, PublishedFileId_t NewItemCreated)
 {
     if (Result == EResult.k_EResultOK)
     {
         workshopTextBox1.PrintLine(string.Format("  Workshop item created.  Item Id = {0}", NewItemCreated.m_PublishedFileId));
         CConfig.UpdateWorkshopItemNumber(NewItemCreated.m_PublishedFileId);
         if (bNeedsToAcceptWorkshopLegalAgreement)
         {
             workshopTextBox1.PrintNewLine();
             workshopTextBox1.PrintLine("You will need to agree to the Steam Workshop Terms of Service agreement at:");
             workshopTextBox1.PrintNewLine();
             workshopTextBox1.PrintLine("http://steamcommunity.com/sharedfiles/workshoplegalagreement");
             workshopTextBox1.PrintNewLine();
             workshopTextBox1.PrintLine("...before this Workshop item can be updated or set to 'public' visibility.");
             workshopTextBox1.PrintLine("After agreeing to the Terms of Service agreement, you will need to use the 'update' command to update this Workshop item.");
             ProcessStartInfo startInfo = new ProcessStartInfo("explorer.exe", "http://steamcommunity.com/sharedfiles/workshoplegalagreement");
             Process.Start(startInfo);
             if (!bDontDeleteTempFiles)
             {
                 CConfig.DeleteDirectory(TempFolder);
             }
             workshopTextBox1.PrintPrompt();
             return;
         }
         if (CSteamInterface.UpdateItem(Game_AppId, NewItemCreated, true, TempFolder, CConfig.previewImageFilename, CConfig.title, CConfig.tags, CConfig.description, ItemUpdated))
         {
             bIsUploadInProgress = true;
             return;
         }
         workshopTextBox1.PrintLine(string.Format("  Steam update item failed: {0}", CSteamInterface.ErrorMessage));
         workshopTextBox1.PrintLine("  You should manually update the item again or delete the item from the Steam Workshop web page.");
         if (!bDontDeleteTempFiles)
         {
             CConfig.DeleteDirectory(TempFolder);
         }
     }
     else
     {
         workshopTextBox1.PrintLine(string.Format("  Steam error creating item: Error code = {0}", Result));
         if (!bDontDeleteTempFiles)
         {
             CConfig.DeleteDirectory(TempFolder);
         }
     }
     workshopTextBox1.PrintPrompt();
 }