From d851e34daf579f6a345a0a847244a0c5ad0aa71f Mon Sep 17 00:00:00 2001 From: caskd Date: Wed, 7 Mar 2018 21:43:28 +0100 Subject: [PATCH] Added a wait for process --- README.md | 6 ++---- UnturnedSL/Program.cs | 10 +++++----- UnturnedSL/UnturnedSL.csproj | 2 +- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 349994b..552f1bc 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ -# USL -![Main Banner](https://s14.postimg.org/x2qqyft69/banner.png) - -[![TravisCI build](https://travis-ci.org/casKd-dev/USL.svg?branch=dev)](https://travis-ci.org/casKd-dev/USL/builds/) +


+

A Gameserver launcher written in C# . This project aims to help people not as experienced with Unturned or computers in general. diff --git a/UnturnedSL/Program.cs b/UnturnedSL/Program.cs index 6463c11..bf3e497 100644 --- a/UnturnedSL/Program.cs +++ b/UnturnedSL/Program.cs @@ -29,7 +29,7 @@ namespace UnturnedSL Run(valid, name, map, welcome, port, data, extralo, path); } - static void Validation(string name, string map, string welcome, string port, string data, string extralo, string path,out bool valid) + static void Validation(string name, string map, string welcome, string port, string data, string extralo, string path, out bool valid) /*Validate if all input is correct*/ { /*Checks if every condition is true*/ @@ -163,8 +163,8 @@ namespace UnturnedSL "If you still get the problem, report it on GitHub!"); DisplayText(name, map, welcome, data, port, extralo, path); Console.Beep(2300, 250); + Console.WriteLine(Environment.NewLine + "Press any key to exit..."); Console.ReadKey(); - Environment.Exit(1); } else { @@ -172,10 +172,10 @@ namespace UnturnedSL Console.WriteLine("Welcome!" + Environment.NewLine); DisplayText(name, map, welcome, data, port, extralo, path); string launchop = "-nographics -batchmode -name " + "\"" + name + "\"" + " -map " + map + " -welcome " + "\"" + welcome + "\"" + " -port:" + port + " " + extralo + " +secureserver/" + data; - Process.Start(path + @"\Unturned.exe ", launchop); - Console.ReadKey(); - Environment.Exit(0); + var proc = Process.Start(path + @"\Unturned.exe ", launchop); + proc.WaitForExit(600000); } + Environment.Exit(0); } static void MkDirIfNotExist(string name) diff --git a/UnturnedSL/UnturnedSL.csproj b/UnturnedSL/UnturnedSL.csproj index 9f08089..6b7abc4 100644 --- a/UnturnedSL/UnturnedSL.csproj +++ b/UnturnedSL/UnturnedSL.csproj @@ -38,7 +38,7 @@ prompt 4 MinimumRecommendedRules.ruleset - true + false false