From d408f89a912aff80ac05550b1c535c3234d0d525 Mon Sep 17 00:00:00 2001 From: fearlessTobi Date: Mon, 27 Aug 2018 23:09:29 +0200 Subject: [PATCH] Rename announce-url, use variable for JWT retrieval url --- src/dedicated_room/citra-room.cpp | 14 +++++++------- src/web_service/web_backend.cpp | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/dedicated_room/citra-room.cpp b/src/dedicated_room/citra-room.cpp index 594f7fcc7..368fc2e47 100644 --- a/src/dedicated_room/citra-room.cpp +++ b/src/dedicated_room/citra-room.cpp @@ -42,7 +42,7 @@ static void PrintHelp(const char* argv0) { "--preferred-game-id The preferred game-id for this room\n" "--username The username used for announce\n" "--token The token used for announce\n" - "--announce-url The url to the announce server\n" + "--endpoint-url The endpoint url to the announce server\n" "-h, --help Display this help and exit\n" "-v, --version Output version information and exit\n"; } @@ -65,7 +65,7 @@ int main(int argc, char** argv) { std::string preferred_game; std::string username; std::string token; - std::string announce_url; + std::string endpoint_url; u64 preferred_game_id = 0; u32 port = Network::DefaultRoomPort; u32 max_members = 16; @@ -79,7 +79,7 @@ int main(int argc, char** argv) { {"preferred-game-id", required_argument, 0, 'i'}, {"username", required_argument, 0, 'u'}, {"token", required_argument, 0, 't'}, - {"announce-url", required_argument, 0, 'a'}, + {"endpoint-url", required_argument, 0, 'a'}, {"help", no_argument, 0, 'h'}, {"version", no_argument, 0, 'v'}, {0, 0, 0, 0}, @@ -114,7 +114,7 @@ int main(int argc, char** argv) { token.assign(optarg); break; case 'a': - announce_url.assign(optarg); + endpoint_url.assign(optarg); break; case 'h': PrintHelp(argv[0]); @@ -160,13 +160,13 @@ int main(int argc, char** argv) { announce = false; std::cout << "token is empty: Hosting a private room\n\n"; } - if (announce_url.empty() && announce) { + if (endpoint_url.empty() && announce) { announce = false; - std::cout << "announce url is empty: Hosting a private room\n\n"; + std::cout << "endpoint url is empty: Hosting a private room\n\n"; } if (announce) { std::cout << "Hosting a public room\n\n"; - Settings::values.web_services_endpoint_url = announce_url; + Settings::values.web_services_endpoint_url = endpoint_url; Settings::values.citra_username = username; Settings::values.citra_token = token; } diff --git a/src/web_service/web_backend.cpp b/src/web_service/web_backend.cpp index b50635d7b..b7f0b1c55 100644 --- a/src/web_service/web_backend.cpp +++ b/src/web_service/web_backend.cpp @@ -25,8 +25,8 @@ std::string UpdateCoreJWT(bool force_new_token, const std::string& username, static std::string jwt; if (jwt.empty() || force_new_token) { if (!username.empty() && !token.empty()) { - std::future future = - PostJson("https://api.citra-emu.org/jwt/internal", username, token); + std::future future = PostJson( + Settings::values.web_services_endpoint_url + "/jwt/internal", username, token); jwt = future.get().returned_data; } }