From 705f7db84dd85555a6aef1e136cf251725cef293 Mon Sep 17 00:00:00 2001 From: FearlessTobi Date: Sat, 25 Dec 2021 20:27:52 +0100 Subject: yuzu: Add ui files for multiplayer rooms --- src/common/CMakeLists.txt | 1 + src/common/announce_multiplayer_room.h | 138 +++++++++++++++++++++++++++++++++ 2 files changed, 139 insertions(+) create mode 100644 src/common/announce_multiplayer_room.h (limited to 'src/common') diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index d574e4b79..05fdfea82 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -41,6 +41,7 @@ add_custom_command(OUTPUT scm_rev.cpp add_library(common STATIC algorithm.h alignment.h + announce_multiplayer_room.h assert.cpp assert.h atomic_helpers.h diff --git a/src/common/announce_multiplayer_room.h b/src/common/announce_multiplayer_room.h new file mode 100644 index 000000000..5ca5893ef --- /dev/null +++ b/src/common/announce_multiplayer_room.h @@ -0,0 +1,138 @@ +// Copyright 2017 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include +#include +#include +#include +#include "common/common_types.h" +#include "web_service/web_result.h" + +namespace AnnounceMultiplayerRoom { + +using MacAddress = std::array; + +struct Room { + struct Member { + std::string username; + std::string nickname; + std::string avatar_url; + MacAddress mac_address; + std::string game_name; + u64 game_id; + }; + std::string id; + std::string verify_UID; ///< UID used for verification + std::string name; + std::string description; + std::string owner; + std::string ip; + u16 port; + u32 max_player; + u32 net_version; + bool has_password; + std::string preferred_game; + u64 preferred_game_id; + + std::vector members; +}; +using RoomList = std::vector; + +/** + * A AnnounceMultiplayerRoom interface class. A backend to submit/get to/from a web service should + * implement this interface. + */ +class Backend { +public: + virtual ~Backend() = default; + + /** + * Sets the Information that gets used for the announce + * @param uid The Id of the room + * @param name The name of the room + * @param description The room description + * @param port The port of the room + * @param net_version The version of the libNetwork that gets used + * @param has_password True if the room is passowrd protected + * @param preferred_game The preferred game of the room + * @param preferred_game_id The title id of the preferred game + */ + virtual void SetRoomInformation(const std::string& name, const std::string& description, + const u16 port, const u32 max_player, const u32 net_version, + const bool has_password, const std::string& preferred_game, + const u64 preferred_game_id) = 0; + /** + * Adds a player information to the data that gets announced + * @param nickname The nickname of the player + * @param mac_address The MAC Address of the player + * @param game_id The title id of the game the player plays + * @param game_name The name of the game the player plays + */ + virtual void AddPlayer(const std::string& username, const std::string& nickname, + const std::string& avatar_url, const MacAddress& mac_address, + const u64 game_id, const std::string& game_name) = 0; + + /** + * Updates the data in the announce service. Re-register the room when required. + * @result The result of the update attempt + */ + virtual WebService::WebResult Update() = 0; + + /** + * Registers the data in the announce service + * @result The result of the register attempt. When the result code is Success, A global Guid of + * the room which may be used for verification will be in the result's returned_data. + */ + virtual WebService::WebResult Register() = 0; + + /** + * Empties the stored players + */ + virtual void ClearPlayers() = 0; + + /** + * Get the room information from the announce service + * @result A list of all rooms the announce service has + */ + virtual RoomList GetRoomList() = 0; + + /** + * Sends a delete message to the announce service + */ + virtual void Delete() = 0; +}; + +/** + * Empty implementation of AnnounceMultiplayerRoom interface that drops all data. Used when a + * functional backend implementation is not available. + */ +class NullBackend : public Backend { +public: + ~NullBackend() = default; + void SetRoomInformation(const std::string& /*name*/, const std::string& /*description*/, + const u16 /*port*/, const u32 /*max_player*/, const u32 /*net_version*/, + const bool /*has_password*/, const std::string& /*preferred_game*/, + const u64 /*preferred_game_id*/) override {} + void AddPlayer(const std::string& /*username*/, const std::string& /*nickname*/, + const std::string& /*avatar_url*/, const MacAddress& /*mac_address*/, + const u64 /*game_id*/, const std::string& /*game_name*/) override {} + WebService::WebResult Update() override { + return WebService::WebResult{WebService::WebResult::Code::NoWebservice, + "WebService is missing"}; + } + WebService::WebResult Register() override { + return WebService::WebResult{WebService::WebResult::Code::NoWebservice, + "WebService is missing"}; + } + void ClearPlayers() override {} + RoomList GetRoomList() override { + return RoomList{}; + } + + void Delete() override {} +}; + +} // namespace AnnounceMultiplayerRoom -- cgit v1.2.3 From 7c3d241f0d03304df2c4d4449c2c8f1f9c7a16d3 Mon Sep 17 00:00:00 2001 From: FearlessTobi Date: Thu, 7 Jul 2022 04:12:12 +0200 Subject: common, core: fix -Wmissing-field-initializers --- src/common/announce_multiplayer_room.h | 4 ++-- src/core/announce_multiplayer_session.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/common') diff --git a/src/common/announce_multiplayer_room.h b/src/common/announce_multiplayer_room.h index 5ca5893ef..8773ce4db 100644 --- a/src/common/announce_multiplayer_room.h +++ b/src/common/announce_multiplayer_room.h @@ -121,11 +121,11 @@ public: const u64 /*game_id*/, const std::string& /*game_name*/) override {} WebService::WebResult Update() override { return WebService::WebResult{WebService::WebResult::Code::NoWebservice, - "WebService is missing"}; + "WebService is missing", ""}; } WebService::WebResult Register() override { return WebService::WebResult{WebService::WebResult::Code::NoWebservice, - "WebService is missing"}; + "WebService is missing", ""}; } void ClearPlayers() override {} RoomList GetRoomList() override { diff --git a/src/core/announce_multiplayer_session.cpp b/src/core/announce_multiplayer_session.cpp index a680ad202..aeca87aac 100644 --- a/src/core/announce_multiplayer_session.cpp +++ b/src/core/announce_multiplayer_session.cpp @@ -34,10 +34,10 @@ WebService::WebResult AnnounceMultiplayerSession::Register() { std::shared_ptr room = Network::GetRoom().lock(); if (!room) { return WebService::WebResult{WebService::WebResult::Code::LibError, - "Network is not initialized"}; + "Network is not initialized", ""}; } if (room->GetState() != Network::Room::State::Open) { - return WebService::WebResult{WebService::WebResult::Code::LibError, "Room is not open"}; + return WebService::WebResult{WebService::WebResult::Code::LibError, "Room is not open", ""}; } UpdateBackendData(room); WebService::WebResult result = backend->Register(); @@ -47,7 +47,7 @@ WebService::WebResult AnnounceMultiplayerSession::Register() { LOG_INFO(WebService, "Room has been registered"); room->SetVerifyUID(result.returned_data); registered = true; - return WebService::WebResult{WebService::WebResult::Code::Success}; + return WebService::WebResult{WebService::WebResult::Code::Success, "", ""}; } void AnnounceMultiplayerSession::Start() { -- cgit v1.2.3 From 4b404191cf054ec3206676f1fccc452bc0a0e223 Mon Sep 17 00:00:00 2001 From: FearlessTobi Date: Fri, 15 Jul 2022 21:11:09 +0200 Subject: Address second part of review comments --- src/common/announce_multiplayer_room.h | 51 ++++++++++++++----------- src/core/announce_multiplayer_session.cpp | 5 +-- src/network/room.cpp | 7 ++-- src/network/room.h | 32 +++------------- src/network/room_member.h | 4 ++ src/web_service/announce_room_json.cpp | 62 +++++++++++++------------------ src/web_service/announce_room_json.h | 5 +-- src/web_service/verify_user_jwt.cpp | 10 ++++- src/yuzu/multiplayer/lobby.cpp | 19 +++++----- 9 files changed, 92 insertions(+), 103 deletions(-) (limited to 'src/common') diff --git a/src/common/announce_multiplayer_room.h b/src/common/announce_multiplayer_room.h index 8773ce4db..2ff38b6cf 100644 --- a/src/common/announce_multiplayer_room.h +++ b/src/common/announce_multiplayer_room.h @@ -15,27 +15,40 @@ namespace AnnounceMultiplayerRoom { using MacAddress = std::array; +struct Member { + std::string username; + std::string nickname; + std::string display_name; + std::string avatar_url; + MacAddress mac_address; + std::string game_name; + u64 game_id; +}; + +struct RoomInformation { + std::string name; ///< Name of the server + std::string description; ///< Server description + u32 member_slots; ///< Maximum number of members in this room + u16 port; ///< The port of this room + std::string preferred_game; ///< Game to advertise that you want to play + u64 preferred_game_id; ///< Title ID for the advertised game + std::string host_username; ///< Forum username of the host + bool enable_yuzu_mods; ///< Allow yuzu Moderators to moderate on this room +}; + +struct GameInfo { + std::string name{""}; + u64 id{0}; +}; + struct Room { - struct Member { - std::string username; - std::string nickname; - std::string avatar_url; - MacAddress mac_address; - std::string game_name; - u64 game_id; - }; + RoomInformation information; + std::string id; std::string verify_UID; ///< UID used for verification - std::string name; - std::string description; - std::string owner; std::string ip; - u16 port; - u32 max_player; u32 net_version; bool has_password; - std::string preferred_game; - u64 preferred_game_id; std::vector members; }; @@ -71,9 +84,7 @@ public: * @param game_id The title id of the game the player plays * @param game_name The name of the game the player plays */ - virtual void AddPlayer(const std::string& username, const std::string& nickname, - const std::string& avatar_url, const MacAddress& mac_address, - const u64 game_id, const std::string& game_name) = 0; + virtual void AddPlayer(const Member& member) = 0; /** * Updates the data in the announce service. Re-register the room when required. @@ -116,9 +127,7 @@ public: const u16 /*port*/, const u32 /*max_player*/, const u32 /*net_version*/, const bool /*has_password*/, const std::string& /*preferred_game*/, const u64 /*preferred_game_id*/) override {} - void AddPlayer(const std::string& /*username*/, const std::string& /*nickname*/, - const std::string& /*avatar_url*/, const MacAddress& /*mac_address*/, - const u64 /*game_id*/, const std::string& /*game_name*/) override {} + void AddPlayer(const Member& /*member*/) override {} WebService::WebResult Update() override { return WebService::WebResult{WebService::WebResult::Code::NoWebservice, "WebService is missing", ""}; diff --git a/src/core/announce_multiplayer_session.cpp b/src/core/announce_multiplayer_session.cpp index aeca87aac..f8aa9bb0b 100644 --- a/src/core/announce_multiplayer_session.cpp +++ b/src/core/announce_multiplayer_session.cpp @@ -88,15 +88,14 @@ AnnounceMultiplayerSession::~AnnounceMultiplayerSession() { void AnnounceMultiplayerSession::UpdateBackendData(std::shared_ptr room) { Network::RoomInformation room_information = room->GetRoomInformation(); - std::vector memberlist = room->GetRoomMemberList(); + std::vector memberlist = room->GetRoomMemberList(); backend->SetRoomInformation( room_information.name, room_information.description, room_information.port, room_information.member_slots, Network::network_version, room->HasPassword(), room_information.preferred_game, room_information.preferred_game_id); backend->ClearPlayers(); for (const auto& member : memberlist) { - backend->AddPlayer(member.username, member.nickname, member.avatar_url, member.mac_address, - member.game_info.id, member.game_info.name); + backend->AddPlayer(member); } } diff --git a/src/network/room.cpp b/src/network/room.cpp index b82a75749..fe55d194c 100644 --- a/src/network/room.cpp +++ b/src/network/room.cpp @@ -1066,8 +1066,8 @@ Room::BanList Room::GetBanList() const { return {room_impl->username_ban_list, room_impl->ip_ban_list}; } -std::vector Room::GetRoomMemberList() const { - std::vector member_list; +std::vector Room::GetRoomMemberList() const { + std::vector member_list; std::lock_guard lock(room_impl->member_mutex); for (const auto& member_impl : room_impl->members) { Member member; @@ -1076,7 +1076,8 @@ std::vector Room::GetRoomMemberList() const { member.display_name = member_impl.user_data.display_name; member.avatar_url = member_impl.user_data.avatar_url; member.mac_address = member_impl.mac_address; - member.game_info = member_impl.game_info; + member.game_name = member_impl.game_info.name; + member.game_id = member_impl.game_info.id; member_list.push_back(member); } return member_list; diff --git a/src/network/room.h b/src/network/room.h index df2253bf8..f282a5ac3 100644 --- a/src/network/room.h +++ b/src/network/room.h @@ -8,11 +8,17 @@ #include #include #include +#include "common/announce_multiplayer_room.h" #include "common/common_types.h" #include "network/verify_user.h" namespace Network { +using AnnounceMultiplayerRoom::GameInfo; +using AnnounceMultiplayerRoom::MacAddress; +using AnnounceMultiplayerRoom::Member; +using AnnounceMultiplayerRoom::RoomInformation; + constexpr u32 network_version = 1; ///< The version of this Room and RoomMember constexpr u16 DefaultRoomPort = 24872; @@ -24,23 +30,6 @@ static constexpr u32 MaxConcurrentConnections = 254; constexpr std::size_t NumChannels = 1; // Number of channels used for the connection -struct RoomInformation { - std::string name; ///< Name of the server - std::string description; ///< Server description - u32 member_slots; ///< Maximum number of members in this room - u16 port; ///< The port of this room - std::string preferred_game; ///< Game to advertise that you want to play - u64 preferred_game_id; ///< Title ID for the advertised game - std::string host_username; ///< Forum username of the host - bool enable_yuzu_mods; ///< Allow yuzu Moderators to moderate on this room -}; - -struct GameInfo { - std::string name{""}; - u64 id{0}; -}; - -using MacAddress = std::array; /// A special MAC address that tells the room we're joining to assign us a MAC address /// automatically. constexpr MacAddress NoPreferredMac = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; @@ -95,15 +84,6 @@ public: Closed, ///< The room is not opened and can not accept connections. }; - struct Member { - std::string nickname; ///< The nickname of the member. - std::string username; ///< The web services username of the member. Can be empty. - std::string display_name; ///< The web services display name of the member. Can be empty. - std::string avatar_url; ///< Url to the member's avatar. Can be empty. - GameInfo game_info; ///< The current game of the member - MacAddress mac_address; ///< The assigned mac address of the member. - }; - Room(); ~Room(); diff --git a/src/network/room_member.h b/src/network/room_member.h index ee1c921d4..c835ba863 100644 --- a/src/network/room_member.h +++ b/src/network/room_member.h @@ -9,11 +9,15 @@ #include #include #include +#include "common/announce_multiplayer_room.h" #include "common/common_types.h" #include "network/room.h" namespace Network { +using AnnounceMultiplayerRoom::GameInfo; +using AnnounceMultiplayerRoom::RoomInformation; + /// Information about the received WiFi packets. /// Acts as our own 802.11 header. struct WifiPacket { diff --git a/src/web_service/announce_room_json.cpp b/src/web_service/announce_room_json.cpp index 984a59f77..84220b851 100644 --- a/src/web_service/announce_room_json.cpp +++ b/src/web_service/announce_room_json.cpp @@ -11,7 +11,7 @@ namespace AnnounceMultiplayerRoom { -static void to_json(nlohmann::json& json, const Room::Member& member) { +static void to_json(nlohmann::json& json, const Member& member) { if (!member.username.empty()) { json["username"] = member.username; } @@ -23,7 +23,7 @@ static void to_json(nlohmann::json& json, const Room::Member& member) { json["gameId"] = member.game_id; } -static void from_json(const nlohmann::json& json, Room::Member& member) { +static void from_json(const nlohmann::json& json, Member& member) { member.nickname = json.at("nickname").get(); member.game_name = json.at("gameName").get(); member.game_id = json.at("gameId").get(); @@ -37,14 +37,14 @@ static void from_json(const nlohmann::json& json, Room::Member& member) { } static void to_json(nlohmann::json& json, const Room& room) { - json["port"] = room.port; - json["name"] = room.name; - if (!room.description.empty()) { - json["description"] = room.description; + json["port"] = room.information.port; + json["name"] = room.information.name; + if (!room.information.description.empty()) { + json["description"] = room.information.description; } - json["preferredGameName"] = room.preferred_game; - json["preferredGameId"] = room.preferred_game_id; - json["maxPlayers"] = room.max_player; + json["preferredGameName"] = room.information.preferred_game; + json["preferredGameId"] = room.information.preferred_game_id; + json["maxPlayers"] = room.information.member_slots; json["netVersion"] = room.net_version; json["hasPassword"] = room.has_password; if (room.members.size() > 0) { @@ -56,22 +56,22 @@ static void to_json(nlohmann::json& json, const Room& room) { static void from_json(const nlohmann::json& json, Room& room) { room.verify_UID = json.at("externalGuid").get(); room.ip = json.at("address").get(); - room.name = json.at("name").get(); + room.information.name = json.at("name").get(); try { - room.description = json.at("description").get(); + room.information.description = json.at("description").get(); } catch (const nlohmann::detail::out_of_range&) { - room.description = ""; - LOG_DEBUG(Network, "Room \'{}\' doesn't contain a description", room.name); + room.information.description = ""; + LOG_DEBUG(Network, "Room \'{}\' doesn't contain a description", room.information.name); } - room.owner = json.at("owner").get(); - room.port = json.at("port").get(); - room.preferred_game = json.at("preferredGameName").get(); - room.preferred_game_id = json.at("preferredGameId").get(); - room.max_player = json.at("maxPlayers").get(); + room.information.host_username = json.at("owner").get(); + room.information.port = json.at("port").get(); + room.information.preferred_game = json.at("preferredGameName").get(); + room.information.preferred_game_id = json.at("preferredGameId").get(); + room.information.member_slots = json.at("maxPlayers").get(); room.net_version = json.at("netVersion").get(); room.has_password = json.at("hasPassword").get(); try { - room.members = json.at("players").get>(); + room.members = json.at("players").get>(); } catch (const nlohmann::detail::out_of_range& e) { LOG_DEBUG(Network, "Out of range {}", e.what()); } @@ -85,26 +85,16 @@ void RoomJson::SetRoomInformation(const std::string& name, const std::string& de const u16 port, const u32 max_player, const u32 net_version, const bool has_password, const std::string& preferred_game, const u64 preferred_game_id) { - room.name = name; - room.description = description; - room.port = port; - room.max_player = max_player; + room.information.name = name; + room.information.description = description; + room.information.port = port; + room.information.member_slots = max_player; room.net_version = net_version; room.has_password = has_password; - room.preferred_game = preferred_game; - room.preferred_game_id = preferred_game_id; + room.information.preferred_game = preferred_game; + room.information.preferred_game_id = preferred_game_id; } -void RoomJson::AddPlayer(const std::string& username_, const std::string& nickname_, - const std::string& avatar_url, - const AnnounceMultiplayerRoom::MacAddress& mac_address, const u64 game_id, - const std::string& game_name) { - AnnounceMultiplayerRoom::Room::Member member; - member.username = username_; - member.nickname = nickname_; - member.avatar_url = avatar_url; - member.mac_address = mac_address; - member.game_id = game_id; - member.game_name = game_name; +void RoomJson::AddPlayer(const AnnounceMultiplayerRoom::Member& member) { room.members.push_back(member); } diff --git a/src/web_service/announce_room_json.h b/src/web_service/announce_room_json.h index f65c93214..811c76fbd 100644 --- a/src/web_service/announce_room_json.h +++ b/src/web_service/announce_room_json.h @@ -24,10 +24,7 @@ public: const u32 max_player, const u32 net_version, const bool has_password, const std::string& preferred_game, const u64 preferred_game_id) override; - void AddPlayer(const std::string& username_, const std::string& nickname_, - const std::string& avatar_url, - const AnnounceMultiplayerRoom::MacAddress& mac_address, const u64 game_id, - const std::string& game_name) override; + void AddPlayer(const AnnounceMultiplayerRoom::Member& member) override; WebResult Update() override; WebResult Register() override; void ClearPlayers() override; diff --git a/src/web_service/verify_user_jwt.cpp b/src/web_service/verify_user_jwt.cpp index 78fe7bed5..3133dcbe2 100644 --- a/src/web_service/verify_user_jwt.cpp +++ b/src/web_service/verify_user_jwt.cpp @@ -2,8 +2,16 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include +#if defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" +#endif #include +#if defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic pop +#endif + +#include #include "common/logging/log.h" #include "web_service/verify_user_jwt.h" #include "web_service/web_backend.h" diff --git a/src/yuzu/multiplayer/lobby.cpp b/src/yuzu/multiplayer/lobby.cpp index 364b4605e..6cc5f8f7e 100644 --- a/src/yuzu/multiplayer/lobby.cpp +++ b/src/yuzu/multiplayer/lobby.cpp @@ -214,7 +214,7 @@ void Lobby::OnRefreshLobby() { for (int r = 0; r < game_list->rowCount(); ++r) { auto index = game_list->index(r, 0); auto game_id = game_list->data(index, GameListItemPath::ProgramIdRole).toULongLong(); - if (game_id != 0 && room.preferred_game_id == game_id) { + if (game_id != 0 && room.information.preferred_game_id == game_id) { smdh_icon = game_list->data(index, Qt::DecorationRole).value(); } } @@ -231,20 +231,21 @@ void Lobby::OnRefreshLobby() { auto first_item = new LobbyItem(); auto row = QList({ first_item, - new LobbyItemName(room.has_password, QString::fromStdString(room.name)), - new LobbyItemGame(room.preferred_game_id, QString::fromStdString(room.preferred_game), - smdh_icon), - new LobbyItemHost(QString::fromStdString(room.owner), QString::fromStdString(room.ip), - room.port, QString::fromStdString(room.verify_UID)), - new LobbyItemMemberList(members, room.max_player), + new LobbyItemName(room.has_password, QString::fromStdString(room.information.name)), + new LobbyItemGame(room.information.preferred_game_id, + QString::fromStdString(room.information.preferred_game), smdh_icon), + new LobbyItemHost(QString::fromStdString(room.information.host_username), + QString::fromStdString(room.ip), room.information.port, + QString::fromStdString(room.verify_UID)), + new LobbyItemMemberList(members, room.information.member_slots), }); model->appendRow(row); // To make the rows expandable, add the member data as a child of the first column of the // rows with people in them and have qt set them to colspan after the model is finished // resetting - if (!room.description.empty()) { + if (!room.information.description.empty()) { first_item->appendRow( - new LobbyItemDescription(QString::fromStdString(room.description))); + new LobbyItemDescription(QString::fromStdString(room.information.description))); } if (!room.members.empty()) { first_item->appendRow(new LobbyItemExpandedMemberList(members)); -- cgit v1.2.3 From 899c8bb33094f43fbd8df9afb4ca84718ebac87e Mon Sep 17 00:00:00 2001 From: german77 Date: Sun, 17 Jul 2022 22:53:44 -0500 Subject: common: multiplayer: Use GameInfo type --- src/common/announce_multiplayer_room.h | 35 ++++++++++++++----------------- src/core/announce_multiplayer_session.cpp | 8 +++---- src/network/room.cpp | 8 +++---- src/network/room.h | 3 +-- src/network/room_member.cpp | 2 +- src/web_service/announce_room_json.cpp | 21 +++++++++---------- src/web_service/announce_room_json.h | 3 +-- src/web_service/verify_user_jwt.h | 2 ++ src/yuzu/multiplayer/host_room.cpp | 21 +++++++++++-------- src/yuzu/multiplayer/lobby.cpp | 11 +++++----- src/yuzu/uisettings.h | 8 +++---- 11 files changed, 60 insertions(+), 62 deletions(-) (limited to 'src/common') 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 { using MacAddress = std::array; +struct GameInfo { + std::string name{""}; + u64 id{0}; +}; + struct Member { std::string username; std::string nickname; std::string display_name; std::string avatar_url; MacAddress mac_address; - std::string game_name; - u64 game_id; + GameInfo game; }; struct RoomInformation { - std::string name; ///< Name of the server - std::string description; ///< Server description - u32 member_slots; ///< Maximum number of members in this room - u16 port; ///< The port of this room - std::string preferred_game; ///< Game to advertise that you want to play - u64 preferred_game_id; ///< Title ID for the advertised game - std::string host_username; ///< Forum username of the host - bool enable_yuzu_mods; ///< Allow yuzu Moderators to moderate on this room -}; - -struct GameInfo { - std::string name{""}; - u64 id{0}; + std::string name; ///< Name of the server + std::string description; ///< Server description + u32 member_slots; ///< Maximum number of members in this room + u16 port; ///< The port of this room + GameInfo preferred_game; ///< Game to advertise that you want to play + std::string host_username; ///< Forum username of the host + bool enable_yuzu_mods; ///< Allow yuzu Moderators to moderate on this room }; struct Room { @@ -75,8 +73,7 @@ public: */ virtual void SetRoomInformation(const std::string& name, const std::string& description, const u16 port, const u32 max_player, const u32 net_version, - const bool has_password, const std::string& preferred_game, - const u64 preferred_game_id) = 0; + const bool has_password, const GameInfo& preferred_game) = 0; /** * Adds a player information to the data that gets announced * @param nickname The nickname of the player @@ -125,8 +122,8 @@ public: ~NullBackend() = default; void SetRoomInformation(const std::string& /*name*/, const std::string& /*description*/, const u16 /*port*/, const u32 /*max_player*/, const u32 /*net_version*/, - const bool /*has_password*/, const std::string& /*preferred_game*/, - const u64 /*preferred_game_id*/) override {} + const bool /*has_password*/, + const GameInfo& /*preferred_game*/) override {} void AddPlayer(const Member& /*member*/) override {} WebService::WebResult Update() override { 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() { void AnnounceMultiplayerSession::UpdateBackendData(std::shared_ptr room) { Network::RoomInformation room_information = room->GetRoomInformation(); std::vector memberlist = room->GetRoomMemberList(); - backend->SetRoomInformation( - room_information.name, room_information.description, room_information.port, - room_information.member_slots, Network::network_version, room->HasPassword(), - room_information.preferred_game, room_information.preferred_game_id); + backend->SetRoomInformation(room_information.name, room_information.description, + room_information.port, room_information.member_slots, + Network::network_version, room->HasPassword(), + room_information.preferred_game); backend->ClearPlayers(); for (const auto& member : memberlist) { 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() { packet << room_information.description; packet << room_information.member_slots; packet << room_information.port; - packet << room_information.preferred_game; + packet << room_information.preferred_game.name; packet << room_information.host_username; packet << static_cast(members.size()); @@ -1013,7 +1013,7 @@ Room::~Room() = default; bool Room::Create(const std::string& name, const std::string& description, const std::string& server_address, u16 server_port, const std::string& password, const u32 max_connections, const std::string& host_username, - const std::string& preferred_game, u64 preferred_game_id, + const GameInfo preferred_game, std::unique_ptr verify_backend, const Room::BanList& ban_list, bool enable_yuzu_mods) { ENetAddress address; @@ -1036,7 +1036,6 @@ bool Room::Create(const std::string& name, const std::string& description, room_impl->room_information.member_slots = max_connections; room_impl->room_information.port = server_port; room_impl->room_information.preferred_game = preferred_game; - room_impl->room_information.preferred_game_id = preferred_game_id; room_impl->room_information.host_username = host_username; room_impl->room_information.enable_yuzu_mods = enable_yuzu_mods; room_impl->password = password; @@ -1076,8 +1075,7 @@ std::vector Room::GetRoomMemberList() const { member.display_name = member_impl.user_data.display_name; member.avatar_url = member_impl.user_data.avatar_url; member.mac_address = member_impl.mac_address; - member.game_name = member_impl.game_info.name; - member.game_id = member_impl.game_info.id; + member.game = member_impl.game_info; member_list.push_back(member); } 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: const std::string& server = "", u16 server_port = DefaultRoomPort, const std::string& password = "", const u32 max_connections = MaxConcurrentConnections, - const std::string& host_username = "", const std::string& preferred_game = "", - u64 preferred_game_id = 0, + const std::string& host_username = "", const GameInfo = {}, std::unique_ptr verify_backend = nullptr, const BanList& ban_list = {}, bool enable_yuzu_mods = false); 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 packet >> info.description; packet >> info.member_slots; packet >> info.port; - packet >> info.preferred_game; + packet >> info.preferred_game.name; packet >> info.host_username; room_information.name = info.name; 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) { if (!member.avatar_url.empty()) { json["avatarUrl"] = member.avatar_url; } - json["gameName"] = member.game_name; - json["gameId"] = member.game_id; + json["gameName"] = member.game.name; + json["gameId"] = member.game.id; } static void from_json(const nlohmann::json& json, Member& member) { member.nickname = json.at("nickname").get(); - member.game_name = json.at("gameName").get(); - member.game_id = json.at("gameId").get(); + member.game.name = json.at("gameName").get(); + member.game.id = json.at("gameId").get(); try { member.username = json.at("username").get(); member.avatar_url = json.at("avatarUrl").get(); @@ -42,8 +42,8 @@ static void to_json(nlohmann::json& json, const Room& room) { if (!room.information.description.empty()) { json["description"] = room.information.description; } - json["preferredGameName"] = room.information.preferred_game; - json["preferredGameId"] = room.information.preferred_game_id; + json["preferredGameName"] = room.information.preferred_game.name; + json["preferredGameId"] = room.information.preferred_game.id; json["maxPlayers"] = room.information.member_slots; json["netVersion"] = room.net_version; json["hasPassword"] = room.has_password; @@ -65,8 +65,8 @@ static void from_json(const nlohmann::json& json, Room& room) { } room.information.host_username = json.at("owner").get(); room.information.port = json.at("port").get(); - room.information.preferred_game = json.at("preferredGameName").get(); - room.information.preferred_game_id = json.at("preferredGameId").get(); + room.information.preferred_game.name = json.at("preferredGameName").get(); + room.information.preferred_game.id = json.at("preferredGameId").get(); room.information.member_slots = json.at("maxPlayers").get(); room.net_version = json.at("netVersion").get(); room.has_password = json.at("hasPassword").get(); @@ -83,8 +83,8 @@ namespace WebService { void RoomJson::SetRoomInformation(const std::string& name, const std::string& description, const u16 port, const u32 max_player, const u32 net_version, - const bool has_password, const std::string& preferred_game, - const u64 preferred_game_id) { + const bool has_password, + const AnnounceMultiplayerRoom::GameInfo& preferred_game) { room.information.name = name; room.information.description = description; room.information.port = port; @@ -92,7 +92,6 @@ void RoomJson::SetRoomInformation(const std::string& name, const std::string& de room.net_version = net_version; room.has_password = has_password; room.information.preferred_game = preferred_game; - room.information.preferred_game_id = preferred_game_id; } void RoomJson::AddPlayer(const AnnounceMultiplayerRoom::Member& member) { 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: ~RoomJson() = default; void SetRoomInformation(const std::string& name, const std::string& description, const u16 port, const u32 max_player, const u32 net_version, const bool has_password, - const std::string& preferred_game, - const u64 preferred_game_id) override; + const AnnounceMultiplayerRoom::GameInfo& preferred_game) override; void AddPlayer(const AnnounceMultiplayerRoom::Member& member) override; WebResult Update() override; 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 @@ namespace WebService { +std::string GetPublicKey(const std::string& host); + class VerifyUserJWT final : public Network::VerifyUser::Backend { public: 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() { } ui->host->setDisabled(true); - auto game_name = ui->game_list->currentData(Qt::DisplayRole).toString(); - auto game_id = ui->game_list->currentData(GameListItemPath::ProgramIdRole).toLongLong(); - auto port = ui->port->isModified() ? ui->port->text().toInt() : Network::DefaultRoomPort; - auto password = ui->password->text().toStdString(); + const AnnounceMultiplayerRoom::GameInfo game{ + .name = ui->game_list->currentData(Qt::DisplayRole).toString().toStdString(), + .id = ui->game_list->currentData(GameListItemPath::ProgramIdRole).toULongLong(), + }; + const auto port = + ui->port->isModified() ? ui->port->text().toInt() : Network::DefaultRoomPort; + const auto password = ui->password->text().toStdString(); const bool is_public = ui->host_type->currentIndex() == 0; Network::Room::BanList ban_list{}; if (ui->load_ban_list->isChecked()) { ban_list = UISettings::values.multiplayer_ban_list; } if (auto room = Network::GetRoom().lock()) { - bool created = room->Create( - ui->room_name->text().toStdString(), - ui->room_description->toPlainText().toStdString(), "", port, password, - ui->max_player->value(), Settings::values.yuzu_username.GetValue(), - game_name.toStdString(), game_id, CreateVerifyBackend(is_public), ban_list); + const bool created = + room->Create(ui->room_name->text().toStdString(), + ui->room_description->toPlainText().toStdString(), "", port, password, + ui->max_player->value(), Settings::values.yuzu_username.GetValue(), + game, CreateVerifyBackend(is_public), ban_list); if (!created) { NetworkMessage::ErrorManager::ShowError( 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() { for (int r = 0; r < game_list->rowCount(); ++r) { auto index = game_list->index(r, 0); auto game_id = game_list->data(index, GameListItemPath::ProgramIdRole).toULongLong(); - if (game_id != 0 && room.information.preferred_game_id == game_id) { + if (game_id != 0 && room.information.preferred_game.id == game_id) { smdh_icon = game_list->data(index, Qt::DecorationRole).value(); } } @@ -223,8 +223,8 @@ void Lobby::OnRefreshLobby() { for (auto member : room.members) { QVariant var; var.setValue(LobbyMember{QString::fromStdString(member.username), - QString::fromStdString(member.nickname), member.game_id, - QString::fromStdString(member.game_name)}); + QString::fromStdString(member.nickname), member.game.id, + QString::fromStdString(member.game.name)}); members.append(var); } @@ -232,8 +232,9 @@ void Lobby::OnRefreshLobby() { auto row = QList({ first_item, new LobbyItemName(room.has_password, QString::fromStdString(room.information.name)), - new LobbyItemGame(room.information.preferred_game_id, - QString::fromStdString(room.information.preferred_game), smdh_icon), + new LobbyItemGame(room.information.preferred_game.id, + QString::fromStdString(room.information.preferred_game.name), + smdh_icon), new LobbyItemHost(QString::fromStdString(room.information.host_username), QString::fromStdString(room.ip), room.information.port, 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 { // multiplayer settings Settings::Setting multiplayer_nickname{QStringLiteral("yuzu"), "nickname"}; Settings::Setting multiplayer_ip{{}, "ip"}; - Settings::SwitchableSetting multiplayer_port{24872, 0, 65535, "port"}; + Settings::SwitchableSetting multiplayer_port{24872, 0, 65535, "port"}; Settings::Setting multiplayer_room_nickname{{}, "room_nickname"}; Settings::Setting multiplayer_room_name{{}, "room_name"}; - Settings::SwitchableSetting multiplayer_max_player{8, 0, 8, "max_player"}; - Settings::SwitchableSetting multiplayer_room_port{24872, 0, 65535, "room_port"}; - Settings::SwitchableSetting multiplayer_host_type{0, 0, 1, "host_type"}; + Settings::SwitchableSetting multiplayer_max_player{8, 0, 8, "max_player"}; + Settings::SwitchableSetting multiplayer_room_port{24872, 0, 65535, "room_port"}; + Settings::SwitchableSetting multiplayer_host_type{0, 0, 1, "host_type"}; Settings::Setting multiplayer_game_id{{}, "game_id"}; Settings::Setting multiplayer_room_description{{}, "room_description"}; std::pair, std::vector> multiplayer_ban_list; -- cgit v1.2.3 From 6a2dcc8b3d4ed0940e33d60fee701bcdb063eb6b Mon Sep 17 00:00:00 2001 From: FearlessTobi Date: Mon, 25 Jul 2022 17:08:20 +0200 Subject: network, yuzu: Improve variable naming and style consistency --- src/common/announce_multiplayer_room.h | 2 +- src/network/network.cpp | 28 ++++++++++++++-------------- src/network/network.h | 4 ++-- src/network/room.cpp | 16 ++++++++-------- src/network/room_member.cpp | 6 ++++-- src/network/verify_user.cpp | 2 +- src/network/verify_user.h | 6 +++--- src/web_service/announce_room_json.cpp | 4 ++-- src/web_service/verify_user_jwt.cpp | 4 ++-- src/web_service/verify_user_jwt.h | 2 +- src/yuzu/multiplayer/host_room.cpp | 2 +- src/yuzu/multiplayer/lobby.cpp | 8 ++++---- src/yuzu/multiplayer/lobby_p.h | 4 ++-- src/yuzu/multiplayer/state.cpp | 12 ++++++++---- 14 files changed, 53 insertions(+), 47 deletions(-) (limited to 'src/common') diff --git a/src/common/announce_multiplayer_room.h b/src/common/announce_multiplayer_room.h index a9e2f89b7..11a80aa8e 100644 --- a/src/common/announce_multiplayer_room.h +++ b/src/common/announce_multiplayer_room.h @@ -43,7 +43,7 @@ struct Room { RoomInformation information; std::string id; - std::string verify_UID; ///< UID used for verification + std::string verify_uid; ///< UID used for verification std::string ip; u32 net_version; bool has_password; diff --git a/src/network/network.cpp b/src/network/network.cpp index e1401a403..36b70c36f 100644 --- a/src/network/network.cpp +++ b/src/network/network.cpp @@ -10,8 +10,8 @@ namespace Network { RoomNetwork::RoomNetwork() { - g_room = std::make_shared(); - g_room_member = std::make_shared(); + m_room = std::make_shared(); + m_room_member = std::make_shared(); } bool RoomNetwork::Init() { @@ -19,30 +19,30 @@ bool RoomNetwork::Init() { LOG_ERROR(Network, "Error initalizing ENet"); return false; } - g_room = std::make_shared(); - g_room_member = std::make_shared(); + m_room = std::make_shared(); + m_room_member = std::make_shared(); LOG_DEBUG(Network, "initialized OK"); return true; } std::weak_ptr RoomNetwork::GetRoom() { - return g_room; + return m_room; } std::weak_ptr RoomNetwork::GetRoomMember() { - return g_room_member; + return m_room_member; } void RoomNetwork::Shutdown() { - if (g_room_member) { - if (g_room_member->IsConnected()) - g_room_member->Leave(); - g_room_member.reset(); + if (m_room_member) { + if (m_room_member->IsConnected()) + m_room_member->Leave(); + m_room_member.reset(); } - if (g_room) { - if (g_room->GetState() == Room::State::Open) - g_room->Destroy(); - g_room.reset(); + if (m_room) { + if (m_room->GetState() == Room::State::Open) + m_room->Destroy(); + m_room.reset(); } enet_deinitialize(); LOG_DEBUG(Network, "shutdown OK"); diff --git a/src/network/network.h b/src/network/network.h index 74eb42bf5..a38f04029 100644 --- a/src/network/network.h +++ b/src/network/network.h @@ -27,8 +27,8 @@ public: void Shutdown(); private: - std::shared_ptr g_room_member; ///< RoomMember (Client) for network games - std::shared_ptr g_room; ///< Room (Server) for network games + std::shared_ptr m_room_member; ///< RoomMember (Client) for network games + std::shared_ptr m_room; ///< Room (Server) for network games }; } // namespace Network diff --git a/src/network/room.cpp b/src/network/room.cpp index 22491b299..b22c5fb89 100644 --- a/src/network/room.cpp +++ b/src/network/room.cpp @@ -29,8 +29,8 @@ public: std::atomic state{State::Closed}; ///< Current state of the room. RoomInformation room_information; ///< Information about this room. - std::string verify_UID; ///< A GUID which may be used for verfication. - mutable std::mutex verify_UID_mutex; ///< Mutex for verify_UID + std::string verify_uid; ///< A GUID which may be used for verfication. + mutable std::mutex verify_uid_mutex; ///< Mutex for verify_uid std::string password; ///< The password required to connect to this room. @@ -369,8 +369,8 @@ void Room::RoomImpl::HandleJoinRequest(const ENetEvent* event) { std::string uid; { - std::lock_guard lock(verify_UID_mutex); - uid = verify_UID; + std::lock_guard lock(verify_uid_mutex); + uid = verify_uid; } member.user_data = verify_backend->LoadUserData(uid, token); @@ -1056,8 +1056,8 @@ const RoomInformation& Room::GetRoomInformation() const { } std::string Room::GetVerifyUID() const { - std::lock_guard lock(room_impl->verify_UID_mutex); - return room_impl->verify_UID; + std::lock_guard lock(room_impl->verify_uid_mutex); + return room_impl->verify_uid; } Room::BanList Room::GetBanList() const { @@ -1086,8 +1086,8 @@ bool Room::HasPassword() const { } void Room::SetVerifyUID(const std::string& uid) { - std::lock_guard lock(room_impl->verify_UID_mutex); - room_impl->verify_UID = uid; + std::lock_guard lock(room_impl->verify_uid_mutex); + room_impl->verify_uid = uid; } void Room::Destroy() { diff --git a/src/network/room_member.cpp b/src/network/room_member.cpp index 11a2e276e..d8cb32721 100644 --- a/src/network/room_member.cpp +++ b/src/network/room_member.cpp @@ -416,8 +416,9 @@ void RoomMember::RoomMemberImpl::Disconnect() { room_information.member_slots = 0; room_information.name.clear(); - if (!server) + if (!server) { return; + } enet_peer_disconnect(server, 0); ENetEvent event; @@ -483,8 +484,9 @@ template void RoomMember::RoomMemberImpl::Invoke(const T& data) { std::lock_guard lock(callback_mutex); CallbackSet callback_set = callbacks.Get(); - for (auto const& callback : callback_set) + for (auto const& callback : callback_set) { (*callback)(data); + } } template diff --git a/src/network/verify_user.cpp b/src/network/verify_user.cpp index d9d98e495..51094e9bc 100644 --- a/src/network/verify_user.cpp +++ b/src/network/verify_user.cpp @@ -10,7 +10,7 @@ Backend::~Backend() = default; NullBackend::~NullBackend() = default; -UserData NullBackend::LoadUserData([[maybe_unused]] const std::string& verify_UID, +UserData NullBackend::LoadUserData([[maybe_unused]] const std::string& verify_uid, [[maybe_unused]] const std::string& token) { return {}; } diff --git a/src/network/verify_user.h b/src/network/verify_user.h index 5c3852d4a..ddae67e99 100644 --- a/src/network/verify_user.h +++ b/src/network/verify_user.h @@ -25,11 +25,11 @@ public: /** * Verifies the given token and loads the information into a UserData struct. - * @param verify_UID A GUID that may be used for verification. + * @param verify_uid A GUID that may be used for verification. * @param token A token that contains user data and verification data. The format and content is * decided by backends. */ - virtual UserData LoadUserData(const std::string& verify_UID, const std::string& token) = 0; + virtual UserData LoadUserData(const std::string& verify_uid, const std::string& token) = 0; }; /** @@ -40,7 +40,7 @@ class NullBackend final : public Backend { public: ~NullBackend(); - UserData LoadUserData(const std::string& verify_UID, const std::string& token) override; + UserData LoadUserData(const std::string& verify_uid, const std::string& token) override; }; } // namespace Network::VerifyUser diff --git a/src/web_service/announce_room_json.cpp b/src/web_service/announce_room_json.cpp index 082bebaa9..0aae8e215 100644 --- a/src/web_service/announce_room_json.cpp +++ b/src/web_service/announce_room_json.cpp @@ -54,7 +54,7 @@ static void to_json(nlohmann::json& json, const Room& room) { } static void from_json(const nlohmann::json& json, Room& room) { - room.verify_UID = json.at("externalGuid").get(); + room.verify_uid = json.at("externalGuid").get(); room.ip = json.at("address").get(); room.information.name = json.at("name").get(); try { @@ -116,7 +116,7 @@ WebService::WebResult RoomJson::Register() { auto reply_json = nlohmann::json::parse(result.returned_data); room = reply_json.get(); room_id = reply_json.at("id").get(); - return WebService::WebResult{WebService::WebResult::Code::Success, "", room.verify_UID}; + return WebService::WebResult{WebService::WebResult::Code::Success, "", room.verify_uid}; } void RoomJson::ClearPlayers() { diff --git a/src/web_service/verify_user_jwt.cpp b/src/web_service/verify_user_jwt.cpp index 3133dcbe2..2f294d378 100644 --- a/src/web_service/verify_user_jwt.cpp +++ b/src/web_service/verify_user_jwt.cpp @@ -35,9 +35,9 @@ std::string GetPublicKey(const std::string& host) { VerifyUserJWT::VerifyUserJWT(const std::string& host) : pub_key(GetPublicKey(host)) {} -Network::VerifyUser::UserData VerifyUserJWT::LoadUserData(const std::string& verify_UID, +Network::VerifyUser::UserData VerifyUserJWT::LoadUserData(const std::string& verify_uid, const std::string& token) { - const std::string audience = fmt::format("external-{}", verify_UID); + const std::string audience = fmt::format("external-{}", verify_uid); using namespace jwt::params; std::error_code error; auto decoded = diff --git a/src/web_service/verify_user_jwt.h b/src/web_service/verify_user_jwt.h index 6db74c208..ec3cc2904 100644 --- a/src/web_service/verify_user_jwt.h +++ b/src/web_service/verify_user_jwt.h @@ -17,7 +17,7 @@ public: VerifyUserJWT(const std::string& host); ~VerifyUserJWT() = default; - Network::VerifyUser::UserData LoadUserData(const std::string& verify_UID, + Network::VerifyUser::UserData LoadUserData(const std::string& verify_uid, const std::string& token) override; private: diff --git a/src/yuzu/multiplayer/host_room.cpp b/src/yuzu/multiplayer/host_room.cpp index a48077544..f59c6a28d 100644 --- a/src/yuzu/multiplayer/host_room.cpp +++ b/src/yuzu/multiplayer/host_room.cpp @@ -163,7 +163,7 @@ void HostRoomWindow::Host() { // Start the announce session if they chose Public if (is_public) { if (auto session = announce_multiplayer_session.lock()) { - // Register the room first to ensure verify_UID is present when we connect + // Register the room first to ensure verify_uid is present when we connect WebService::WebResult result = session->Register(); if (result.result_code != WebService::WebResult::Code::Success) { QMessageBox::warning( diff --git a/src/yuzu/multiplayer/lobby.cpp b/src/yuzu/multiplayer/lobby.cpp index 0c6648ab5..6daef9712 100644 --- a/src/yuzu/multiplayer/lobby.cpp +++ b/src/yuzu/multiplayer/lobby.cpp @@ -149,11 +149,11 @@ void Lobby::OnJoinRoom(const QModelIndex& source) { const std::string ip = proxy->data(connection_index, LobbyItemHost::HostIPRole).toString().toStdString(); int port = proxy->data(connection_index, LobbyItemHost::HostPortRole).toInt(); - const std::string verify_UID = + const std::string verify_uid = proxy->data(connection_index, LobbyItemHost::HostVerifyUIDRole).toString().toStdString(); // attempt to connect in a different thread - QFuture f = QtConcurrent::run([nickname, ip, port, password, verify_UID, this] { + QFuture f = QtConcurrent::run([nickname, ip, port, password, verify_uid, this] { std::string token; #ifdef ENABLE_WEB_SERVICE if (!Settings::values.yuzu_username.GetValue().empty() && @@ -161,7 +161,7 @@ void Lobby::OnJoinRoom(const QModelIndex& source) { WebService::Client client(Settings::values.web_api_url.GetValue(), Settings::values.yuzu_username.GetValue(), Settings::values.yuzu_token.GetValue()); - token = client.GetExternalJWT(verify_UID).returned_data; + token = client.GetExternalJWT(verify_uid).returned_data; if (token.empty()) { LOG_ERROR(WebService, "Could not get external JWT, verification may fail"); } else { @@ -239,7 +239,7 @@ void Lobby::OnRefreshLobby() { smdh_icon), new LobbyItemHost(QString::fromStdString(room.information.host_username), QString::fromStdString(room.ip), room.information.port, - QString::fromStdString(room.verify_UID)), + QString::fromStdString(room.verify_uid)), new LobbyItemMemberList(members, room.information.member_slots), }); model->appendRow(row); diff --git a/src/yuzu/multiplayer/lobby_p.h b/src/yuzu/multiplayer/lobby_p.h index afb8b99dc..bb2de4af3 100644 --- a/src/yuzu/multiplayer/lobby_p.h +++ b/src/yuzu/multiplayer/lobby_p.h @@ -123,11 +123,11 @@ public: static const int HostVerifyUIDRole = Qt::UserRole + 4; LobbyItemHost() = default; - explicit LobbyItemHost(QString username, QString ip, u16 port, QString verify_UID) { + explicit LobbyItemHost(QString username, QString ip, u16 port, QString verify_uid) { setData(username, HostUsernameRole); setData(ip, HostIPRole); setData(port, HostPortRole); - setData(verify_UID, HostVerifyUIDRole); + setData(verify_uid, HostVerifyUIDRole); } QVariant data(int role) const override { diff --git a/src/yuzu/multiplayer/state.cpp b/src/yuzu/multiplayer/state.cpp index de25225dd..661a32b3e 100644 --- a/src/yuzu/multiplayer/state.cpp +++ b/src/yuzu/multiplayer/state.cpp @@ -98,14 +98,18 @@ void MultiplayerState::retranslateUi() { status_text->setText(tr("Not Connected")); } - if (lobby) + if (lobby) { lobby->RetranslateUi(); - if (host_room) + } + if (host_room) { host_room->RetranslateUi(); - if (client_room) + } + if (client_room) { client_room->RetranslateUi(); - if (direct_connect) + } + if (direct_connect) { direct_connect->RetranslateUi(); + } } void MultiplayerState::OnNetworkStateChanged(const Network::RoomMember::State& state) { -- cgit v1.2.3 From 61ce57b5242984c297283de5868ea4938391a911 Mon Sep 17 00:00:00 2001 From: FearlessTobi Date: Mon, 25 Jul 2022 17:18:30 +0200 Subject: network, yuzu: Make copyright headers SPDX-compliant --- src/common/announce_multiplayer_room.h | 5 ++--- src/core/announce_multiplayer_session.cpp | 5 ++--- src/core/announce_multiplayer_session.h | 5 ++--- src/network/network.cpp | 5 ++--- src/network/network.h | 5 ++--- src/network/packet.cpp | 5 ++--- src/network/packet.h | 5 ++--- src/network/room.cpp | 5 ++--- src/network/room.h | 5 ++--- src/network/room_member.cpp | 5 ++--- src/network/room_member.h | 5 ++--- src/network/verify_user.cpp | 5 ++--- src/network/verify_user.h | 5 ++--- src/web_service/announce_room_json.cpp | 5 ++--- src/web_service/announce_room_json.h | 5 ++--- src/web_service/verify_user_jwt.cpp | 5 ++--- src/web_service/verify_user_jwt.h | 5 ++--- src/yuzu/multiplayer/chat_room.cpp | 5 ++--- src/yuzu/multiplayer/chat_room.h | 5 ++--- src/yuzu/multiplayer/client_room.cpp | 5 ++--- src/yuzu/multiplayer/client_room.h | 5 ++--- src/yuzu/multiplayer/direct_connect.cpp | 5 ++--- src/yuzu/multiplayer/direct_connect.h | 5 ++--- src/yuzu/multiplayer/host_room.cpp | 5 ++--- src/yuzu/multiplayer/host_room.h | 5 ++--- src/yuzu/multiplayer/lobby.cpp | 5 ++--- src/yuzu/multiplayer/lobby.h | 5 ++--- src/yuzu/multiplayer/lobby_p.h | 5 ++--- src/yuzu/multiplayer/message.cpp | 5 ++--- src/yuzu/multiplayer/message.h | 5 ++--- src/yuzu/multiplayer/moderation_dialog.cpp | 5 ++--- src/yuzu/multiplayer/moderation_dialog.h | 5 ++--- src/yuzu/multiplayer/state.cpp | 5 ++--- src/yuzu/multiplayer/state.h | 5 ++--- src/yuzu/multiplayer/validation.h | 5 ++--- src/yuzu/util/clickable_label.cpp | 5 ++--- src/yuzu/util/clickable_label.h | 5 ++--- 37 files changed, 74 insertions(+), 111 deletions(-) (limited to 'src/common') diff --git a/src/common/announce_multiplayer_room.h b/src/common/announce_multiplayer_room.h index 11a80aa8e..0ad9da2be 100644 --- a/src/common/announce_multiplayer_room.h +++ b/src/common/announce_multiplayer_room.h @@ -1,6 +1,5 @@ -// Copyright 2017 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2017 Citra Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/announce_multiplayer_session.cpp b/src/core/announce_multiplayer_session.cpp index 8f96b4ee8..d73a488cf 100644 --- a/src/core/announce_multiplayer_session.cpp +++ b/src/core/announce_multiplayer_session.cpp @@ -1,6 +1,5 @@ -// Copyright 2017 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2017 Citra Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #include #include diff --git a/src/core/announce_multiplayer_session.h b/src/core/announce_multiplayer_session.h index 5da3c1f8d..db790f7d2 100644 --- a/src/core/announce_multiplayer_session.h +++ b/src/core/announce_multiplayer_session.h @@ -1,6 +1,5 @@ -// Copyright 2017 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2017 Citra Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/network/network.cpp b/src/network/network.cpp index 36b70c36f..0841e4134 100644 --- a/src/network/network.cpp +++ b/src/network/network.cpp @@ -1,6 +1,5 @@ -// Copyright 2017 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2017 Citra Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #include "common/assert.h" #include "common/logging/log.h" diff --git a/src/network/network.h b/src/network/network.h index a38f04029..e4de207b2 100644 --- a/src/network/network.h +++ b/src/network/network.h @@ -1,6 +1,5 @@ -// Copyright 2017 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2017 Citra Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/network/packet.cpp b/src/network/packet.cpp index a3c1e1644..d6c8dc646 100644 --- a/src/network/packet.cpp +++ b/src/network/packet.cpp @@ -1,6 +1,5 @@ -// Copyright 2017 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2017 Citra Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #ifdef _WIN32 #include diff --git a/src/network/packet.h b/src/network/packet.h index 7bdc3da95..aa9fa39e2 100644 --- a/src/network/packet.h +++ b/src/network/packet.h @@ -1,6 +1,5 @@ -// Copyright 2017 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2017 Citra Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/network/room.cpp b/src/network/room.cpp index b22c5fb89..d5f0bb723 100644 --- a/src/network/room.cpp +++ b/src/network/room.cpp @@ -1,6 +1,5 @@ -// Copyright 2017 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2017 Citra Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #include #include diff --git a/src/network/room.h b/src/network/room.h index 90a82563f..6f7e3b5b5 100644 --- a/src/network/room.h +++ b/src/network/room.h @@ -1,6 +1,5 @@ -// Copyright 2017 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2017 Citra Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/network/room_member.cpp b/src/network/room_member.cpp index d8cb32721..38a6f6bfd 100644 --- a/src/network/room_member.cpp +++ b/src/network/room_member.cpp @@ -1,6 +1,5 @@ -// Copyright 2017 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2017 Citra Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #include #include diff --git a/src/network/room_member.h b/src/network/room_member.h index 8d6254023..bbb7d13d4 100644 --- a/src/network/room_member.h +++ b/src/network/room_member.h @@ -1,6 +1,5 @@ -// Copyright 2017 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2017 Citra Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/network/verify_user.cpp b/src/network/verify_user.cpp index 51094e9bc..f84cfe59b 100644 --- a/src/network/verify_user.cpp +++ b/src/network/verify_user.cpp @@ -1,6 +1,5 @@ -// Copyright 2018 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2018 Citra Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #include "network/verify_user.h" diff --git a/src/network/verify_user.h b/src/network/verify_user.h index ddae67e99..6fc64d8a3 100644 --- a/src/network/verify_user.h +++ b/src/network/verify_user.h @@ -1,6 +1,5 @@ -// Copyright 2018 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2018 Citra Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/web_service/announce_room_json.cpp b/src/web_service/announce_room_json.cpp index 0aae8e215..4c3195efd 100644 --- a/src/web_service/announce_room_json.cpp +++ b/src/web_service/announce_room_json.cpp @@ -1,6 +1,5 @@ -// Copyright 2017 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2017 Citra Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #include #include diff --git a/src/web_service/announce_room_json.h b/src/web_service/announce_room_json.h index 24ec29c65..32c08858d 100644 --- a/src/web_service/announce_room_json.h +++ b/src/web_service/announce_room_json.h @@ -1,6 +1,5 @@ -// Copyright 2017 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2017 Citra Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/web_service/verify_user_jwt.cpp b/src/web_service/verify_user_jwt.cpp index 2f294d378..3bff46f0a 100644 --- a/src/web_service/verify_user_jwt.cpp +++ b/src/web_service/verify_user_jwt.cpp @@ -1,6 +1,5 @@ -// Copyright 2018 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2018 Citra Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #if defined(__GNUC__) || defined(__clang__) #pragma GCC diagnostic push diff --git a/src/web_service/verify_user_jwt.h b/src/web_service/verify_user_jwt.h index ec3cc2904..27b0a100c 100644 --- a/src/web_service/verify_user_jwt.h +++ b/src/web_service/verify_user_jwt.h @@ -1,6 +1,5 @@ -// Copyright 2018 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2018 Citra Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/yuzu/multiplayer/chat_room.cpp b/src/yuzu/multiplayer/chat_room.cpp index 9f2c57eee..5837b36ab 100644 --- a/src/yuzu/multiplayer/chat_room.cpp +++ b/src/yuzu/multiplayer/chat_room.cpp @@ -1,6 +1,5 @@ -// Copyright 2017 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2017 Citra Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #include #include diff --git a/src/yuzu/multiplayer/chat_room.h b/src/yuzu/multiplayer/chat_room.h index 9179d16fb..01c70fad0 100644 --- a/src/yuzu/multiplayer/chat_room.h +++ b/src/yuzu/multiplayer/chat_room.h @@ -1,6 +1,5 @@ -// Copyright 2017 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2017 Citra Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/yuzu/multiplayer/client_room.cpp b/src/yuzu/multiplayer/client_room.cpp index 9bef9bdfc..a9859ed70 100644 --- a/src/yuzu/multiplayer/client_room.cpp +++ b/src/yuzu/multiplayer/client_room.cpp @@ -1,6 +1,5 @@ -// Copyright 2017 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2017 Citra Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #include #include diff --git a/src/yuzu/multiplayer/client_room.h b/src/yuzu/multiplayer/client_room.h index 6303b2595..f338e3c59 100644 --- a/src/yuzu/multiplayer/client_room.h +++ b/src/yuzu/multiplayer/client_room.h @@ -1,6 +1,5 @@ -// Copyright 2017 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2017 Citra Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/yuzu/multiplayer/direct_connect.cpp b/src/yuzu/multiplayer/direct_connect.cpp index 360d66bea..9000c4531 100644 --- a/src/yuzu/multiplayer/direct_connect.cpp +++ b/src/yuzu/multiplayer/direct_connect.cpp @@ -1,6 +1,5 @@ -// Copyright 2017 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2017 Citra Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #include #include diff --git a/src/yuzu/multiplayer/direct_connect.h b/src/yuzu/multiplayer/direct_connect.h index 719030d29..4e1043053 100644 --- a/src/yuzu/multiplayer/direct_connect.h +++ b/src/yuzu/multiplayer/direct_connect.h @@ -1,6 +1,5 @@ -// Copyright 2017 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2017 Citra Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/yuzu/multiplayer/host_room.cpp b/src/yuzu/multiplayer/host_room.cpp index f59c6a28d..cb9464b2b 100644 --- a/src/yuzu/multiplayer/host_room.cpp +++ b/src/yuzu/multiplayer/host_room.cpp @@ -1,6 +1,5 @@ -// Copyright 2017 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2017 Citra Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #include #include diff --git a/src/yuzu/multiplayer/host_room.h b/src/yuzu/multiplayer/host_room.h index 98a56458f..a968042d0 100644 --- a/src/yuzu/multiplayer/host_room.h +++ b/src/yuzu/multiplayer/host_room.h @@ -1,6 +1,5 @@ -// Copyright 2017 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2017 Citra Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/yuzu/multiplayer/lobby.cpp b/src/yuzu/multiplayer/lobby.cpp index 6daef9712..23c2f21ab 100644 --- a/src/yuzu/multiplayer/lobby.cpp +++ b/src/yuzu/multiplayer/lobby.cpp @@ -1,6 +1,5 @@ -// Copyright 2017 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2017 Citra Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #include #include diff --git a/src/yuzu/multiplayer/lobby.h b/src/yuzu/multiplayer/lobby.h index ec6ec2662..82744ca94 100644 --- a/src/yuzu/multiplayer/lobby.h +++ b/src/yuzu/multiplayer/lobby.h @@ -1,6 +1,5 @@ -// Copyright 2017 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2017 Citra Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/yuzu/multiplayer/lobby_p.h b/src/yuzu/multiplayer/lobby_p.h index bb2de4af3..8071cede4 100644 --- a/src/yuzu/multiplayer/lobby_p.h +++ b/src/yuzu/multiplayer/lobby_p.h @@ -1,6 +1,5 @@ -// Copyright 2017 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2017 Citra Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/yuzu/multiplayer/message.cpp b/src/yuzu/multiplayer/message.cpp index 458f1e7d1..76ec276ad 100644 --- a/src/yuzu/multiplayer/message.cpp +++ b/src/yuzu/multiplayer/message.cpp @@ -1,6 +1,5 @@ -// Copyright 2017 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2017 Citra Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #include #include diff --git a/src/yuzu/multiplayer/message.h b/src/yuzu/multiplayer/message.h index 49a31997d..eb5c8d1be 100644 --- a/src/yuzu/multiplayer/message.h +++ b/src/yuzu/multiplayer/message.h @@ -1,6 +1,5 @@ -// Copyright 2017 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2017 Citra Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/yuzu/multiplayer/moderation_dialog.cpp b/src/yuzu/multiplayer/moderation_dialog.cpp index fc3f36c57..c9b8ed397 100644 --- a/src/yuzu/multiplayer/moderation_dialog.cpp +++ b/src/yuzu/multiplayer/moderation_dialog.cpp @@ -1,6 +1,5 @@ -// Copyright 2018 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2018 Citra Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #include #include diff --git a/src/yuzu/multiplayer/moderation_dialog.h b/src/yuzu/multiplayer/moderation_dialog.h index 8adec0cd8..e9e5daff7 100644 --- a/src/yuzu/multiplayer/moderation_dialog.h +++ b/src/yuzu/multiplayer/moderation_dialog.h @@ -1,6 +1,5 @@ -// Copyright 2018 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2018 Citra Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/yuzu/multiplayer/state.cpp b/src/yuzu/multiplayer/state.cpp index 661a32b3e..015c59788 100644 --- a/src/yuzu/multiplayer/state.cpp +++ b/src/yuzu/multiplayer/state.cpp @@ -1,6 +1,5 @@ -// Copyright 2018 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2018 Citra Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #include #include diff --git a/src/yuzu/multiplayer/state.h b/src/yuzu/multiplayer/state.h index bdd5cc954..9c60712d5 100644 --- a/src/yuzu/multiplayer/state.h +++ b/src/yuzu/multiplayer/state.h @@ -1,6 +1,5 @@ -// Copyright 2018 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2018 Citra Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/yuzu/multiplayer/validation.h b/src/yuzu/multiplayer/validation.h index 1c215a190..7d48e589d 100644 --- a/src/yuzu/multiplayer/validation.h +++ b/src/yuzu/multiplayer/validation.h @@ -1,6 +1,5 @@ -// Copyright 2017 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2017 Citra Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/yuzu/util/clickable_label.cpp b/src/yuzu/util/clickable_label.cpp index 5bde838ca..89d14190a 100644 --- a/src/yuzu/util/clickable_label.cpp +++ b/src/yuzu/util/clickable_label.cpp @@ -1,6 +1,5 @@ -// Copyright 2017 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2017 Citra Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #include "yuzu/util/clickable_label.h" diff --git a/src/yuzu/util/clickable_label.h b/src/yuzu/util/clickable_label.h index 3c65a74be..4fe744150 100644 --- a/src/yuzu/util/clickable_label.h +++ b/src/yuzu/util/clickable_label.h @@ -1,6 +1,5 @@ -// Copyright 2017 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2017 Citra Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #pragma once -- cgit v1.2.3