diff --git a/Core/HLE/sceNetAdhoc.cpp b/Core/HLE/sceNetAdhoc.cpp index c940fbedb03f..d32bbe48eda4 100644 --- a/Core/HLE/sceNetAdhoc.cpp +++ b/Core/HLE/sceNetAdhoc.cpp @@ -1324,6 +1324,9 @@ static int sceNetAdhocPdpCreate(const char *mac, int port, int bufferSize, u32 f // Switch to non-blocking for futher usage changeBlockingMode(usocket, 1); + // Workaround to give time for the port to be bound before using the socket for sending to prevent MGS:PW from detecting a wrong source port during recvfrom + hleEatMicro(10000); + // Success return hleLogDebug(SCENET, i + 1, "success"); } @@ -3232,6 +3235,9 @@ static int sceNetAdhocPtpOpen(const char *srcmac, int sport, const char *dstmac, // Switch to non-blocking for futher usage changeBlockingMode(tcpsocket, 1); + // Workaround to give time for the port to be bound before using the socket for sending to prevent receiver getting a wrong source port + hleEatMicro(10000); + // Initiate PtpConnect (ie. The Warrior seems to try to PtpSend right after PtpOpen without trying to PtpConnect first) NetAdhocPtp_Connect(i + 1, rexmt_int, 1, false); @@ -3798,6 +3804,9 @@ static int sceNetAdhocPtpListen(const char *srcmac, int sport, int bufsize, int // Switch to non-blocking for futher usage changeBlockingMode(tcpsocket, 1); + // Workaround to give time for the port to be bound before using the socket + hleEatMicro(10000); + // Return PTP Socket Pointer return hleLogDebug(SCENET, i + 1, "success"); }