Commit Graph
29 Commits
Author SHA1 Message Date
Henrik RydgårdandClaude Opus 5.5 1cf65ab6a4 Clarify comments from the crash fixes
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-19 09:10:03 +02:00
Henrik RydgårdandClaude Opus 5.5 d9db5cf63b Adhoc: Stop a running matching context before deleting it
NetAdhocMatching_Delete unlinked the context before calling Stop, which then
couldn't find it, so the input and event threads were never joined and
deleting the context destroyed joinable std::threads (std::terminate). Seen
on Android when shutting down a game with matching running.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-19 07:47:49 +02:00
Henrik RydgårdandClaude Opus 5.5 16a03f16e8 Adhoc: Restore the inited flags from savestates
Loading a savestate kept the current session's netAdhocInited,
netAdhocctlInited and matching-inited flags rather than the saved ones.
Loaded into a fresh boot, a state saved with adhocctl initialized (but not
connected) then failed every adhocctl call with NOT_INITIALIZED. MGS Peace
Walker shuts ad hoc down before a cutscene and retried
sceNetAdhocctlDisconnect forever, leaving the screen black.

Take the flags from the state, and bring the host side in line: start the
friendFinder and log in again when the state has adhocctl up and we don't,
stop it in the opposite case. Also save the product code, which that login
sends.

Also add a game.state.save debugger command, used to reproduce this.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-18 09:15:51 +02:00
Acts1631 7de6a6ccfb Avoid overflow in matching packet length checks
Matching packet handlers added untrusted payload lengths to fixed header
sizes before comparing them with the datagram length. Large values could
overflow and permit out-of-bounds reads. Compare against the remaining
packet size instead, and reject negative ACCEPT sibling counts.
2026-10-03 21:55:32 -04:00
Henrik RydgårdandClaude Opus 5.5 639e57c2bd Savestate: Keep pending adhocctl requests, so a waiting Init survives a load
With WLAN on and no server reachable, sceNetAdhocctlInit keeps its thread
waiting for the login. The load dropped the request, and the wait ended in
BUSY, which Init can't retry. Splinter Cell then ran its failure path with
a deleted event flag. Also stop freeing matching event buffers into the
restored allocator, and take the event lock when clearing.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-28 09:34:06 -06:00
Henrik Rydgård c5e4d0d90d Rename the get-memory-pointer functions to make it clear where CPU exceptions can happen. 2026-08-12 14:06:16 +02:00
Henrik Rydgård 3bd41376da More memory cleanup 2026-08-11 20:12:10 +02:00
Henrik Rydgård 8cb1732564 Clean up the memory partition ID enum 2026-07-25 14:53:02 +02:00
Henrik Rydgård 040996f185 Use new/delete properly for SceNetAdhocMatchingContext. It contains non-POD C++ objects. 2026-07-23 11:17:44 +02:00
Henrik Rydgård 702e18bd2d Fix typo (thanks Nemo)
See #d0dd10c
2026-07-18 23:55:25 +02:00
Henrik Rydgård d0dd10ce6b Avoid memsetting a non-POD struct (fixes compiler warning) 2026-06-16 11:05:16 +02:00
Katharine Chui f218138f2e add missing null check during actOnDeathPacket
It is not impossible for deadkid to not be tracked, so we have to
null check that
2026-02-26 13:18:03 +01:00
Henrik Rydgård 3e2dce1e54 Move AdHoc error codes to the big enum, fix the naming convention to be consistent 2025-08-06 17:44:54 +02:00
Nemoumbra c7aafd4cbe Deduplicated a config variable 2025-07-02 01:30:21 +03:00
Nemoumbra 921fd32969 8 vars moved to NetAdhocCommon, 1 var moved to sceNetAdhocMatching 2025-07-01 19:56:09 +03:00
Henrik Rydgård 4e25f44eef Rename some module-related functions to include HLE where appropriate 2025-03-31 11:17:50 +02:00
Henrik Rydgård 0f840e6240 Move JPEG error codes to the big enum, some include cleanup 2025-03-21 20:44:46 +01:00
Henrik Rydgård e24317b20b A lot more logging fixes 2025-01-20 12:20:21 +01:00
Henrik Rydgård 7d2ad6980e Another batch of changes 2025-01-20 12:20:21 +01:00
Nemoumbra aae7b187d5 Hadouken fixes: SendData funcs + sceNetAdhocMatchingGetPoolStat 2025-01-05 01:07:10 +03:00
Nemoumbra 94f4ad200b Hadooken fixes: sceNetAdhocMatchingSelectTarget, NetAdhocMatching_CancelTargetWithOpt 2025-01-05 00:46:42 +03:00
Nemoumbra 3497ccacb5 Hadooken codestyle fix + cleaned up NetAdhocMatching_Start 2025-01-05 00:08:20 +03:00
Nemoumbra f7289ff22a Simplified 2 more matching funcs 2025-01-04 23:52:31 +03:00
Nemoumbra 4f623db57a Added early returns for actOn{X}Packet funcs 2025-01-04 23:42:39 +03:00
Nemoumbra 110799f09d Cleaned up broadcastHelloMessage and broadcastPingMessage 2025-01-04 21:08:31 +03:00
Nemoumbra 9f94e035a7 Added early returns for send{X}Packet funcs 2025-01-04 20:29:39 +03:00
Nemoumbra 9f4f0a4e6a Brace codestyle fix 2025-01-04 19:55:50 +03:00
Nemoumbra 96f9749e2e Split out the matching code from sceNetAdhoc.cpp 2025-01-03 04:59:26 +03:00
Nemoumbra b265b3b994 Added empty sceNetAdhocMatching files 2025-01-02 16:03:37 +03:00