From 1205e3305cd6f8f3bbc2d2f89f708e88f8ebba26 Mon Sep 17 00:00:00 2001 From: Adam Jordanek Date: Wed, 29 Apr 2020 19:47:10 +0200 Subject: [PATCH 01/24] Epic games support --- data/icons/icons.gresource.xml | 1 + data/icons/symbolic/sources/epicgames.svg | 57 +++++++++ src/app.vala | 3 +- src/data/GameSource.vala | 1 + src/data/sources/epicgames/EpicGames.vala | 103 +++++++++++++++++ src/data/sources/epicgames/EpicGamesGame.vala | 26 +++++ src/meson.build | 4 + .../SettingsDialog/SettingsDialog.vala | 1 + .../pages/sources/EpicGames.vala | 108 ++++++++++++++++++ src/ui/views/WelcomeView.vala | 4 +- 10 files changed, 305 insertions(+), 3 deletions(-) create mode 100644 data/icons/symbolic/sources/epicgames.svg create mode 100644 src/data/sources/epicgames/EpicGames.vala create mode 100644 src/data/sources/epicgames/EpicGamesGame.vala create mode 100644 src/ui/dialogs/SettingsDialog/pages/sources/EpicGames.vala diff --git a/data/icons/icons.gresource.xml b/data/icons/icons.gresource.xml index bf13ca6a..334ba166 100644 --- a/data/icons/icons.gresource.xml +++ b/data/icons/icons.gresource.xml @@ -3,6 +3,7 @@ symbolic/sources/sources-all.svg symbolic/sources/steam.svg + symbolic/sources/epicgames.svg symbolic/sources/gog.svg symbolic/sources/humble.svg symbolic/sources/humble-trove.svg diff --git a/data/icons/symbolic/sources/epicgames.svg b/data/icons/symbolic/sources/epicgames.svg new file mode 100644 index 00000000..5e6870b1 --- /dev/null +++ b/data/icons/symbolic/sources/epicgames.svg @@ -0,0 +1,57 @@ + +image/svg+xml \ No newline at end of file diff --git a/src/app.vala b/src/app.vala index 9bb6a90d..f9b67a06 100644 --- a/src/app.vala +++ b/src/app.vala @@ -23,6 +23,7 @@ using Gee; using GameHub.Data; using GameHub.Data.DB; using GameHub.Data.Sources.Steam; +using GameHub.Data.Sources.EpicGames; using GameHub.Data.Sources.GOG; using GameHub.Data.Sources.Humble; using GameHub.Data.Sources.Itch; @@ -141,7 +142,7 @@ namespace GameHub ImageCache.init(); Database.create(); - GameSources = { new Steam(), new GOG(), new Humble(), new Trove(), new Itch(), new User() }; + GameSources = { new Steam(), new EpicGames(), new GOG(), new Humble(), new Trove(), new Itch(), new User() }; Providers.ImageProviders = { new Providers.Images.Steam(), new Providers.Images.SteamGridDB(), new Providers.Images.JinxSGVI() }; Providers.DataProviders = { new Providers.Data.IGDB() }; diff --git a/src/data/GameSource.vala b/src/data/GameSource.vala index 25b51e4e..c50abf81 100644 --- a/src/data/GameSource.vala +++ b/src/data/GameSource.vala @@ -21,6 +21,7 @@ using Gee; using GameHub.Utils; using GameHub.Data.Sources.Steam; using GameHub.Data.Sources.GOG; +using GameHub.Data.Sources.EpicGames; namespace GameHub.Data { diff --git a/src/data/sources/epicgames/EpicGames.vala b/src/data/sources/epicgames/EpicGames.vala new file mode 100644 index 00000000..4bb2d2c0 --- /dev/null +++ b/src/data/sources/epicgames/EpicGames.vala @@ -0,0 +1,103 @@ +/* +This file is part of GameHub. +Copyright (C) 2018-2019 Anatoliy Kashkin + +GameHub is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +GameHub is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GameHub. If not, see . +*/ + +using Gee; +using GameHub.Data.DB; +using GameHub.Utils; + +namespace GameHub.Data.Sources.EpicGames +{ + public class EpicGames: GameSource + { + public static EpicGames instance; + + public override string id { get { return "epicgames"; } } + public override string name { get { return "EpicGames"; } } + public override string icon { get { return "source-epicgames-symbolic"; } } + + private bool enable = true; + public override bool enabled + { + get { return enable; } + set { enable = value; } + } + + + public string? user_id { get; protected set; } + public string? user_name { get; protected set; } + + public EpicGames() + { + instance = this; + } + + public override bool is_installed(bool refresh) + { + return true; + } + + public override async bool install() + { + return true; + } + + public override async bool authenticate() + { + return true; + } + + public override bool is_authenticated() + { + return true; + } + + public override bool can_authenticate_automatically() + { + return true; + } + + public async bool refresh_token() + { + debug("TEST2"); + return true; + } + + private ArrayList _games = new ArrayList(Game.is_equal); + + public override ArrayList games { get { return _games; } } + + public override async ArrayList load_games(Utils.FutureResult2? game_loaded=null, Utils.Future? cache_loaded=null) + { + debug("[EpicGames] Load games"); + + var output = new DataInputStream(new Subprocess.newv ({"legendary", "list-games"}, STDOUT_PIPE).get_stdout_pipe ()); + string? line = null; + MatchInfo info; + while ((line = yield output.read_line_async ()) != null) { + // FIXME: This REGEX is ugly + if (/\*\s*([^(]*)\s\(App\sname:\s([a-zA-Z0-9]+),\sversion:\s([^)]*)\)/.match (line, 0, out info)) { + debug ("\tname = %s\tid = %s\tversion = %s\n\n", info.fetch (1), info.fetch (2), info.fetch (3)); + _games.add(new EpicGamesGame(this, info.fetch (1), info.fetch (2))); + } + } + return _games; + } + + + } +} diff --git a/src/data/sources/epicgames/EpicGamesGame.vala b/src/data/sources/epicgames/EpicGamesGame.vala new file mode 100644 index 00000000..a680faff --- /dev/null +++ b/src/data/sources/epicgames/EpicGamesGame.vala @@ -0,0 +1,26 @@ +using Gee; +using GameHub.Data.DB; +using GameHub.Utils; + +namespace GameHub.Data.Sources.EpicGames +{ + public class EpicGamesGame: Game + { + public EpicGamesGame(EpicGames src, string name, string id) + { + this.name = name; + this.id = id; + platforms.add(Platform.WINDOWS); + } + + + public override async void install(Runnable.Installer.InstallMode install_mode=Runnable.Installer.InstallMode.INTERACTIVE) + { + + } + public override async void uninstall() + { + } + + } +} diff --git a/src/meson.build b/src/meson.build index 2acdeac9..c43fe219 100644 --- a/src/meson.build +++ b/src/meson.build @@ -45,6 +45,9 @@ sources = [ 'data/sources/steam/Steam.vala', 'data/sources/steam/SteamGame.vala', + 'data/sources/epicgames/EpicGames.vala', + 'data/sources/epicgames/EpicGamesGame.vala', + 'data/sources/gog/GOG.vala', 'data/sources/gog/GOGGame.vala', @@ -104,6 +107,7 @@ sources = [ 'ui/dialogs/SettingsDialog/pages/general/Collection.vala', 'ui/dialogs/SettingsDialog/pages/general/Tweaks.vala', 'ui/dialogs/SettingsDialog/pages/sources/Steam.vala', + 'ui/dialogs/SettingsDialog/pages/sources/EpicGames.vala', 'ui/dialogs/SettingsDialog/pages/sources/GOG.vala', 'ui/dialogs/SettingsDialog/pages/sources/Humble.vala', 'ui/dialogs/SettingsDialog/pages/sources/Itch.vala', diff --git a/src/ui/dialogs/SettingsDialog/SettingsDialog.vala b/src/ui/dialogs/SettingsDialog/SettingsDialog.vala index 2c15973f..b71cf692 100644 --- a/src/ui/dialogs/SettingsDialog/SettingsDialog.vala +++ b/src/ui/dialogs/SettingsDialog/SettingsDialog.vala @@ -89,6 +89,7 @@ namespace GameHub.UI.Dialogs.SettingsDialog #endif add_page("sources/steam", new Pages.Sources.Steam(this)); + add_page("sources/epicgames", new Pages.Sources.EpicGames(this)); add_page("sources/gog", new Pages.Sources.GOG(this)); add_page("sources/humble", new Pages.Sources.Humble(this)); add_page("sources/itch", new Pages.Sources.Itch(this)); diff --git a/src/ui/dialogs/SettingsDialog/pages/sources/EpicGames.vala b/src/ui/dialogs/SettingsDialog/pages/sources/EpicGames.vala new file mode 100644 index 00000000..f98db3d8 --- /dev/null +++ b/src/ui/dialogs/SettingsDialog/pages/sources/EpicGames.vala @@ -0,0 +1,108 @@ +/* +This file is part of GameHub. +Copyright (C) 2018-2019 Anatoliy Kashkin + +GameHub is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +GameHub is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GameHub. If not, see . +*/ + +using Gtk; + +using GameHub.Utils; +using GameHub.UI.Widgets; + +namespace GameHub.UI.Dialogs.SettingsDialog.Pages.Sources +{ + public class EpicGames: SettingsDialogPage + { + private Settings.Auth.Humble humble_auth; + private Button logout_btn; + private FileChooserEntry games_dir_chooser; + + public EpicGames(SettingsDialog dlg) + { + Object( + dialog: dlg, + title: "Humble Bundle", + description: _("Disabled"), + icon_name: "source-epicgames-symbolic", + activatable: true + ); + status = description; + } + + construct + { + var paths = FSUtils.Paths.Settings.instance; + + humble_auth = Settings.Auth.Humble.instance; + + add_switch(_("Load games from Humble Trove"), humble_auth.load_trove_games, v => { humble_auth.load_trove_games = v; update(); request_restart(); }); + + add_separator(); + + games_dir_chooser = add_file_chooser(_("Games directory"), FileChooserAction.SELECT_FOLDER, paths.humble_games, v => { paths.humble_games = v; update(); request_restart(); }).get_children().last().data as FileChooserEntry; + + status_switch.active = humble_auth.enabled; + status_switch.notify["active"].connect(() => { + humble_auth.enabled = status_switch.active; + request_restart(); + update(); + }); + + logout_btn = new Button.with_label(_("Logout")); + action_area.add(logout_btn); + + logout_btn.clicked.connect(() => { + humble_auth.authenticated = false; + humble_auth.access_token = ""; + request_restart(); + update(); + }); + + update(); + } + + private void update() + { + content_area.sensitive = humble_auth.enabled; + logout_btn.sensitive = humble_auth.authenticated && humble_auth.access_token.length > 0; + + if(" " in FSUtils.Paths.Settings.instance.humble_games) + { + games_dir_chooser.get_style_context().add_class(Gtk.STYLE_CLASS_ERROR); + status_type = StatusType.ERROR; + } + else + { + games_dir_chooser.get_style_context().remove_class(Gtk.STYLE_CLASS_ERROR); + status_type = restart_requested ? StatusType.WARNING : StatusType.NONE; + } + dialog.update_games_dir_space_message(); + + if(!humble_auth.enabled) + { + status = description = _("Disabled"); + } + else if(!humble_auth.authenticated || humble_auth.access_token.length == 0) + { + status = description = _("Not authenticated"); + } + else + { + status = description = _("Authenticated"); + } + } + + } +} diff --git a/src/ui/views/WelcomeView.vala b/src/ui/views/WelcomeView.vala index 1029a4ab..e1271bb6 100644 --- a/src/ui/views/WelcomeView.vala +++ b/src/ui/views/WelcomeView.vala @@ -96,6 +96,7 @@ namespace GameHub.UI.Views foreach(var src in GameSources) { + debug("[GS] %s", src.icon); welcome.append(src.icon, src.name, ""); } @@ -126,12 +127,11 @@ namespace GameHub.UI.Views var src = GameSources[index]; var btn = welcome.get_button_from_index(index); - welcome.set_item_visible(index, !(src is Sources.Humble.Trove) && !(src is Sources.User.User) && src.enabled); if(src is Sources.Humble.Trove || !src.enabled) continue; enabled_sources++; - + debug("[GS] %s %s", src.name, src.is_installed(true).to_string()); if(src.is_installed(true)) { btn.title = src.name; From b4b126889517319b690b948447304df08ff2a811 Mon Sep 17 00:00:00 2001 From: Adam Jordanek Date: Wed, 29 Apr 2020 22:21:48 +0200 Subject: [PATCH 02/24] fixup! Epic games support --- src/data/sources/epicgames/EpicGames.vala | 32 +++++++++++++------ src/data/sources/epicgames/EpicGamesGame.vala | 29 +++++++++++++++-- 2 files changed, 49 insertions(+), 12 deletions(-) diff --git a/src/data/sources/epicgames/EpicGames.vala b/src/data/sources/epicgames/EpicGames.vala index 4bb2d2c0..08a428e9 100644 --- a/src/data/sources/epicgames/EpicGames.vala +++ b/src/data/sources/epicgames/EpicGames.vala @@ -85,16 +85,30 @@ namespace GameHub.Data.Sources.EpicGames { debug("[EpicGames] Load games"); - var output = new DataInputStream(new Subprocess.newv ({"legendary", "list-games"}, STDOUT_PIPE).get_stdout_pipe ()); - string? line = null; - MatchInfo info; - while ((line = yield output.read_line_async ()) != null) { - // FIXME: This REGEX is ugly - if (/\*\s*([^(]*)\s\(App\sname:\s([a-zA-Z0-9]+),\sversion:\s([^)]*)\)/.match (line, 0, out info)) { - debug ("\tname = %s\tid = %s\tversion = %s\n\n", info.fetch (1), info.fetch (2), info.fetch (3)); - _games.add(new EpicGamesGame(this, info.fetch (1), info.fetch (2))); + Utils.thread("GOGLoading", () => { + _games.clear(); + var output = new DataInputStream(new Subprocess.newv ({"legendary", "list-games"}, STDOUT_PIPE).get_stdout_pipe ()); + string? line = null; + MatchInfo info; + games_count = 0; + while ((line = output.read_line()) != null) { + // FIXME: This REGEX is ugly + if (/\*\s*([^(]*)\s\(App\sname:\s([a-zA-Z0-9]+),\sversion:\s([^)]*)\)/.match (line, 0, out info)) { + debug ("\tname = %s\tid = %s\tversion = %s\n\n", info.fetch (1), info.fetch (2), info.fetch (3)); + var g = new EpicGamesGame(this, info.fetch (1), info.fetch (2)); + + if(game_loaded != null) + { + game_loaded(g, true); + } + _games.add(g); + games_count++; + g.save(); + } } - } + Idle.add(load_games.callback); + }); + yield; return _games; } diff --git a/src/data/sources/epicgames/EpicGamesGame.vala b/src/data/sources/epicgames/EpicGamesGame.vala index a680faff..ba43b14d 100644 --- a/src/data/sources/epicgames/EpicGamesGame.vala +++ b/src/data/sources/epicgames/EpicGamesGame.vala @@ -6,13 +6,36 @@ namespace GameHub.Data.Sources.EpicGames { public class EpicGamesGame: Game { - public EpicGamesGame(EpicGames src, string name, string id) + public EpicGamesGame(EpicGames src, string nameP, string idP) { - this.name = name; - this.id = id; + source = src; + name = nameP; + id = idP; + icon = ""; platforms.add(Platform.WINDOWS); + update_status(); } + public override void update_status() + { + if(status.state == Game.State.DOWNLOADING && status.download.status.state != Downloader.Download.State.CANCELLED) return; + + status = new Game.Status(executable != null && executable.query_exists() ? Game.State.INSTALLED : Game.State.UNINSTALLED, this); + if(status.state == Game.State.INSTALLED) + { + remove_tag(Tables.Tags.BUILTIN_UNINSTALLED); + add_tag(Tables.Tags.BUILTIN_INSTALLED); + } + else + { + add_tag(Tables.Tags.BUILTIN_UNINSTALLED); + remove_tag(Tables.Tags.BUILTIN_INSTALLED); + } + + installers_dir = FSUtils.file(FSUtils.Paths.Collection.Humble.expand_installers(name)); + + update_version(); + } public override async void install(Runnable.Installer.InstallMode install_mode=Runnable.Installer.InstallMode.INTERACTIVE) { From ddc0ac6c0276d9b8f599eb2df82639aab5284cd6 Mon Sep 17 00:00:00 2001 From: Adam Jordanek Date: Wed, 29 Apr 2020 22:24:26 +0200 Subject: [PATCH 03/24] fixup! Epic games support --- src/data/sources/epicgames/EpicGamesGame.vala | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/data/sources/epicgames/EpicGamesGame.vala b/src/data/sources/epicgames/EpicGamesGame.vala index ba43b14d..f94574dc 100644 --- a/src/data/sources/epicgames/EpicGamesGame.vala +++ b/src/data/sources/epicgames/EpicGamesGame.vala @@ -37,6 +37,41 @@ namespace GameHub.Data.Sources.EpicGames update_version(); } + public EpicGamesGame.from_db(EpicGames src, Sqlite.Statement s) + { + source = src; + id = Tables.Games.ID.get(s); + name = Tables.Games.NAME.get(s); + info = Tables.Games.INFO.get(s); + info_detailed = Tables.Games.INFO_DETAILED.get(s); + icon = Tables.Games.ICON.get(s); + image = Tables.Games.IMAGE.get(s); + install_dir = Tables.Games.INSTALL_PATH.get(s) != null ? FSUtils.file(Tables.Games.INSTALL_PATH.get(s)) : null; + executable_path = Tables.Games.EXECUTABLE.get(s); + work_dir_path = Tables.Games.WORK_DIR.get(s); + compat_tool = Tables.Games.COMPAT_TOOL.get(s); + compat_tool_settings = Tables.Games.COMPAT_TOOL_SETTINGS.get(s); + arguments = Tables.Games.ARGUMENTS.get(s); + last_launch = Tables.Games.LAST_LAUNCH.get_int64(s); + playtime_source = Tables.Games.PLAYTIME_SOURCE.get_int64(s); + playtime_tracked = Tables.Games.PLAYTIME_TRACKED.get_int64(s); + image_vertical = Tables.Games.IMAGE_VERTICAL.get(s); + + platforms.clear(); + var pls = Tables.Games.PLATFORMS.get(s).split(","); + foreach(var pl in pls) + { + foreach(var p in Platform.PLATFORMS) + { + if(pl == p.id()) + { + platforms.add(p); + break; + } + } + } + } + public override async void install(Runnable.Installer.InstallMode install_mode=Runnable.Installer.InstallMode.INTERACTIVE) { From 69be44dcfee7d2acfaf0606614792dc2cda6efa5 Mon Sep 17 00:00:00 2001 From: Adam Jordanek Date: Thu, 30 Apr 2020 08:42:13 +0200 Subject: [PATCH 04/24] fixup! Epic games support --- src/data/sources/epicgames/EpicGamesGame.vala | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/data/sources/epicgames/EpicGamesGame.vala b/src/data/sources/epicgames/EpicGamesGame.vala index f94574dc..21037ea1 100644 --- a/src/data/sources/epicgames/EpicGamesGame.vala +++ b/src/data/sources/epicgames/EpicGamesGame.vala @@ -1,3 +1,22 @@ +/* +This file is part of GameHub. +Copyright (C) 2018-2019 Anatoliy Kashkin +Copyright (C) 2020 Adam Jordanek + +GameHub is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +GameHub is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GameHub. If not, see . +*/ + using Gee; using GameHub.Data.DB; using GameHub.Utils; @@ -74,7 +93,6 @@ namespace GameHub.Data.Sources.EpicGames public override async void install(Runnable.Installer.InstallMode install_mode=Runnable.Installer.InstallMode.INTERACTIVE) { - } public override async void uninstall() { From 621b35a1d91e45a3cf7c2db8ab24b72a40cd5d61 Mon Sep 17 00:00:00 2001 From: Adam Jordanek Date: Thu, 30 Apr 2020 09:07:50 +0200 Subject: [PATCH 05/24] fixup! Epic games support --- src/data/sources/epicgames/EpicGames.vala | 52 +++++++++++++++---- src/data/sources/epicgames/EpicGamesGame.vala | 2 + 2 files changed, 44 insertions(+), 10 deletions(-) diff --git a/src/data/sources/epicgames/EpicGames.vala b/src/data/sources/epicgames/EpicGames.vala index 08a428e9..33018343 100644 --- a/src/data/sources/epicgames/EpicGames.vala +++ b/src/data/sources/epicgames/EpicGames.vala @@ -1,6 +1,7 @@ /* This file is part of GameHub. Copyright (C) 2018-2019 Anatoliy Kashkin +Copyright (C) 2020 Adam Jordanek GameHub is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -48,32 +49,37 @@ namespace GameHub.Data.Sources.EpicGames public override bool is_installed(bool refresh) { + debug("[EpicGames] is_installed: NOT IMPLEMENTED"); return true; } public override async bool install() { + debug("[EpicGames] install: NOT IMPLEMENTED"); return true; } public override async bool authenticate() { + debug("[EpicGames] authenticate: NOT IMPLEMENTED"); return true; } public override bool is_authenticated() { + debug("[EpicGames] is_authenticated: NOT IMPLEMENTED"); return true; } public override bool can_authenticate_automatically() { + debug("[EpicGames] can_authenticate_automatically: NOT IMPLEMENTED"); return true; } public async bool refresh_token() { - debug("TEST2"); + debug("[EpicGames] refresh_token: NOT IMPLEMENTED"); return true; } @@ -85,25 +91,51 @@ namespace GameHub.Data.Sources.EpicGames { debug("[EpicGames] Load games"); - Utils.thread("GOGLoading", () => { + Utils.thread("EpicGamesLoading", () => { _games.clear(); + + games_count = 0; + var cached = Tables.Games.get_all(this); + if(cached.size > 0) + { + foreach(var g in cached) + { + if(!Settings.UI.Behavior.instance.merge_games || !Tables.Merges.is_game_merged(g)) + { + _games.add(g); + if(game_loaded != null) + { + game_loaded(g, true); + } + } + games_count++; + } + } + + if(cache_loaded != null) + { + cache_loaded(); + } + + var output = new DataInputStream(new Subprocess.newv ({"legendary", "list-games"}, STDOUT_PIPE).get_stdout_pipe ()); string? line = null; MatchInfo info; - games_count = 0; while ((line = output.read_line()) != null) { // FIXME: This REGEX is ugly if (/\*\s*([^(]*)\s\(App\sname:\s([a-zA-Z0-9]+),\sversion:\s([^)]*)\)/.match (line, 0, out info)) { debug ("\tname = %s\tid = %s\tversion = %s\n\n", info.fetch (1), info.fetch (2), info.fetch (3)); var g = new EpicGamesGame(this, info.fetch (1), info.fetch (2)); - - if(game_loaded != null) - { - game_loaded(g, true); + bool is_new_game = !_games.contains(g); + if(is_new_game) { + if(game_loaded != null) + { + game_loaded(g, true); + } + _games.add(g); + games_count++; + g.save(); } - _games.add(g); - games_count++; - g.save(); } } Idle.add(load_games.callback); diff --git a/src/data/sources/epicgames/EpicGamesGame.vala b/src/data/sources/epicgames/EpicGamesGame.vala index 21037ea1..6561a5db 100644 --- a/src/data/sources/epicgames/EpicGamesGame.vala +++ b/src/data/sources/epicgames/EpicGamesGame.vala @@ -93,9 +93,11 @@ namespace GameHub.Data.Sources.EpicGames public override async void install(Runnable.Installer.InstallMode install_mode=Runnable.Installer.InstallMode.INTERACTIVE) { + debug("[EpicGamesGame] install: NOT IMPLEMENTED"); } public override async void uninstall() { + debug("[EpicGamesGame] uninstall: NOT IMPLEMENTED"); } } From 2885a20bd2aa665194b22852368112cc0b45c4a6 Mon Sep 17 00:00:00 2001 From: Adam Jordanek Date: Thu, 30 Apr 2020 09:59:19 +0200 Subject: [PATCH 06/24] fixup! Epic games support --- src/data/db/tables/Games.vala | 5 +++++ src/data/sources/epicgames/EpicGames.vala | 7 +++++- src/data/sources/epicgames/EpicGamesGame.vala | 22 ++++++------------- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/data/db/tables/Games.vala b/src/data/db/tables/Games.vala index c7fcbda5..4e350100 100644 --- a/src/data/db/tables/Games.vala +++ b/src/data/db/tables/Games.vala @@ -22,6 +22,7 @@ using Sqlite; using GameHub.Utils; using GameHub.Data.Sources.Steam; +using GameHub.Data.Sources.EpicGames; using GameHub.Data.Sources.GOG; using GameHub.Data.Sources.Humble; using GameHub.Data.Sources.Itch; @@ -396,6 +397,10 @@ namespace GameHub.Data.DB.Tables { g = new SteamGame.from_db((Steam) s, st); } + else if(s is EpicGames) + { + g = new EpicGamesGame.from_db((EpicGames) s, st); + } else if(s is GOG) { g = new GOGGame.from_db((GOG) s, st); diff --git a/src/data/sources/epicgames/EpicGames.vala b/src/data/sources/epicgames/EpicGames.vala index 33018343..6c319e79 100644 --- a/src/data/sources/epicgames/EpicGames.vala +++ b/src/data/sources/epicgames/EpicGames.vala @@ -89,6 +89,11 @@ namespace GameHub.Data.Sources.EpicGames public override async ArrayList load_games(Utils.FutureResult2? game_loaded=null, Utils.Future? cache_loaded=null) { + if(_games.size > 0) + { + return _games; + } + debug("[EpicGames] Load games"); Utils.thread("EpicGamesLoading", () => { @@ -128,13 +133,13 @@ namespace GameHub.Data.Sources.EpicGames var g = new EpicGamesGame(this, info.fetch (1), info.fetch (2)); bool is_new_game = !_games.contains(g); if(is_new_game) { + g.save(); if(game_loaded != null) { game_loaded(g, true); } _games.add(g); games_count++; - g.save(); } } } diff --git a/src/data/sources/epicgames/EpicGamesGame.vala b/src/data/sources/epicgames/EpicGamesGame.vala index 6561a5db..9af02df6 100644 --- a/src/data/sources/epicgames/EpicGamesGame.vala +++ b/src/data/sources/epicgames/EpicGamesGame.vala @@ -32,26 +32,18 @@ namespace GameHub.Data.Sources.EpicGames id = idP; icon = ""; platforms.add(Platform.WINDOWS); + + install_dir = null; + executable_path = "$game_dir/start.sh"; + work_dir_path = "$game_dir"; + info_detailed = @"{}"; + + mount_overlays.begin(); update_status(); } public override void update_status() { - if(status.state == Game.State.DOWNLOADING && status.download.status.state != Downloader.Download.State.CANCELLED) return; - - status = new Game.Status(executable != null && executable.query_exists() ? Game.State.INSTALLED : Game.State.UNINSTALLED, this); - if(status.state == Game.State.INSTALLED) - { - remove_tag(Tables.Tags.BUILTIN_UNINSTALLED); - add_tag(Tables.Tags.BUILTIN_INSTALLED); - } - else - { - add_tag(Tables.Tags.BUILTIN_UNINSTALLED); - remove_tag(Tables.Tags.BUILTIN_INSTALLED); - } - - installers_dir = FSUtils.file(FSUtils.Paths.Collection.Humble.expand_installers(name)); update_version(); } From 5e4b36872b7e0974e2625fe0bbf1a711780b1e78 Mon Sep 17 00:00:00 2001 From: Adam Jordanek Date: Thu, 30 Apr 2020 10:36:19 +0200 Subject: [PATCH 07/24] fixup! Epic games support --- data/icons/symbolic/sources/epicgames.svg | 59 +++++-------------- src/data/sources/epicgames/EpicGames.vala | 5 +- src/data/sources/epicgames/EpicGamesGame.vala | 7 ++- 3 files changed, 26 insertions(+), 45 deletions(-) diff --git a/data/icons/symbolic/sources/epicgames.svg b/data/icons/symbolic/sources/epicgames.svg index 5e6870b1..f618e2a2 100644 --- a/data/icons/symbolic/sources/epicgames.svg +++ b/data/icons/symbolic/sources/epicgames.svg @@ -5,53 +5,26 @@ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" - viewBox="0 0 647.16699 750.97701" - height="750.97699" - width="647.16699" - xml:space="preserve" + version="1.1" id="svg2" - version="1.1">image/svg+xml \ No newline at end of file + transform="matrix(0.75000002,0,0,-0.75000002,-408.36334,-12.770541)" + d="M 58.859375,0.97265625 C 15.931376,0.97265625 0.08789062,16.815673 0.08789062,59.763672 V 577.99805 c 0,4.86 0.19566668,9.37397 0.625,13.55664 0.97733328,9.37466 1.16219298,18.46007 9.88085938,28.80273 0.852,1.01334 9.753906,7.63672 9.753906,7.63672 4.788,2.348 8.057027,4.07667 13.457032,6.25 L 294.59961,743.50781 c 13.53867,6.20667 19.19987,8.62631 29.0332,8.43164 v 0.002 h 0.0391 0.0371 v -0.002 c 9.83334,0.19467 15.49516,-2.22497 29.03516,-8.43164 L 613.53711,634.24414 c 5.40133,-2.17333 8.66965,-3.902 13.45898,-6.25 0,0 8.90129,-6.62338 9.75196,-7.63672 8.71866,-10.34266 8.90352,-19.42807 9.88086,-28.80273 0.42933,-4.18267 0.62695,-8.69664 0.62695,-13.55664 V 59.763672 c 0,-42.947999 -15.84482,-58.79101575 -58.77148,-58.79101575 z M 476.86523,98.300781 h 21.29297 c 35.60667,0 52.79883,17.277879 52.79883,53.060549 v 58.82617 h -42.97656 v -56.35742 c 0,-11.51733 -5.32362,-16.86133 -16.37695,-16.86133 h -7.36914 c -11.46002,0 -16.78516,5.344 -16.78516,16.86133 v 181.81445 c 0,11.51867 5.32514,16.86328 16.78516,16.86328 h 8.1914 c 11.04667,0 16.3711,-5.34461 16.3711,-16.86328 v -64.99219 h 42.98242 v 67.04688 c 0,35.79066 -17.59885,53.47461 -53.21485,53.47461 h -21.69922 c -35.60799,0 -53.21484,-17.68395 -53.21484,-53.47461 V 151.77539 c 0,-35.78933 17.60685,-53.474609 53.21484,-53.474609 z M 95.564453,100.76953 h 97.429687 v 39.89649 h -53.63086 v 81.44921 h 51.57617 v 39.89454 h -51.57617 v 86.79882 h 54.44531 v 39.89649 H 95.564453 Z m 119.388667,0 h 68.76954 c 35.61466,0 53.21484,17.68528 53.21484,53.47461 v 76.51172 c 0,35.78267 -17.60018,53.4668 -53.21484,53.4668 h -24.96875 v 104.48242 h -43.80079 z m 141.74415,0 h 43.80468 v 287.93555 h -43.80468 z m -97.94336,38.66602 v 106.1289 h 18.01367 c 11.05333,0 16.36914,-5.35047 16.36914,-16.86914 v -72.39843 c 0,-11.51604 -5.31581,-16.86133 -16.36914,-16.86133 z M 138.12695,457.20703 h 1.30664 1.18946 1.30664 1.30664 l 1.3164,0.11914 1.3086,0.1211 h 1.1875 l 1.1875,0.11914 1.30859,0.23828 1.07617,0.11914 1.1875,0.24023 1.18946,0.23828 1.07422,0.23828 1.06835,0.24024 1.07032,0.24023 1.07617,0.35743 1.06836,0.23828 0.94922,0.35937 1.07617,0.35938 1.07031,0.47656 1.06641,0.47851 1.07617,0.47852 1.07031,0.59766 1.06836,0.47851 0.95703,0.59766 1.06836,0.59765 0.94922,0.59766 1.07617,0.59766 0.94922,0.71679 0.94922,0.59766 0.95508,0.71875 0.94922,0.7168 0.95703,0.83594 0.94922,0.71679 -0.7168,0.95703 -0.83008,0.83594 -0.71679,0.95703 -0.83008,0.95508 -0.7168,0.95703 -0.71094,0.83594 -0.83789,0.95703 -0.70898,0.95508 -0.7168,0.83984 -0.83203,0.95508 -0.71484,0.95703 -0.83008,0.95508 -0.71875,0.83789 -0.70899,0.95508 -0.83593,0.95703 -0.71289,0.95508 -0.83594,0.83789 -0.70899,0.95508 -0.95703,-0.7168 -0.94922,-0.83594 -0.95507,-0.59765 -0.94922,-0.71875 -0.95117,-0.59571 -0.95508,-0.59961 -0.95118,-0.5957 -1.06835,-0.59961 -0.95508,-0.47656 -0.94922,-0.47852 -0.95703,-0.35937 -1.06836,-0.35742 -1.06836,-0.35938 -1.07617,-0.23828 -1.1875,-0.24023 -1.1875,-0.23829 -1.18946,-0.11914 -1.30859,-0.11914 -1.31445,-0.11914 h -1.3086 -1.1875 l -1.1875,0.11914 -1.07617,0.11914 -1.1875,0.23828 -1.07031,0.24024 -1.07617,0.35742 -1.06836,0.35938 -1.06836,0.47851 -1.07031,0.47656 -0.95508,0.59766 -0.94727,0.59766 -0.95898,0.59961 -0.82813,0.71679 -0.83789,0.7168 -0.83008,0.7168 -0.71679,0.83593 -0.82813,0.83789 -0.71875,0.95508 -0.59179,0.83789 -0.59766,0.95703 -0.58789,1.07422 -0.59961,0.95703 -0.47656,1.07618 -0.35938,1.07617 -0.47266,1.07617 -0.35742,1.19336 -0.23828,1.18945 -0.24023,1.07422 -0.24024,1.31641 -0.11718,1.19531 -0.11329,1.19531 v 1.31446 0.24023 1.19531 l 0.11329,1.19531 0.11718,1.07618 0.1211,1.19531 0.23828,1.07422 0.24023,1.07812 0.23828,1.07422 0.35938,1.07617 0.35156,0.95508 0.47852,1.19531 0.47656,1.07813 0.5918,1.07422 0.59765,0.95703 0.59766,0.95508 0.70898,0.95898 0.71875,0.83594 0.82813,0.83594 0.71875,0.83593 0.82812,0.71875 0.95703,0.7168 0.94922,0.7168 0.94922,0.59765 0.95508,0.59766 1.07031,0.47852 1.06836,0.47851 1.07617,0.47656 1.1875,0.35938 1.18946,0.35937 1.19531,0.24024 1.1875,0.23828 1.18945,0.11914 1.30664,0.11914 h 1.3086 1.42578 l 1.3164,-0.11914 1.3086,-0.11914 1.1875,-0.12109 1.1875,-0.24024 1.19726,-0.23828 1.1875,-0.35742 1.06836,-0.24024 1.07032,-0.47656 0.95507,-0.47851 1.06836,-0.47852 0.83594,-0.47852 0.95117,-0.59765 v -1.19531 -1.19336 -1.19727 -1.19336 -1.3164 -1.19532 -1.19531 -1.19531 -1.19531 h -1.18945 -1.07422 -1.18945 -1.1875 -1.18946 -1.07421 -1.18946 -1.18945 -1.1875 -1.07422 -1.18945 -1.1875 -1.18946 -1.07617 -1.1875 v -1.19532 -1.07617 -1.19531 -1.19531 -1.19532 -1.07617 -1.19531 -1.19531 -1.19532 -1.07617 -1.19531 -1.19531 -1.19531 -1.07618 -1.1875 h 1.1875 1.19531 1.18946 1.1875 1.18945 1.1875 1.19531 1.1875 1.18946 1.18945 1.19336 1.18945 1.1875 1.1875 1.19532 1.18945 1.18945 1.1875 1.19531 1.18946 1.1875 1.1875 1.19531 1.18945 1.1875 1.1875 1.19727 1.1875 1.18945 1.1875 1.19531 1.1875 1.18946 v 1.1875 1.19532 1.19531 1.07617 1.19531 1.19531 1.19532 1.19531 1.19531 1.07617 1.19532 1.19531 1.19531 1.19531 1.19532 1.19531 1.07617 1.19531 1.19532 1.19726 1.19336 1.19727 1.19336 1.07617 1.19531 1.19531 1.19727 1.19336 1.19531 1.07617 1.19532 1.19531 1.19531 l -0.83008,0.7168 -0.95508,0.71679 -0.83203,0.59961 -0.95508,0.7168 -0.94922,0.59766 -0.94922,0.71679 -0.95703,0.59766 -0.94922,0.59766 -1.07617,0.5957 -1.06836,0.59961 -1.07031,0.59765 -1.07422,0.47071 -1.06836,0.59765 -1.18945,0.47852 -1.06641,0.47851 -1.19726,0.47657 -1.06836,0.47851 -1.07032,0.35938 -1.07421,0.35937 -1.06836,0.35938 -1.18946,0.35742 -1.06836,0.35937 -1.19531,0.23829 -1.06836,0.24023 -1.18945,0.23828 -1.19336,0.23828 -1.18945,0.11914 -1.3086,0.1211 -1.1875,0.11914 -1.30859,0.11914 -1.19531,0.11914 -1.30664,0.11914 h -1.3086 -1.30859 -1.30664 -1.19727 l -1.1875,-0.11914 -1.30859,-0.11914 -1.1875,-0.11914 -1.1875,-0.11914 -1.19727,-0.1211 -1.1875,-0.23828 -1.18945,-0.24023 -1.06836,-0.23828 -1.19336,-0.23828 -1.07031,-0.35938 -1.1875,-0.23828 -1.07617,-0.35938 -1.06836,-0.47851 -1.07031,-0.35742 -1.18555,-0.47852 -1.07617,-0.47851 -1.07032,-0.47657 -1.06836,-0.47851 -1.07617,-0.59766 -0.94922,-0.5918 -1.06836,-0.59765 -0.95703,-0.59961 -0.94922,-0.5957 -0.95507,-0.71875 -0.94922,-0.71485 -0.95117,-0.71875 -0.83594,-0.7168 -0.83008,-0.71679 -0.83594,-0.83789 -0.83008,-0.71485 -0.83789,-0.83789 -0.82812,-0.83789 -0.71875,-0.83593 -0.70899,-0.95508 -0.71875,-0.83789 -0.59765,-0.95508 -0.70899,-0.95899 -0.59765,-0.95312 -0.5918,-0.95899 -0.595702,-1.07617 -0.597657,-0.95508 -0.470703,-1.07617 -0.478516,-1.07617 -0.478515,-1.07617 -0.470703,-1.07422 -0.359375,-0.95508 -0.478516,-1.07812 -0.238281,-1.07617 -0.353516,-1.07422 -0.238281,-1.19532 -0.357422,-1.07617 -0.240234,-1.19531 -0.119141,-1.07617 -0.240234,-1.19531 -0.117188,-1.07618 -0.121094,-1.19531 -0.111328,-1.19531 -0.11914,-1.19531 v -1.31446 -1.19531 -0.24023 -1.19532 l 0.11914,-1.31445 v -1.19531 l 0.111328,-1.19531 0.121094,-1.31446 0.238282,-1.1875 0.11914,-1.19726 0.238281,-1.07618 0.359375,-1.19336 0.240235,-1.19726 0.349609,-1.07617 0.359375,-1.19336 0.359375,-1.07617 0.478516,-1.19727 0.470703,-1.07422 0.478515,-1.07617 0.478516,-1.07617 0.470703,-1.07617 0.597657,-1.07422 0.595702,-0.95703 0.5918,-0.95703 0.59765,-0.95704 0.59766,-0.95507 0.70898,-0.95704 0.71875,-0.95507 0.70899,-0.95508 0.71875,-0.83985 0.82812,-0.83593 0.71875,-0.83789 0.83008,-0.83399 0.83594,-0.83789 0.83008,-0.7168 0.95508,-0.83789 0.83007,-0.71679 0.94922,-0.7168 0.95703,-0.59766 0.94922,-0.71679 0.95703,-0.59766 0.94727,-0.59766 1.07031,-0.59765 1.07617,-0.59766 1.06836,-0.59765 1.06836,-0.47852 1.07422,-0.47852 1.18945,-0.59765 0.94922,-0.35742 1.18946,-0.35938 1.07617,-0.47851 1.06836,-0.24024 1.06836,-0.35742 1.19531,-0.24024 1.06836,-0.35742 1.1875,-0.23828 1.18945,-0.12109 1.19531,-0.23828 1.18946,-0.11914 1.18554,-0.11914 1.18946,-0.1211 z m 375.13477,0.24024 h 1.1875 1.31445 1.3086 1.30664 l 1.30859,0.11914 1.30859,0.11914 h 1.1875 l 1.31446,0.11914 1.1875,0.24023 1.30859,0.11914 1.18945,0.23828 1.07618,0.23828 1.1875,0.24024 1.18945,0.24023 1.06836,0.23829 1.19531,0.35742 1.06836,0.35937 1.07031,0.24024 1.19336,0.47656 1.07031,0.35937 1.06836,0.47657 1.06836,0.47851 1.19532,0.47852 1.06835,0.59765 0.94922,0.47852 1.07618,0.59766 1.07031,0.59765 0.94922,0.59961 1.07422,0.7168 0.95117,0.5957 0.95508,0.71875 0.94921,0.7168 0.94922,0.7168 -0.70898,0.95703 -0.59766,0.95507 -0.71093,0.95704 -0.7168,0.95703 -0.71094,1.07422 -0.59766,0.95703 -0.71679,0.95703 -0.71094,0.95508 -0.5957,0.95703 -0.71289,0.95703 -0.7168,0.95703 -0.59766,0.95508 -0.70898,1.07617 -0.71875,0.95508 -0.70899,0.95703 -0.59765,0.95508 -0.71094,0.95703 -0.95703,-0.7168 -1.06641,-0.59765 -0.95117,-0.59766 -0.95703,-0.7168 -1.06641,-0.47851 -0.95898,-0.59766 -1.06641,-0.47851 -0.94922,-0.47852 -1.07617,-0.47852 -0.94922,-0.47656 -1.06836,-0.35937 -0.95703,-0.47852 -1.30859,-0.35742 -1.1875,-0.35938 -1.18945,-0.35742 -1.19532,-0.24023 -1.1875,-0.23828 -1.1875,-0.24024 -1.18945,-0.12109 -1.19531,-0.11719 -1.06836,-0.12109 h -1.18945 -1.42579 l -1.30859,0.23828 -1.19531,0.24023 -1.06836,0.23828 -0.94922,0.48047 -0.83789,0.47657 -1.06836,0.95703 -0.71875,1.07617 -0.46875,1.07617 -0.12109,1.19531 v 0.23828 l 0.12109,1.55469 0.58984,1.31445 0.47852,0.7168 0.82812,0.83789 1.07618,0.59766 0.94922,0.59765 1.18945,0.47852 1.31445,0.47852 1.42774,0.47656 0.94921,0.23828 0.94922,0.35937 1.07617,0.23829 1.06836,0.35937 1.1875,0.24023 1.31641,0.35743 1.30859,0.35742 1.30664,0.36133 1.30665,0.23828 1.18945,0.35742 1.30664,0.35938 1.19726,0.23828 1.18946,0.35937 1.1875,0.35742 1.06836,0.35938 1.19531,0.35937 1.06836,0.35742 1.06836,0.35938 1.31445,0.4707 1.18946,0.59961 1.1875,0.47657 1.18945,0.59765 1.07617,0.59766 1.06836,0.59765 0.94922,0.59766 0.95508,0.7168 0.95117,0.59765 0.94922,0.83789 0.95507,0.83594 0.83008,0.95703 0.83594,0.83594 0.71094,0.95703 0.7168,1.07422 0.59179,0.95703 0.59766,1.07617 0.47656,0.95703 0.35938,1.07422 0.35156,1.07617 0.24023,1.07618 0.23828,1.19531 0.23828,1.19727 0.11915,1.19335 0.12109,1.31446 v 1.3164 0.23829 1.3164 l -0.12109,1.31445 -0.11915,1.19532 -0.11914,1.3125 -0.24023,1.19726 -0.35742,1.19336 -0.23047,1.07617 -0.36133,1.19727 -0.47656,1.07617 -0.47852,0.95703 -0.4707,1.07422 -0.59766,0.95508 -0.59765,0.95898 -0.71094,0.95508 -0.59766,0.95703 -0.70898,0.83594 -0.83789,0.83594 -0.71094,0.71875 -0.95508,0.83594 -0.83007,0.71875 -0.95704,0.71679 -0.94922,0.58985 -0.94921,0.71679 -1.07618,0.59766 -1.06835,0.47851 -1.06836,0.59766 -1.19532,0.47852 -1.18945,0.47851 -1.1875,0.35742 -1.1875,0.35938 -1.07617,0.35742 -1.1875,0.24024 -1.07031,0.23828 -1.06836,0.23828 -1.19532,0.24023 -1.18945,0.11914 -1.06836,0.11914 -1.19531,0.1211 -1.30664,0.11914 -1.18945,0.11914 h -1.1875 -1.3086 -1.31445 -1.1875 l -1.18945,-0.11914 h -1.30665 l -1.18945,-0.11914 -1.19531,-0.1211 -1.30859,-0.11914 -1.1875,-0.23828 -1.1875,-0.12109 -1.19532,-0.23828 -1.18945,-0.23828 -1.18945,-0.24024 -1.1875,-0.23828 -1.19532,-0.35742 -1.06836,-0.24024 -1.1875,-0.35937 -1.18945,-0.35742 -1.07422,-0.47852 -1.18945,-0.35937 -1.06836,-0.35743 -1.18945,-0.47851 -1.07422,-0.47852 -1.07031,-0.47851 -1.06836,-0.58985 -1.07618,-0.47851 -1.06836,-0.59961 -0.94921,-0.5957 -1.07618,-0.59766 -0.94921,-0.59766 -0.95704,-0.59765 -0.94921,-0.7168 -0.94922,-0.7168 -0.95508,-0.71875 -0.95117,-0.71679 -0.83594,-0.7168 -0.94922,-0.83594 0.7168,-0.95703 0.83008,-0.83594 0.71679,-0.95898 0.83008,-0.95508 0.71875,-0.83594 0.70898,-0.95703 0.8379,-0.95703 0.70898,-0.83594 0.83789,-0.95507 0.70899,-0.8379 0.83593,-0.95507 0.71094,-0.95899 0.71875,-0.83594 0.82812,-0.95507 0.7168,-0.95703 0.83008,-0.83594 0.7168,-0.95703 0.94922,0.71875 1.07031,0.71679 0.95508,0.7168 1.07031,0.7168 0.95508,0.59765 1.07031,0.7168 0.94727,0.59766 1.07812,0.47851 0.94727,0.59766 1.07031,0.47851 1.07617,0.47852 1.06641,0.47852 1.07226,0.35742 1.07422,0.47851 1.1875,0.35742 1.18945,0.35938 1.06836,0.35937 1.19532,0.24024 1.1875,0.23828 1.18945,0.23828 1.30664,0.11914 1.19531,0.24024 h 1.18945 l 1.30665,0.11718 h 1.18945 1.42578 l 1.30859,-0.11718 1.19532,-0.24024 1.06836,-0.23828 1.07031,-0.24023 0.95508,-0.35743 0.83203,-0.47851 0.95508,-0.7168 0.70898,-0.83789 0.47852,-0.95703 0.36132,-1.07422 0.11719,-1.19531 v -0.24024 l -0.11719,-1.43359 -0.47851,-1.19727 -0.59961,-0.83593 -0.83008,-0.7168 -0.95703,-0.7168 -0.94922,-0.47851 -1.06836,-0.47852 -1.19531,-0.47851 -1.42578,-0.59571 -0.83203,-0.24023 -0.94727,-0.23828 -1.07617,-0.35938 -1.07031,-0.23828 -1.1875,-0.35937 -1.19532,-0.23828 -1.30664,-0.35938 -1.18945,-0.23828 -1.30859,-0.35938 -1.1875,-0.23828 -1.19532,-0.35937 -1.1875,-0.23828 -1.18945,-0.35938 -1.07617,-0.35742 -1.18555,-0.24023 -1.07226,-0.35938 -1.06641,-0.35742 -1.07617,-0.35938 -1.3086,-0.47851 -1.1875,-0.47852 -1.18945,-0.47656 -1.19531,-0.47852 -1.06836,-0.59765 -1.18945,-0.59766 -0.95508,-0.59765 -1.07031,-0.59766 -0.94922,-0.7168 -0.95508,-0.59765 -0.83008,-0.71875 -0.83594,-0.83594 -0.83008,-0.83789 -0.71679,-0.83594 -0.71094,-0.83594 -0.59766,-0.83593 -0.58984,-0.95899 -0.59766,-1.07422 -0.47851,-0.82812 -0.35938,-0.95899 -0.35156,-1.07422 -0.35742,-0.95703 -0.24024,-1.19531 -0.23828,-1.07617 -0.12109,-1.19531 -0.11719,-1.19532 -0.12109,-1.31445 v -1.31445 -0.24024 -1.19531 l 0.12109,-1.19531 0.11719,-1.07617 0.12109,-1.19532 0.23828,-1.07422 0.24024,-1.07617 0.35742,-1.07812 0.24024,-1.07422 0.4707,-1.07617 0.47851,-1.07617 0.47657,-1.07422 0.59179,-1.07813 0.59571,-1.07422 0.71093,-0.95703 0.71875,-0.95508 0.83008,-0.95703 0.83594,-0.83594 0.83008,-0.95703 0.95703,-0.83789 0.82812,-0.59765 0.95704,-0.7168 0.94921,-0.7168 0.94922,-0.59765 1.07618,-0.59766 1.06835,-0.47852 1.06836,-0.59765 1.07618,-0.47656 1.1875,-0.35938 1.1875,-0.47851 1.07617,-0.35743 0.94922,-0.24023 1.07226,-0.24024 1.07422,-0.23828 1.1875,-0.23828 1.07031,-0.24023 1.1875,-0.11914 1.19532,-0.11914 1.1875,-0.11914 z m -289.08984,0.83593 h 1.1875 1.07617 1.1875 1.18945 1.19531 1.06836 1.1875 1.18945 1.19532 1.07031 1.18555 1.18945 1.19531 1.07032 1.1875 1.1875 1.19531 1.06836 1.18945 l 0.47852,1.07618 0.47851,1.07617 0.4707,1.07617 0.47852,1.19531 0.35742,1.07422 0.47071,1.07617 0.47851,1.07617 0.47852,1.07618 0.47851,1.07617 0.4707,1.19336 0.47852,1.07812 0.47852,1.07422 0.35156,1.07617 0.47851,1.07617 0.47852,1.07618 0.47852,1.19531 0.4707,1.07617 0.47656,1.07617 0.47852,1.07422 0.4707,1.07617 0.35937,1.07618 0.47657,1.19531 0.47265,1.07617 0.47852,1.07617 0.47656,1.07617 0.47852,1.07618 0.4707,1.07421 0.47852,1.19532 0.35937,1.07617 0.4707,1.07422 0.47852,1.07617 0.47852,1.07812 0.47851,1.07422 0.4707,1.19531 0.47852,1.06836 0.47656,1.07813 0.35156,1.07422 0.47852,1.07617 0.47852,1.07617 0.4707,1.07617 0.47852,1.19532 0.47851,1.07617 0.47852,1.07422 0.4707,1.07617 0.35937,1.07617 0.47657,1.07617 0.47265,1.19532 0.47657,1.07617 0.47851,1.07422 0.47852,1.07617 0.4707,1.07617 0.47852,1.07617 0.35742,1.19531 0.47265,1.07618 0.47657,1.07617 0.47851,1.07617 0.47071,1.07617 0.47851,1.07422 0.48047,1.19531 0.47852,1.07617 0.3496,1.07618 0.47852,1.07422 0.47852,1.07812 0.4707,1.07617 0.47851,1.19336 0.47852,1.07617 0.47656,1.07618 0.47071,1.07617 0.35937,1.07422 0.48047,1.07617 0.4707,1.19726 0.47656,1.07422 0.47657,1.07617 0.47265,1.07618 0.47657,1.07617 0.47851,1.06836 0.36133,1.19531 0.46875,1.07617 0.47852,1.07617 0.47851,1.07617 h -1.1875 -1.19531 -1.07031 -1.18555 -1.19727 -1.1875 -1.18945 -1.06836 -1.19531 -1.1875 -1.18945 -1.18946 -1.19336 -1.07031 -1.1875 -1.18945 -1.19532 -1.1875 -1.06835 -1.18946 -1.19336 l -0.47265,-1.07617 -0.35938,-1.07617 -0.47656,-1.07617 -0.47852,-1.19531 -0.35156,-1.06836 -0.47851,-1.07617 -0.47852,-1.07618 -0.35156,-1.07617 -0.47657,-1.07422 -0.48046,-1.07617 -0.35547,-1.07617 -0.47266,-1.19531 -0.47851,-1.07617 -0.35938,-1.07618 -0.47852,-1.07617 h -1.1875 -1.1875 -1.18945 -1.1875 -1.07617 -1.18945 -1.1875 -1.19532 -1.1875 -1.18945 -1.1875 -1.1875 -1.19726 -1.1875 -1.06836 -1.19532 -1.18945 -1.1875 -1.18945 -1.19336 -1.18946 -1.18945 -1.1875 -1.1875 -1.07812 -1.18555 -1.18945 -1.19532 -1.18945 l -0.4707,1.07617 -0.35742,1.07618 -0.47852,1.07617 -0.47852,1.19531 -0.35156,1.07617 -0.47656,1.07617 -0.48047,1.07422 -0.35742,1.07617 -0.4707,1.07618 -0.47852,1.07617 -0.35937,1.06836 -0.47266,1.19531 -0.47656,1.07617 -0.35938,1.07617 -0.47851,1.07617 h -1.1875 -1.1875 -1.1875 -1.19727 -1.1875 -1.30859 -1.1875 -1.18946 -1.19531 -1.1875 -1.1875 -1.18945 -1.19531 -1.1875 -1.1875 -1.3086 -1.19531 -1.18945 -1.1875 -1.18946 l 0.47071,-1.07617 0.47851,-1.07617 0.47852,-1.07617 0.4707,-1.19531 0.35938,-1.06836 0.47851,-1.07617 0.47852,-1.07618 0.4707,-1.07617 0.47852,-1.07422 0.47851,-1.19726 0.4707,-1.07617 0.47852,-1.07422 0.35742,-1.07617 0.47852,-1.07618 0.4707,-1.07617 0.47852,-1.19336 0.47656,-1.07617 0.47266,-1.07812 0.47851,-1.07422 0.47656,-1.07618 0.35938,-1.07617 0.4707,-1.19531 0.47852,-1.07422 0.47851,-1.07617 0.47071,-1.07617 0.47851,-1.07617 0.47852,-1.07618 0.4707,-1.19531 0.35938,-1.07617 0.47851,-1.07617 0.47656,-1.07617 0.47266,-1.07422 0.47656,-1.07617 0.47852,-1.19532 0.4707,-1.07617 0.47852,-1.07617 0.35742,-1.07617 0.48047,-1.07422 0.4707,-1.07617 0.47852,-1.19532 0.47851,-1.07617 0.4707,-1.07617 0.47657,-1.07617 0.47851,-1.07422 0.35938,-1.07813 0.4707,-1.06836 0.47852,-1.19531 0.47656,-1.07422 0.47265,-1.07812 0.47657,-1.07617 0.47851,-1.07422 0.47071,-1.07617 0.35937,-1.19532 0.47852,-1.07421 0.47656,-1.07618 0.47266,-1.07617 0.47851,-1.07617 0.47852,-1.07617 0.4707,-1.19531 0.47852,-1.07618 0.35742,-1.07617 0.47851,-1.07422 0.47071,-1.07617 0.47851,-1.07617 0.47852,-1.19531 0.4707,-1.07618 0.47852,-1.07617 0.47851,-1.07617 0.35156,-1.07422 0.47852,-1.07812 0.47852,-1.19336 0.47851,-1.07617 0.4707,-1.07618 0.47852,-1.07617 0.47656,-1.07617 0.47071,-1.07422 0.35937,-1.19531 0.47852,-1.07617 0.47851,-1.07617 z m 68.57812,0.59766 h 1.1875 1.19531 1.07031 1.1875 1.18946 1.19531 1.06836 1.1875 1.19727 1.1875 1.06836 1.18945 1.19531 1.1875 1.06836 1.1875 1.19727 1.18945 1.0664 1.18946 1.19531 l 0.58984,0.95703 0.59766,1.07422 0.70899,0.94922 0.5996,1.07617 0.59766,0.95508 0.58984,1.07812 0.59766,0.94727 0.71289,1.07812 0.5957,0.95703 0.59766,0.95508 0.5918,1.06836 0.59765,0.95703 0.70899,1.07422 0.59765,0.95703 0.59766,1.06836 0.58984,0.95703 0.71875,0.95508 0.59766,1.07031 0.58984,0.95508 0.59766,1.07618 0.5918,0.95703 0.71679,1.06836 0.59766,0.95703 0.58984,1.07422 0.59766,0.94921 0.5918,0.95704 0.71679,1.07617 0.59766,0.95703 0.58984,1.07617 0.59766,0.94922 0.5918,1.07617 0.71679,0.95508 0.59766,1.06836 0.5918,0.95703 0.59765,-0.95703 0.59571,-1.06836 0.71093,-0.95508 0.59571,-1.07617 0.59375,-0.94922 0.5957,-1.07617 0.71094,-0.95703 0.59765,-1.07617 0.59961,-0.95704 0.58789,-0.94921 0.71875,-1.07422 0.58985,-0.95703 0.59961,-1.06836 0.5957,-0.95703 0.71094,-1.07618 0.5957,-0.95508 0.59961,-1.07031 0.58984,-0.95508 0.59961,-0.95703 0.70899,-1.06836 0.59765,-0.95703 0.59766,-1.07422 0.5918,-0.95703 0.71484,-1.06836 0.5918,-0.95508 0.59765,-0.95703 0.59766,-1.07812 0.70898,-0.94727 0.59961,-1.07812 0.58985,-0.95508 0.59765,-1.07617 0.7168,-0.94922 0.5918,-1.07422 0.59765,-0.95703 h 1.1875 1.18946 1.07422 1.18945 1.1875 1.18945 1.07422 1.18945 1.1875 1.18946 1.07617 1.1875 1.1875 1.18945 1.07422 1.18945 1.18946 1.1875 1.07617 1.1875 1.1875 v 1.19531 1.19531 1.19532 1.19531 1.19531 1.19531 1.19532 1.19531 1.19531 1.19531 1.19532 1.19531 1.19531 1.19531 1.19532 1.19726 1.19531 1.19532 1.07422 1.19531 1.19531 1.19531 1.19532 1.19726 1.19531 1.19532 1.19531 1.19336 1.19726 1.19532 1.19531 1.18945 1.19336 1.19727 1.19336 1.19531 1.19531 1.19531 1.19532 1.19726 1.19336 1.19727 1.19531 1.19531 1.19336 1.19531 1.19532 1.19726 1.19336 1.19727 1.19531 1.19531 1.19336 1.19727 1.07617 1.19531 1.19531 1.19336 1.19727 1.19336 1.19726 1.19532 1.19531 1.19531 1.19531 1.19532 1.19531 1.19336 1.19726 1.18946 1.19336 1.19726 1.19531 h -1.1875 -1.1875 -1.18945 -1.31446 -1.1875 -1.18945 -1.1875 -1.19531 -1.18946 -1.30664 -1.18945 -1.1875 -1.19531 -1.1875 -1.18946 -1.30664 -1.19726 -1.1875 -1.18945 v -1.19531 -1.19726 -1.19336 -1.19727 -1.20117 -1.19531 -1.19532 -1.19726 -1.19336 -1.19531 -1.19531 -1.20313 -1.19531 -1.19532 -1.19531 -1.19531 -1.20312 -1.19532 -1.19531 -1.19531 -1.19532 -1.19531 -1.20117 -1.19531 -1.19727 -1.19531 -1.19531 -1.19532 -1.20312 -1.19531 -1.19531 -1.19336 -1.19532 -1.19531 -1.20312 -1.19532 -1.19531 -1.19531 -1.19531 -1.20313 -1.19531 -1.19531 -1.19532 l -0.59571,0.95508 -0.71094,1.08399 -0.59765,0.95703 -0.71094,0.95703 -0.5957,1.07422 -0.71875,0.95703 -0.58985,0.95703 -0.59961,1.08203 -0.70898,0.95508 -0.59766,0.95703 -0.71679,0.95703 -0.58985,1.08203 -0.71875,0.95703 -0.58984,0.95508 -0.59961,1.07617 -0.7168,0.96289 -0.58984,0.95704 -0.71875,1.07617 -0.58789,0.95703 -0.71875,0.95508 -0.58984,1.08203 -0.59961,0.95898 -0.71485,0.95508 -0.59179,1.07617 -0.7168,0.96289 -0.58984,0.95508 -0.7168,0.95899 -0.59961,1.07421 -0.58985,0.9629 -0.71679,0.95703 -0.58985,1.07617 -0.71875,0.95508 -0.59765,0.95703 -0.70899,1.08398 -0.59765,0.95508 h -0.47266 l -0.7168,-1.07617 -0.59765,-0.96289 -0.71094,-1.07617 -0.59766,-0.95704 -0.71093,-1.07421 -0.59571,-0.96485 -0.71093,-1.07422 -0.59766,-0.95898 -0.7168,-1.07422 -0.59179,-0.95508 -0.7168,-1.08398 -0.58984,-0.95703 -0.7168,-1.07618 -0.59961,-0.95507 -0.70898,-1.08204 -0.59766,-0.95703 -0.70899,-1.07617 -0.71875,-0.95508 -0.59765,-1.08398 -0.70899,-0.95508 -0.59765,-1.07617 -0.71094,-0.95703 -0.59766,-1.08399 -0.71093,-0.95507 -0.59766,-1.07618 -0.7168,-0.95507 -0.58984,-1.07618 -0.71875,-0.96484 -0.58984,-1.07422 -0.7168,-0.95703 -0.59766,-1.07617 -0.70898,-0.95508 -0.60156,-1.08398 -0.70899,-0.95508 v 1.19336 1.19726 1.19531 1.20118 1.19531 1.19531 1.19531 1.19727 1.20117 1.19531 1.07618 1.19531 1.19531 1.19531 1.20313 1.19531 1.19531 1.19336 1.19727 1.19531 1.20117 1.19532 1.19726 1.19336 1.19727 1.19336 1.20312 1.19531 1.19532 1.19531 1.19531 1.20117 1.07813 1.19531 1.19336 1.19726 1.19532 1.19531 1.20117 1.19727 1.19336 1.19726 1.19531 h -1.1875 -1.19531 -1.18945 -1.1875 -1.1875 -1.19532 -1.18945 -1.1875 -1.18945 -1.19532 -1.1875 -1.18945 -1.1875 -1.19531 -1.1875 -1.18945 -1.18946 -1.19531 -1.1875 v -1.19531 -1.19726 -1.19336 -1.18946 -1.19726 -1.19336 -1.19531 -1.19532 -1.19531 -1.19531 -1.19531 -1.19532 -1.19726 -1.19336 -1.19727 -1.19336 -1.19531 -1.19531 -1.07617 -1.19727 -1.19336 -1.19531 -1.19531 -1.19727 -1.19336 -1.19726 -1.19532 -1.19531 -1.19336 -1.19531 -1.19531 -1.19727 -1.19336 -1.19726 -1.19532 -1.19531 -1.19531 -1.19531 -1.19336 -1.19727 -1.19336 -1.18945 -1.19531 -1.19532 -1.19726 -1.19336 -1.19531 -1.19532 -1.19531 -1.19726 -1.19532 -1.19531 -1.19531 -1.19531 -1.07422 -1.19532 -1.19531 -1.19726 -1.19532 -1.19531 -1.19531 -1.19531 -1.19532 -1.19531 -1.19531 -1.19531 -1.19532 -1.19531 -1.19531 -1.19531 -1.19532 -1.19531 z m 108.61133,0 h 1.1875 1.18945 1.19531 1.18555 1.18945 1.18946 1.19531 1.1875 1.1875 1.18945 1.19531 1.18946 1.1875 1.1875 1.07617 1.18945 1.1875 1.18946 1.19336 1.18945 1.1875 1.18945 1.19531 1.1875 1.1875 1.18946 1.19531 1.18945 1.1875 1.1875 1.19727 1.1875 1.1875 1.1875 1.18945 1.19727 1.1875 1.1875 1.1875 1.19726 1.1875 1.1875 1.1875 1.07813 1.1875 1.18945 1.18945 1.19336 1.1875 1.18946 1.1875 1.19531 1.18945 1.1875 1.18946 1.19335 1.18946 1.18945 v 1.19531 1.07617 1.19532 1.19531 1.19531 1.07617 1.19532 1.19531 1.07422 1.19726 1.19336 1.07813 1.19531 1.19336 1.19726 1.07618 1.19531 h -1.18945 -1.18946 -1.19335 -1.18946 -1.1875 -1.18945 -1.07617 -1.1875 -1.1875 -1.18946 -1.19531 -1.1875 -1.18945 -1.1875 -1.19727 -1.1875 -1.1875 -1.1875 -1.19726 -1.06641 -1.18945 -1.18946 -1.19531 -1.1875 -1.18945 -1.1875 -1.19531 -1.1875 -1.18946 -1.1875 -1.19531 -1.18945 -1.06836 -1.1875 -1.19531 -1.18946 -1.1875 -1.18945 -1.19531 v 1.19531 1.19336 1.19531 1.19532 1.19726 1.07617 1.19336 1.19727 1.19336 1.19726 1.19336 1.19727 h 1.19531 1.18945 1.1875 1.18946 1.19531 1.1875 1.1875 1.18945 1.07617 1.1875 1.18946 1.1875 1.19531 1.1875 1.18945 1.1875 1.19531 1.18946 1.18945 1.1875 1.19336 1.18945 1.18946 1.18945 1.19336 1.18945 1.06836 1.1875 1.19531 1.18946 1.1875 1.1875 1.19531 1.18945 1.1875 v 1.19336 1.07617 1.18945 1.19532 1.07617 1.19336 1.19726 1.07617 1.19532 1.19531 1.19531 1.07422 1.19531 1.19531 1.07813 1.19531 h -1.1875 -1.18945 -1.19531 -1.1875 -1.1875 -1.18946 -1.19531 -1.1875 -1.06836 -1.18945 -1.19336 -1.18945 -1.18946 -1.18945 -1.19336 -1.1875 -1.18945 -1.18946 -1.19531 -1.1875 -1.18945 -1.1875 -1.19531 -1.1875 -1.18946 -1.1875 -1.07617 -1.18945 -1.1875 -1.1875 -1.19531 -1.18946 -1.1875 -1.18945 -1.19531 v 1.19336 1.31641 1.19531 1.19531 1.31446 1.19726 1.19336 1.31445 1.19532 1.19531 1.31445 1.19532 h 1.19531 1.18945 1.1875 1.18946 1.19531 1.1875 1.1875 1.18945 1.19531 1.3086 1.1875 1.1875 1.19531 1.18945 1.18946 1.1875 1.19531 1.1875 1.18945 1.1875 1.1875 1.19727 1.1875 1.18945 1.18555 1.19726 1.18946 1.1875 1.1875 1.31445 1.18945 1.1875 1.18946 1.19531 1.1875 1.18945 1.1875 1.19531 1.1875 v 1.19726 1.07422 1.19726 1.19336 1.19727 1.07617 1.19336 1.19531 1.07813 1.19336 1.19531 1.07813 1.1875 1.19531 1.19336 1.07812 1.19531 h -1.1875 -1.19531 -1.1875 -1.18945 -1.1875 -1.19531 -1.18946 -1.1875 -1.18945 -1.31445 -1.1875 -1.1875 -1.18946 -1.19726 -1.18555 -1.18945 -1.1875 -1.19727 -1.1875 -1.1875 -1.18945 -1.1875 -1.19531 -1.1875 -1.18946 -1.18945 -1.19531 -1.1875 -1.1875 -1.3086 -1.19531 -1.18945 -1.1875 -1.1875 -1.19531 -1.18946 -1.1875 -1.18945 -1.19531 -1.1875 -1.1875 -1.18946 -1.19726 -1.18555 -1.18945 -1.1875 -1.19531 -1.18946 -1.30859 -1.1875 -1.1875 -1.19531 -1.18946 -1.18945 -1.18555 -1.19531 -1.18945 -1.1875 v -1.19531 -1.19726 -1.19336 -1.18946 -1.19726 -1.19336 -1.19531 -1.19532 -1.19531 -1.19531 -1.19531 -1.19532 -1.19726 -1.19336 -1.19727 -1.19336 -1.19531 -1.19531 -1.07617 -1.19727 -1.19336 -1.19531 -1.19531 -1.19727 -1.19336 -1.19726 -1.19532 -1.19531 -1.19336 -1.19531 -1.19531 -1.19727 -1.19336 -1.19726 -1.19532 -1.19531 -1.19531 -1.19531 -1.19336 -1.19727 -1.19336 -1.18945 -1.19531 -1.19532 -1.19726 -1.19336 -1.19531 -1.19532 -1.19531 -1.19726 -1.19532 -1.19531 -1.19531 -1.19531 -1.07422 -1.19532 -1.19531 -1.19726 -1.19532 -1.19531 -1.19531 -1.19531 -1.19532 -1.19531 -1.19531 -1.19531 -1.19532 -1.19531 -1.19531 -1.19531 -1.19532 -1.19531 z M 235,485.71289 l -0.4707,1.07617 -0.35742,1.08399 -0.47852,1.19531 -0.47852,1.08203 -0.35156,1.07422 -0.47851,1.07812 -0.47852,1.20118 -0.4707,1.07617 -0.35938,1.07617 -0.47851,1.08203 -0.47852,1.07617 -0.35156,1.19727 -0.47656,1.08203 -0.47852,1.07422 -0.35742,1.07617 -0.47266,1.08203 -0.47851,1.19727 -0.47657,1.07617 -0.35156,1.08203 -0.47851,1.07617 -0.47852,1.19531 -0.35937,1.08399 -0.47071,1.07422 h 1.1875 1.18945 1.18946 1.19336 1.18945 1.1875 1.18945 1.19532 1.06836 1.1875 1.19726 1.1875 1.1875 1.18945 1.1875 1.19532 1.1875 l -0.47657,-1.07422 -0.35937,-1.08399 -0.4707,-1.19531 -0.47852,-1.07617 -0.35937,-1.08203 -0.47071,-1.07617 -0.47656,-1.19727 -0.35937,-1.08203 -0.47852,-1.07617 -0.4707,-1.07422 -0.35938,-1.08203 -0.47851,-1.19727 -0.35157,-1.07617 -0.47851,-1.08203 -0.47852,-1.07617 -0.35742,-1.07617 -0.4707,-1.20118 -0.47852,-1.07812 -0.35742,-1.07422 -0.47852,-1.08203 -0.4707,-1.19531 -0.35937,-1.08399 z m -36.10742,163.34375 h 250.74023 l -127.98242,42.20508 z" + style="fill:#bebebe;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.33333325" /> \ No newline at end of file diff --git a/src/data/sources/epicgames/EpicGames.vala b/src/data/sources/epicgames/EpicGames.vala index 6c319e79..09b5b0cb 100644 --- a/src/data/sources/epicgames/EpicGames.vala +++ b/src/data/sources/epicgames/EpicGames.vala @@ -121,6 +121,9 @@ namespace GameHub.Data.Sources.EpicGames { cache_loaded(); } + var regex = /\*\s*([^(]*)\s\(App\sname:\s([a-zA-Z0-9]+),\sversion:\s([^)]*)\)/; + + var installed_output = new DataInputStream(new Subprocess.newv ({"legendary", "list-installed"}, STDOUT_PIPE).get_stdout_pipe ()); var output = new DataInputStream(new Subprocess.newv ({"legendary", "list-games"}, STDOUT_PIPE).get_stdout_pipe ()); @@ -128,7 +131,7 @@ namespace GameHub.Data.Sources.EpicGames MatchInfo info; while ((line = output.read_line()) != null) { // FIXME: This REGEX is ugly - if (/\*\s*([^(]*)\s\(App\sname:\s([a-zA-Z0-9]+),\sversion:\s([^)]*)\)/.match (line, 0, out info)) { + if (regex.match (line, 0, out info)) { debug ("\tname = %s\tid = %s\tversion = %s\n\n", info.fetch (1), info.fetch (2), info.fetch (3)); var g = new EpicGamesGame(this, info.fetch (1), info.fetch (2)); bool is_new_game = !_games.contains(g); diff --git a/src/data/sources/epicgames/EpicGamesGame.vala b/src/data/sources/epicgames/EpicGamesGame.vala index 9af02df6..c86119d4 100644 --- a/src/data/sources/epicgames/EpicGamesGame.vala +++ b/src/data/sources/epicgames/EpicGamesGame.vala @@ -85,7 +85,12 @@ namespace GameHub.Data.Sources.EpicGames public override async void install(Runnable.Installer.InstallMode install_mode=Runnable.Installer.InstallMode.INTERACTIVE) { - debug("[EpicGamesGame] install: NOT IMPLEMENTED"); + var output = new DataInputStream(new Subprocess.newv ({"legendary", "download", id}, STDOUT_PIPE).get_stdout_pipe ()); + string? line = null; + while ((line = output.read_line()) != null) { + debug("[EpicGames] %s", line); + } + } public override async void uninstall() { From d7c48cc6c58fc8fb5b2eebce47383914ad52c2a4 Mon Sep 17 00:00:00 2001 From: Adam Jordanek Date: Thu, 30 Apr 2020 12:56:07 +0200 Subject: [PATCH 08/24] fixup! Epic games support --- src/data/sources/epicgames/EpicGames.vala | 3 -- src/data/sources/epicgames/EpicGamesGame.vala | 43 ++++++++++++++++++- 2 files changed, 41 insertions(+), 5 deletions(-) diff --git a/src/data/sources/epicgames/EpicGames.vala b/src/data/sources/epicgames/EpicGames.vala index 09b5b0cb..89601ef1 100644 --- a/src/data/sources/epicgames/EpicGames.vala +++ b/src/data/sources/epicgames/EpicGames.vala @@ -123,9 +123,6 @@ namespace GameHub.Data.Sources.EpicGames } var regex = /\*\s*([^(]*)\s\(App\sname:\s([a-zA-Z0-9]+),\sversion:\s([^)]*)\)/; - var installed_output = new DataInputStream(new Subprocess.newv ({"legendary", "list-installed"}, STDOUT_PIPE).get_stdout_pipe ()); - - var output = new DataInputStream(new Subprocess.newv ({"legendary", "list-games"}, STDOUT_PIPE).get_stdout_pipe ()); string? line = null; MatchInfo info; diff --git a/src/data/sources/epicgames/EpicGamesGame.vala b/src/data/sources/epicgames/EpicGamesGame.vala index c86119d4..3e3420fa 100644 --- a/src/data/sources/epicgames/EpicGamesGame.vala +++ b/src/data/sources/epicgames/EpicGamesGame.vala @@ -44,6 +44,37 @@ namespace GameHub.Data.Sources.EpicGames public override void update_status() { + var regex = /\*\s*([^(]*)\s\(App\sname:\s([a-zA-Z0-9]+),\sversion:\s([^)]*)\)/; + var installed_output = new DataInputStream(new Subprocess.newv ({"legendary", "list-installed"}, STDOUT_PIPE).get_stdout_pipe ()); + var state = Game.State.UNINSTALLED; + + string? line = null; + MatchInfo info; + while ((line = installed_output.read_line()) != null) { + // FIXME: This REGEX is ugly + if (regex.match (line, 0, out info)) { + debug ("Installed \tname = %s\tid = %s\tversion = %s\n\n", info.fetch (1), info.fetch (2), info.fetch (3)); + debug("'%s' - '%s'", id, info.fetch(2)); + if(info.fetch(2) == id) { + debug("Installed"); + state = Game.State.INSTALLED; + executable_path = "ls"; + break; + } + + } + } + status = new Game.Status(state, this); + if(state == Game.State.INSTALLED) + { + remove_tag(Tables.Tags.BUILTIN_UNINSTALLED); + add_tag(Tables.Tags.BUILTIN_INSTALLED); + } + else + { + add_tag(Tables.Tags.BUILTIN_UNINSTALLED); + remove_tag(Tables.Tags.BUILTIN_INSTALLED); + } update_version(); } @@ -85,17 +116,25 @@ namespace GameHub.Data.Sources.EpicGames public override async void install(Runnable.Installer.InstallMode install_mode=Runnable.Installer.InstallMode.INTERACTIVE) { - var output = new DataInputStream(new Subprocess.newv ({"legendary", "download", id}, STDOUT_PIPE).get_stdout_pipe ()); + // FIXME: It can be done much better + var process = new Subprocess.newv ({"legendary", "download", id}, STDOUT_PIPE | STDIN_PIPE); + var input = new DataOutputStream(process.get_stdin_pipe ()); + var output = new DataInputStream(process.get_stdout_pipe ()); string? line = null; + input.put_string("y\n"); while ((line = output.read_line()) != null) { debug("[EpicGames] %s", line); } - } public override async void uninstall() { debug("[EpicGamesGame] uninstall: NOT IMPLEMENTED"); } + public override async void run() + { + new Subprocess.newv ({"legendary", "launch", id}, STDOUT_PIPE); + } + } } From d7ac6ab4097a1d996b36e773ae3b4d54e95b9699 Mon Sep 17 00:00:00 2001 From: Adam Jordanek Date: Thu, 30 Apr 2020 13:05:21 +0200 Subject: [PATCH 09/24] fixup! Epic games support --- src/data/sources/epicgames/EpicGames.vala | 17 ++++++++++++- src/data/sources/epicgames/EpicGamesGame.vala | 24 ++++--------------- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/src/data/sources/epicgames/EpicGames.vala b/src/data/sources/epicgames/EpicGames.vala index 89601ef1..68a186b8 100644 --- a/src/data/sources/epicgames/EpicGames.vala +++ b/src/data/sources/epicgames/EpicGames.vala @@ -87,6 +87,11 @@ namespace GameHub.Data.Sources.EpicGames public override ArrayList games { get { return _games; } } + private ArrayList _installed = new ArrayList(); + public bool is_app_installed(string id) { + return _installed.contains(id); + } + public override async ArrayList load_games(Utils.FutureResult2? game_loaded=null, Utils.Future? cache_loaded=null) { if(_games.size > 0) @@ -123,9 +128,19 @@ namespace GameHub.Data.Sources.EpicGames } var regex = /\*\s*([^(]*)\s\(App\sname:\s([a-zA-Z0-9]+),\sversion:\s([^)]*)\)/; - var output = new DataInputStream(new Subprocess.newv ({"legendary", "list-games"}, STDOUT_PIPE).get_stdout_pipe ()); + var installed_output = new DataInputStream(new Subprocess.newv ({"legendary", "list-installed"}, STDOUT_PIPE).get_stdout_pipe ()); + string? line = null; MatchInfo info; + while ((line = installed_output.read_line()) != null) { + // FIXME: This REGEX is ugly + if (regex.match (line, 0, out info)) { + _installed.add(info.fetch(2)); + } + } + + var output = new DataInputStream(new Subprocess.newv ({"legendary", "list-games"}, STDOUT_PIPE).get_stdout_pipe ()); + while ((line = output.read_line()) != null) { // FIXME: This REGEX is ugly if (regex.match (line, 0, out info)) { diff --git a/src/data/sources/epicgames/EpicGamesGame.vala b/src/data/sources/epicgames/EpicGamesGame.vala index 3e3420fa..e7d3cf4c 100644 --- a/src/data/sources/epicgames/EpicGamesGame.vala +++ b/src/data/sources/epicgames/EpicGamesGame.vala @@ -44,27 +44,11 @@ namespace GameHub.Data.Sources.EpicGames public override void update_status() { - var regex = /\*\s*([^(]*)\s\(App\sname:\s([a-zA-Z0-9]+),\sversion:\s([^)]*)\)/; - var installed_output = new DataInputStream(new Subprocess.newv ({"legendary", "list-installed"}, STDOUT_PIPE).get_stdout_pipe ()); var state = Game.State.UNINSTALLED; - - string? line = null; - MatchInfo info; - while ((line = installed_output.read_line()) != null) { - // FIXME: This REGEX is ugly - if (regex.match (line, 0, out info)) { - debug ("Installed \tname = %s\tid = %s\tversion = %s\n\n", info.fetch (1), info.fetch (2), info.fetch (3)); - debug("'%s' - '%s'", id, info.fetch(2)); - if(info.fetch(2) == id) { - debug("Installed"); - state = Game.State.INSTALLED; - executable_path = "ls"; - break; - } - - } + if (((EpicGames)source).is_app_installed(id)) { + state = Game.State.INSTALLED; } - status = new Game.Status(state, this); + if(state == Game.State.INSTALLED) { remove_tag(Tables.Tags.BUILTIN_UNINSTALLED); @@ -75,7 +59,7 @@ namespace GameHub.Data.Sources.EpicGames add_tag(Tables.Tags.BUILTIN_UNINSTALLED); remove_tag(Tables.Tags.BUILTIN_INSTALLED); } - + status = new Game.Status(state, this); update_version(); } From 886349dc9234e5a4c683c4fecff051e8fb059d8a Mon Sep 17 00:00:00 2001 From: Adam Jordanek Date: Thu, 30 Apr 2020 13:19:47 +0200 Subject: [PATCH 10/24] fixup! Epic games support --- src/data/db/tables/Games.vala | 4 ++++ src/data/db/tables/IGDBData.vala | 1 + src/data/db/tables/Tags.vala | 1 + src/data/sources/epicgames/EpicGames.vala | 1 - src/data/sources/epicgames/EpicGamesGame.vala | 6 +++++- 5 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/data/db/tables/Games.vala b/src/data/db/tables/Games.vala index 4e350100..9423f20d 100644 --- a/src/data/db/tables/Games.vala +++ b/src/data/db/tables/Games.vala @@ -312,6 +312,10 @@ namespace GameHub.Data.DB.Tables { g = new SteamGame.from_db((Steam) s, st); } + else if(s is EpicGames) + { + g = new EpicGamesGame.from_db((EpicGames) s, st); + } else if(s is GOG) { g = new GOGGame.from_db((GOG) s, st); diff --git a/src/data/db/tables/IGDBData.vala b/src/data/db/tables/IGDBData.vala index 6c151437..bc53146e 100644 --- a/src/data/db/tables/IGDBData.vala +++ b/src/data/db/tables/IGDBData.vala @@ -24,6 +24,7 @@ using GameHub.Utils; using GameHub.Data.Sources.Steam; using GameHub.Data.Sources.GOG; using GameHub.Data.Sources.Humble; +using GameHub.Data.Sources.EpicGames; namespace GameHub.Data.DB.Tables { diff --git a/src/data/db/tables/Tags.vala b/src/data/db/tables/Tags.vala index dfcad4a0..5803e420 100644 --- a/src/data/db/tables/Tags.vala +++ b/src/data/db/tables/Tags.vala @@ -22,6 +22,7 @@ using Sqlite; using GameHub.Utils; using GameHub.Data.Sources.Steam; +using GameHub.Data.Sources.EpicGames; using GameHub.Data.Sources.GOG; using GameHub.Data.Sources.Humble; diff --git a/src/data/sources/epicgames/EpicGames.vala b/src/data/sources/epicgames/EpicGames.vala index 68a186b8..81edb6ac 100644 --- a/src/data/sources/epicgames/EpicGames.vala +++ b/src/data/sources/epicgames/EpicGames.vala @@ -144,7 +144,6 @@ namespace GameHub.Data.Sources.EpicGames while ((line = output.read_line()) != null) { // FIXME: This REGEX is ugly if (regex.match (line, 0, out info)) { - debug ("\tname = %s\tid = %s\tversion = %s\n\n", info.fetch (1), info.fetch (2), info.fetch (3)); var g = new EpicGamesGame(this, info.fetch (1), info.fetch (2)); bool is_new_game = !_games.contains(g); if(is_new_game) { diff --git a/src/data/sources/epicgames/EpicGamesGame.vala b/src/data/sources/epicgames/EpicGamesGame.vala index e7d3cf4c..7b7da4bd 100644 --- a/src/data/sources/epicgames/EpicGamesGame.vala +++ b/src/data/sources/epicgames/EpicGamesGame.vala @@ -32,6 +32,7 @@ namespace GameHub.Data.Sources.EpicGames id = idP; icon = ""; platforms.add(Platform.WINDOWS); + platforms.add(Platform.LINUX); install_dir = null; executable_path = "$game_dir/start.sh"; @@ -47,6 +48,10 @@ namespace GameHub.Data.Sources.EpicGames var state = Game.State.UNINSTALLED; if (((EpicGames)source).is_app_installed(id)) { state = Game.State.INSTALLED; + debug ("New installed game: \tname = %s\t", name); + } else { + + debug ("New not installed game: \tname = %s\t", name); } if(state == Game.State.INSTALLED) @@ -60,7 +65,6 @@ namespace GameHub.Data.Sources.EpicGames remove_tag(Tables.Tags.BUILTIN_INSTALLED); } status = new Game.Status(state, this); - update_version(); } public EpicGamesGame.from_db(EpicGames src, Sqlite.Statement s) From aa0b63493ac18186b835a9bba1c3b842db2a0ef6 Mon Sep 17 00:00:00 2001 From: Adam Jordanek Date: Thu, 30 Apr 2020 13:40:05 +0200 Subject: [PATCH 11/24] fixup! Epic games support --- src/data/sources/epicgames/EpicGames.vala | 4 ++++ src/data/sources/epicgames/EpicGamesGame.vala | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/data/sources/epicgames/EpicGames.vala b/src/data/sources/epicgames/EpicGames.vala index 81edb6ac..7a88a8f4 100644 --- a/src/data/sources/epicgames/EpicGames.vala +++ b/src/data/sources/epicgames/EpicGames.vala @@ -105,6 +105,7 @@ namespace GameHub.Data.Sources.EpicGames _games.clear(); games_count = 0; + var cached = Tables.Games.get_all(this); if(cached.size > 0) { @@ -126,6 +127,7 @@ namespace GameHub.Data.Sources.EpicGames { cache_loaded(); } + var regex = /\*\s*([^(]*)\s\(App\sname:\s([a-zA-Z0-9]+),\sversion:\s([^)]*)\)/; var installed_output = new DataInputStream(new Subprocess.newv ({"legendary", "list-installed"}, STDOUT_PIPE).get_stdout_pipe ()); @@ -154,6 +156,8 @@ namespace GameHub.Data.Sources.EpicGames } _games.add(g); games_count++; + } else { + _games.get(_games.index_of(g)).update_status(); } } } diff --git a/src/data/sources/epicgames/EpicGamesGame.vala b/src/data/sources/epicgames/EpicGamesGame.vala index 7b7da4bd..97cce3d5 100644 --- a/src/data/sources/epicgames/EpicGamesGame.vala +++ b/src/data/sources/epicgames/EpicGamesGame.vala @@ -28,7 +28,7 @@ namespace GameHub.Data.Sources.EpicGames public EpicGamesGame(EpicGames src, string nameP, string idP) { source = src; - name = nameP; + name = nameP + "test"; id = idP; icon = ""; platforms.add(Platform.WINDOWS); @@ -100,6 +100,7 @@ namespace GameHub.Data.Sources.EpicGames } } } + update_status(); } public override async void install(Runnable.Installer.InstallMode install_mode=Runnable.Installer.InstallMode.INTERACTIVE) From 8aa12bdd13260ad845a19aedc7ccbf3fb8bcb414 Mon Sep 17 00:00:00 2001 From: Adam Jordanek Date: Thu, 30 Apr 2020 13:40:26 +0200 Subject: [PATCH 12/24] fixup! Epic games support --- src/data/sources/epicgames/EpicGamesGame.vala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/sources/epicgames/EpicGamesGame.vala b/src/data/sources/epicgames/EpicGamesGame.vala index 97cce3d5..bde16005 100644 --- a/src/data/sources/epicgames/EpicGamesGame.vala +++ b/src/data/sources/epicgames/EpicGamesGame.vala @@ -28,7 +28,7 @@ namespace GameHub.Data.Sources.EpicGames public EpicGamesGame(EpicGames src, string nameP, string idP) { source = src; - name = nameP + "test"; + name = nameP; id = idP; icon = ""; platforms.add(Platform.WINDOWS); From 62645cbe5f80d37eb241b5e465f7048ac21f276b Mon Sep 17 00:00:00 2001 From: Adam Jordanek Date: Thu, 30 Apr 2020 13:40:38 +0200 Subject: [PATCH 13/24] fixup! Epic games support --- src/data/sources/epicgames/EpicGamesGame.vala | 1 - 1 file changed, 1 deletion(-) diff --git a/src/data/sources/epicgames/EpicGamesGame.vala b/src/data/sources/epicgames/EpicGamesGame.vala index bde16005..90b01624 100644 --- a/src/data/sources/epicgames/EpicGamesGame.vala +++ b/src/data/sources/epicgames/EpicGamesGame.vala @@ -32,7 +32,6 @@ namespace GameHub.Data.Sources.EpicGames id = idP; icon = ""; platforms.add(Platform.WINDOWS); - platforms.add(Platform.LINUX); install_dir = null; executable_path = "$game_dir/start.sh"; From da3df53a4520a6b87b39f30ff29a71d877ed2e5a Mon Sep 17 00:00:00 2001 From: Adam Jordanek Date: Thu, 30 Apr 2020 13:51:16 +0200 Subject: [PATCH 14/24] fixup! Epic games support --- src/data/sources/epicgames/EpicGames.vala | 3 +- .../pages/sources/EpicGames.vala | 54 +------------------ 2 files changed, 3 insertions(+), 54 deletions(-) diff --git a/src/data/sources/epicgames/EpicGames.vala b/src/data/sources/epicgames/EpicGames.vala index 7a88a8f4..e80e9943 100644 --- a/src/data/sources/epicgames/EpicGames.vala +++ b/src/data/sources/epicgames/EpicGames.vala @@ -157,7 +157,8 @@ namespace GameHub.Data.Sources.EpicGames _games.add(g); games_count++; } else { - _games.get(_games.index_of(g)).update_status(); + var index = _games.index_of(g); + _games.get(index).update_status(); } } } diff --git a/src/ui/dialogs/SettingsDialog/pages/sources/EpicGames.vala b/src/ui/dialogs/SettingsDialog/pages/sources/EpicGames.vala index f98db3d8..cf08ca91 100644 --- a/src/ui/dialogs/SettingsDialog/pages/sources/EpicGames.vala +++ b/src/ui/dialogs/SettingsDialog/pages/sources/EpicGames.vala @@ -33,7 +33,7 @@ namespace GameHub.UI.Dialogs.SettingsDialog.Pages.Sources { Object( dialog: dlg, - title: "Humble Bundle", + title: "EpicGames", description: _("Disabled"), icon_name: "source-epicgames-symbolic", activatable: true @@ -45,63 +45,11 @@ namespace GameHub.UI.Dialogs.SettingsDialog.Pages.Sources { var paths = FSUtils.Paths.Settings.instance; - humble_auth = Settings.Auth.Humble.instance; - - add_switch(_("Load games from Humble Trove"), humble_auth.load_trove_games, v => { humble_auth.load_trove_games = v; update(); request_restart(); }); - - add_separator(); - - games_dir_chooser = add_file_chooser(_("Games directory"), FileChooserAction.SELECT_FOLDER, paths.humble_games, v => { paths.humble_games = v; update(); request_restart(); }).get_children().last().data as FileChooserEntry; - - status_switch.active = humble_auth.enabled; - status_switch.notify["active"].connect(() => { - humble_auth.enabled = status_switch.active; - request_restart(); - update(); - }); - - logout_btn = new Button.with_label(_("Logout")); - action_area.add(logout_btn); - - logout_btn.clicked.connect(() => { - humble_auth.authenticated = false; - humble_auth.access_token = ""; - request_restart(); - update(); - }); - update(); } private void update() { - content_area.sensitive = humble_auth.enabled; - logout_btn.sensitive = humble_auth.authenticated && humble_auth.access_token.length > 0; - - if(" " in FSUtils.Paths.Settings.instance.humble_games) - { - games_dir_chooser.get_style_context().add_class(Gtk.STYLE_CLASS_ERROR); - status_type = StatusType.ERROR; - } - else - { - games_dir_chooser.get_style_context().remove_class(Gtk.STYLE_CLASS_ERROR); - status_type = restart_requested ? StatusType.WARNING : StatusType.NONE; - } - dialog.update_games_dir_space_message(); - - if(!humble_auth.enabled) - { - status = description = _("Disabled"); - } - else if(!humble_auth.authenticated || humble_auth.access_token.length == 0) - { - status = description = _("Not authenticated"); - } - else - { - status = description = _("Authenticated"); - } } } From 2cf03f1383cf13cb0317e4eb47a3c8babd6e6df5 Mon Sep 17 00:00:00 2001 From: Adam Jordanek Date: Thu, 30 Apr 2020 13:51:42 +0200 Subject: [PATCH 15/24] fixup! Epic games support --- src/ui/dialogs/SettingsDialog/pages/sources/EpicGames.vala | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/ui/dialogs/SettingsDialog/pages/sources/EpicGames.vala b/src/ui/dialogs/SettingsDialog/pages/sources/EpicGames.vala index cf08ca91..d7539d66 100644 --- a/src/ui/dialogs/SettingsDialog/pages/sources/EpicGames.vala +++ b/src/ui/dialogs/SettingsDialog/pages/sources/EpicGames.vala @@ -25,10 +25,6 @@ namespace GameHub.UI.Dialogs.SettingsDialog.Pages.Sources { public class EpicGames: SettingsDialogPage { - private Settings.Auth.Humble humble_auth; - private Button logout_btn; - private FileChooserEntry games_dir_chooser; - public EpicGames(SettingsDialog dlg) { Object( From 372b908b9e70dbfaf5811a7b31e514d6fece7325 Mon Sep 17 00:00:00 2001 From: Adam Jordanek Date: Thu, 30 Apr 2020 14:32:18 +0200 Subject: [PATCH 16/24] fixup! Epic games support --- src/data/sources/epicgames/EpicGames.vala | 35 +++++++++++++------ src/data/sources/epicgames/EpicGamesGame.vala | 15 +++++++- 2 files changed, 39 insertions(+), 11 deletions(-) diff --git a/src/data/sources/epicgames/EpicGames.vala b/src/data/sources/epicgames/EpicGames.vala index e80e9943..62b6cdd8 100644 --- a/src/data/sources/epicgames/EpicGames.vala +++ b/src/data/sources/epicgames/EpicGames.vala @@ -31,6 +31,8 @@ namespace GameHub.Data.Sources.EpicGames public override string name { get { return "EpicGames"; } } public override string icon { get { return "source-epicgames-symbolic"; } } + private Regex regex = /\*\s*([^(]*)\s\(App\sname:\s([a-zA-Z0-9]+),\sversion:\s([^)]*)\)/; + private bool enable = true; public override bool enabled { @@ -88,10 +90,31 @@ namespace GameHub.Data.Sources.EpicGames public override ArrayList games { get { return _games; } } private ArrayList _installed = new ArrayList(); + + public bool refresh = true; + + public void invalidate_installed() {refresh = true;} + public bool is_app_installed(string id) { + if(refresh) { + build_installed(); + } + refresh = false; return _installed.contains(id); } + private void build_installed() { + var installed_output = new DataInputStream(new Subprocess.newv ({"legendary", "list-installed"}, STDOUT_PIPE).get_stdout_pipe ()); + _installed.clear(); + string? line = null; + MatchInfo info; + while ((line = installed_output.read_line()) != null) { + if (regex.match (line, 0, out info)) { + _installed.add(info.fetch(2)); + } + } + } + public override async ArrayList load_games(Utils.FutureResult2? game_loaded=null, Utils.Future? cache_loaded=null) { if(_games.size > 0) @@ -128,19 +151,11 @@ namespace GameHub.Data.Sources.EpicGames cache_loaded(); } - var regex = /\*\s*([^(]*)\s\(App\sname:\s([a-zA-Z0-9]+),\sversion:\s([^)]*)\)/; + - var installed_output = new DataInputStream(new Subprocess.newv ({"legendary", "list-installed"}, STDOUT_PIPE).get_stdout_pipe ()); - + build_installed(); string? line = null; MatchInfo info; - while ((line = installed_output.read_line()) != null) { - // FIXME: This REGEX is ugly - if (regex.match (line, 0, out info)) { - _installed.add(info.fetch(2)); - } - } - var output = new DataInputStream(new Subprocess.newv ({"legendary", "list-games"}, STDOUT_PIPE).get_stdout_pipe ()); while ((line = output.read_line()) != null) { diff --git a/src/data/sources/epicgames/EpicGamesGame.vala b/src/data/sources/epicgames/EpicGamesGame.vala index 90b01624..8f6f2d9f 100644 --- a/src/data/sources/epicgames/EpicGamesGame.vala +++ b/src/data/sources/epicgames/EpicGamesGame.vala @@ -113,14 +113,27 @@ namespace GameHub.Data.Sources.EpicGames while ((line = output.read_line()) != null) { debug("[EpicGames] %s", line); } + ((EpicGames)source).invalidate_installed(); + update_status(); } public override async void uninstall() { - debug("[EpicGamesGame] uninstall: NOT IMPLEMENTED"); + // FIXME: It can be done much better + var process = new Subprocess.newv ({"legendary", "uninstall", id}, STDOUT_PIPE | STDIN_PIPE); + var input = new DataOutputStream(process.get_stdin_pipe ()); + var output = new DataInputStream(process.get_stdout_pipe ()); + string? line = null; + input.put_string("y\n"); + while ((line = output.read_line()) != null) { + debug("[EpicGames] %s", line); + } + ((EpicGames)source).invalidate_installed(); + update_status(); } public override async void run() { + // FIXME: not good idea new Subprocess.newv ({"legendary", "launch", id}, STDOUT_PIPE); } From 8fa12cbbd83941a37e644d7c1c9ee18fb7289e77 Mon Sep 17 00:00:00 2001 From: Adam Jordanek Date: Thu, 30 Apr 2020 22:30:43 +0200 Subject: [PATCH 17/24] fixup! Epic games support --- src/data/sources/epicgames/EpicGames.vala | 33 +++---------------- src/data/sources/epicgames/EpicGamesGame.vala | 30 ++++------------- src/meson.build | 1 + 3 files changed, 11 insertions(+), 53 deletions(-) diff --git a/src/data/sources/epicgames/EpicGames.vala b/src/data/sources/epicgames/EpicGames.vala index 62b6cdd8..54e465a7 100644 --- a/src/data/sources/epicgames/EpicGames.vala +++ b/src/data/sources/epicgames/EpicGames.vala @@ -26,7 +26,7 @@ namespace GameHub.Data.Sources.EpicGames public class EpicGames: GameSource { public static EpicGames instance; - + public override string id { get { return "epicgames"; } } public override string name { get { return "EpicGames"; } } public override string icon { get { return "source-epicgames-symbolic"; } } @@ -41,12 +41,15 @@ namespace GameHub.Data.Sources.EpicGames } + public LegendaryWrapper? legendary_wrapper { get; private set; } + public string? user_id { get; protected set; } public string? user_name { get; protected set; } public EpicGames() { instance = this; + legendary_wrapper = new LegendaryWrapper(); } public override bool is_installed(bool refresh) @@ -89,32 +92,6 @@ namespace GameHub.Data.Sources.EpicGames public override ArrayList games { get { return _games; } } - private ArrayList _installed = new ArrayList(); - - public bool refresh = true; - - public void invalidate_installed() {refresh = true;} - - public bool is_app_installed(string id) { - if(refresh) { - build_installed(); - } - refresh = false; - return _installed.contains(id); - } - - private void build_installed() { - var installed_output = new DataInputStream(new Subprocess.newv ({"legendary", "list-installed"}, STDOUT_PIPE).get_stdout_pipe ()); - _installed.clear(); - string? line = null; - MatchInfo info; - while ((line = installed_output.read_line()) != null) { - if (regex.match (line, 0, out info)) { - _installed.add(info.fetch(2)); - } - } - } - public override async ArrayList load_games(Utils.FutureResult2? game_loaded=null, Utils.Future? cache_loaded=null) { if(_games.size > 0) @@ -152,8 +129,6 @@ namespace GameHub.Data.Sources.EpicGames } - - build_installed(); string? line = null; MatchInfo info; var output = new DataInputStream(new Subprocess.newv ({"legendary", "list-games"}, STDOUT_PIPE).get_stdout_pipe ()); diff --git a/src/data/sources/epicgames/EpicGamesGame.vala b/src/data/sources/epicgames/EpicGamesGame.vala index 8f6f2d9f..fadcc95b 100644 --- a/src/data/sources/epicgames/EpicGamesGame.vala +++ b/src/data/sources/epicgames/EpicGamesGame.vala @@ -31,7 +31,7 @@ namespace GameHub.Data.Sources.EpicGames name = nameP; id = idP; icon = ""; - platforms.add(Platform.WINDOWS); + platforms.add(Platform.LINUX); install_dir = null; executable_path = "$game_dir/start.sh"; @@ -45,7 +45,7 @@ namespace GameHub.Data.Sources.EpicGames public override void update_status() { var state = Game.State.UNINSTALLED; - if (((EpicGames)source).is_app_installed(id)) { + if (((EpicGames)source).legendary_wrapper.is_installed(id)) { state = Game.State.INSTALLED; debug ("New installed game: \tname = %s\t", name); } else { @@ -104,37 +104,19 @@ namespace GameHub.Data.Sources.EpicGames public override async void install(Runnable.Installer.InstallMode install_mode=Runnable.Installer.InstallMode.INTERACTIVE) { - // FIXME: It can be done much better - var process = new Subprocess.newv ({"legendary", "download", id}, STDOUT_PIPE | STDIN_PIPE); - var input = new DataOutputStream(process.get_stdin_pipe ()); - var output = new DataInputStream(process.get_stdout_pipe ()); - string? line = null; - input.put_string("y\n"); - while ((line = output.read_line()) != null) { - debug("[EpicGames] %s", line); - } - ((EpicGames)source).invalidate_installed(); + ((EpicGames)source).legendary_wrapper.install(id); update_status(); } public override async void uninstall() { - // FIXME: It can be done much better - var process = new Subprocess.newv ({"legendary", "uninstall", id}, STDOUT_PIPE | STDIN_PIPE); - var input = new DataOutputStream(process.get_stdin_pipe ()); - var output = new DataInputStream(process.get_stdout_pipe ()); - string? line = null; - input.put_string("y\n"); - while ((line = output.read_line()) != null) { - debug("[EpicGames] %s", line); - } - ((EpicGames)source).invalidate_installed(); + ((EpicGames)source).legendary_wrapper.uninstall(id); update_status(); } public override async void run() { - // FIXME: not good idea - new Subprocess.newv ({"legendary", "launch", id}, STDOUT_PIPE); + ((EpicGames)source).legendary_wrapper.run(id); + } } diff --git a/src/meson.build b/src/meson.build index c43fe219..23bc6db2 100644 --- a/src/meson.build +++ b/src/meson.build @@ -47,6 +47,7 @@ sources = [ 'data/sources/epicgames/EpicGames.vala', 'data/sources/epicgames/EpicGamesGame.vala', + 'data/sources/epicgames/LegendaryWrapper.vala', 'data/sources/gog/GOG.vala', 'data/sources/gog/GOGGame.vala', From 5b1155664ade6be037df3af04b13da3e1bdb5bca Mon Sep 17 00:00:00 2001 From: Adam Jordanek Date: Thu, 30 Apr 2020 22:33:50 +0200 Subject: [PATCH 18/24] fixup! Epic games support --- src/data/sources/epicgames/EpicGames.vala | 36 ++++++++++------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/src/data/sources/epicgames/EpicGames.vala b/src/data/sources/epicgames/EpicGames.vala index 54e465a7..622b3fc8 100644 --- a/src/data/sources/epicgames/EpicGames.vala +++ b/src/data/sources/epicgames/EpicGames.vala @@ -128,28 +128,22 @@ namespace GameHub.Data.Sources.EpicGames cache_loaded(); } - - string? line = null; - MatchInfo info; - var output = new DataInputStream(new Subprocess.newv ({"legendary", "list-games"}, STDOUT_PIPE).get_stdout_pipe ()); - - while ((line = output.read_line()) != null) { - // FIXME: This REGEX is ugly - if (regex.match (line, 0, out info)) { - var g = new EpicGamesGame(this, info.fetch (1), info.fetch (2)); - bool is_new_game = !_games.contains(g); - if(is_new_game) { - g.save(); - if(game_loaded != null) - { - game_loaded(g, true); - } - _games.add(g); - games_count++; - } else { - var index = _games.index_of(g); - _games.get(index).update_status(); + var games = legendary_wrapper.getGames(); + foreach(var game in games) + { + var g = new EpicGamesGame(this, game.name, game.id); + bool is_new_game = !_games.contains(g); + if(is_new_game) { + g.save(); + if(game_loaded != null) + { + game_loaded(g, true); } + _games.add(g); + games_count++; + } else { + var index = _games.index_of(g); + _games.get(index).update_status(); } } Idle.add(load_games.callback); From 77f6c10bbd72531852e5a25726645b9606d6e2c8 Mon Sep 17 00:00:00 2001 From: Adam Jordanek Date: Thu, 30 Apr 2020 22:34:06 +0200 Subject: [PATCH 19/24] fixup! Epic games support --- .../sources/epicgames/LegendaryWrapper.vala | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 src/data/sources/epicgames/LegendaryWrapper.vala diff --git a/src/data/sources/epicgames/LegendaryWrapper.vala b/src/data/sources/epicgames/LegendaryWrapper.vala new file mode 100644 index 00000000..9c81a1ea --- /dev/null +++ b/src/data/sources/epicgames/LegendaryWrapper.vala @@ -0,0 +1,95 @@ +using Gee; + +namespace GameHub.Data.Sources.EpicGames +{ + public struct LegendaryGame { + string name; + string id; + string version; + } + + public class LegendaryWrapper + { + private Regex regex = /\*\s*([^(]*)\s\(App\sname:\s([a-zA-Z0-9]+),\sversion:\s([^)]*)\)/; + + public LegendaryWrapper() + { + } + + public ArrayList getGames() { + var result = new ArrayList(); + + string? line = null; + MatchInfo info; + var output = new DataInputStream(new Subprocess.newv ({"legendary", "list-games"}, STDOUT_PIPE).get_stdout_pipe ()); + + while ((line = output.read_line()) != null) { + if (regex.match (line, 0, out info)) { + LegendaryGame? g = {info.fetch (1), info.fetch (2), info.fetch (3)}; + result.add(g); + } + } + return result; + } + + public void install(string id) + { + // FIXME: It can be done much better + var process = new Subprocess.newv ({"legendary", "download", id}, STDOUT_PIPE | STDIN_PIPE); + var input = new DataOutputStream(process.get_stdin_pipe ()); + var output = new DataInputStream(process.get_stdout_pipe ()); + string? line = null; + input.put_string("y\n"); + while ((line = output.read_line()) != null) { + debug("[EpicGames] %s", line); + } + refresh_installed = true; + } + + public void uninstall(string id) + { + // FIXME: It can be done much better + var process = new Subprocess.newv ({"legendary", "uninstall", id}, STDOUT_PIPE | STDIN_PIPE); + var input = new DataOutputStream(process.get_stdin_pipe ()); + var output = new DataInputStream(process.get_stdout_pipe ()); + string? line = null; + input.put_string("y\n"); + while ((line = output.read_line()) != null) { + debug("[EpicGames] %s", line); + } + refresh_installed = true; + } + + public void run(string id) { + // FIXME: not good idea + new Subprocess.newv ({"legendary", "launch", id}, STDOUT_PIPE); + } + + private bool refresh_installed = true; + private ArrayList _installed = new ArrayList(); + + public bool is_installed(string id) + { + if(refresh_installed) { + build_installed_list(); + refresh_installed = false; + } + return _installed.contains(id); + } + + + private void build_installed_list() + { + var installed_output = new DataInputStream(new Subprocess.newv ({"legendary", "list-installed"}, STDOUT_PIPE).get_stdout_pipe ()); + _installed.clear(); + string? line = null; + MatchInfo info; + while ((line = installed_output.read_line()) != null) { + if (regex.match (line, 0, out info)) { + _installed.add(info.fetch(2)); + } + } + } + + } +} \ No newline at end of file From ab431bb1fef4393763f062272fa107a75dcf0f5a Mon Sep 17 00:00:00 2001 From: Adam Jordanek Date: Thu, 30 Apr 2020 22:53:24 +0200 Subject: [PATCH 20/24] fixup! Epic games support --- src/data/sources/epicgames/EpicGamesGame.vala | 3 ++- .../sources/epicgames/LegendaryWrapper.vala | 24 +++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/data/sources/epicgames/EpicGamesGame.vala b/src/data/sources/epicgames/EpicGamesGame.vala index fadcc95b..627999a3 100644 --- a/src/data/sources/epicgames/EpicGamesGame.vala +++ b/src/data/sources/epicgames/EpicGamesGame.vala @@ -31,6 +31,7 @@ namespace GameHub.Data.Sources.EpicGames name = nameP; id = idP; icon = ""; + image = src.legendary_wrapper.get_image(id); platforms.add(Platform.LINUX); install_dir = null; @@ -74,7 +75,7 @@ namespace GameHub.Data.Sources.EpicGames info = Tables.Games.INFO.get(s); info_detailed = Tables.Games.INFO_DETAILED.get(s); icon = Tables.Games.ICON.get(s); - image = Tables.Games.IMAGE.get(s); + image = src.legendary_wrapper.get_image(id);//Tables.Games.IMAGE.get(s); install_dir = Tables.Games.INSTALL_PATH.get(s) != null ? FSUtils.file(Tables.Games.INSTALL_PATH.get(s)) : null; executable_path = Tables.Games.EXECUTABLE.get(s); work_dir_path = Tables.Games.WORK_DIR.get(s); diff --git a/src/data/sources/epicgames/LegendaryWrapper.vala b/src/data/sources/epicgames/LegendaryWrapper.vala index 9c81a1ea..95fa634c 100644 --- a/src/data/sources/epicgames/LegendaryWrapper.vala +++ b/src/data/sources/epicgames/LegendaryWrapper.vala @@ -32,6 +32,30 @@ namespace GameHub.Data.Sources.EpicGames return result; } + public string get_image(string id) + { + string res = ""; + var file = File.new_for_path("/home/dotevo/.config/legendary/metadata/"+id+".json"); + + if (file.query_exists ()) { + var dis = new DataInputStream (file.read ()); + string line; + + while ((line = dis.read_line (null)) != null) { + res += line; + } + var parser = new Json.Parser (); + parser.load_from_data (res); + var root_object = parser.get_root().get_object(); + + var metadata = root_object.get_object_member ("metadata"); + var keyImages = metadata.get_array_member ("keyImages"); + var img = keyImages.get_object_element (0).get_string_member ("url"); + return img; + } + return ""; + } + public void install(string id) { // FIXME: It can be done much better From b20cc0ea424fc2bd341109839390bac677fc538a Mon Sep 17 00:00:00 2001 From: Adam Jordanek Date: Thu, 30 Apr 2020 22:56:50 +0200 Subject: [PATCH 21/24] fixup! Epic games support --- src/data/sources/epicgames/LegendaryWrapper.vala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/sources/epicgames/LegendaryWrapper.vala b/src/data/sources/epicgames/LegendaryWrapper.vala index 95fa634c..82db64c2 100644 --- a/src/data/sources/epicgames/LegendaryWrapper.vala +++ b/src/data/sources/epicgames/LegendaryWrapper.vala @@ -35,7 +35,7 @@ namespace GameHub.Data.Sources.EpicGames public string get_image(string id) { string res = ""; - var file = File.new_for_path("/home/dotevo/.config/legendary/metadata/"+id+".json"); + var file = File.new_for_path(Environment.get_home_dir () + "/.config/legendary/metadata/"+id+".json"); if (file.query_exists ()) { var dis = new DataInputStream (file.read ()); From af94e500c7582d2776062983a671fc0681b274f8 Mon Sep 17 00:00:00 2001 From: Adam Jordanek Date: Fri, 1 May 2020 21:21:54 +0200 Subject: [PATCH 22/24] fixup! Epic games support --- src/data/sources/epicgames/EpicGamesGame.vala | 50 ++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/src/data/sources/epicgames/EpicGamesGame.vala b/src/data/sources/epicgames/EpicGamesGame.vala index 627999a3..b204128b 100644 --- a/src/data/sources/epicgames/EpicGamesGame.vala +++ b/src/data/sources/epicgames/EpicGamesGame.vala @@ -21,10 +21,14 @@ using Gee; using GameHub.Data.DB; using GameHub.Utils; +using GameHub.Utils.Downloader; + namespace GameHub.Data.Sources.EpicGames { public class EpicGamesGame: Game { + public ArrayList? installers { get; protected set; default = new ArrayList(); } + public EpicGamesGame(EpicGames src, string nameP, string idP) { source = src; @@ -100,12 +104,14 @@ namespace GameHub.Data.Sources.EpicGames } } } + installers.add(new EpicGamesGame.EpicGamesInstaller(this, id)); update_status(); } public override async void install(Runnable.Installer.InstallMode install_mode=Runnable.Installer.InstallMode.INTERACTIVE) { - ((EpicGames)source).legendary_wrapper.install(id); + new GameHub.UI.Dialogs.InstallDialog(this, installers, install_mode, install.callback); + yield; update_status(); } public override async void uninstall() @@ -120,5 +126,47 @@ namespace GameHub.Data.Sources.EpicGames } + public class EpicGamesInstaller: Runnable.Installer + { + public EpicGamesGame game; + public override string name { owned get { return "TEST"; } } + + public EpicGamesInstaller(EpicGamesGame game, string id) + { + this.game = game; + id = id; + platform = Platform.CURRENT; + } + + public override async void install(Runnable runnable, CompatTool? tool=null) + { + EpicGamesGame? game = null; + if(runnable is EpicGamesGame) + { + game = runnable as EpicGamesGame; + } + + EpicGames epic = (EpicGames)(game.source); + + Utils.thread("EpicGamesGame.Installer", () => { + game.status = new Game.Status(Game.State.DOWNLOADING, game, null); + + + epic.legendary_wrapper.install(game.id); + Idle.add(install.callback); + }); + yield; + + if(game != null) game.status = new Game.Status(Game.State.INSTALLED, game, null); + + runnable.update_status(); + + debug("install"); + } + } } + + + + } From db87e36743208681e65ac0083416efad085a6881 Mon Sep 17 00:00:00 2001 From: Nils Date: Tue, 26 May 2020 14:11:22 -0600 Subject: [PATCH 23/24] Running legendary check The check is working. I will write the rest based on Itch because the structure is similar. --- src/data/sources/epicgames/EpicGames.vala | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/data/sources/epicgames/EpicGames.vala b/src/data/sources/epicgames/EpicGames.vala index 622b3fc8..2be69b9b 100644 --- a/src/data/sources/epicgames/EpicGames.vala +++ b/src/data/sources/epicgames/EpicGames.vala @@ -54,6 +54,18 @@ namespace GameHub.Data.Sources.EpicGames public override bool is_installed(bool refresh) { + //check if legendary exists + var legendary = Utils.find_executable("legendary"); + + if(legendary == null || !legendary.query_exists()) + { + debug("[EpicGames] is_installed: Legendary not found"); + } + else + { + debug("[EpicGames] is_installed: LegendaryYES"); + } + debug("[EpicGames] is_installed: NOT IMPLEMENTED"); return true; } From 8a2911e5acb1777ae9db9c4bf7afab12f43c1f5c Mon Sep 17 00:00:00 2001 From: Nils Date: Tue, 26 May 2020 17:00:08 -0600 Subject: [PATCH 24/24] Legendary package UI report --- ...com.github.tkashkin.gamehub.gschema.xml.in | 19 ++++++++ src/data/sources/epicgames/EpicGames.vala | 20 ++++++++- src/settings/Auth.vala | 25 +++++++++++ .../pages/sources/EpicGames.vala | 43 +++++++++++++++++++ src/utils/FSUtils.vala | 6 +++ 5 files changed, 111 insertions(+), 2 deletions(-) diff --git a/data/com.github.tkashkin.gamehub.gschema.xml.in b/data/com.github.tkashkin.gamehub.gschema.xml.in index 134b2287..1c28fc53 100644 --- a/data/com.github.tkashkin.gamehub.gschema.xml.in +++ b/data/com.github.tkashkin.gamehub.gschema.xml.in @@ -199,6 +199,21 @@ + + + true + Is Epic enabled + + + false + Did user get authentication code + + + '@PREF_AUTH_CODE_EPIC@' + Epic AUTH CODE + + + @@ -221,6 +236,10 @@ '~/Games/itch' itch.io games directory + + '~/Games/epic' + Epic games directory + diff --git a/src/data/sources/epicgames/EpicGames.vala b/src/data/sources/epicgames/EpicGames.vala index 2be69b9b..a6273d40 100644 --- a/src/data/sources/epicgames/EpicGames.vala +++ b/src/data/sources/epicgames/EpicGames.vala @@ -26,6 +26,9 @@ namespace GameHub.Data.Sources.EpicGames public class EpicGames: GameSource { public static EpicGames instance; + + private bool? installed = null; + public File? legendary_executable = null; public override string id { get { return "epicgames"; } } public override string name { get { return "EpicGames"; } } @@ -54,20 +57,33 @@ namespace GameHub.Data.Sources.EpicGames public override bool is_installed(bool refresh) { + /* + Epic games depends on + */ + if(installed != null && !refresh) + { + return (!) installed; + } + //check if legendary exists var legendary = Utils.find_executable("legendary"); if(legendary == null || !legendary.query_exists()) { debug("[EpicGames] is_installed: Legendary not found"); + } else { debug("[EpicGames] is_installed: LegendaryYES"); } - debug("[EpicGames] is_installed: NOT IMPLEMENTED"); - return true; + legendary_executable = legendary; + + installed = legendary_executable != null && legendary_executable.query_exists(); + + return (!) installed; + } public override async bool install() diff --git a/src/settings/Auth.vala b/src/settings/Auth.vala index fa0b91cf..19368090 100644 --- a/src/settings/Auth.vala +++ b/src/settings/Auth.vala @@ -133,4 +133,29 @@ namespace GameHub.Settings.Auth } } } + + public class Epic: SettingsSchema + { + public bool enabled { get; set; } + public bool authenticated { get; set; } + public string auth_code { get; set; } + + public Epic() + { + base(ProjectConfig.PROJECT_NAME + ".auth.epic"); + } + + private static Epic? _instance; + public static unowned Epic instance + { + get + { + if(_instance == null) + { + _instance = new Epic(); + } + return _instance; + } + } + } } diff --git a/src/ui/dialogs/SettingsDialog/pages/sources/EpicGames.vala b/src/ui/dialogs/SettingsDialog/pages/sources/EpicGames.vala index d7539d66..5b32aa39 100644 --- a/src/ui/dialogs/SettingsDialog/pages/sources/EpicGames.vala +++ b/src/ui/dialogs/SettingsDialog/pages/sources/EpicGames.vala @@ -25,6 +25,9 @@ namespace GameHub.UI.Dialogs.SettingsDialog.Pages.Sources { public class EpicGames: SettingsDialogPage { + private Settings.Auth.Epic epic_auth; + private FileChooserEntry games_dir_chooser; + public EpicGames(SettingsDialog dlg) { Object( @@ -40,12 +43,52 @@ namespace GameHub.UI.Dialogs.SettingsDialog.Pages.Sources construct { var paths = FSUtils.Paths.Settings.instance; + epic_auth = Settings.Auth.Epic.instance; + + games_dir_chooser = add_file_chooser(_("Games directory"), FileChooserAction.SELECT_FOLDER, paths.epic_games, v => { paths.epic_games = v; request_restart(); update(); }).get_children().last().data as FileChooserEntry; + + add_separator(); + + //add_apikey_entry(); + //add_link(_("Generate key"), "https://itch.io/api-keys"); + + add_separator(); + + status_switch.active = epic_auth.enabled; + status_switch.notify["active"].connect(() => { + epic_auth.enabled = status_switch.active; + update(); + request_restart(); + }); + + update(); } private void update() { + var epic = GameHub.Data.Sources.EpicGames.EpicGames.instance; + + content_area.sensitive = epic.enabled; + + if(!epic.enabled) + { + status = description = _("Disabled"); + } + else if(!epic.is_installed()) + { + status = description = _("Missing Legendary"); + } + else if(!epic.is_authenticated()) + { + status = description = _("Not authenticated"); + } + else + { + status = description = epic.user_name != null ? _("Authenticated as %s").printf(epic.user_name) : _("Authenticated"); + } + } } diff --git a/src/utils/FSUtils.vala b/src/utils/FSUtils.vala index c90b72da..fc3f6d14 100644 --- a/src/utils/FSUtils.vala +++ b/src/utils/FSUtils.vala @@ -41,6 +41,7 @@ namespace GameHub.Utils public string humble_games { get; set; } public string itch_home { get; set; } public string itch_games { get; set; } + public string epic_games { get; set; } public Settings() { @@ -136,6 +137,11 @@ namespace GameHub.Utils public const string ButlerExecutable = FSUtils.Paths.Itch.ButlerRoot + "/versions/%s/butler"; } + public class Epic + { + public static string Games { owned get { return FSUtils.Paths.Settings.instance.epic_games; } } + } + public class Collection: GameHub.Settings.SettingsSchema { public string root { get; set; }