summaryrefslogtreecommitdiff
path: root/src/network/room.h
diff options
context:
space:
mode:
authorGravatar FearlessTobi2022-07-15 21:11:09 +0200
committerGravatar FearlessTobi2022-07-25 21:59:30 +0200
commit4b404191cf054ec3206676f1fccc452bc0a0e223 (patch)
tree8a1582246c41260fe82804bf4dcb9abf77176e27 /src/network/room.h
parentAddress first part of review comments (diff)
downloadyuzu-4b404191cf054ec3206676f1fccc452bc0a0e223.tar.gz
yuzu-4b404191cf054ec3206676f1fccc452bc0a0e223.tar.xz
yuzu-4b404191cf054ec3206676f1fccc452bc0a0e223.zip
Address second part of review comments
Diffstat (limited to 'src/network/room.h')
-rw-r--r--src/network/room.h32
1 files changed, 6 insertions, 26 deletions
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 @@
8#include <memory> 8#include <memory>
9#include <string> 9#include <string>
10#include <vector> 10#include <vector>
11#include "common/announce_multiplayer_room.h"
11#include "common/common_types.h" 12#include "common/common_types.h"
12#include "network/verify_user.h" 13#include "network/verify_user.h"
13 14
14namespace Network { 15namespace Network {
15 16
17using AnnounceMultiplayerRoom::GameInfo;
18using AnnounceMultiplayerRoom::MacAddress;
19using AnnounceMultiplayerRoom::Member;
20using AnnounceMultiplayerRoom::RoomInformation;
21
16constexpr u32 network_version = 1; ///< The version of this Room and RoomMember 22constexpr u32 network_version = 1; ///< The version of this Room and RoomMember
17 23
18constexpr u16 DefaultRoomPort = 24872; 24constexpr u16 DefaultRoomPort = 24872;
@@ -24,23 +30,6 @@ static constexpr u32 MaxConcurrentConnections = 254;
24 30
25constexpr std::size_t NumChannels = 1; // Number of channels used for the connection 31constexpr std::size_t NumChannels = 1; // Number of channels used for the connection
26 32
27struct RoomInformation {
28 std::string name; ///< Name of the server
29 std::string description; ///< Server description
30 u32 member_slots; ///< Maximum number of members in this room
31 u16 port; ///< The port of this room
32 std::string preferred_game; ///< Game to advertise that you want to play
33 u64 preferred_game_id; ///< Title ID for the advertised game
34 std::string host_username; ///< Forum username of the host
35 bool enable_yuzu_mods; ///< Allow yuzu Moderators to moderate on this room
36};
37
38struct GameInfo {
39 std::string name{""};
40 u64 id{0};
41};
42
43using MacAddress = std::array<u8, 6>;
44/// A special MAC address that tells the room we're joining to assign us a MAC address 33/// A special MAC address that tells the room we're joining to assign us a MAC address
45/// automatically. 34/// automatically.
46constexpr MacAddress NoPreferredMac = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; 35constexpr MacAddress NoPreferredMac = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
@@ -95,15 +84,6 @@ public:
95 Closed, ///< The room is not opened and can not accept connections. 84 Closed, ///< The room is not opened and can not accept connections.
96 }; 85 };
97 86
98 struct Member {
99 std::string nickname; ///< The nickname of the member.
100 std::string username; ///< The web services username of the member. Can be empty.
101 std::string display_name; ///< The web services display name of the member. Can be empty.
102 std::string avatar_url; ///< Url to the member's avatar. Can be empty.
103 GameInfo game_info; ///< The current game of the member
104 MacAddress mac_address; ///< The assigned mac address of the member.
105 };
106
107 Room(); 87 Room();
108 ~Room(); 88 ~Room();
109 89