AdvancedLauncher.Management.ConfigurationManager.CheckGame C# (CSharp) Method

CheckGame() public method

public CheckGame ( GameModel model ) : bool
model AdvancedLauncher.SDK.Model.Config.GameModel
return bool
        public bool CheckGame(GameModel model)
        {
            if (model == null) {
                throw new ArgumentException("model argument cannot be null");
            }
            IConfiguration config = GetConfiguration(model);
            string pGamePath = GetGamePath(model);
            if (string.IsNullOrEmpty(pGamePath)) {
                return false;
            }
            new FileIOPermission(FileIOPermissionAccess.Read, pGamePath).Assert();
            if (!File.Exists(Path.Combine(pGamePath, config.VersionLocalPath)) || !File.Exists(Path.Combine(pGamePath, config.GameExecutable))) {
                return false;
            }
            if (!File.Exists(Path.Combine(pGamePath, puPF)) || !File.Exists(Path.Combine(pGamePath, puHF))) {
                return false;
            }
            return true;
        }

Usage Example

        private void OnProfileChanged(object sender, BaseEventArgs e)
        {
            GameModel model         = ProfileManager.CurrentProfile.GameModel;
            bool      gameAvailable = ConfigurationManager.CheckGame(model);

            if (Community != null)
            {
                Community.IsEnabled = ConfigurationManager.GetConfiguration(model).IsWebAvailable;
            }
            if (Gallery != null)
            {
                Gallery.IsEnabled = gameAvailable;
            }
            if (Personalization != null)
            {
                Personalization.IsEnabled = gameAvailable;
            }
        }
All Usage Examples Of AdvancedLauncher.Management.ConfigurationManager::CheckGame