diff options
| -rw-r--r-- | src/common/announce_multiplayer_room.h | 35 | ||||
| -rw-r--r-- | src/core/announce_multiplayer_session.cpp | 8 | ||||
| -rw-r--r-- | src/network/room.cpp | 8 | ||||
| -rw-r--r-- | src/network/room.h | 3 | ||||
| -rw-r--r-- | src/network/room_member.cpp | 2 | ||||
| -rw-r--r-- | src/web_service/announce_room_json.cpp | 21 | ||||
| -rw-r--r-- | src/web_service/announce_room_json.h | 3 | ||||
| -rw-r--r-- | src/web_service/verify_user_jwt.h | 2 | ||||
| -rw-r--r-- | src/yuzu/multiplayer/host_room.cpp | 21 | ||||
| -rw-r--r-- | src/yuzu/multiplayer/lobby.cpp | 11 | ||||
| -rw-r--r-- | src/yuzu/uisettings.h | 8 |
11 files changed, 60 insertions, 62 deletions
diff --git a/src/common/announce_multiplayer_room.h b/src/common/announce_multiplayer_room.h index 2ff38b6cf..a9e2f89b7 100644 --- a/src/common/announce_multiplayer_room.h +++ b/src/common/announce_multiplayer_room.h | |||
| @@ -15,30 +15,28 @@ namespace AnnounceMultiplayerRoom { | |||
| 15 | 15 | ||
| 16 | using MacAddress = std::array<u8, 6>; | 16 | using MacAddress = std::array<u8, 6>; |
| 17 | 17 | ||
| 18 | struct GameInfo { | ||
| 19 | std::string name{""}; | ||
| 20 | u64 id{0}; | ||
| 21 | }; | ||
| 22 | |||
| 18 | struct Member { | 23 | struct Member { |
| 19 | std::string username; | 24 | std::string username; |
| 20 | std::string nickname; | 25 | std::string nickname; |
| 21 | std::string display_name; | 26 | std::string display_name; |
| 22 | std::string avatar_url; | 27 | std::string avatar_url; |
| 23 | MacAddress mac_address; | 28 | MacAddress mac_address; |
| 24 | std::string game_name; | 29 | GameInfo game; |
| 25 | u64 game_id; | ||
| 26 | }; | 30 | }; |
| 27 | 31 | ||
| 28 | struct RoomInformation { | 32 | struct RoomInformation { |
| 29 | std::string name; ///< Name of the server | 33 | std::string name; ///< Name of the server |
| 30 | std::string description; ///< Server description | 34 | std::string description; ///< Server description |
| 31 | u32 member_slots; ///< Maximum number of members in this room | 35 | u32 member_slots; ///< Maximum number of members in this room |
| 32 | u16 port; ///< The port of this room | 36 | u16 port; ///< The port of this room |
| 33 | std::string preferred_game; ///< Game to advertise that you want to play | 37 | GameInfo preferred_game; ///< Game to advertise that you want to play |
| 34 | u64 preferred_game_id; ///< Title ID for the advertised game | 38 | std::string host_username; ///< Forum username of the host |
| 35 | std::string host_username; ///< Forum username of the host | 39 | bool enable_yuzu_mods; ///< Allow yuzu Moderators to moderate on this room |
| 36 | bool enable_yuzu_mods; ///< Allow yuzu Moderators to moderate on this room | ||
| 37 | }; | ||
| 38 | |||
| 39 | struct GameInfo { | ||
| 40 | std::string name{""}; | ||
| 41 | u64 id{0}; | ||
| 42 | }; | 40 | }; |
| 43 | 41 | ||
| 44 | struct Room { | 42 | struct Room { |
| @@ -75,8 +73,7 @@ public: | |||
| 75 | */ | 73 | */ |
| 76 | virtual void SetRoomInformation(const std::string& name, const std::string& description, | 74 | virtual void SetRoomInformation(const std::string& name, const std::string& description, |
| 77 | const u16 port, const u32 max_player, const u32 net_version, | 75 | const u16 port, const u32 max_player, const u32 net_version, |
| 78 | const bool has_password, const std::string& preferred_game, | 76 | const bool has_password, const GameInfo& preferred_game) = 0; |
| 79 | const u64 preferred_game_id) = 0; | ||
| 80 | /** | 77 | /** |
| 81 | * Adds a player information to the data that gets announced | 78 | * Adds a player information to the data that gets announced |
| 82 | * @param nickname The nickname of the player | 79 | * @param nickname The nickname of the player |
| @@ -125,8 +122,8 @@ public: | |||
| 125 | ~NullBackend() = default; | 122 | ~NullBackend() = default; |
| 126 | void SetRoomInformation(const std::string& /*name*/, const std::string& /*description*/, | 123 | void SetRoomInformation(const std::string& /*name*/, const std::string& /*description*/, |
| 127 | const u16 /*port*/, const u32 /*max_player*/, const u32 /*net_version*/, | 124 | const u16 /*port*/, const u32 /*max_player*/, const u32 /*net_version*/, |
| 128 | const bool /*has_password*/, const std::string& /*preferred_game*/, | 125 | const bool /*has_password*/, |
| 129 | const u64 /*preferred_game_id*/) override {} | 126 | const GameInfo& /*preferred_game*/) override {} |
| 130 | void AddPlayer(const Member& /*member*/) override {} | 127 | void AddPlayer(const Member& /*member*/) override {} |
| 131 | WebService::WebResult Update() override { | 128 | WebService::WebResult Update() override { |
| 132 | return WebService::WebResult{WebService::WebResult::Code::NoWebservice, | 129 | return WebService::WebResult{WebService::WebResult::Code::NoWebservice, |
diff --git a/src/core/announce_multiplayer_session.cpp b/src/core/announce_multiplayer_session.cpp index f8aa9bb0b..db9eaeac8 100644 --- a/src/core/announce_multiplayer_session.cpp +++ b/src/core/announce_multiplayer_session.cpp | |||
| @@ -89,10 +89,10 @@ AnnounceMultiplayerSession::~AnnounceMultiplayerSession() { | |||
| 89 | void AnnounceMultiplayerSession::UpdateBackendData(std::shared_ptr<Network::Room> room) { | 89 | void AnnounceMultiplayerSession::UpdateBackendData(std::shared_ptr<Network::Room> room) { |
| 90 | Network::RoomInformation room_information = room->GetRoomInformation(); | 90 | Network::RoomInformation room_information = room->GetRoomInformation(); |
| 91 | std::vector<AnnounceMultiplayerRoom::Member> memberlist = room->GetRoomMemberList(); | 91 | std::vector<AnnounceMultiplayerRoom::Member> memberlist = room->GetRoomMemberList(); |
| 92 | backend->SetRoomInformation( | 92 | backend->SetRoomInformation(room_information.name, room_information.description, |
| 93 | room_information.name, room_information.description, room_information.port, | 93 | room_information.port, room_information.member_slots, |
| 94 | room_information.member_slots, Network::network_version, room->HasPassword(), | 94 | Network::network_version, room->HasPassword(), |
| 95 | room_information.preferred_game, room_information.preferred_game_id); | 95 | room_information.preferred_game); |
| 96 | backend->ClearPlayers(); | 96 | backend->ClearPlayers(); |
| 97 | for (const auto& member : memberlist) { | 97 | for (const auto& member : memberlist) { |
| 98 | backend->AddPlayer(member); | 98 | backend->AddPlayer(member); |
diff --git a/src/network/room.cpp b/src/network/room.cpp index fe55d194c..22491b299 100644 --- a/src/network/room.cpp +++ b/src/network/room.cpp | |||
| @@ -811,7 +811,7 @@ void Room::RoomImpl::BroadcastRoomInformation() { | |||
| 811 | packet << room_information.description; | 811 | packet << room_information.description; |
| 812 | packet << room_information.member_slots; | 812 | packet << room_information.member_slots; |
| 813 | packet << room_information.port; | 813 | packet << room_information.port; |
| 814 | packet << room_information.preferred_game; | 814 | packet << room_information.preferred_game.name; |
| 815 | packet << room_information.host_username; | 815 | packet << room_information.host_username; |
| 816 | 816 | ||
| 817 | packet << static_cast<u32>(members.size()); | 817 | packet << static_cast<u32>(members.size()); |
| @@ -1013,7 +1013,7 @@ Room::~Room() = default; | |||
| 1013 | bool Room::Create(const std::string& name, const std::string& description, | 1013 | bool Room::Create(const std::string& name, const std::string& description, |
| 1014 | const std::string& server_address, u16 server_port, const std::string& password, | 1014 | const std::string& server_address, u16 server_port, const std::string& password, |
| 1015 | const u32 max_connections, const std::string& host_username, | 1015 | const u32 max_connections, const std::string& host_username, |
| 1016 | const std::string& preferred_game, u64 preferred_game_id, | 1016 | const GameInfo preferred_game, |
| 1017 | std::unique_ptr<VerifyUser::Backend> verify_backend, | 1017 | std::unique_ptr<VerifyUser::Backend> verify_backend, |
| 1018 | const Room::BanList& ban_list, bool enable_yuzu_mods) { | 1018 | const Room::BanList& ban_list, bool enable_yuzu_mods) { |
| 1019 | ENetAddress address; | 1019 | ENetAddress address; |
| @@ -1036,7 +1036,6 @@ bool Room::Create(const std::string& name, const std::string& description, | |||
| 1036 | room_impl->room_information.member_slots = max_connections; | 1036 | room_impl->room_information.member_slots = max_connections; |
| 1037 | room_impl->room_information.port = server_port; | 1037 | room_impl->room_information.port = server_port; |
| 1038 | room_impl->room_information.preferred_game = preferred_game; | 1038 | room_impl->room_information.preferred_game = preferred_game; |
| 1039 | room_impl->room_information.preferred_game_id = preferred_game_id; | ||
| 1040 | room_impl->room_information.host_username = host_username; | 1039 | room_impl->room_information.host_username = host_username; |
| 1041 | room_impl->room_information.enable_yuzu_mods = enable_yuzu_mods; | 1040 | room_impl->room_information.enable_yuzu_mods = enable_yuzu_mods; |
| 1042 | room_impl->password = password; | 1041 | room_impl->password = password; |
| @@ -1076,8 +1075,7 @@ std::vector<Member> Room::GetRoomMemberList() const { | |||
| 1076 | member.display_name = member_impl.user_data.display_name; | 1075 | member.display_name = member_impl.user_data.display_name; |
| 1077 | member.avatar_url = member_impl.user_data.avatar_url; | 1076 | member.avatar_url = member_impl.user_data.avatar_url; |
| 1078 | member.mac_address = member_impl.mac_address; | 1077 | member.mac_address = member_impl.mac_address; |
| 1079 | member.game_name = member_impl.game_info.name; | 1078 | member.game = member_impl.game_info; |
| 1080 | member.game_id = member_impl.game_info.id; | ||
| 1081 | member_list.push_back(member); | 1079 | member_list.push_back(member); |
| 1082 | } | 1080 | } |
| 1083 | return member_list; | 1081 | return member_list; |
diff --git a/src/network/room.h b/src/network/room.h index f282a5ac3..90a82563f 100644 --- a/src/network/room.h +++ b/src/network/room.h | |||
| @@ -125,8 +125,7 @@ public: | |||
| 125 | const std::string& server = "", u16 server_port = DefaultRoomPort, | 125 | const std::string& server = "", u16 server_port = DefaultRoomPort, |
| 126 | const std::string& password = "", | 126 | const std::string& password = "", |
| 127 | const u32 max_connections = MaxConcurrentConnections, | 127 | const u32 max_connections = MaxConcurrentConnections, |
| 128 | const std::string& host_username = "", const std::string& preferred_game = "", | 128 | const std::string& host_username = "", const GameInfo = {}, |
| 129 | u64 preferred_game_id = 0, | ||
| 130 | std::unique_ptr<VerifyUser::Backend> verify_backend = nullptr, | 129 | std::unique_ptr<VerifyUser::Backend> verify_backend = nullptr, |
| 131 | const BanList& ban_list = {}, bool enable_yuzu_mods = false); | 130 | const BanList& ban_list = {}, bool enable_yuzu_mods = false); |
| 132 | 131 | ||
diff --git a/src/network/room_member.cpp b/src/network/room_member.cpp index d6ace9b39..11a2e276e 100644 --- a/src/network/room_member.cpp +++ b/src/network/room_member.cpp | |||
| @@ -303,7 +303,7 @@ void RoomMember::RoomMemberImpl::HandleRoomInformationPacket(const ENetEvent* ev | |||
| 303 | packet >> info.description; | 303 | packet >> info.description; |
| 304 | packet >> info.member_slots; | 304 | packet >> info.member_slots; |
| 305 | packet >> info.port; | 305 | packet >> info.port; |
| 306 | packet >> info.preferred_game; | 306 | packet >> info.preferred_game.name; |
| 307 | packet >> info.host_username; | 307 | packet >> info.host_username; |
| 308 | room_information.name = info.name; | 308 | room_information.name = info.name; |
| 309 | room_information.description = info.description; | 309 | room_information.description = info.description; |
diff --git a/src/web_service/announce_room_json.cpp b/src/web_service/announce_room_json.cpp index 84220b851..082bebaa9 100644 --- a/src/web_service/announce_room_json.cpp +++ b/src/web_service/announce_room_json.cpp | |||
| @@ -19,14 +19,14 @@ static void to_json(nlohmann::json& json, const Member& member) { | |||
| 19 | if (!member.avatar_url.empty()) { | 19 | if (!member.avatar_url.empty()) { |
| 20 | json["avatarUrl"] = member.avatar_url; | 20 | json["avatarUrl"] = member.avatar_url; |
| 21 | } | 21 | } |
| 22 | json["gameName"] = member.game_name; | 22 | json["gameName"] = member.game.name; |
| 23 | json["gameId"] = member.game_id; | 23 | json["gameId"] = member.game.id; |
| 24 | } | 24 | } |
| 25 | 25 | ||
| 26 | static void from_json(const nlohmann::json& json, Member& member) { | 26 | static void from_json(const nlohmann::json& json, Member& member) { |
| 27 | member.nickname = json.at("nickname").get<std::string>(); | 27 | member.nickname = json.at("nickname").get<std::string>(); |
| 28 | member.game_name = json.at("gameName").get<std::string>(); | 28 | member.game.name = json.at("gameName").get<std::string>(); |
| 29 | member.game_id = json.at("gameId").get<u64>(); | 29 | member.game.id = json.at("gameId").get<u64>(); |
| 30 | try { | 30 | try { |
| 31 | member.username = json.at("username").get<std::string>(); | 31 | member.username = json.at("username").get<std::string>(); |
| 32 | member.avatar_url = json.at("avatarUrl").get<std::string>(); | 32 | member.avatar_url = json.at("avatarUrl").get<std::string>(); |
| @@ -42,8 +42,8 @@ static void to_json(nlohmann::json& json, const Room& room) { | |||
| 42 | if (!room.information.description.empty()) { | 42 | if (!room.information.description.empty()) { |
| 43 | json["description"] = room.information.description; | 43 | json["description"] = room.information.description; |
| 44 | } | 44 | } |
| 45 | json["preferredGameName"] = room.information.preferred_game; | 45 | json["preferredGameName"] = room.information.preferred_game.name; |
| 46 | json["preferredGameId"] = room.information.preferred_game_id; | 46 | json["preferredGameId"] = room.information.preferred_game.id; |
| 47 | json["maxPlayers"] = room.information.member_slots; | 47 | json["maxPlayers"] = room.information.member_slots; |
| 48 | json["netVersion"] = room.net_version; | 48 | json["netVersion"] = room.net_version; |
| 49 | json["hasPassword"] = room.has_password; | 49 | json["hasPassword"] = room.has_password; |
| @@ -65,8 +65,8 @@ static void from_json(const nlohmann::json& json, Room& room) { | |||
| 65 | } | 65 | } |
| 66 | room.information.host_username = json.at("owner").get<std::string>(); | 66 | room.information.host_username = json.at("owner").get<std::string>(); |
| 67 | room.information.port = json.at("port").get<u16>(); | 67 | room.information.port = json.at("port").get<u16>(); |
| 68 | room.information.preferred_game = json.at("preferredGameName").get<std::string>(); | 68 | room.information.preferred_game.name = json.at("preferredGameName").get<std::string>(); |
| 69 | room.information.preferred_game_id = json.at("preferredGameId").get<u64>(); | 69 | room.information.preferred_game.id = json.at("preferredGameId").get<u64>(); |
| 70 | room.information.member_slots = json.at("maxPlayers").get<u32>(); | 70 | room.information.member_slots = json.at("maxPlayers").get<u32>(); |
| 71 | room.net_version = json.at("netVersion").get<u32>(); | 71 | room.net_version = json.at("netVersion").get<u32>(); |
| 72 | room.has_password = json.at("hasPassword").get<bool>(); | 72 | room.has_password = json.at("hasPassword").get<bool>(); |
| @@ -83,8 +83,8 @@ namespace WebService { | |||
| 83 | 83 | ||
| 84 | void RoomJson::SetRoomInformation(const std::string& name, const std::string& description, | 84 | void RoomJson::SetRoomInformation(const std::string& name, const std::string& description, |
| 85 | const u16 port, const u32 max_player, const u32 net_version, | 85 | const u16 port, const u32 max_player, const u32 net_version, |
| 86 | const bool has_password, const std::string& preferred_game, | 86 | const bool has_password, |
| 87 | const u64 preferred_game_id) { | 87 | const AnnounceMultiplayerRoom::GameInfo& preferred_game) { |
| 88 | room.information.name = name; | 88 | room.information.name = name; |
| 89 | room.information.description = description; | 89 | room.information.description = description; |
| 90 | room.information.port = port; | 90 | room.information.port = port; |
| @@ -92,7 +92,6 @@ void RoomJson::SetRoomInformation(const std::string& name, const std::string& de | |||
| 92 | room.net_version = net_version; | 92 | room.net_version = net_version; |
| 93 | room.has_password = has_password; | 93 | room.has_password = has_password; |
| 94 | room.information.preferred_game = preferred_game; | 94 | room.information.preferred_game = preferred_game; |
| 95 | room.information.preferred_game_id = preferred_game_id; | ||
| 96 | } | 95 | } |
| 97 | void RoomJson::AddPlayer(const AnnounceMultiplayerRoom::Member& member) { | 96 | void RoomJson::AddPlayer(const AnnounceMultiplayerRoom::Member& member) { |
| 98 | room.members.push_back(member); | 97 | room.members.push_back(member); |
diff --git a/src/web_service/announce_room_json.h b/src/web_service/announce_room_json.h index 811c76fbd..24ec29c65 100644 --- a/src/web_service/announce_room_json.h +++ b/src/web_service/announce_room_json.h | |||
| @@ -22,8 +22,7 @@ public: | |||
| 22 | ~RoomJson() = default; | 22 | ~RoomJson() = default; |
| 23 | void SetRoomInformation(const std::string& name, const std::string& description, const u16 port, | 23 | void SetRoomInformation(const std::string& name, const std::string& description, const u16 port, |
| 24 | const u32 max_player, const u32 net_version, const bool has_password, | 24 | const u32 max_player, const u32 net_version, const bool has_password, |
| 25 | const std::string& preferred_game, | 25 | const AnnounceMultiplayerRoom::GameInfo& preferred_game) override; |
| 26 | const u64 preferred_game_id) override; | ||
| 27 | void AddPlayer(const AnnounceMultiplayerRoom::Member& member) override; | 26 | void AddPlayer(const AnnounceMultiplayerRoom::Member& member) override; |
| 28 | WebResult Update() override; | 27 | WebResult Update() override; |
| 29 | WebResult Register() override; | 28 | WebResult Register() override; |
diff --git a/src/web_service/verify_user_jwt.h b/src/web_service/verify_user_jwt.h index 826e01eed..6db74c208 100644 --- a/src/web_service/verify_user_jwt.h +++ b/src/web_service/verify_user_jwt.h | |||
| @@ -10,6 +10,8 @@ | |||
| 10 | 10 | ||
| 11 | namespace WebService { | 11 | namespace WebService { |
| 12 | 12 | ||
| 13 | std::string GetPublicKey(const std::string& host); | ||
| 14 | |||
| 13 | class VerifyUserJWT final : public Network::VerifyUser::Backend { | 15 | class VerifyUserJWT final : public Network::VerifyUser::Backend { |
| 14 | public: | 16 | public: |
| 15 | VerifyUserJWT(const std::string& host); | 17 | VerifyUserJWT(const std::string& host); |
diff --git a/src/yuzu/multiplayer/host_room.cpp b/src/yuzu/multiplayer/host_room.cpp index 5470b8b86..053e22fe4 100644 --- a/src/yuzu/multiplayer/host_room.cpp +++ b/src/yuzu/multiplayer/host_room.cpp | |||
| @@ -132,21 +132,24 @@ void HostRoomWindow::Host() { | |||
| 132 | } | 132 | } |
| 133 | ui->host->setDisabled(true); | 133 | ui->host->setDisabled(true); |
| 134 | 134 | ||
| 135 | auto game_name = ui->game_list->currentData(Qt::DisplayRole).toString(); | 135 | const AnnounceMultiplayerRoom::GameInfo game{ |
| 136 | auto game_id = ui->game_list->currentData(GameListItemPath::ProgramIdRole).toLongLong(); | 136 | .name = ui->game_list->currentData(Qt::DisplayRole).toString().toStdString(), |
| 137 | auto port = ui->port->isModified() ? ui->port->text().toInt() : Network::DefaultRoomPort; | 137 | .id = ui->game_list->currentData(GameListItemPath::ProgramIdRole).toULongLong(), |
| 138 | auto password = ui->password->text().toStdString(); | 138 | }; |
| 139 | const auto port = | ||
| 140 | ui->port->isModified() ? ui->port->text().toInt() : Network::DefaultRoomPort; | ||
| 141 | const auto password = ui->password->text().toStdString(); | ||
| 139 | const bool is_public = ui->host_type->currentIndex() == 0; | 142 | const bool is_public = ui->host_type->currentIndex() == 0; |
| 140 | Network::Room::BanList ban_list{}; | 143 | Network::Room::BanList ban_list{}; |
| 141 | if (ui->load_ban_list->isChecked()) { | 144 | if (ui->load_ban_list->isChecked()) { |
| 142 | ban_list = UISettings::values.multiplayer_ban_list; | 145 | ban_list = UISettings::values.multiplayer_ban_list; |
| 143 | } | 146 | } |
| 144 | if (auto room = Network::GetRoom().lock()) { | 147 | if (auto room = Network::GetRoom().lock()) { |
| 145 | bool created = room->Create( | 148 | const bool created = |
| 146 | ui->room_name->text().toStdString(), | 149 | room->Create(ui->room_name->text().toStdString(), |
| 147 | ui->room_description->toPlainText().toStdString(), "", port, password, | 150 | ui->room_description->toPlainText().toStdString(), "", port, password, |
| 148 | ui->max_player->value(), Settings::values.yuzu_username.GetValue(), | 151 | ui->max_player->value(), Settings::values.yuzu_username.GetValue(), |
| 149 | game_name.toStdString(), game_id, CreateVerifyBackend(is_public), ban_list); | 152 | game, CreateVerifyBackend(is_public), ban_list); |
| 150 | if (!created) { | 153 | if (!created) { |
| 151 | NetworkMessage::ErrorManager::ShowError( | 154 | NetworkMessage::ErrorManager::ShowError( |
| 152 | NetworkMessage::ErrorManager::COULD_NOT_CREATE_ROOM); | 155 | NetworkMessage::ErrorManager::COULD_NOT_CREATE_ROOM); |
diff --git a/src/yuzu/multiplayer/lobby.cpp b/src/yuzu/multiplayer/lobby.cpp index 6cc5f8f7e..1b6b782d9 100644 --- a/src/yuzu/multiplayer/lobby.cpp +++ b/src/yuzu/multiplayer/lobby.cpp | |||
| @@ -214,7 +214,7 @@ void Lobby::OnRefreshLobby() { | |||
| 214 | for (int r = 0; r < game_list->rowCount(); ++r) { | 214 | for (int r = 0; r < game_list->rowCount(); ++r) { |
| 215 | auto index = game_list->index(r, 0); | 215 | auto index = game_list->index(r, 0); |
| 216 | auto game_id = game_list->data(index, GameListItemPath::ProgramIdRole).toULongLong(); | 216 | auto game_id = game_list->data(index, GameListItemPath::ProgramIdRole).toULongLong(); |
| 217 | if (game_id != 0 && room.information.preferred_game_id == game_id) { | 217 | if (game_id != 0 && room.information.preferred_game.id == game_id) { |
| 218 | smdh_icon = game_list->data(index, Qt::DecorationRole).value<QPixmap>(); | 218 | smdh_icon = game_list->data(index, Qt::DecorationRole).value<QPixmap>(); |
| 219 | } | 219 | } |
| 220 | } | 220 | } |
| @@ -223,8 +223,8 @@ void Lobby::OnRefreshLobby() { | |||
| 223 | for (auto member : room.members) { | 223 | for (auto member : room.members) { |
| 224 | QVariant var; | 224 | QVariant var; |
| 225 | var.setValue(LobbyMember{QString::fromStdString(member.username), | 225 | var.setValue(LobbyMember{QString::fromStdString(member.username), |
| 226 | QString::fromStdString(member.nickname), member.game_id, | 226 | QString::fromStdString(member.nickname), member.game.id, |
| 227 | QString::fromStdString(member.game_name)}); | 227 | QString::fromStdString(member.game.name)}); |
| 228 | members.append(var); | 228 | members.append(var); |
| 229 | } | 229 | } |
| 230 | 230 | ||
| @@ -232,8 +232,9 @@ void Lobby::OnRefreshLobby() { | |||
| 232 | auto row = QList<QStandardItem*>({ | 232 | auto row = QList<QStandardItem*>({ |
| 233 | first_item, | 233 | first_item, |
| 234 | new LobbyItemName(room.has_password, QString::fromStdString(room.information.name)), | 234 | new LobbyItemName(room.has_password, QString::fromStdString(room.information.name)), |
| 235 | new LobbyItemGame(room.information.preferred_game_id, | 235 | new LobbyItemGame(room.information.preferred_game.id, |
| 236 | QString::fromStdString(room.information.preferred_game), smdh_icon), | 236 | QString::fromStdString(room.information.preferred_game.name), |
| 237 | smdh_icon), | ||
| 237 | new LobbyItemHost(QString::fromStdString(room.information.host_username), | 238 | new LobbyItemHost(QString::fromStdString(room.information.host_username), |
| 238 | QString::fromStdString(room.ip), room.information.port, | 239 | QString::fromStdString(room.ip), room.information.port, |
| 239 | QString::fromStdString(room.verify_UID)), | 240 | QString::fromStdString(room.verify_UID)), |
diff --git a/src/yuzu/uisettings.h b/src/yuzu/uisettings.h index 83a6cffa3..6cd4d6cb2 100644 --- a/src/yuzu/uisettings.h +++ b/src/yuzu/uisettings.h | |||
| @@ -105,12 +105,12 @@ struct Values { | |||
| 105 | // multiplayer settings | 105 | // multiplayer settings |
| 106 | Settings::Setting<QString> multiplayer_nickname{QStringLiteral("yuzu"), "nickname"}; | 106 | Settings::Setting<QString> multiplayer_nickname{QStringLiteral("yuzu"), "nickname"}; |
| 107 | Settings::Setting<QString> multiplayer_ip{{}, "ip"}; | 107 | Settings::Setting<QString> multiplayer_ip{{}, "ip"}; |
| 108 | Settings::SwitchableSetting<uint> multiplayer_port{24872, 0, 65535, "port"}; | 108 | Settings::SwitchableSetting<uint, true> multiplayer_port{24872, 0, 65535, "port"}; |
| 109 | Settings::Setting<QString> multiplayer_room_nickname{{}, "room_nickname"}; | 109 | Settings::Setting<QString> multiplayer_room_nickname{{}, "room_nickname"}; |
| 110 | Settings::Setting<QString> multiplayer_room_name{{}, "room_name"}; | 110 | Settings::Setting<QString> multiplayer_room_name{{}, "room_name"}; |
| 111 | Settings::SwitchableSetting<uint> multiplayer_max_player{8, 0, 8, "max_player"}; | 111 | Settings::SwitchableSetting<uint, true> multiplayer_max_player{8, 0, 8, "max_player"}; |
| 112 | Settings::SwitchableSetting<uint> multiplayer_room_port{24872, 0, 65535, "room_port"}; | 112 | Settings::SwitchableSetting<uint, true> multiplayer_room_port{24872, 0, 65535, "room_port"}; |
| 113 | Settings::SwitchableSetting<uint> multiplayer_host_type{0, 0, 1, "host_type"}; | 113 | Settings::SwitchableSetting<uint, true> multiplayer_host_type{0, 0, 1, "host_type"}; |
| 114 | Settings::Setting<qulonglong> multiplayer_game_id{{}, "game_id"}; | 114 | Settings::Setting<qulonglong> multiplayer_game_id{{}, "game_id"}; |
| 115 | Settings::Setting<QString> multiplayer_room_description{{}, "room_description"}; | 115 | Settings::Setting<QString> multiplayer_room_description{{}, "room_description"}; |
| 116 | std::pair<std::vector<std::string>, std::vector<std::string>> multiplayer_ban_list; | 116 | std::pair<std::vector<std::string>, std::vector<std::string>> multiplayer_ban_list; |