internal List <Game> GetLibraryGames() { using (var view = playniteApi.WebViews.CreateOffscreenView()) { var api = new GogAccountClient(view); if (!api.GetIsUserLoggedIn()) { throw new Exception("User is not logged in to GOG account."); } var accInfo = api.GetAccountInfo(); var libGames = api.GetOwnedGames(accInfo); if (libGames == null) { throw new Exception("Failed to obtain libary data."); } return(LibraryGamesToGames(libGames).ToList()); } }
internal List<GameInfo> GetLibraryGames() { if (LibrarySettings.UsePublicAccount) { return GetLibraryGames(LibrarySettings.AccountName); } using (var view = PlayniteApi.WebViews.CreateOffscreenView()) { var api = new GogAccountClient(view); if (!api.GetIsUserLoggedIn()) { throw new Exception("User is not logged in to GOG account."); } var libGames = api.GetOwnedGamesLegacy(); if (libGames == null) { throw new Exception("Failed to obtain libary data."); } return LibraryGamesToGames(libGames).ToList(); } }
public GogAchievements(IPlayniteAPI PlayniteApi) { var view = PlayniteApi.WebViews.CreateOffscreenView(); gogAPI = new GogAccountClient(view); }
public GogAchievements(IPlayniteAPI PlayniteApi, SuccessStorySettings settings, string PluginUserDataPath) : base(PlayniteApi, settings, PluginUserDataPath) { var view = PlayniteApi.WebViews.CreateOffscreenView(); gogAPI = new GogAccountClient(view); }