Added a wait for process

This commit is contained in:
Alex D. 2018-03-07 21:43:28 +01:00
parent a1d102ef40
commit d851e34daf
3 changed files with 8 additions and 10 deletions

View File

@ -1,7 +1,5 @@
# USL <p align=center><img src="https://s14.postimg.org/x2qqyft69/banner.png"><br>
![Main Banner](https://s14.postimg.org/x2qqyft69/banner.png) <img src="https://travis-ci.org/casKd-dev/USL.svg?style=flat-square&branch=release"> <img src="https://img.shields.io/badge/License-MIT-yellow.svg"></p>
[![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# . A Gameserver launcher written in C# .
This project aims to help people not as experienced with Unturned or computers in general. This project aims to help people not as experienced with Unturned or computers in general.

View File

@ -163,8 +163,8 @@ namespace UnturnedSL
"If you still get the problem, report it on GitHub!"); "If you still get the problem, report it on GitHub!");
DisplayText(name, map, welcome, data, port, extralo, path); DisplayText(name, map, welcome, data, port, extralo, path);
Console.Beep(2300, 250); Console.Beep(2300, 250);
Console.WriteLine(Environment.NewLine + "Press any key to exit...");
Console.ReadKey(); Console.ReadKey();
Environment.Exit(1);
} }
else else
{ {
@ -172,10 +172,10 @@ namespace UnturnedSL
Console.WriteLine("Welcome!" + Environment.NewLine); Console.WriteLine("Welcome!" + Environment.NewLine);
DisplayText(name, map, welcome, data, port, extralo, path); DisplayText(name, map, welcome, data, port, extralo, path);
string launchop = "-nographics -batchmode -name " + "\"" + name + "\"" + " -map " + map + " -welcome " + "\"" + welcome + "\"" + " -port:" + port + " " + extralo + " +secureserver/" + data; string launchop = "-nographics -batchmode -name " + "\"" + name + "\"" + " -map " + map + " -welcome " + "\"" + welcome + "\"" + " -port:" + port + " " + extralo + " +secureserver/" + data;
Process.Start(path + @"\Unturned.exe ", launchop); var proc = Process.Start(path + @"\Unturned.exe ", launchop);
Console.ReadKey(); proc.WaitForExit(600000);
Environment.Exit(0);
} }
Environment.Exit(0);
} }
static void MkDirIfNotExist(string name) static void MkDirIfNotExist(string name)

View File

@ -38,7 +38,7 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<RunCodeAnalysis>true</RunCodeAnalysis> <RunCodeAnalysis>false</RunCodeAnalysis>
<CodeAnalysisIgnoreGeneratedCode>false</CodeAnalysisIgnoreGeneratedCode> <CodeAnalysisIgnoreGeneratedCode>false</CodeAnalysisIgnoreGeneratedCode>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">