Example #1
0
 public static void Main()
 {
     //Estas tres lineas crean la ventana base del proyecto (en el lenguaje del framework, un "juego"), y crean una ventana para el
     using DesktopGameHost host = Host.GetSuitableHost(@"GamesToGo");
     using Game program         = new GamesToGoEditor();
     host.Run(program);
 }
Example #2
0
 public static int Main(string[] args)
 {
     using (DesktopGameHost host = Host.GetSuitableDesktopHost(@"osu", new() { BindIPC = true })) {
         host.Run(new OsuTestBrowser());
         return(0);
     }
 }
Example #3
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);
            }
        }
Example #4
0
        public static void Main()
        {
            Game            app  = new GDEApp();
            DesktopGameHost host = Host.GetSuitableHost("GDE");

            host.Run(app);
        }
Example #5
0
        public static void Main(string[] args)
        {
            string cwd = CurrentDirectory;

            using (DesktopGameHost host = Host.GetSuitableHost("Rhythmic", true))
            {
                host.ExceptionThrown += handleException;

                if (!host.IsPrimaryInstance)
                {
                    ArchiveImportIPCChannel importer = new ArchiveImportIPCChannel(host);
                    // Restore the cwd so relative paths given at the command line work correctly
                    Directory.SetCurrentDirectory(cwd);
                    foreach (string 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
                {
                    switch (args.FirstOrDefault() ?? string.Empty)
                    {
                    default:
                        host.Run(new RhythmicGameDesktop(args));
                        break;
                    }
                }
            }
        }
Example #6
0
        public StableStorage(string path, DesktopGameHost host)
            : base(path, host)
        {
            this.host = host;

            songsPath = new Lazy <string>(locateSongsDirectory);
        }
Example #7
0
 public static void Main()
 {
     using (DesktopGameHost host = Host.GetSuitableHost(@"GDE Tests", true))
     {
         host.Run(new GDETestBrowser());
     }
 }
Example #8
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);
        }
Example #9
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);
            }
        }
Example #10
0
 static void Main()
 {
     using (DesktopGameHost host = Host.GetSuitableHost(@"Tester", true))
     {
         host.Run(new TestGame());
     }
 }
Example #11
0
 public static int Main(string[] args)
 {
     using (DesktopGameHost host = Host.GetSuitableHost(@"karaoke-visual-test-runner", true))
     {
         host.Run(new OsuTestBrowser());
         return(0);
     }
 }
 public static int Main(string[] args)
 {
     using (DesktopGameHost host = Host.GetSuitableHost(@"osu", true))
     {
         host.Run(new TournamentTestBrowser());
         return(0);
     }
 }
Example #13
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);
     }
 }
Example #14
0
        public static void Main(string[] args)
        {
            var cwd = Environment.CurrentDirectory;

            using (DesktopGameHost host = Host.GetSuitableHost("Touhou Online"))
            {
                if (host.IsPrimaryInstance)
                {
                    host.Run(new TouhouOnlineGame(args));
                    //test branch2
                }
            }
        }
Example #15
0
        public static void Main(params string[] args)
        {
            string server;

            if ((server = args.FirstOrDefault(a => a.StartsWith(@"--server="))) != null)
            {
                APIController.AlternativeServer = server.Substring(server.IndexOf('=') + 1);
            }
            //Estas tres lineas crean la ventana base del proyecto (en el lenguaje del framework, un "juego"), y crean una ventana para el
            using DesktopGameHost host = Host.GetSuitableHost(@"GamesToGo");
            using Game program         = new GamesToGoEditor();
            host.Run(program);
        }
