mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-07-01 11:25:21 +02:00
Added the public lobby to android. (#125)
This is adapted from kleidis old PR to Azahar. Changes from it: - Fixed inconsistent button styling in the dialog for connection - Allowed to hide both empty and full rooms. - Proper serving of preferred games - Enables web service for android by default - Better implementation of multiplayer.cpp that works with oop Also fixes the room network class and turns it into a static namespace in network Signed-off-by: Aleksandr Popovich <alekpopo@pm.me> Co-authored-by: swurl <swurl@swurl.xyz> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/125 Co-authored-by: Aleksandr Popovich <alekpopo@pm.me> Co-committed-by: Aleksandr Popovich <alekpopo@pm.me>
This commit is contained in:
parent
7e13da47af
commit
76fa525592
99 changed files with 1470 additions and 498 deletions
|
|
@ -1,6 +1,9 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#include "core/hle/service/ldn/lan_discovery.h"
|
||||
#include "core/internal_network/network.h"
|
||||
#include "core/internal_network/network_interface.h"
|
||||
|
|
@ -33,9 +36,8 @@ void LanStation::OverrideInfo() {
|
|||
node_info->is_connected = connected ? 1 : 0;
|
||||
}
|
||||
|
||||
LANDiscovery::LANDiscovery(Network::RoomNetwork& room_network_)
|
||||
: stations({{{1, this}, {2, this}, {3, this}, {4, this}, {5, this}, {6, this}, {7, this}}}),
|
||||
room_network{room_network_} {}
|
||||
LANDiscovery::LANDiscovery()
|
||||
: stations({{{1, this}, {2, this}, {3, this}, {4, this}, {5, this}, {6, this}, {7, this}}}){}
|
||||
|
||||
LANDiscovery::~LANDiscovery() {
|
||||
if (inited) {
|
||||
|
|
@ -410,7 +412,7 @@ void LANDiscovery::OnNetworkInfoChanged() {
|
|||
|
||||
Network::IPv4Address LANDiscovery::GetLocalIp() const {
|
||||
Network::IPv4Address local_ip{0xFF, 0xFF, 0xFF, 0xFF};
|
||||
if (auto room_member = room_network.GetRoomMember().lock()) {
|
||||
if (auto room_member = Network::GetRoomMember().lock()) {
|
||||
if (room_member->IsConnected()) {
|
||||
local_ip = room_member->GetFakeIpAddress();
|
||||
}
|
||||
|
|
@ -468,7 +470,7 @@ void LANDiscovery::SendBroadcast(Network::LDNPacketType type) {
|
|||
}
|
||||
|
||||
void LANDiscovery::SendPacket(const Network::LDNPacket& packet) {
|
||||
if (auto room_member = room_network.GetRoomMember().lock()) {
|
||||
if (auto room_member = Network::GetRoomMember().lock()) {
|
||||
if (room_member->IsConnected()) {
|
||||
room_member->SendLdnPacket(packet);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
|
|
@ -47,7 +50,7 @@ class LANDiscovery {
|
|||
public:
|
||||
using LanEventFunc = std::function<void()>;
|
||||
|
||||
LANDiscovery(Network::RoomNetwork& room_network_);
|
||||
LANDiscovery();
|
||||
~LANDiscovery();
|
||||
|
||||
State GetState() const;
|
||||
|
|
@ -127,7 +130,5 @@ protected:
|
|||
std::optional<Ipv4Address> host_ip;
|
||||
|
||||
LanEventFunc lan_event;
|
||||
|
||||
Network::RoomNetwork& room_network;
|
||||
};
|
||||
} // namespace Service::LDN
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "core/core.h"
|
||||
|
|
@ -22,7 +25,7 @@ namespace Service::LDN {
|
|||
IUserLocalCommunicationService::IUserLocalCommunicationService(Core::System& system_)
|
||||
: ServiceFramework{system_, "IUserLocalCommunicationService"},
|
||||
service_context{system, "IUserLocalCommunicationService"},
|
||||
room_network{system_.GetRoomNetwork()}, lan_discovery{room_network} {
|
||||
lan_discovery{} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, C<&IUserLocalCommunicationService::GetState>, "GetState"},
|
||||
|
|
@ -65,7 +68,7 @@ IUserLocalCommunicationService::IUserLocalCommunicationService(Core::System& sys
|
|||
|
||||
IUserLocalCommunicationService::~IUserLocalCommunicationService() {
|
||||
if (is_initialized) {
|
||||
if (auto room_member = room_network.GetRoomMember().lock()) {
|
||||
if (auto room_member = Network::GetRoomMember().lock()) {
|
||||
room_member->Unbind(ldn_packet_received);
|
||||
}
|
||||
}
|
||||
|
|
@ -103,7 +106,7 @@ Result IUserLocalCommunicationService::GetIpv4Address(Out<Ipv4Address> out_curre
|
|||
*out_subnet_mask = {Network::TranslateIPv4(network_interface->subnet_mask)};
|
||||
|
||||
// When we're connected to a room, spoof the hosts IP address
|
||||
if (auto room_member = room_network.GetRoomMember().lock()) {
|
||||
if (auto room_member = Network::GetRoomMember().lock()) {
|
||||
if (room_member->IsConnected()) {
|
||||
*out_current_address = room_member->GetFakeIpAddress();
|
||||
}
|
||||
|
|
@ -280,7 +283,7 @@ Result IUserLocalCommunicationService::Initialize(ClientProcessId aruid) {
|
|||
const auto network_interface = Network::GetSelectedNetworkInterface();
|
||||
R_UNLESS(network_interface, ResultAirplaneModeEnabled);
|
||||
|
||||
if (auto room_member = room_network.GetRoomMember().lock()) {
|
||||
if (auto room_member = Network::GetRoomMember().lock()) {
|
||||
ldn_packet_received = room_member->BindOnLdnPacketReceived(
|
||||
[this](const Network::LDNPacket& packet) { OnLDNPacketReceived(packet); });
|
||||
} else {
|
||||
|
|
@ -295,7 +298,7 @@ Result IUserLocalCommunicationService::Initialize(ClientProcessId aruid) {
|
|||
|
||||
Result IUserLocalCommunicationService::Finalize() {
|
||||
LOG_INFO(Service_LDN, "called");
|
||||
if (auto room_member = room_network.GetRoomMember().lock()) {
|
||||
if (auto room_member = Network::GetRoomMember().lock()) {
|
||||
room_member->Unbind(ldn_packet_received);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/service/cmif_types.h"
|
||||
|
|
@ -13,10 +16,6 @@ namespace Core {
|
|||
class System;
|
||||
}
|
||||
|
||||
namespace Network {
|
||||
class RoomNetwork;
|
||||
}
|
||||
|
||||
namespace Service::LDN {
|
||||
|
||||
class IUserLocalCommunicationService final
|
||||
|
|
@ -91,7 +90,6 @@ private:
|
|||
|
||||
KernelHelpers::ServiceContext service_context;
|
||||
Kernel::KEvent* state_change_event;
|
||||
Network::RoomNetwork& room_network;
|
||||
LANDiscovery lan_discovery;
|
||||
|
||||
// Callback identifier for the OnLDNPacketReceived event.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue