示例#1
0
文件: Program.cs 项目: yumiris/HCE
        public static void Main(string[] args)
        {
            var config = new LoaderConfiguration();
            var loader = new Loader(config);

            try
            {
                if (args.Length == 0)
                {
                    loader.Start(ExecutableFactory.Detect());
                    return;
                }

                /**
                 * The parameters are expected to be the HCE ones, e.g. `-window`, `-safemode`, etc.
                 * This effectively makes the SPV3 Loader a wrapper around the HCE executable.
                 */
                var parameters = new ParametersParser().Parse(string.Join(" ", args));

                /**
                 * This allows explicit declaration of the path which the HCE executable resides in.
                 * If the path isn't declared, then we implicitly attempt to detect the executable.
                 */
                var executable = args[0].Contains(Executable.Name)
                    ? new Executable(args[0])
                    : ExecutableFactory.Detect();

                loader.Start(executable, parameters);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
示例#2
0
        private static ClientConfiguration GetOrleansConfiguration(LoaderConfiguration config)
        {
            var orleansConfig = new ClientConfiguration()
            {
                DefaultTraceLevel = Severity.Info,
                TraceToConsole    = true,
                TraceFilePattern  = "none",
            };

            foreach (var silo in config.Orleans.Silos)
            {
                orleansConfig.Gateways.Add(new IPEndPoint(IPAddress.Parse(silo.Address), silo.Port));
            }

            return(orleansConfig);
        }
示例#3
0
        public static void Main(string[] args)
        {
            var config = new LoaderConfiguration();
            var loader = new Loader(config, new StatusOutput());

            try
            {
                Task.Run(() =>
                {
                    /**
                     * Implicitly detect the HCE executable and start it without any parameters.
                     */
                    if (args.Length == 0)
                    {
                        loader.Start(ExecutableFactory.Detect());
                        return;
                    }

                    /**
                     * The parameters are expected to be the HCE ones, e.g. `-window`, `-safemode`, etc.
                     * This effectively makes the SPV3 Loader a wrapper around the HCE executable.
                     */
                    var parameters = new ParametersParser().Parse(string.Join(" ", args));

                    /**
                     * This allows explicit declaration of the path which the HCE executable resides in.
                     * If the path isn't declared, then we implicitly attempt to detect the executable.
                     */
                    var executable = args[0].Contains(Executable.Name)
                        ? new Executable(args[0])
                        : ExecutableFactory.Detect();

                    loader.Start(executable, parameters);
                }).GetAwaiter().GetResult();
            }
            catch (SecurityException e)
            {
                Console.WriteLine(e.ToString());
                Environment.Exit(1);
            }
        }
示例#4
0
        public static IHeader Create(LoaderConfiguration configuration)
        {
            if (configuration.Header > 1)
            {
                return new HeaderParserMulti()
                       {
                           Configuration = configuration
                       }
            }
            ;
            else
            {
                return new HeaderParserSingle()
                       {
                           Configuration = configuration
                       }
            };

            throw new Exception("eee");
        }
    }