Example #16
0
        public static int Main(string[] args)
        {
            // Back up the cwd before DesktopGameHost changes it
            var  cwd    = Environment.CurrentDirectory;
            bool useSdl = args.Contains("--sdl");

            using (DesktopGameHost host = Host.GetSuitableHost(@"osu", true, useSdl: useSdl))
            {
                host.ExceptionThrown += handleException;

                if (!host.IsPrimaryInstance)
                {
                    if (args.Length > 0 && args[0].Contains('.')) // easy way to check for a file import in args
                    {
                        var importer = new ArchiveImportIPCChannel(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");
                            }
                        }

                        return(0);
                    }

                    // we want to allow multiple instances to be started when in debug.
                    if (!DebugUtils.IsDebugBuild)
                    {
                        return(0);
                    }
                }

                switch (args.FirstOrDefault() ?? string.Empty)
                {
                default:
                    host.Run(new OsuGameDesktop(args));
                    break;

                case "--tournament":
                    host.Run(new TournamentGame());
                    break;
                }

                return(0);
            }
        }
Example #17
0
        public static void Main(string[] args)
        {
            foreach (string arg in args)
            {
                ParseFlags(arg);
            }

            using (DesktopGameHost host = Host.GetSuitableHost(@"Circles!Galore"))
            {
                host.ExceptionThrown += handleException;

                host.Run(new CirclesGame());
            }
        }
Example #18
0
        private void load(LargeTextureStore store, GameHost host)
        {
            Texture folderButton = store.Get("Folder Button");

            Size = folderButton.Size / 2;
            AddInternal(new Sprite
            {
                Texture = folderButton,
                Anchor  = Anchor.CentreRight,
                Origin  = Anchor.CentreRight,
                Margin  = new MarginPadding(10),
                Size    = folderButton.Size / 2
            });
            desktopHost = (DesktopGameHost)host;
        }
Example #19
0
        public static int Main(string[] args)
        {
            // required to initialise native SQLite libraries on some platforms.

            if (!RuntimeInfo.IsMono)
            {
                useMulticoreJit();
            }

            // 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 ArchiveImportIPCChannel(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
                {
                    switch (args.FirstOrDefault() ?? string.Empty)
                    {
                    case "--tests":
                        host.Run(new OsuTestBrowser());
                        break;

                    default:
                        host.Run(new OsuGameDesktop(args));
                        break;
                    }
                }

                return(0);
            }
        }
