コード例 #1
0
 private static void SteamUpdateRequest(ModUpdateInfo updateInfo, string modRootPath)
 {
     try
     {
         var mod = new Mod(modRootPath);
         SteamUtility.Init();
         Console.WriteLine(mod.ToString());
         Console.WriteLine($"Latest changenote: {updateInfo.LatestChangeNote}");
         if (SteamUtility.Upload(mod, updateInfo.LatestChangeNote))
         {
             Console.WriteLine("Upload done");
         }
     }
     catch (Exception e)
     {
         Console.WriteLine(e.Message);
     }
     finally
     {
         SteamUtility.Shutdown();
     }
 }
コード例 #2
0
        private static void SteamUpdateRequest(ReleaseSettings settings, ModUpdateInfo updateInfo, string releasePath, string workspacePath)
        {
            if (UserAccepts("Upload to Steam workshop now? (Y/N): "))
            {
                try
                {
                    var publishedIdPath    = releasePath + @"\About\PublishedFileId.txt";
                    var publishedIdPathTwo = workspacePath + @"\About\PublishedFileId.txt";
                    if (!File.Exists(publishedIdPath))
                    {
                        if (UserAccepts("\nPublishedFileId.txt not detected. Input workshop ID now? (Y / N): "))
                        {
                            Console.WriteLine("\nPlease enter the workshop ID OR Press ENTER to continue: ");
                            var newPublishedId = Console.ReadLine();
                            using (var sw = File.CreateText(publishedIdPath))
                            {
                                sw.WriteLine(newPublishedId);
                            }
                            using (var sw = File.CreateText(publishedIdPathTwo))
                            {
                                sw.WriteLine(newPublishedId);
                            }
                        }
                    }

                    var mod = new Mod(releasePath);
                    SteamUtility.Init();
                    Console.WriteLine(mod.ToString());
                    if (SteamUtility.Upload(mod, UpdateReport(updateInfo)))
                    {
                        Console.WriteLine("Upload done");
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.Message);
                }
            }