diff --git a/core/libgamestream/src/client.c b/core/libgamestream/src/client.c index 259a12a3a..93ae11480 100644 --- a/core/libgamestream/src/client.c +++ b/core/libgamestream/src/client.c @@ -19,11 +19,9 @@ #include "http.h" #include "xml.h" -#include "mkcert.h" #include "client.h" #include "errors.h" #include "priv.h" -#include #include @@ -32,15 +30,12 @@ #include #include #include -#include -#include -#include +#include #include #include #include #include #include -#include #include #include "uuidstr.h" @@ -68,6 +63,8 @@ static bool construct_url(GS_CLIENT, char *url, size_t ulen, bool secure, const static bool append_param(char *url, size_t ulen, const char *param, const char *value_fmt, ...); +static bool append_params_raw(char *url, size_t ulen, const char *params); + static uint16_t server_port(const SERVER_DATA *server, bool secure); static void bytes_to_hex(const unsigned char *in, char *out, size_t len) { @@ -568,6 +565,9 @@ int gs_start_app(GS_CLIENT hnd, PSERVER_DATA server, STREAM_CONFIGURATION *confi append_param(url, sizeof(url), "remoteControllersBitmap", "%d", gamepad_mask); append_param(url, sizeof(url), "gcmap", "%d", gamepad_mask); } + if (!is_gfe) { + append_params_raw(url, sizeof(url), LiGetLaunchUrlQueryParameters()); + } if ((ret = http_request(hnd->http, url, data)) == GS_OK) { server->currentGame = appId; @@ -961,6 +961,22 @@ static bool append_param(char *url, size_t ulen, const char *param, const char * return true; } +static bool append_params_raw(char *url, size_t ulen, const char *params) { + char *p = url + strlen(url); + if (params[0] == '&') { + params++; + } + size_t plen = strlen(params); + size_t append_len = plen + 2 /* "¶ms\0" */; + if ((p - url) + append_len > ulen) { + return false; + } + *p++ = '&'; + p = stpncpy(p, params, plen); + *p = '\0'; + return true; +} + static uint16_t server_port(const SERVER_DATA *server, bool secure) { return secure ? server->httpsPort : server->extPort; } diff --git a/core/moonlight-common-c b/core/moonlight-common-c index 3ed3ba625..48d7f1ace 160000 --- a/core/moonlight-common-c +++ b/core/moonlight-common-c @@ -1 +1 @@ -Subproject commit 3ed3ba62534ce06c1b97fec46722969e7710fee6 +Subproject commit 48d7f1ace168d07dad339718f1350979545f15d2