From eef3110dcf93251930bfd0964caa348cd5a922ba Mon Sep 17 00:00:00 2001 From: ANR2ME Date: Sat, 13 Feb 2021 21:17:59 +0700 Subject: [PATCH] Shows a warning on Screen when detecting AdhocMatching data coming from an incorrect port, progressing any further may ended with connection issue. Players will need to wait until the port detected correctly before progressing any further (may takes a few more seconds) --- Core/HLE/sceNetAdhoc.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Core/HLE/sceNetAdhoc.cpp b/Core/HLE/sceNetAdhoc.cpp index f0a8297962..8dca3921bd 100644 --- a/Core/HLE/sceNetAdhoc.cpp +++ b/Core/HLE/sceNetAdhoc.cpp @@ -7072,6 +7072,7 @@ int matchingEventThread(int matchingId) int matchingInputThread(int matchingId) // TODO: The MatchingInput thread is using sceNetAdhocPdpRecv & sceNetAdhocPdpSend functions so it might be better to run this on PSP thread instead of real thread { setCurrentThreadName("MatchingInput"); + auto n = GetI18NCategory("Networking"); // Multithreading Lock peerlock.lock(); // Cast Context @@ -7247,6 +7248,10 @@ int matchingInputThread(int matchingId) // TODO: The MatchingInput thread is usi // Ignore Incoming Trash Data } + else if (recvresult == 0 && rxbuflen > 0) { + WARN_LOG(SCENET, "InputLoop[%d]: Unknown Port[%s:%u] (Recved=%i, Length=%i)", matchingId, mac2str(&sendermac).c_str(), senderport, recvresult, rxbuflen); + host->NotifyUserMessage(std::string(n->T("Data from incorrect Port")) + std::string(" [") + mac2str(&sendermac) + std::string("]:") + std::to_string(senderport) + std::string(" -> ") + std::to_string(context->port), 1.0, 0x0080ff); + } // Handle Peer Timeouts handleTimeout(context);