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"
|
||||||
|
@ -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);
|
||||||
|
@ -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) {
|
||||||
|
|
|
@ -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