Fixed formatting
This commit is contained in:
parent
8a1f3b7c41
commit
c793a9c95c
3 changed files with 368 additions and 376 deletions
|
@ -246,8 +246,7 @@ void Config::ReadValues() {
|
||||||
|
|
||||||
// Network
|
// Network
|
||||||
|
|
||||||
Settings::values.network_route =
|
Settings::values.network_route = config->GetString("Network", "network_route", "");
|
||||||
config->GetString("Network", "network_route", "");
|
|
||||||
|
|
||||||
// Miscellaneous
|
// Miscellaneous
|
||||||
// log_filter has a different default here than from common
|
// log_filter has a different default here than from common
|
||||||
|
|
|
@ -13,9 +13,9 @@
|
||||||
|
|
||||||
#include <android/api-level.h>
|
#include <android/api-level.h>
|
||||||
#include <android/native_window_jni.h>
|
#include <android/native_window_jni.h>
|
||||||
#include <network/room_member.h>
|
|
||||||
#include <network/network.h>
|
|
||||||
#include <core/loader/nro.h>
|
#include <core/loader/nro.h>
|
||||||
|
#include <network/network.h>
|
||||||
|
#include <network/room_member.h>
|
||||||
|
|
||||||
#include "common/detached_tasks.h"
|
#include "common/detached_tasks.h"
|
||||||
#include "common/dynamic_library.h"
|
#include "common/dynamic_library.h"
|
||||||
|
@ -60,8 +60,8 @@
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
class EmulationSession final {
|
class EmulationSession final {
|
||||||
public:
|
public:
|
||||||
EmulationSession() {
|
EmulationSession() {
|
||||||
m_vfs = std::make_shared<FileSys::RealVfsFilesystem>();
|
m_vfs = std::make_shared<FileSys::RealVfsFilesystem>();
|
||||||
}
|
}
|
||||||
|
@ -350,7 +350,8 @@ namespace {
|
||||||
|
|
||||||
if (const auto member = room_network.GetRoomMember().lock()) {
|
if (const auto member = room_network.GetRoomMember().lock()) {
|
||||||
// Prevent the user from trying to join a room while they are already joining.
|
// Prevent the user from trying to join a room while they are already joining.
|
||||||
if (member->GetState() == Network::RoomMember::State::Joining || member->IsConnected()) {
|
if (member->GetState() == Network::RoomMember::State::Joining ||
|
||||||
|
member->IsConnected()) {
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
member->Join(nickname, server_addr, server_port);
|
member->Join(nickname, server_addr, server_port);
|
||||||
|
@ -366,7 +367,7 @@ namespace {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct RomMetadata {
|
struct RomMetadata {
|
||||||
std::string title;
|
std::string title;
|
||||||
std::vector<u8> icon;
|
std::vector<u8> icon;
|
||||||
|
@ -400,7 +401,7 @@ namespace {
|
||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static void LoadDiskCacheProgress(VideoCore::LoadCallbackStage stage, int progress, int max) {
|
static void LoadDiskCacheProgress(VideoCore::LoadCallbackStage stage, int progress, int max) {
|
||||||
JNIEnv* env = IDCache::GetEnvForThread();
|
JNIEnv* env = IDCache::GetEnvForThread();
|
||||||
env->CallStaticVoidMethod(IDCache::GetDiskCacheProgressClass(),
|
env->CallStaticVoidMethod(IDCache::GetDiskCacheProgressClass(),
|
||||||
|
@ -408,7 +409,7 @@ namespace {
|
||||||
static_cast<jint>(progress), static_cast<jint>(max));
|
static_cast<jint>(progress), static_cast<jint>(max));
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static EmulationSession s_instance;
|
static EmulationSession s_instance;
|
||||||
|
|
||||||
// Frontend management
|
// Frontend management
|
||||||
|
@ -436,7 +437,7 @@ namespace {
|
||||||
std::condition_variable_any m_cv;
|
std::condition_variable_any m_cv;
|
||||||
mutable std::mutex m_perf_stats_mutex;
|
mutable std::mutex m_perf_stats_mutex;
|
||||||
mutable std::mutex m_mutex;
|
mutable std::mutex m_mutex;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*static*/ EmulationSession EmulationSession::s_instance;
|
/*static*/ EmulationSession EmulationSession::s_instance;
|
||||||
|
|
||||||
|
@ -686,7 +687,7 @@ jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_isHomebrew([[maybe_unused]] JNIEn
|
||||||
}
|
}
|
||||||
|
|
||||||
void Java_org_yuzu_yuzu_1emu_NativeLibrary_initializeEmulation
|
void Java_org_yuzu_yuzu_1emu_NativeLibrary_initializeEmulation
|
||||||
[[maybe_unused]] (JNIEnv* env, [[maybe_unused]] jclass clazz) {
|
[[maybe_unused]] (JNIEnv* env, [[maybe_unused]] jclass clazz) {
|
||||||
// Create the default config.ini.
|
// Create the default config.ini.
|
||||||
Config{};
|
Config{};
|
||||||
// Initialize the emulated system.
|
// Initialize the emulated system.
|
||||||
|
@ -795,16 +796,11 @@ void Java_org_yuzu_yuzu_1emu_NativeLibrary_submitInlineKeyboardInput(JNIEnv* env
|
||||||
}
|
}
|
||||||
|
|
||||||
void Java_org_yuzu_yuzu_1emu_NativeLibrary_connectToRoom(JNIEnv* env, jclass clazz,
|
void Java_org_yuzu_yuzu_1emu_NativeLibrary_connectToRoom(JNIEnv* env, jclass clazz,
|
||||||
jstring nickname,
|
jstring nickname, jstring server_addr,
|
||||||
jstring server_addr,
|
jint server_port, jstring password) {
|
||||||
jint server_port,
|
EmulationSession::GetInstance().DirectConnectToRoom(GetJString(env, nickname),
|
||||||
jstring password) {
|
|
||||||
EmulationSession::GetInstance().DirectConnectToRoom(
|
|
||||||
GetJString(env, nickname),
|
|
||||||
GetJString(env, server_addr).c_str(),
|
GetJString(env, server_addr).c_str(),
|
||||||
server_port,
|
server_port, GetJString(env, password));
|
||||||
GetJString(env, password)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
jstring Java_org_yuzu_yuzu_1emu_NativeLibrary_getRoomMemberState(JNIEnv* env, jclass clazz) {
|
jstring Java_org_yuzu_yuzu_1emu_NativeLibrary_getRoomMemberState(JNIEnv* env, jclass clazz) {
|
||||||
|
@ -812,7 +808,7 @@ jstring Java_org_yuzu_yuzu_1emu_NativeLibrary_getRoomMemberState(JNIEnv* env, jc
|
||||||
|
|
||||||
std::string state_str{};
|
std::string state_str{};
|
||||||
|
|
||||||
switch(state) {
|
switch (state) {
|
||||||
using State = Network::RoomMember::State;
|
using State = Network::RoomMember::State;
|
||||||
|
|
||||||
case State::Uninitialized:
|
case State::Uninitialized:
|
||||||
|
|
|
@ -20,9 +20,9 @@
|
||||||
#include <iphlpapi.h>
|
#include <iphlpapi.h>
|
||||||
#else
|
#else
|
||||||
#include <cerrno>
|
#include <cerrno>
|
||||||
|
#include <arpa/inet.h>
|
||||||
#include <ifaddrs.h>
|
#include <ifaddrs.h>
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
#include <arpa/inet.h>
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -103,18 +103,15 @@ std::vector<NetworkInterface> GetAvailableNetworkInterfaces() {
|
||||||
|
|
||||||
boost::split(route_parts, Settings::values.network_route.GetValue(), boost::is_any_of(";"));
|
boost::split(route_parts, Settings::values.network_route.GetValue(), boost::is_any_of(";"));
|
||||||
|
|
||||||
struct in_addr ip{}, sm{}, gw{};
|
struct in_addr ip {
|
||||||
|
}, sm{}, gw{};
|
||||||
|
|
||||||
inet_pton(AF_INET, route_parts[1].c_str(), &ip);
|
inet_pton(AF_INET, route_parts[1].c_str(), &ip);
|
||||||
inet_pton(AF_INET, route_parts[2].c_str(), &sm);
|
inet_pton(AF_INET, route_parts[2].c_str(), &sm);
|
||||||
inet_pton(AF_INET, route_parts[3].c_str(), &gw);
|
inet_pton(AF_INET, route_parts[3].c_str(), &gw);
|
||||||
|
|
||||||
result.emplace_back(NetworkInterface{
|
result.emplace_back(
|
||||||
.name{route_parts[0]},
|
NetworkInterface{.name{route_parts[0]}, .ip_address{ip}, .subnet_mask{sm}, .gateway{gw}});
|
||||||
.ip_address{ip},
|
|
||||||
.subnet_mask{sm},
|
|
||||||
.gateway{gw}
|
|
||||||
});
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue