Change to `int`-only debug client ID

This commit is contained in:
Salman Ahmed 2021-07-21 07:53:24 +03:00
parent 37393a8432
commit ebd555129f
1 changed files with 16 additions and 5 deletions

View File

@ -24,12 +24,23 @@ public static int Main(string[] args)
var cwd = Environment.CurrentDirectory;
string gameName = @"osu";
bool tournamentClient = false;
if (DebugUtils.IsDebugBuild)
foreach (var arg in args.Select(s => s.Split('=')))
{
var customNameArg = args.SingleOrDefault(s => s.StartsWith(@"--name=", StringComparison.Ordinal));
if (customNameArg != null)
gameName = customNameArg.Replace(@"--name=", string.Empty);
switch (arg[0])
{
case "--tournament":
tournamentClient = true;
break;
case "--debug-client-id":
if (!DebugUtils.IsDebugBuild)
break;
gameName = $"{gameName}-{int.Parse(arg[1])}";
break;
}
}
using (DesktopGameHost host = Host.GetSuitableHost(gameName, true))
@ -57,7 +68,7 @@ public static int Main(string[] args)
return 0;
}
if (args.Contains("--tournament"))
if (tournamentClient)
host.Run(new TournamentGame());
else
host.Run(new OsuGameDesktop(args));