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 ++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 21 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", ""}; -- cgit v1.2.3