mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-09-28 19:38:47 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cabccad296 |
@@ -28,13 +28,13 @@ object NativeConfig {
|
||||
* Reads values in the global config file and saves them.
|
||||
*/
|
||||
@Synchronized
|
||||
external fun reloadGlobalConfig()
|
||||
external fun reloadGlobalConfig(): Boolean
|
||||
|
||||
/**
|
||||
* Saves global settings values in memory to disk.
|
||||
*/
|
||||
@Synchronized
|
||||
external fun saveGlobalConfig()
|
||||
external fun saveGlobalConfig(): Boolean
|
||||
|
||||
/**
|
||||
* Creates per-game config for the specified parameters. Must be unloaded once per-game config
|
||||
@@ -54,7 +54,7 @@ object NativeConfig {
|
||||
* Saves per-game settings values in memory to disk.
|
||||
*/
|
||||
@Synchronized
|
||||
external fun savePerGameConfig()
|
||||
external fun savePerGameConfig(): Boolean
|
||||
|
||||
/**
|
||||
* Destroys the stored per-game config object. This does not save the config.
|
||||
|
||||
@@ -58,13 +58,18 @@ void Java_org_yuzu_yuzu_1emu_utils_NativeConfig_unloadGlobalConfig(JNIEnv* env,
|
||||
global_config.reset();
|
||||
}
|
||||
|
||||
void Java_org_yuzu_yuzu_1emu_utils_NativeConfig_reloadGlobalConfig(JNIEnv* env, jobject obj) {
|
||||
global_config->AndroidConfig::ReloadAllValues();
|
||||
ResetFxChainToGlobal();
|
||||
jboolean Java_org_yuzu_yuzu_1emu_utils_NativeConfig_reloadGlobalConfig(JNIEnv* env, jobject obj) {
|
||||
if (global_config) {
|
||||
global_config->AndroidConfig::ReloadAllValues();
|
||||
ResetFxChainToGlobal();
|
||||
}
|
||||
return global_config != nullptr;
|
||||
}
|
||||
|
||||
void Java_org_yuzu_yuzu_1emu_utils_NativeConfig_saveGlobalConfig(JNIEnv* env, jobject obj) {
|
||||
global_config->AndroidConfig::SaveAllValues();
|
||||
jboolean Java_org_yuzu_yuzu_1emu_utils_NativeConfig_saveGlobalConfig(JNIEnv* env, jobject obj) {
|
||||
if (global_config)
|
||||
global_config->AndroidConfig::SaveAllValues();
|
||||
return global_config != nullptr;
|
||||
}
|
||||
|
||||
void Java_org_yuzu_yuzu_1emu_utils_NativeConfig_initializePerGameConfig(JNIEnv* env, jobject obj,
|
||||
@@ -77,13 +82,14 @@ void Java_org_yuzu_yuzu_1emu_utils_NativeConfig_initializePerGameConfig(JNIEnv*
|
||||
std::make_unique<AndroidConfig>(config_file_name, Config::ConfigType::PerGameConfig);
|
||||
}
|
||||
|
||||
jboolean Java_org_yuzu_yuzu_1emu_utils_NativeConfig_isPerGameConfigLoaded(JNIEnv* env,
|
||||
jobject obj) {
|
||||
jboolean Java_org_yuzu_yuzu_1emu_utils_NativeConfig_isPerGameConfigLoaded(JNIEnv* env, jobject obj) {
|
||||
return per_game_config != nullptr;
|
||||
}
|
||||
|
||||
void Java_org_yuzu_yuzu_1emu_utils_NativeConfig_savePerGameConfig(JNIEnv* env, jobject obj) {
|
||||
per_game_config->AndroidConfig::SaveAllValues();
|
||||
jboolean Java_org_yuzu_yuzu_1emu_utils_NativeConfig_savePerGameConfig(JNIEnv* env, jobject obj) {
|
||||
if (per_game_config)
|
||||
per_game_config->AndroidConfig::SaveAllValues();
|
||||
return per_game_config != nullptr;
|
||||
}
|
||||
|
||||
void Java_org_yuzu_yuzu_1emu_utils_NativeConfig_unloadPerGameConfig(JNIEnv* env, jobject obj) {
|
||||
|
||||
@@ -430,8 +430,8 @@ private:
|
||||
LOG_DEBUG(Service_NIFM, "(STUBBED) called");
|
||||
|
||||
const auto result = [this] {
|
||||
const auto has_connection = Network::GetHostIPv4Address().has_value()
|
||||
&& (Network::IsConnectedToAnyRoom() || !Settings::values.airplane_mode.GetValue());
|
||||
const auto has_connection = Network::GetHostIPv4Address().has_value() &&
|
||||
!Settings::values.airplane_mode.GetValue();
|
||||
switch (state) {
|
||||
case RequestState::NotSubmitted:
|
||||
return has_connection ? ResultSuccess : ResultNetworkCommunicationDisabled;
|
||||
@@ -925,10 +925,10 @@ void IGeneralService::SetWirelessCommunicationEnabled(HLERequestContext& ctx) {
|
||||
}
|
||||
|
||||
void IGeneralService::IsWirelessCommunicationEnabled(HLERequestContext& ctx) {
|
||||
bool const enabled = (!Settings::values.airplane_mode.GetValue() || Network::IsConnectedToAnyRoom());
|
||||
const bool en = !Settings::values.airplane_mode.GetValue();
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push<u8>(enabled);
|
||||
rb.Push<u8>(en);
|
||||
}
|
||||
|
||||
void IGeneralService::GetInternetConnectionStatus(HLERequestContext& ctx) {
|
||||
@@ -972,7 +972,7 @@ void IGeneralService::IsEthernetCommunicationEnabled(HLERequestContext& ctx) {
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
rb.Push(ResultSuccess);
|
||||
if (Network::GetHostIPv4Address().has_value() && (!Settings::values.airplane_mode.GetValue() || Network::IsConnectedToAnyRoom())) {
|
||||
if (Network::GetHostIPv4Address().has_value() && !Settings::values.airplane_mode.GetValue()) {
|
||||
rb.Push<u8>(1);
|
||||
} else {
|
||||
rb.Push<u8>(0);
|
||||
@@ -984,7 +984,7 @@ void IGeneralService::IsAnyInternetRequestAccepted(HLERequestContext& ctx) {
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
rb.Push(ResultSuccess);
|
||||
if (Network::GetHostIPv4Address().has_value() && (!Settings::values.airplane_mode.GetValue() || Network::IsConnectedToAnyRoom())) {
|
||||
if (Network::GetHostIPv4Address().has_value() && !Settings::values.airplane_mode.GetValue()) {
|
||||
rb.Push<u8>(1);
|
||||
} else {
|
||||
rb.Push<u8>(0);
|
||||
|
||||
@@ -547,19 +547,21 @@ std::pair<s32, Errno> BSD_USA::SocketImpl(Domain domain, Type type, Protocol pro
|
||||
|
||||
LOG_INFO(Service, "New socket fd={}", fd);
|
||||
|
||||
if (Network::IsConnectedToAnyRoom()) {
|
||||
auto room_member = Network::GetRoomMember().lock();
|
||||
if (room_member && room_member->IsConnected()) {
|
||||
descriptor.socket = std::make_shared<Network::ProxySocket>();
|
||||
} else {
|
||||
descriptor.socket = std::make_shared<Network::Socket>();
|
||||
if (Settings::values.airplane_mode.GetValue() && descriptor.is_connection_based) {
|
||||
LOG_ERROR(Service, "Airplane mode is enabled, cannot create socket");
|
||||
return {-1, Errno::NOTCONN};
|
||||
}
|
||||
}
|
||||
|
||||
descriptor.socket->Initialize(Translate(domain), Translate(type), Translate(protocol));
|
||||
descriptor.is_connection_based = IsConnectionBased(type);
|
||||
|
||||
if (Settings::values.airplane_mode.GetValue() && descriptor.is_connection_based) {
|
||||
LOG_ERROR(Service, "Airplane mode is enabled, cannot create socket");
|
||||
return {-1, Errno::NOTCONN};
|
||||
}
|
||||
|
||||
return {fd, Errno::SUCCESS};
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ void RefreshFromHost() {
|
||||
return;
|
||||
}
|
||||
|
||||
st.wifi_enabled = (!Settings::values.airplane_mode.GetValue() || Network::IsConnectedToAnyRoom());
|
||||
st.wifi_enabled = !Settings::values.airplane_mode.GetValue();
|
||||
st.ethernet_enabled = sel->kind == HostAdapterKind::Ethernet;
|
||||
|
||||
st.connected = true;
|
||||
|
||||
@@ -32,11 +32,6 @@ std::weak_ptr<RoomMember> GetRoomMember() {
|
||||
return g_room_member;
|
||||
}
|
||||
|
||||
bool IsConnectedToAnyRoom() {
|
||||
auto const room_member = GetRoomMember().lock();
|
||||
return room_member && room_member->IsConnected();
|
||||
}
|
||||
|
||||
void Shutdown() {
|
||||
if (g_room_member) {
|
||||
if (g_room_member->IsConnected())
|
||||
|
||||
@@ -20,8 +20,6 @@ std::weak_ptr<Room> GetRoom();
|
||||
/// Returns a pointer to the room member handle
|
||||
std::weak_ptr<RoomMember> GetRoomMember();
|
||||
|
||||
bool IsConnectedToAnyRoom();
|
||||
|
||||
/// Unregisters the network device, the room, and the room member and shut them down.
|
||||
void Shutdown();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user