mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-19 20:07:54 -05:00
Address second part of review comments
This commit is contained in:
@ -1066,8 +1066,8 @@ Room::BanList Room::GetBanList() const {
|
||||
return {room_impl->username_ban_list, room_impl->ip_ban_list};
|
||||
}
|
||||
|
||||
std::vector<Room::Member> Room::GetRoomMemberList() const {
|
||||
std::vector<Room::Member> member_list;
|
||||
std::vector<Member> Room::GetRoomMemberList() const {
|
||||
std::vector<Member> 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::Member> 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;
|
||||
|
@ -8,11 +8,17 @@
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#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<u8, 6>;
|
||||
/// 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();
|
||||
|
||||
|
@ -9,11 +9,15 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <boost/serialization/vector.hpp>
|
||||
#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 {
|
||||
|
Reference in New Issue
Block a user