From ebd555129f81e46ec6f73eeeaa4f49e619723fc6 Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Wed, 21 Jul 2021 07:53:24 +0300 Subject: [PATCH] Change to `int`-only debug client ID --- osu.Desktop/Program.cs | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/osu.Desktop/Program.cs b/osu.Desktop/Program.cs index b17fe87538..0bcbc696bc 100644 --- a/osu.Desktop/Program.cs +++ b/osu.Desktop/Program.cs @@ -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));