From fb50dca553b36c8517ace3aa3e5b2db19dad8e5a Mon Sep 17 00:00:00 2001 From: Ikey Doherty Date: Sun, 22 Oct 2017 01:13:55 +0100 Subject: [PATCH] redirect: Set up an initial Ark Survival Evolved profile Signed-off-by: Ikey Doherty --- src/redirect/main.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/redirect/main.c b/src/redirect/main.c index 2184293..4e304f6 100644 --- a/src/redirect/main.c +++ b/src/redirect/main.c @@ -59,11 +59,21 @@ typedef struct LsiRedirectTable { */ static LsiRedirectTable lsi_table = { 0 }; +/** + * Contains all of our replacement rules. + */ +static LsiRedirectProfile *lsi_profile = NULL; + /** * We'll only perform teardown code if the process doesn't `abort()` or `_exit()` */ __attribute__((destructor)) static void lsi_redirect_shutdown(void) { + if (lsi_profile) { + lsi_redirect_profile_free(lsi_profile); + lsi_profile = NULL; + } + if (!lsi_init) { return; } @@ -143,14 +153,15 @@ __attribute__((constructor)) static void lsi_redirect_init(void) /* Temporary hack, we'll make this more generic later */ if (strcmp(process_name, "ShooterGame") == 0) { - lsi_override = true; + lsi_profile = lsi_redirect_profile_new("ARK Survival Evolved"); } - if (!lsi_override) { + if (!lsi_profile) { return; } + lsi_override = true; - lsi_log_debug("Enable lsi_redirect for '%s'", process_name); + lsi_log_debug("Enable lsi_redirect for '%s'", lsi_profile->name); } static char *lsi_redirect_replace_path(const char *path)