From e5bafd423d70912772cc599396cbd1e50e9e506f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 29 Oct 2026 07:04:45 +0100 Subject: [PATCH] sceNetAdhocMatching: Report every join request, after SetHelloOpt too The rule that dropped the first join after the hello data changed came from a race in pspautotests net/adhoc/pair/matching2, where the host started looking for the REQUEST after it had come. A PSP reports the join at once however soon after SetHelloOpt it arrives, also when the host changes its hello data every second (net/adhoc/pair/matchingjoin). Ridge Racer does that every 5 seconds, so its clients could never enter a race. Co-Authored-By: Claude Opus 5.5 --- Core/HLE/proAdhoc.h | 3 --- Core/HLE/sceNetAdhocMatching.cpp | 14 ++------------ pspautotests | 2 +- 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/Core/HLE/proAdhoc.h b/Core/HLE/proAdhoc.h index 4726784599..6d4d77d478 100644 --- a/Core/HLE/proAdhoc.h +++ b/Core/HLE/proAdhoc.h @@ -527,9 +527,6 @@ typedef struct SceNetAdhocMatchingContext { //bool InConnection = false; //u32_le handlerid = -1; //int eventMatchingHandlerUpdate = -1; - - // After the hello data changes, a PSP host's game isn't told about the next join request from a new peer. - bool dropNextJoin = false; } SceNetAdhocMatchingContext; // End of psp definitions diff --git a/Core/HLE/sceNetAdhocMatching.cpp b/Core/HLE/sceNetAdhocMatching.cpp index 5bbe8f6ef5..248bde5c6c 100644 --- a/Core/HLE/sceNetAdhocMatching.cpp +++ b/Core/HLE/sceNetAdhocMatching.cpp @@ -672,12 +672,6 @@ void actOnJoinPacket(SceNetAdhocMatchingContext * context, SceNetEtherAddr * sen return; } - // The host takes the request, but the game isn't told (see dropNextJoin). That's only seen for a - // peer the host didn't know yet: one it had already denied gets its REQUEST (pspautotests - // net/adhoc/pair/matching2 and matching3). - const bool silent = context->dropNextJoin && findPeer(context, sendermac) == NULL; - context->dropNextJoin = false; - // We still got a unoccupied slot in our room (Parent / P2P) if ((context->mode == PSP_ADHOC_MATCHING_MODE_PARENT && countChildren(context) < (context->maxpeers - 1)) || (context->mode == PSP_ADHOC_MATCHING_MODE_P2P && findP2P(context) == NULL)) { // Complete Packet Header available @@ -732,7 +726,7 @@ void actOnJoinPacket(SceNetAdhocMatchingContext * context, SceNetEtherAddr * sen peerlock.unlock(); // Spawn Request Event - if (!silent) spawnLocalEvent(context, PSP_ADHOC_MATCHING_EVENT_REQUEST, sendermac, optlen, opt); + spawnLocalEvent(context, PSP_ADHOC_MATCHING_EVENT_REQUEST, sendermac, optlen, opt); // Return Success return; @@ -748,7 +742,7 @@ void actOnJoinPacket(SceNetAdhocMatchingContext * context, SceNetEtherAddr * sen peer->lastping = CoreTiming::GetGlobalTimeUsScaled(); // Spawn Request Event - if (!silent) spawnLocalEvent(context, PSP_ADHOC_MATCHING_EVENT_REQUEST, sendermac, optlen, opt); + spawnLocalEvent(context, PSP_ADHOC_MATCHING_EVENT_REQUEST, sendermac, optlen, opt); // Return Success return; @@ -2325,10 +2319,6 @@ int sceNetAdhocMatchingSetHelloOpt(int matchingId, int optLenAddr, u32 optDataAd //context->hello = NULL; } - // The first join request after this, from a client the host doesn't know yet, never reaches the game - // on a PSP, even if the client has seen the new hello (pspautotests net/adhoc/pair/matching2). - context->dropNextJoin = true; - // Return Success return hleLogDebug(Log::sceNet, 0); } diff --git a/pspautotests b/pspautotests index e1f5702e25..8ba5805298 160000 --- a/pspautotests +++ b/pspautotests @@ -1 +1 @@ -Subproject commit e1f5702e25e1f97c0406d4a253b65971668597ce +Subproject commit 8ba58052984825365a94ec42fb2e0e42bb661231