public virtual GgpDebugQueryTarget Create() { // Factory creation for the YetiGameletDebugger entry point. var taskContext = _serviceManager.GetJoinableTaskContext(); taskContext.ThrowIfNotOnMainThread(); var fileSystem = new FileSystem(); var jsonUtil = new JsonUtil(); var sdkConfigFactory = new SdkConfig.Factory(jsonUtil); var yetiVsiService = (YetiVSIService)_serviceManager.GetGlobalService(typeof(YetiVSIService)); var options = yetiVsiService.Options; var accountOptionLoader = new VsiAccountOptionLoader(options); var credentialConfigFactory = new CredentialConfig.Factory(jsonUtil); var credentialManager = new CredentialManager(credentialConfigFactory, accountOptionLoader); var cloudConnection = new CloudConnection(); // NOTE: this CloudRunner is re-used for all subsequent debug sessions. var cloudRunner = new CloudRunner(sdkConfigFactory, credentialManager, cloudConnection, new GgpSDKUtil()); var applicationClientFactory = GetApplicationClientFactory(); var gameletClientFactory = GetGameletClientFactory(); var testAccountClientFactory = GetTestAccountClientFactory(); var managedProcessFactory = new ManagedProcess.Factory(); var remoteCommand = GetRemoteCommand(managedProcessFactory); var remoteFile = new RemoteFile(managedProcessFactory); var remoteDeploy = new RemoteDeploy(remoteCommand, remoteFile, managedProcessFactory, fileSystem); var metrics = _serviceManager.GetGlobalService(typeof(SMetrics)) as IMetrics; var sdkVersion = GetSdkVersion(); var sshManager = GetSshManager(managedProcessFactory, cloudRunner); var launchParamsConverter = new LaunchGameParamsConverter(sdkConfigFactory, new QueryParametersParser()); var debugSessionMetrics = new DebugSessionMetrics(metrics); var actionRecorder = new ActionRecorder(debugSessionMetrics); var gameLaunchManager = new GameLaunchBeHelper(gameletClientFactory.Create(cloudRunner), launchParamsConverter); var vsiLaunchFactory = new VsiGameLaunchFactory( gameletClientFactory.Create(cloudRunner), GetCancelableTaskFactory(), gameLaunchManager, actionRecorder, _dialogUtil); var gameLauncher = new GameLauncher(gameletClientFactory.Create(cloudRunner), yetiVsiService, launchParamsConverter, GetCancelableTaskFactory(), actionRecorder, _dialogUtil, vsiLaunchFactory); var gameletSelectorFactory = new GameletSelectorFactory( _dialogUtil, cloudRunner, GetGameletSelectorWindowFactory(), GetCancelableTaskFactory(), gameletClientFactory, sshManager, remoteCommand, gameLaunchManager, taskContext); var serializer = new JsonUtil(); var launchCommandFormatter = new ChromeClientLaunchCommandFormatter(serializer); var paramsFactory = new DebugEngine.DebugEngine.Params.Factory(serializer); return(new GgpDebugQueryTarget(fileSystem, sdkConfigFactory, gameletClientFactory, applicationClientFactory, GetCancelableTaskFactory(), _dialogUtil, remoteDeploy, debugSessionMetrics, credentialManager, testAccountClientFactory, gameletSelectorFactory, cloudRunner, sdkVersion, launchCommandFormatter, paramsFactory, yetiVsiService, gameLauncher)); }
// Constructor for tests. public GgpDebugQueryTarget(IFileSystem fileSystem, SdkConfig.Factory sdkConfigFactory, IGameletClientFactory gameletClientFactory, IApplicationClientFactory applicationClientFactory, CancelableTask.Factory cancelableTaskFactory, IDialogUtil dialogUtil, IRemoteDeploy remoteDeploy, DebugSessionMetrics metrics, ICredentialManager credentialManager, ITestAccountClientFactory testAccountClientFactory, IGameletSelectorFactory gameletSelectorFactory, ICloudRunner cloudRunner, Versions.SdkVersion sdkVersion, ChromeClientLaunchCommandFormatter launchCommandFormatter, DebugEngine.DebugEngine.Params.Factory paramsFactory, IYetiVSIService yetiVsiService, IGameLauncher gameLauncher) { _fileSystem = fileSystem; _sdkConfigFactory = sdkConfigFactory; _gameletClientFactory = gameletClientFactory; _applicationClientFactory = applicationClientFactory; _cancelableTaskFactory = cancelableTaskFactory; _dialogUtil = dialogUtil; _remoteDeploy = remoteDeploy; _metrics = metrics; _credentialManager = credentialManager; _testAccountClientFactory = testAccountClientFactory; _cloudRunner = cloudRunner; _yetiVsiService = yetiVsiService; _gameletSelectorFactory = gameletSelectorFactory; _sdkVersion = sdkVersion; _launchCommandFormatter = launchCommandFormatter; _paramsFactory = paramsFactory; _gameLauncher = gameLauncher; }
public CoreAttachWindow(IServiceProvider serviceProvider) { var serviceManager = new ServiceManager(); _taskContext = serviceManager.GetJoinableTaskContext(); _dialogUtil = new DialogUtil(); IExtensionOptions options = ((YetiVSIService)serviceManager.RequireGlobalService(typeof(YetiVSIService))) .Options; var managedProcessFactory = new ManagedProcess.Factory(); var progressDialogFactory = new ProgressDialog.Factory(); _cancelableTaskFactory = new CancelableTask.Factory(_taskContext, progressDialogFactory); _coreListRequest = new CoreListRequest.Factory().Create(); var jsonUtil = new JsonUtil(); var credentialConfigFactory = new CredentialConfig.Factory(jsonUtil); var accountOptionLoader = new VsiAccountOptionLoader(options); var credentialManager = new CredentialManager(credentialConfigFactory, accountOptionLoader); _developerAccount = credentialManager.LoadAccount(); IRemoteCommand remoteCommand = new RemoteCommand(managedProcessFactory); _remoteFile = new RemoteFile(managedProcessFactory); var cloudConnection = new CloudConnection(); var sdkConfigFactory = new SdkConfig.Factory(jsonUtil); // NOTE: the lifetime of this CloudRunner is limited to the current CoreAttachWindow. _cloudRunner = new CloudRunner(sdkConfigFactory, credentialManager, cloudConnection, new GgpSDKUtil()); _gameletClientFactory = new GameletClient.Factory(); var sshKeyLoader = new SshKeyLoader(managedProcessFactory); var sshKnownHostsWriter = new SshKnownHostsWriter(); _sshManager = new SshManager(_gameletClientFactory, _cloudRunner, sshKeyLoader, sshKnownHostsWriter, remoteCommand); _debugSessionMetrics = new DebugSessionMetrics( serviceProvider.GetService(typeof(SMetrics)) as IMetrics); _debugSessionMetrics.UseNewDebugSessionId(); _actionRecorder = new ActionRecorder(_debugSessionMetrics); InitializeComponent(); _instanceSelectionWindowFactory = new ProjectInstanceSelection.Factory(); _paramsFactory = new DebugEngine.DebugEngine.Params.Factory(jsonUtil); SelectInstanceOnInit(); }