diff options
Diffstat (limited to 'src/dedicated_room/yuzu_room.cpp')
| -rw-r--r-- | src/dedicated_room/yuzu_room.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/dedicated_room/yuzu_room.cpp b/src/dedicated_room/yuzu_room.cpp index 482e772fb..7b6deba41 100644 --- a/src/dedicated_room/yuzu_room.cpp +++ b/src/dedicated_room/yuzu_room.cpp | |||
| @@ -27,8 +27,8 @@ | |||
| 27 | #include "common/scm_rev.h" | 27 | #include "common/scm_rev.h" |
| 28 | #include "common/settings.h" | 28 | #include "common/settings.h" |
| 29 | #include "common/string_util.h" | 29 | #include "common/string_util.h" |
| 30 | #include "core/announce_multiplayer_session.h" | ||
| 31 | #include "core/core.h" | 30 | #include "core/core.h" |
| 31 | #include "network/announce_multiplayer_session.h" | ||
| 32 | #include "network/network.h" | 32 | #include "network/network.h" |
| 33 | #include "network/room.h" | 33 | #include "network/room.h" |
| 34 | #include "network/verify_user.h" | 34 | #include "network/verify_user.h" |
| @@ -75,6 +75,12 @@ static constexpr char BanListMagic[] = "YuzuRoom-BanList-1"; | |||
| 75 | 75 | ||
| 76 | static constexpr char token_delimiter{':'}; | 76 | static constexpr char token_delimiter{':'}; |
| 77 | 77 | ||
| 78 | static void PadToken(std::string& token) { | ||
| 79 | while (token.size() % 4 != 0) { | ||
| 80 | token.push_back('='); | ||
| 81 | } | ||
| 82 | } | ||
| 83 | |||
| 78 | static std::string UsernameFromDisplayToken(const std::string& display_token) { | 84 | static std::string UsernameFromDisplayToken(const std::string& display_token) { |
| 79 | std::size_t outlen; | 85 | std::size_t outlen; |
| 80 | 86 | ||
| @@ -300,6 +306,7 @@ int main(int argc, char** argv) { | |||
| 300 | if (username.empty()) { | 306 | if (username.empty()) { |
| 301 | LOG_INFO(Network, "Hosting a public room"); | 307 | LOG_INFO(Network, "Hosting a public room"); |
| 302 | Settings::values.web_api_url = web_api_url; | 308 | Settings::values.web_api_url = web_api_url; |
| 309 | PadToken(token); | ||
| 303 | Settings::values.yuzu_username = UsernameFromDisplayToken(token); | 310 | Settings::values.yuzu_username = UsernameFromDisplayToken(token); |
| 304 | username = Settings::values.yuzu_username.GetValue(); | 311 | username = Settings::values.yuzu_username.GetValue(); |
| 305 | Settings::values.yuzu_token = TokenFromDisplayToken(token); | 312 | Settings::values.yuzu_token = TokenFromDisplayToken(token); |