early-access version 2967

This commit is contained in:
pineappleEA 2022-09-21 03:10:45 +02:00
parent 7e939deb74
commit d0f99d1371
5 changed files with 14 additions and 10 deletions

View File

@ -1,7 +1,7 @@
yuzu emulator early access yuzu emulator early access
============= =============
This is the source code for early-access 2966. This is the source code for early-access 2967.
## Legal Notice ## Legal Notice

View File

@ -285,7 +285,7 @@ Result LANDiscovery::DestroyNetwork() {
ResetStations(); ResetStations();
SetState(State::AccessPointOpened); SetState(State::AccessPointOpened);
LanEvent(); lan_event();
return ResultSuccess; return ResultSuccess;
} }
@ -320,7 +320,7 @@ Result LANDiscovery::Disconnect() {
} }
SetState(State::StationOpened); SetState(State::StationOpened);
LanEvent(); lan_event();
return ResultSuccess; return ResultSuccess;
} }
@ -338,7 +338,7 @@ Result LANDiscovery::Initialize(LanEventFunc lan_event_, bool listening) {
} }
connected_clients.clear(); connected_clients.clear();
LanEvent = lan_event_; lan_event = lan_event_;
SetState(State::Initialized); SetState(State::Initialized);
@ -405,13 +405,13 @@ void LANDiscovery::OnDisconnectFromHost() {
host_ip = std::nullopt; host_ip = std::nullopt;
if (state == State::StationConnected) { if (state == State::StationConnected) {
SetState(State::StationOpened); SetState(State::StationOpened);
LanEvent(); lan_event();
} }
} }
void LANDiscovery::OnNetworkInfoChanged() { void LANDiscovery::OnNetworkInfoChanged() {
if (IsNodeStateChanged()) { if (IsNodeStateChanged()) {
LanEvent(); lan_event();
} }
return; return;
} }

View File

@ -110,7 +110,7 @@ protected:
void SendPacket(const Network::LDNPacket& packet); void SendPacket(const Network::LDNPacket& packet);
static const LanEventFunc empty_func; static const LanEventFunc empty_func;
const Ssid fake_ssid{"YuzuFakeSsidForLdn"}; static constexpr Ssid fake_ssid{"YuzuFakeSsidForLdn"};
bool inited{}; bool inited{};
std::mutex packet_mutex; std::mutex packet_mutex;
@ -127,7 +127,7 @@ protected:
std::vector<Ipv4Address> connected_clients; std::vector<Ipv4Address> connected_clients;
std::optional<Ipv4Address> host_ip; std::optional<Ipv4Address> host_ip;
LanEventFunc LanEvent; LanEventFunc lan_event;
Network::RoomNetwork& room_network; Network::RoomNetwork& room_network;
}; };

View File

@ -157,7 +157,7 @@ struct Ssid {
Ssid() = default; Ssid() = default;
explicit Ssid(std::string_view data) { constexpr explicit Ssid(std::string_view data) {
length = static_cast<u8>(std::min(data.size(), SsidLengthMax)); length = static_cast<u8>(std::min(data.size(), SsidLengthMax));
data.copy(raw.data(), length); data.copy(raw.data(), length);
raw[length] = 0; raw[length] = 0;
@ -170,6 +170,10 @@ struct Ssid {
bool operator==(const Ssid& b) const { bool operator==(const Ssid& b) const {
return (length == b.length) && (std::memcmp(raw.data(), b.raw.data(), length) == 0); return (length == b.length) && (std::memcmp(raw.data(), b.raw.data(), length) == 0);
} }
bool operator!=(const Ssid& b) const {
return !operator==(b);
}
}; };
static_assert(sizeof(Ssid) == 0x22, "Ssid is an invalid size"); static_assert(sizeof(Ssid) == 0x22, "Ssid is an invalid size");

View File

@ -125,7 +125,7 @@
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="title"> <property name="title">
<string>Multiplayer</string> <string>&amp;Multiplayer</string>
</property> </property>
<addaction name="action_View_Lobby"/> <addaction name="action_View_Lobby"/>
<addaction name="action_Start_Room"/> <addaction name="action_Start_Room"/>