Inheritance: Model.Component
Exemplo n.º 1
0
        private void StartProcess(int appId)
        {
            OptionComponent      optionComponent      = Game.Scene.GetComponent <OptionComponent>();
            StartConfigComponent startConfigComponent = Game.Scene.GetComponent <StartConfigComponent>();
            string      configFile  = optionComponent.Options.Config;
            StartConfig startConfig = startConfigComponent.Get(appId);

#if __MonoCS__
            const string exe       = @"mono";
            string       arguments = $"--debug App.exe --appId={startConfig.AppId} --appType={startConfig.AppType} --config={configFile}";
#else
            const string exe       = @"App.exe";
            string       arguments = $"--appId={startConfig.AppId} --appType={startConfig.AppType} --config={configFile}";
#endif

            Log.Info($"{exe} {arguments}");
            try
            {
                ProcessStartInfo info = new ProcessStartInfo {
                    FileName = exe, Arguments = arguments, CreateNoWindow = true, UseShellExecute = true
                };

                Process process = Process.Start(info);
                this.processes.Add(startConfig.AppId, process);
            }
            catch (Exception e)
            {
                Log.Error(e.ToString());
            }
        }
Exemplo n.º 2
0
        public void Awake()
        {
            StartConfigComponent startConfigComponent = Game.Scene.GetComponent <StartConfigComponent>();

            this.AppId = startConfigComponent.StartConfig.AppId;

            StartConfig startConfig = startConfigComponent.LocationConfig;

            this.LocationAddress = startConfig.GetComponent <InnerConfig>().IPEndPoint;
        }