diff options
Diffstat (limited to 'src/common/announce_multiplayer_room.h')
| -rw-r--r-- | src/common/announce_multiplayer_room.h | 51 |
1 files changed, 30 insertions, 21 deletions
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 { | |||
| 15 | 15 | ||
| 16 | using MacAddress = std::array<u8, 6>; | 16 | using MacAddress = std::array<u8, 6>; |
| 17 | 17 | ||
| 18 | struct Member { | ||
| 19 | std::string username; | ||
| 20 | std::string nickname; | ||
| 21 | std::string display_name; | ||
| 22 | std::string avatar_url; | ||
| 23 | MacAddress mac_address; | ||
| 24 | std::string game_name; | ||
| 25 | u64 game_id; | ||
| 26 | }; | ||
| 27 | |||
| 28 | struct RoomInformation { | ||
| 29 | std::string name; ///< Name of the server | ||
| 30 | std::string description; ///< Server description | ||
| 31 | u32 member_slots; ///< Maximum number of members in this room | ||
| 32 | u16 port; ///< The port of this room | ||
| 33 | std::string preferred_game; ///< Game to advertise that you want to play | ||
| 34 | u64 preferred_game_id; ///< Title ID for the advertised game | ||
| 35 | std::string host_username; ///< Forum username of the host | ||
| 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 | }; | ||
| 43 | |||
| 18 | struct Room { | 44 | struct Room { |
| 19 | struct Member { | 45 | RoomInformation information; |
| 20 | std::string username; | 46 | |
| 21 | std::string nickname; | ||
| 22 | std::string avatar_url; | ||
| 23 | MacAddress mac_address; | ||
| 24 | std::string game_name; | ||
| 25 | u64 game_id; | ||
| 26 | }; | ||
| 27 | std::string id; | 47 | std::string id; |
| 28 | std::string verify_UID; ///< UID used for verification | 48 | std::string verify_UID; ///< UID used for verification |
| 29 | std::string name; | ||
| 30 | std::string description; | ||
| 31 | std::string owner; | ||
| 32 | std::string ip; | 49 | std::string ip; |
| 33 | u16 port; | ||
| 34 | u32 max_player; | ||
| 35 | u32 net_version; | 50 | u32 net_version; |
| 36 | bool has_password; | 51 | bool has_password; |
| 37 | std::string preferred_game; | ||
| 38 | u64 preferred_game_id; | ||
| 39 | 52 | ||
| 40 | std::vector<Member> members; | 53 | std::vector<Member> members; |
| 41 | }; | 54 | }; |
| @@ -71,9 +84,7 @@ public: | |||
| 71 | * @param game_id The title id of the game the player plays | 84 | * @param game_id The title id of the game the player plays |
| 72 | * @param game_name The name of the game the player plays | 85 | * @param game_name The name of the game the player plays |
| 73 | */ | 86 | */ |
| 74 | virtual void AddPlayer(const std::string& username, const std::string& nickname, | 87 | virtual void AddPlayer(const Member& member) = 0; |
| 75 | const std::string& avatar_url, const MacAddress& mac_address, | ||
| 76 | const u64 game_id, const std::string& game_name) = 0; | ||
| 77 | 88 | ||
| 78 | /** | 89 | /** |
| 79 | * Updates the data in the announce service. Re-register the room when required. | 90 | * Updates the data in the announce service. Re-register the room when required. |
| @@ -116,9 +127,7 @@ public: | |||
| 116 | const u16 /*port*/, const u32 /*max_player*/, const u32 /*net_version*/, | 127 | const u16 /*port*/, const u32 /*max_player*/, const u32 /*net_version*/, |
| 117 | const bool /*has_password*/, const std::string& /*preferred_game*/, | 128 | const bool /*has_password*/, const std::string& /*preferred_game*/, |
| 118 | const u64 /*preferred_game_id*/) override {} | 129 | const u64 /*preferred_game_id*/) override {} |
| 119 | void AddPlayer(const std::string& /*username*/, const std::string& /*nickname*/, | 130 | void AddPlayer(const Member& /*member*/) override {} |
| 120 | const std::string& /*avatar_url*/, const MacAddress& /*mac_address*/, | ||
| 121 | const u64 /*game_id*/, const std::string& /*game_name*/) override {} | ||
| 122 | WebService::WebResult Update() override { | 131 | WebService::WebResult Update() override { |
| 123 | return WebService::WebResult{WebService::WebResult::Code::NoWebservice, | 132 | return WebService::WebResult{WebService::WebResult::Code::NoWebservice, |
| 124 | "WebService is missing", ""}; | 133 | "WebService is missing", ""}; |