mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2025-12-16 12:08:49 +00:00
Clean up
This commit is contained in:
parent
97d763b839
commit
7fbfdad69a
@ -1,4 +1,4 @@
|
||||
// Copyright 2017 Citra Emulator Project
|
||||
// Copyright Citra Emulator Project / Azahar Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
@ -14,7 +14,6 @@
|
||||
#include "citra_qt/multiplayer/validation.h"
|
||||
#include "citra_qt/uisettings.h"
|
||||
#include "core/hle/service/cfg/cfg.h"
|
||||
#include "core/hle/service/cfg/cfg_u.h"
|
||||
#include "network/network.h"
|
||||
#include "network/network_settings.h"
|
||||
#include "ui_direct_connect.h"
|
||||
@ -91,7 +90,8 @@ void DirectConnectWindow::Connect() {
|
||||
room_member->Join(ui->nickname->text().toStdString(),
|
||||
Service::CFG::GetConsoleIdHash(system),
|
||||
ui->ip->text().toStdString().c_str(), port, 0,
|
||||
Service::CFG::GetConsoleMacAddress(system), ui->password->text().toStdString().c_str());
|
||||
Service::CFG::GetConsoleMacAddress(system),
|
||||
ui->password->text().toStdString().c_str());
|
||||
}
|
||||
});
|
||||
watcher->setFuture(f);
|
||||
|
||||
@ -19,8 +19,6 @@
|
||||
#include "citra_qt/uisettings.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "core/hle/service/cfg/cfg.h"
|
||||
#include "core/hle/service/cfg/cfg_u.h"
|
||||
#include "core/core.h"
|
||||
#include "network/announce_multiplayer_session.h"
|
||||
#include "network/network_settings.h"
|
||||
#include "ui_host_room.h"
|
||||
@ -195,8 +193,8 @@ void HostRoomWindow::Host() {
|
||||
}
|
||||
#endif
|
||||
member->Join(ui->username->text().toStdString(), Service::CFG::GetConsoleIdHash(system),
|
||||
"127.0.0.1", static_cast<u16>(port), 0, Service::CFG::GetConsoleMacAddress(system), password,
|
||||
token);
|
||||
"127.0.0.1", static_cast<u16>(port), 0,
|
||||
Service::CFG::GetConsoleMacAddress(system), password, token);
|
||||
|
||||
// Store settings
|
||||
UISettings::values.room_nickname = ui->username->text();
|
||||
|
||||
@ -14,7 +14,6 @@
|
||||
#include "citra_qt/uisettings.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "core/hle/service/cfg/cfg.h"
|
||||
#include "core/hle/service/cfg/cfg_u.h"
|
||||
#include "network/network.h"
|
||||
#include "network/network_settings.h"
|
||||
#include "ui_lobby.h"
|
||||
@ -176,7 +175,8 @@ void Lobby::OnJoinRoom(const QModelIndex& source) {
|
||||
#endif
|
||||
if (auto room_member = Network::GetRoomMember().lock()) {
|
||||
room_member->Join(nickname, Service::CFG::GetConsoleIdHash(system), ip.c_str(),
|
||||
static_cast<u16>(port), 0, Service::CFG::GetConsoleMacAddress(system), password, token);
|
||||
static_cast<u16>(port), 0, Service::CFG::GetConsoleMacAddress(system),
|
||||
password, token);
|
||||
}
|
||||
});
|
||||
watcher->setFuture(f);
|
||||
|
||||
@ -108,9 +108,6 @@ HackManager hack_manager = {
|
||||
|
||||
// Pretendo Network's Nimbus
|
||||
0x000400000D40D200,
|
||||
|
||||
// DLP
|
||||
0x0004013000002802,
|
||||
},
|
||||
}},
|
||||
|
||||
|
||||
@ -3261,8 +3261,8 @@ void Module::Interface::BeginImportProgramTemporarily(Kernel::HLERequestContext&
|
||||
|
||||
AuthorizeCIAFileDecryption(cia_file.get(), ctx);
|
||||
|
||||
file = std::make_shared<Service::FS::File>(
|
||||
am->system.Kernel(), std::move(cia_file), cia_path);
|
||||
file =
|
||||
std::make_shared<Service::FS::File>(am->system.Kernel(), std::move(cia_file), cia_path);
|
||||
}
|
||||
am->cia_installing = true;
|
||||
|
||||
|
||||
@ -106,9 +106,12 @@ void NWM_UDS::BroadcastNodeMap() {
|
||||
packet.channel = network_channel;
|
||||
packet.type = Network::WifiPacket::PacketType::NodeMap;
|
||||
packet.destination_address = Network::BroadcastMac;
|
||||
auto node_can_broad = [](auto& node) -> bool {return node.second.connected && !node.second.spec;};
|
||||
std::size_t num_entries = std::count_if(node_map.begin(), node_map.end(),
|
||||
[&node_can_broad](const auto& node) { return node_can_broad(node); });
|
||||
auto node_can_broad = [](auto& node) -> bool {
|
||||
return node.second.connected && !node.second.spec;
|
||||
};
|
||||
std::size_t num_entries =
|
||||
std::count_if(node_map.begin(), node_map.end(),
|
||||
[&node_can_broad](const auto& node) { return node_can_broad(node); });
|
||||
using node_t = decltype(node_map)::value_type;
|
||||
packet.data.resize(sizeof(num_entries) +
|
||||
(sizeof(node_t::first) + sizeof(node_t::second.node_id)) * num_entries);
|
||||
@ -186,7 +189,8 @@ void NWM_UDS::HandleAssociationResponseFrame(const Network::WifiPacket& packet)
|
||||
using Network::WifiPacket;
|
||||
WifiPacket eapol_start;
|
||||
eapol_start.channel = network_channel;
|
||||
eapol_start.data = GenerateEAPoLStartFrame(std::get<u16>(assoc_result), conn_type, current_node);
|
||||
eapol_start.data =
|
||||
GenerateEAPoLStartFrame(std::get<u16>(assoc_result), conn_type, current_node);
|
||||
// TODO(B3N30): Encrypt the packet.
|
||||
eapol_start.destination_address = packet.transmitter_address;
|
||||
eapol_start.type = WifiPacket::PacketType::Data;
|
||||
@ -245,7 +249,8 @@ void NWM_UDS::HandleEAPoLPacket(const Network::WifiPacket& packet) {
|
||||
node_map[packet.transmitter_address].connected = true;
|
||||
node_map[packet.transmitter_address].spec = true;
|
||||
} else {
|
||||
LOG_ERROR(Service_NWM, "Client tried connecting with unknown connection type: 0x{:x}", static_cast<u32>(eapol_start.conn_type));
|
||||
LOG_ERROR(Service_NWM, "Client tried connecting with unknown connection type: 0x{:x}",
|
||||
static_cast<u32>(eapol_start.conn_type));
|
||||
}
|
||||
|
||||
// Send the EAPoL-Logoff packet.
|
||||
@ -310,7 +315,7 @@ void NWM_UDS::HandleEAPoLPacket(const Network::WifiPacket& packet) {
|
||||
connection_status_event->Signal();
|
||||
connection_event->Signal();
|
||||
} else if (connection_status.status == NetworkStatus::ConnectedAsClient ||
|
||||
connection_status.status == NetworkStatus::ConnectedAsSpectator) {
|
||||
connection_status.status == NetworkStatus::ConnectedAsSpectator) {
|
||||
// TODO(B3N30): Remove that section and send/receive a proper connection_status packet
|
||||
// On a 3ds this packet wouldn't be addressed to already connected clients
|
||||
// We use this information because in the current implementation the host
|
||||
@ -345,8 +350,7 @@ void NWM_UDS::HandleEAPoLPacket(const Network::WifiPacket& packet) {
|
||||
|
||||
void NWM_UDS::HandleSecureDataPacket(const Network::WifiPacket& packet) {
|
||||
const auto secure_data = ParseSecureDataHeader(packet.data);
|
||||
std::scoped_lock lock{connection_status_mutex,
|
||||
system.Kernel().GetHLELock()};
|
||||
std::scoped_lock lock{connection_status_mutex, system.Kernel().GetHLELock()};
|
||||
|
||||
if (connection_status.status != NetworkStatus::ConnectedAsHost &&
|
||||
connection_status.status != NetworkStatus::ConnectedAsClient &&
|
||||
@ -626,7 +630,6 @@ void NWM_UDS::RecvBeaconBroadcastData(Kernel::HLERequestContext& ctx) {
|
||||
|
||||
// end scan input struct
|
||||
|
||||
|
||||
u32 wlan_comm_id = rp.Pop<u32>();
|
||||
u32 id = rp.Pop<u32>();
|
||||
// From 3dbrew:
|
||||
@ -796,7 +799,7 @@ void NWM_UDS::Bind(Kernel::HLERequestContext& ctx) {
|
||||
u8 data_channel = rp.Pop<u8>();
|
||||
u16 network_node_id = rp.Pop<u16>();
|
||||
|
||||
LOG_INFO(Service_NWM, "called");
|
||||
LOG_DEBUG(Service_NWM, "called");
|
||||
|
||||
if (data_channel == 0 || bind_node_id == 0) {
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||
@ -1073,7 +1076,7 @@ void NWM_UDS::DestroyNetwork(Kernel::HLERequestContext& ctx) {
|
||||
}
|
||||
|
||||
void NWM_UDS::DisconnectNetwork(Kernel::HLERequestContext& ctx) {
|
||||
LOG_INFO(Service_NWM, "disconnecting from network");
|
||||
LOG_DEBUG(Service_NWM, "disconnecting from network");
|
||||
IPC::RequestParser rp(ctx);
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright 2014 Citra Emulator Project
|
||||
// Copyright Citra Emulator Project / Azahar Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
@ -18,9 +18,9 @@
|
||||
#include <boost/serialization/export.hpp>
|
||||
#include "common/common_types.h"
|
||||
#include "common/swap.h"
|
||||
#include "core/hle/service/nwm/uds_common.h"
|
||||
#include "core/hle/service/service.h"
|
||||
#include "network/network.h"
|
||||
#include "core/hle/service/nwm/uds_common.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright 2025 Azahar Emulator Project
|
||||
// Copyright Citra Emulator Project / Azahar Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
@ -13,4 +13,4 @@ enum class ConnectionType : u8 {
|
||||
Spectator = 0x2,
|
||||
};
|
||||
|
||||
}; // Service::NWM
|
||||
}; // namespace Service::NWM
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright 2017 Citra Emulator Project
|
||||
// Copyright Citra Emulator Project / Azahar Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
@ -286,7 +286,8 @@ SecureDataHeader ParseSecureDataHeader(std::span<const u8> data) {
|
||||
return header;
|
||||
}
|
||||
|
||||
std::vector<u8> GenerateEAPoLStartFrame(u16 association_id, ConnectionType conn_type, const NodeInfo& node_info) {
|
||||
std::vector<u8> GenerateEAPoLStartFrame(u16 association_id, ConnectionType conn_type,
|
||||
const NodeInfo& node_info) {
|
||||
EAPoLStartPacket eapol_start{};
|
||||
eapol_start.association_id = association_id;
|
||||
eapol_start.conn_type = conn_type;
|
||||
@ -328,7 +329,6 @@ NodeInfo DeserializeNodeInfoFromFrame(std::span<const u8> frame) {
|
||||
// Skip the LLC header
|
||||
std::memcpy(&eapol_start, frame.data() + sizeof(LLCHeader), sizeof(eapol_start));
|
||||
|
||||
NodeInfo node{};
|
||||
return DeserializeNodeInfo(eapol_start.node);
|
||||
}
|
||||
|
||||
@ -376,7 +376,6 @@ EAPoLLogoffPacket ParseEAPoLLogoffFrame(std::span<const u8> frame) {
|
||||
return eapol_logoff;
|
||||
}
|
||||
|
||||
|
||||
EAPoLStartPacket DeserializeEAPolStartPacket(std::span<const u8> frame) {
|
||||
EAPoLStartPacket eapol_start;
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright 2017 Citra Emulator Project
|
||||
// Copyright Citra Emulator Project / Azahar Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
#include "common/common_types.h"
|
||||
#include "common/swap.h"
|
||||
#include "core/hle/service/nwm/uds_beacon.h"
|
||||
#include "core/hle/service/service.h"
|
||||
#include "core/hle/service/nwm/uds_common.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Service::NWM {
|
||||
|
||||
@ -132,7 +132,8 @@ SecureDataHeader ParseSecureDataHeader(std::span<const u8> data);
|
||||
* communication.
|
||||
* @returns The generated frame body.
|
||||
*/
|
||||
std::vector<u8> GenerateEAPoLStartFrame(u16 association_id, ConnectionType conn_type, const NodeInfo& node_info);
|
||||
std::vector<u8> GenerateEAPoLStartFrame(u16 association_id, ConnectionType conn_type,
|
||||
const NodeInfo& node_info);
|
||||
|
||||
/*
|
||||
* Returns the EtherType of the specified 802.11 frame.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user