Example #20
0
        public static int Main(string[] args)
        {
            // Back up the cwd before DesktopGameHost changes it
            var cwd = Environment.CurrentDirectory;

            using (DesktopGameHost host = Host.GetSuitableHost(@"osu", true))
            {
                host.ExceptionThrown += handleException;

                if (!host.IsPrimaryInstance)
                {
                    var importer = new ArchiveImportIPCChannel(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
                {
                    switch (args.FirstOrDefault() ?? string.Empty)
                    {
                    default:
                        host.Run(new OsuGameDesktop(args));
                        break;

                    case "--tournament":
                        host.Run(new TournamentGame());
                        break;
                    }
                }

                return(0);
            }
        }
Example #21
0
 public SeeSharpStorage(string baseName, DesktopGameHost host) : base(baseName, host)
 {
     BaseName = @"SeeSharp";
 }
Example #22
0
 public StableStorage(DesktopGameHost host)
     : base(string.Empty, host)
 {
 }
 public WindowsStorage(string baseName, DesktopGameHost host)
     : base(baseName, host)
 {
     // allows traversal of long directory/filenames beyond the standard limitations (see https://stackoverflow.com/a/5188559)
     BasePath = Regex.Replace(BasePath, @"^([a-zA-Z]):\\", @"\\?\$1:\");
 }
Example #24
0
        public static void Main(string[] args)
        {
            // Back up the cwd before DesktopGameHost changes it
            string cwd = Environment.CurrentDirectory;

            string gameName         = base_game_name;
            bool   tournamentClient = false;

            foreach (string arg in args)
            {
                string[] split = arg.Split('=');

                string key = split[0];
                string val = split.Length > 1 ? split[1] : string.Empty;

                switch (key)
                {
                case "--tournament":
                    tournamentClient = true;
                    break;

                case "--debug-client-id":
                    if (!DebugUtils.IsDebugBuild)
                    {
                        throw new InvalidOperationException("Cannot use this argument in a non-debug build.");
                    }

                    if (!int.TryParse(val, out int clientID))
                    {
                        throw new ArgumentException("Provided client ID must be an integer.");
                    }

                    gameName = $"{base_game_name}-{clientID}";
                    break;
                }
            }

            using (DesktopGameHost host = Host.GetSuitableDesktopHost(gameName, new HostOptions {
                BindIPC = true
            }))
            {
                host.ExceptionThrown += handleException;

                if (!host.IsPrimaryInstance)
                {
                    if (args.Length > 0 && args[0].Contains('.')) // easy way to check for a file import in args
                    {
                        var importer = new ArchiveImportIPCChannel(host);

                        foreach (string file in args)
                        {
                            Console.WriteLine(@"Importing {0}", file);
                            if (!importer.ImportAsync(Path.GetFullPath(file, cwd)).Wait(3000))
                            {
                                throw new TimeoutException(@"IPC took too long to send");
                            }
                        }

                        return;
                    }

                    // we want to allow multiple instances to be started when in debug.
                    if (!DebugUtils.IsDebugBuild)
                    {
                        Logger.Log(@"osu! does not support multiple running instances.", LoggingTarget.Runtime, LogLevel.Error);
                        return;
                    }
                }

                if (host.IsPrimaryInstance)
                {
                    try
                    {
                        Logger.Log("Starting legacy IPC provider...");
                        legacyIpc = new LegacyTcpIpcProvider();
                        legacyIpc.Bind();
                    }
                    catch (Exception ex)
                    {
                        Logger.Error(ex, "Failed to start legacy IPC provider");
                    }
                }

                if (tournamentClient)
                {
                    host.Run(new TournamentGame());
                }
                else
                {
                    host.Run(new OsuGameDesktop(args));
                }
            }
        }
Example #25
0
 public DesktopStorage(string path, DesktopGameHost host)
     : base(path, host)
 {
 }
Example #26
0
 public static void Main()
 {
     using (DesktopGameHost host = Host.GetSuitableHost(@"Rhythmic", true))
         host.Run(new RhythmicTestBrowser());
 }
Example #27
0
        public static int Main(string[] args)
        {
            // Back up the cwd before DesktopGameHost changes it
            var cwd = Environment.CurrentDirectory;

            string gameName         = base_game_name;
            bool   tournamentClient = false;

            foreach (var arg in args)
            {
                var split = arg.Split('=');

                var key = split[0];
                var val = split.Length > 1 ? split[1] : string.Empty;

                switch (key)
                {
                case "--tournament":
                    tournamentClient = true;
                    break;

                case "--debug-client-id":
                    if (!DebugUtils.IsDebugBuild)
                    {
                        throw new InvalidOperationException("Cannot use this argument in a non-debug build.");
                    }

                    if (!int.TryParse(val, out int clientID))
                    {
                        throw new ArgumentException("Provided client ID must be an integer.");
                    }

                    gameName = $"{base_game_name}-{clientID}";
                    break;
                }
            }

            using (DesktopGameHost host = Host.GetSuitableHost(gameName, true))
            {
                host.ExceptionThrown += handleException;

                if (!host.IsPrimaryInstance)
                {
                    if (args.Length > 0 && args[0].Contains('.')) // easy way to check for a file import in args
                    {
                        var importer = new ArchiveImportIPCChannel(host);

                        foreach (var file in args)
                        {
                            Console.WriteLine(@"Importing {0}", file);
                            if (!importer.ImportAsync(Path.GetFullPath(file, cwd)).Wait(3000))
                            {
                                throw new TimeoutException(@"IPC took too long to send");
                            }
                        }

                        return(0);
                    }

                    // we want to allow multiple instances to be started when in debug.
                    if (!DebugUtils.IsDebugBuild)
                    {
                        return(0);
                    }
                }

                if (tournamentClient)
                {
                    host.Run(new TournamentGame());
                }
                else
                {
                    host.Run(new OsuGameDesktop(args));
                }

                return(0);
            }
        }
Example #28
0
 public LinuxStorage(string baseName, DesktopGameHost host)
     : base(baseName, host)
 {
 }
Example #29
0
 public WindowsStorage(string baseName, DesktopGameHost host)
     : base(baseName, host)
 {
 }
 public MacOSStorage(string baseName, DesktopGameHost host)
     : base(baseName, host)
 {
 }