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 <noreply@anthropic.com>
This commit is contained in:
Henrik RydgårdandClaude Opus 5.5 committed 2026-10-29 22:39:06 +01:00
1 parent 5cc3554667
commit e5bafd423d
3 files changed
+3 -16

No files matched your search

-3
View File
@@ -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
+2 -12
View File
@@ -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);
}