From 0281449da27699da1d4b27bd9641d97213db2592 Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Sun, 11 Sep 2022 04:42:10 +0200 Subject: [PATCH] early-access version 2945 --- README.md | 2 +- src/dedicated_room/yuzu_room.cpp | 14 ++++++++++++-- src/yuzu/multiplayer/lobby_p.h | 2 ++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5dca50f04..6c31c51d0 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 2944. +This is the source code for early-access 2945. ## Legal Notice diff --git a/src/dedicated_room/yuzu_room.cpp b/src/dedicated_room/yuzu_room.cpp index 8d8ac1ed7..359891883 100755 --- a/src/dedicated_room/yuzu_room.cpp +++ b/src/dedicated_room/yuzu_room.cpp @@ -76,8 +76,18 @@ static constexpr char BanListMagic[] = "YuzuRoom-BanList-1"; static constexpr char token_delimiter{':'}; static void PadToken(std::string& token) { - const auto remainder = token.size() % 3; - for (size_t i = 0; i < (3 - remainder); i++) { + std::size_t outlen = 0; + + std::array output{}; + std::array roundtrip{}; + for (size_t i = 0; i < 3; i++) { + mbedtls_base64_decode(output.data(), output.size(), &outlen, + reinterpret_cast(token.c_str()), + token.length()); + mbedtls_base64_encode(roundtrip.data(), roundtrip.size(), &outlen, output.data(), outlen); + if (memcmp(roundtrip.data(), token.data(), token.size()) == 0) { + break; + } token.push_back('='); } } diff --git a/src/yuzu/multiplayer/lobby_p.h b/src/yuzu/multiplayer/lobby_p.h index 8b1707506..068c95aca 100755 --- a/src/yuzu/multiplayer/lobby_p.h +++ b/src/yuzu/multiplayer/lobby_p.h @@ -90,6 +90,8 @@ public: setData(game_name, GameNameRole); if (!smdh_icon.isNull()) { setData(smdh_icon, GameIconRole); + } else { + setData(QIcon::fromTheme(QStringLiteral("chip")).pixmap(32), GameIconRole); } }