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

View File

@ -24,12 +24,23 @@ namespace osu.Desktop
var cwd = Environment.CurrentDirectory; var cwd = Environment.CurrentDirectory;
string gameName = @"osu"; 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)); switch (arg[0])
if (customNameArg != null) {
gameName = customNameArg.Replace(@"--name=", string.Empty); 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)) using (DesktopGameHost host = Host.GetSuitableHost(gameName, true))
@ -57,7 +68,7 @@ namespace osu.Desktop
return 0; return 0;
} }
if (args.Contains("--tournament")) if (tournamentClient)
host.Run(new TournamentGame()); host.Run(new TournamentGame());
else else
host.Run(new OsuGameDesktop(args)); host.Run(new OsuGameDesktop(args));