early-access version 2924

This commit is contained in:
pineappleEA
2022-08-30 10:26:34 +02:00
parent ca859712c9
commit 644509666f
30 changed files with 438 additions and 50 deletions

View File

@@ -10,7 +10,7 @@ add_executable(yuzu-room
create_target_directory_groups(yuzu-room)
target_link_libraries(yuzu-room PRIVATE common core network)
target_link_libraries(yuzu-room PRIVATE common network)
if (ENABLE_WEB_SERVICE)
target_compile_definitions(yuzu-room PRIVATE -DENABLE_WEB_SERVICE)
target_link_libraries(yuzu-room PRIVATE web_service)

View File

@@ -27,8 +27,8 @@
#include "common/scm_rev.h"
#include "common/settings.h"
#include "common/string_util.h"
#include "core/announce_multiplayer_session.h"
#include "core/core.h"
#include "network/announce_multiplayer_session.h"
#include "network/network.h"
#include "network/room.h"
#include "network/verify_user.h"
@@ -75,6 +75,12 @@ static constexpr char BanListMagic[] = "YuzuRoom-BanList-1";
static constexpr char token_delimiter{':'};
static void PadToken(std::string& token) {
while (token.size() % 4 != 0) {
token.push_back('=');
}
}
static std::string UsernameFromDisplayToken(const std::string& display_token) {
std::size_t outlen;
@@ -300,6 +306,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);