コード例 #1
0
        private void TryToAddGameFromHeartbeatFile(string filepath, int processId)
        {
            var response = SteelFilter.LaunchControl.GetHeartbeatStatus(filepath);

            if (response.IsValid)
            {
                var  gameSession = _map.GetGameSessionByServerAccount(response.Status.ServerName, response.Status.AccountName);
                bool newGame     = false;
                if (gameSession == null)
                {
                    gameSession = new GameSession();
                    newGame     = true;
                }
                UpdateGameSessionFromHeartbeatStatus(gameSession, filepath, response);
                if (newGame)
                {
                    _map.AddGameSession(gameSession);
                }
                if (!_configurator.ContainsSteelFilterPath(response.Status.SteelFilterFilePath))
                {
                    var gameConfig = new Configurator.GameConfig()
                    {
                        SteelFilterPath    = response.Status.SteelFilterFilePath,
                        SteelFilterVersion = response.Status.SteelFilterVersion
                    };
                    _configurator.AddGameConfig(gameConfig);
                    Logger.WriteInfo(string.Format(
                                         "SteelFilter#{0} found: {1}",
                                         _configurator.GetNumberGameConfigs(),
                                         gameConfig));
                }
                NotifyGameChange(gameSession, GameChangeType.StartGame);
            }
        }
コード例 #2
0
        private void RecordGameDll()
        {
            var info = SteelFilter.LaunchControl.GetSteelFilterInfo();

            _configurator.AddGameConfig(
                new Configurator.GameConfig()
            {
                SteelFilterPath    = info.SteelFilterPath,
                SteelFilterVersion = info.SteelFilterVersion
            }
                );
        }