public static int Main(string[] args) { LegacyFilesystemReader.Register(); using (DesktopGameHost host = Host.GetSuitableHost(@"osu", true)) { if (!host.IsPrimaryInstance) { var importer = new BeatmapImporter(host); foreach (var file in args) { if (!importer.Import(file).Wait(1000)) { throw new TimeoutException(@"IPC took too long to send"); } } Console.WriteLine(@"Sent import requests to running instance"); } else { Ruleset.Register(new OsuRuleset()); Ruleset.Register(new TaikoRuleset()); Ruleset.Register(new ManiaRuleset()); Ruleset.Register(new CatchRuleset()); BaseGame osu = new OsuGame(args); host.Add(osu); host.Run(); } return(0); } }
public static int Main(string[] args) { LegacyFilesystemReader.Register(); // Back up the cwd before DesktopGameHost changes it var cwd = Environment.CurrentDirectory; using (DesktopGameHost host = Host.GetSuitableHost(@"osu", true)) { if (!host.IsPrimaryInstance) { var importer = new BeatmapIPCChannel(host); // Restore the cwd so relative paths given at the command line work correctly Directory.SetCurrentDirectory(cwd); foreach (var file in args) { Console.WriteLine(@"Importing {0}", file); if (!importer.ImportAsync(Path.GetFullPath(file)).Wait(3000)) { throw new TimeoutException(@"IPC took too long to send"); } } } else { host.Run(new OsuGameDesktop(args)); } return(0); } }
static void Main(string[] args) { LegacyFilesystemReader.Register(); OszArchiveReader.Register(); using (var host = Host.GetSuitableHost(@"osu", true)) { if (!host.IsPrimaryInstance) { Console.WriteLine("Not launching, there is already an instance of the osu host running"); return; } using (var appController = new AppController(args, host)) { var Application = SelectApplication(args); Application(args, host, appController.Dependencies); } } }