void launchGameFromItem(WorkerArgs args, LaunchItem launchItem, Dictionary <string, DateTime> accountLaunchTimes) { Logger.WriteDebug("launchGameFromItem on thread {0}: Account={1}, Server={2}, Char={3}", Thread.CurrentThread.ManagedThreadId, launchItem.AccountName, launchItem.ServerName, launchItem.CharacterSelected); LaunchManager mgr = new LaunchManager(args.ClientExeLocation, launchItem, accountLaunchTimes); mgr.ReportStatusEvent += (status, item) => FireReportLaunchItemStatusEvent(status, item); LaunchManager.LaunchManagerResult launchResult; GameSession session = null; try { session = _gameSessionMap.StartLaunchingSession(launchItem.ServerName, launchItem.AccountName); FireReportAccountStatusEvent(ServerAccountStatusEnum.Starting, launchItem); launchResult = mgr.LaunchGameHandlingDelaysAndTitles(_worker); } finally { _gameSessionMap.EndLaunchingSession(launchItem.ServerName, launchItem.AccountName); } if (launchResult.Success) { ++_serverIndex; // Let's just wait for game monitor to check if the character list changed // b/c the AccountManager is subscribed for that event //CallUiNotifyAvailableCharactersChanged(); // Pick up any characters - experimental 2017-04-10 // CallUiLoadUserAccounts(); // Pick up any characters - before 2017-04-10 _gameSessionMap.StartSessionWatcher(session); session.WindowHwnd = launchResult.Hwnd; // session.ProcessId is already populated FireReportLaunchItemStatusEvent("Launched", launchItem); } }
private void CreateGameChannel(int processId, GameSession gameSession) { gameSession.GameChannel = SteelFilter.Channels.Channel.MakeLauncherChannel(processId); _map.StartSessionWatcher(gameSession); }