Ejemplo n.º 1
0
        public static int Main(string[] args)
        {
            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
            {
                BaseGame osu = new OsuGame(args);
                host.Add(osu);
                host.Run();
            }

            return(0);
        }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
 static int Main(string[] args)
 {
     using (DesktopGameHost host = Host.GetSuitableHost(@"FX2", true))
     {
         BaseGame osu = new FXGame(args);
         host.Add(osu);
         host.Run();
         return(0);
     }
 }
Ejemplo n.º 4
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 BeatmapImporter(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.Import(Path.GetFullPath(file)).Wait(3000))
                        {
                            throw new TimeoutException(@"IPC took too long to send");
                        }
                    }
                }
                else
                {
                    Ruleset.Register(new OsuRuleset());
                    Ruleset.Register(new TaikoRuleset());
                    Ruleset.Register(new ManiaRuleset());
                    Ruleset.Register(new CatchRuleset());

                    BaseGame osu = new OsuGameDesktop(args);
                    host.Add(osu);
                    host.Run();
                }
                return(0);
            }
        }