summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFearlessTobi <thm.frey@gmail.com>2022-08-27 04:00:27 +0200
committerFearlessTobi <thm.frey@gmail.com>2022-08-27 04:00:27 +0200
commit27d7db1faecd761f6dccd753792b2e72d71e9fdd (patch)
tree01537940c3504d08b7eb5c07ba4e27fd064ace24 /src
parentyuzu/multiplayer: Warn when game is running or no network interface is selected (diff)
downloadyuzu-27d7db1faecd761f6dccd753792b2e72d71e9fdd.tar
yuzu-27d7db1faecd761f6dccd753792b2e72d71e9fdd.tar.gz
yuzu-27d7db1faecd761f6dccd753792b2e72d71e9fdd.tar.bz2
yuzu-27d7db1faecd761f6dccd753792b2e72d71e9fdd.tar.lz
yuzu-27d7db1faecd761f6dccd753792b2e72d71e9fdd.tar.xz
yuzu-27d7db1faecd761f6dccd753792b2e72d71e9fdd.tar.zst
yuzu-27d7db1faecd761f6dccd753792b2e72d71e9fdd.zip
Diffstat (limited to 'src')
-rw-r--r--src/dedicated_room/yuzu_room.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/dedicated_room/yuzu_room.cpp b/src/dedicated_room/yuzu_room.cpp
index 7c1a75de3..173a53317 100644
--- a/src/dedicated_room/yuzu_room.cpp
+++ b/src/dedicated_room/yuzu_room.cpp
@@ -75,6 +75,17 @@ static constexpr char BanListMagic[] = "YuzuRoom-BanList-1";
static constexpr char token_delimiter{':'};
+static void PadToken(std::string& token) {
+ const auto remainder = token.size() % 3;
+ if (remainder == 0) {
+ return;
+ }
+
+ for (size_t i = 0; i < (3 - remainder); i++) {
+ token.push_back('=');
+ }
+}
+
static std::string UsernameFromDisplayToken(const std::string& display_token) {
std::size_t outlen;
@@ -300,6 +311,7 @@ int main(int argc, char** argv) {
if (username.empty()) {
LOG_INFO(Network, "Hosting a public room");
Settings::values.web_api_url = web_api_url;
+ PadToken(token);
Settings::values.yuzu_username = UsernameFromDisplayToken(token);
username = Settings::values.yuzu_username.GetValue();
Settings::values.yuzu_token = TokenFromDisplayToken(token);