Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Debug option to ignore all Unknown/illegal socket errors #11065

Closed
logantgt opened this issue Oct 27, 2021 · 0 comments
Closed
Labels

Comments

@logantgt
Copy link

logantgt commented Oct 27, 2021

Quick summary

Some titles (notably LittleBigPlanet) currently have network issues caused by the emulator incorrectly throwing Unknown/illegal socket errors that ultimately disable their online features. It would be nice to have a Debug option that, when enabled, allows the emulator to post these warnings to the log without throwing an error.

Details

Currently, we can tell the emulator to not throw Unknown/illegal socket errors using this patch in sys_net.cpp;

diff --git a/rpcs3/Emu/Cell/lv2/sys_net.cpp b/rpcs3/Emu/Cell/lv2/sys_net.cpp
index b2b8af499..8630e9287 100644
--- a/rpcs3/Emu/Cell/lv2/sys_net.cpp
+++ b/rpcs3/Emu/Cell/lv2/sys_net.cpp
@@ -249,7 +249,7 @@ static sys_net_error get_last_error(bool is_blocking, int native_error = 0)
 		ERROR_CASE(EHOSTDOWN);
 		ERROR_CASE(EHOSTUNREACH);
 	default:
-		fmt::throw_exception("sys_net get_last_error(is_blocking=%d, native_error=%d): Unknown/illegal socket error", is_blocking, native_error);
+		sys_net.warning("sys_net get_last_error(is_blocking=%d, native_error=%d): Unknown/illegal socket error", is_blocking, native_error);
 	}
 
 	if (name && result != SYS_NET_EWOULDBLOCK && result != SYS_NET_EINPROGRESS)
@@ -3109,12 +3109,6 @@ error_code sys_net_bnet_socket(ppu_thread& ppu, s32 family, s32 type, s32 protoc
 		sys_net.error("sys_net_bnet_socket(): unknown family (%d)", family);
 	}
 
-	if (type != SYS_NET_SOCK_STREAM && type != SYS_NET_SOCK_DGRAM && type != SYS_NET_SOCK_DGRAM_P2P && type != SYS_NET_SOCK_STREAM_P2P)
-	{
-		sys_net.error("sys_net_bnet_socket(): unsupported type (%d)", type);
-		return -SYS_NET_EPROTONOSUPPORT;
-	}
-
 	lv2_socket::socket_type native_socket = 0;
 
 	if (type != SYS_NET_SOCK_DGRAM_P2P && type != SYS_NET_SOCK_STREAM_P2P)

Keep in mind the above is just an example, you can obviously implement it however you want - that's just how we got past LittleBigPlanet's online error.

It would be helpful to have the ability to enable/disable these changes using a checkbox in RPCS3's debug options as a heavy-handed way to bypass these issues. This might also come in handy for other development purposes.

1. Please describe, what part of RPCS3 would be affected by your feature:

  • Debugging
  • Networking

2. Please tell us, why your feature is important to RPCS3.

Improves game compatibility/functionality in some titles.


cc @jvyden

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants