1
0
Fork 0
forked from eden-emu/eden

[nifm, bsd] add airplane mode functionality to a new nifm call and fix local files (#225)

There is a cmd `IsAnyInternetRequestAccepted` which is called by games like DOOM to check if internet access is available. Adds the newly added airplane mode there.
Also, moved down the airplane mode check on bsd to also check if it's a local file request, if it is, let it connect. (SMO guide web applet for example)
+ adds a check in IRequest if airplane mode is active, which then results in an not succeeding requests.

Reviewed-on: eden-emu/eden#225
Co-authored-by: Maufeat <sahyno1996@gmail.com>
Co-committed-by: Maufeat <sahyno1996@gmail.com>
This commit is contained in:
Maufeat 2025-06-28 16:04:13 +00:00 committed by JPikachu
parent c88d0b3967
commit 726e1e756d
4 changed files with 21 additions and 18 deletions

View file

@ -491,11 +491,6 @@ void BSD::ExecuteWork(HLERequestContext& ctx, Work work) {
std::pair<s32, Errno> BSD::SocketImpl(Domain domain, Type type, Protocol protocol) {
if (Settings::values.airplane_mode.GetValue()) {
LOG_ERROR(Service, "Airplane mode is enabled, cannot create socket");
return {-1, Errno::NOTCONN};
}
if (type == Type::SEQPACKET) {
UNIMPLEMENTED_MSG("SOCK_SEQPACKET errno management");
} else if (type == Type::RAW && (domain != Domain::INET || protocol != Protocol::ICMP)) {
@ -528,6 +523,11 @@ std::pair<s32, Errno> BSD::SocketImpl(Domain domain, Type type, Protocol protoco
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};
}