Exemplo n.º 1
0
        public static UpdatePatchEntry ReadMultipleFiles()
        {
            UpdatePatchEntry pE = new UpdatePatchEntry();

            Thread t = new Thread(() =>
            {
                Console.WriteLine("Importing Files to be Uploaded...");
                string pExt           = NetworkObjectParameters.GamePatchExtension;
                string phExt          = NetworkObjectParameters.PatchHistoryExtension;
                OpenFileDialog dialog = new OpenFileDialog();
                dialog.Multiselect    = true;
                dialog.Filter         = $"Openbound Patching Files ({pExt}, {phExt})|*{pExt};*{phExt};";
                dialog.ShowDialog();

                foreach (string str in dialog.FileNames)
                {
                    if (str.Contains(pExt))
                    {
                        pE.PatchFiles.Add(str);
                    }
                    else
                    {
                        pE.PatchHistoryFile = str;
                    }
                }
            });

            t.SetApartmentState(ApartmentState.STA);
            t.Start();

            while (t.IsAlive)
            {
                Thread.Sleep(50);
            }

            return(pE);
        }
Exemplo n.º 2
0
        private void UploadGameUpdatePatchesToAllContainers_Click(object sender, EventArgs e)
        {
            Program.ShowConsole();
            Console.Clear();

            List <string> containerNames = GetCreatedContainerNames();

            UpdatePatchEntry pE = ReadMultipleFiles();

            foreach (string containerName in containerNames)
            {
                string filename = pE.PatchHistoryFile.Split('\\').Last();
                PipelineHelper.ExecuteShellCommand($"docker cp \"{pE.PatchHistoryFile}\" \"{containerName}:/{NetworkObjectParameters.FetchServerVersioningFolder}/{filename}\"");
                foreach (string patchPath in pE.PatchFiles)
                {
                    filename = patchPath.Split('\\').Last();
                    PipelineHelper.ExecuteShellCommand($"docker cp \"{pE.PatchHistoryFile}\" \"{containerName}:/{NetworkObjectParameters.FetchServerPatchesFolder}/{filename}\"");
                }
            }

            Console.WriteLine("Press any key to continue...");
            Console.ReadKey();
            Program.HideConsole();
        }