Commit Graph
453 Commits
Author SHA1 Message Date
Henrik RydgårdandClaude Opus 5.5 7ec860c24f Adhoc: Stop waiting for a login that has already failed
sceNetAdhocctlInit waits until the friend finder has logged into the adhoc
server, polling in emulated time but giving up only after 5s of wall time.
The friend finder makes one attempt per login request, and it too waited
the full 5s on a connection that had already been refused, because it
only looked for success. Now it checks the socket error and gives up at
once, and records the failure so the wait ends with it.

In headless, which runs far ahead of real time, Gods Eater Burst sat in
this wait for its whole run.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-29 12:37:48 -06:00
Henrik RydgårdandClaude Opus 5.5 2cd84012d0 Adhoc: Fix shutdown hanging when it comes right after adhoc init
The friend finder thread set friendFinderRunning itself, after a DNS
lookup of the adhoc server. A shutdown in that window cleared the flag
first; the thread then set it again, looped forever, and the join in
NetAdhocctl_Term() never returned. Gods Eater Burst hit this in about one
headless run in six. The flag is now set before the thread is created,
and a finished thread is joined before a new one replaces it, which
would otherwise call std::terminate.

The built-in adhoc server thread had the same race, behind its check for
an existing server, and gets the same fix.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-29 11:58:42 -06: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 11c6111027 Only show the relay mode notification if networking is enabled 2026-09-19 13:02:44 -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 0596ee97f6 More memory access cleanup 2026-08-11 20:14:01 +02:00
Henrik Rydgård 3bd41376da More memory cleanup 2026-08-11 20:12:10 +02:00
Henrik Rydgård 3c81d6b121 More manual Read_U32 cleanup
Buildfix
2026-08-11 10:28:36 +02:00
Katharine Chui 01849c251e use new aemu_postoffice apis during polling 2026-07-19 11:30:27 +02:00
Katharine Chui ff83e8c896 bump aemu_postoffice
- Make GetPdpStat behave more like in P2P mode
  - Now fetches accumulated ready to be received amount of data
    instead of only the immediate to be received Pdp block
- Make GetPtpStat behave more like in P2P mode
  - Now fetches accumulated ready to be received amount of data
    instead of the size of the next server send block
- Make PtpRecv behave more like in P2P mode
  - Fix block like behavior where whole server send block has
    to be consumed before getting data from the next send block
  - Fix block like bahavior where sender sends in small PtpSend
    calls while receiver receive with less frequent but bigger
    buffer PtpRecv causes bloat(and eventually server kick)
    on relay
2026-07-19 11:30:27 +02:00
Henrik Rydgård 61e76fcf68 Add the ability to hide adhoc servers using a "hidden" entry in the json.
Useful when servers are temporarily down.
2026-04-23 11:12:58 +02:00
Henrik Rydgård d9ee8cb538 Fix json parsing bugs, add data.json for Relay Brasiliero 2026-04-05 12:57:41 -06:00
Henrik Rydgård c63d30508e GamesNexus also has data.json. Also, do an inventory of favicons. Not many usable... 2026-03-30 16:05:29 -06:00
Henrik Rydgård 6a977bd27f Fix bug preventing us from loading the server list from the server 2026-03-30 13:51:27 -06:00
Henrik Rydgård cfc5d74602 Some progress with server status UI 2026-03-30 11:34:19 -06:00
Henrik Rydgård 90f52b88a1 Initial work on downloading and showing the status from adhoc servers 2026-03-28 12:41:34 -06:00
Katharine Chui f1f6f3d75f fix the warriors in relay mode
The behavior of https://github.com/hrydgard/ppsspp/pull/13967 was
missing in relay mode, adding that back.

Also skips ptp flush in relay mode.
2026-03-19 19:00:08 +01:00
Katharine Chui 0f219edcc9 fix street rider sending pdp packets using wrong pdp dst addresses in relay mode
In P2P mode, this issue was solved by resolving the final IP
address without the first byte. Fix the issue again for relay mode
by resolving the true mac address before sending.

True mac resolving was also added to relay mode ptp connect as a
precaution.
2026-03-17 17:40:31 +01:00
Henrik Rydgård ae08b31573 Avoid the HTTP request on sceNetAdhoc init by reading from cache 2026-03-09 10:50:24 +01:00
Henrik Rydgård 71d884379d Fix a potential race condition 2026-03-09 00:51:39 +01:00
Henrik Rydgård cf9ee07b8e Adhoc: Forgot that we have to load the server list in-game to check the connection mode 2026-03-09 00:44:56 +01:00
Henrik Rydgård f6dda460f9 Translate relay connection messages 2026-03-09 00:19:36 +01:00
Henrik Rydgård d5c2a7ce62 Change some message timeouts 2026-03-09 00:19:36 +01:00
Henrik Rydgård ba6ff9a224 Improve the adhoc server selector a little bit, add metadata viewer 2026-03-08 00:31:29 +01:00
Henrik Rydgård 781be0d251 Add missing fallback for loading the adhoc server list 2026-03-07 09:52:20 +01:00
Henrik Rydgård 04b86a0d87 Address Kethen's feedback 2026-03-06 13:34:16 +01:00
Henrik Rydgård 1a95e9e4e9 Fetch the public adhoc server list from metadata.ppsspp.org/adhoc-servers.json 2026-03-06 13:25:07 +01:00
Henrik Rydgård 2520c87c95 Merge pull request #21352 from Kethen/adhoc_fixes
Handle adhoc relay connection a bit better
2026-03-06 00:05:07 +01:00
Henrik Rydgård e3e568d1d4 Sneak in a fix to the adhoc server list (didn't read modes correctly from json) 2026-03-05 23:14:52 +01:00
Katharine Chui 6f64663f75 handle relay failure during adhoc pdp seend/recv 2026-03-05 22:50:40 +01:00
Katharine Chui 1875286019 remove extra GetI18NCategory 2026-03-05 22:41:13 +01:00
Katharine Chui 1a86682e84 do not use ptp connection result to check for adhoc relay status
ptp connection failure could also be due to the clinet on the other
side not accepting the connection
2026-03-05 22:34:32 +01:00
Katharine Chui 101789c075 disable adhoc relay retrying after 15 seconds of lack of success 2026-03-05 22:26:16 +01:00
Katharine Chui 1e8e929bd9 shorten relay connection failure OSD message 2026-03-05 19:22:10 +01:00
Katharine Chui 20424bc5bc Handle adhoc relay conection a bit better
- bump aemu_postoffice
  - timeout TCP connection attempts at 5s to not block the library user too much
  - set send and receive buffer sizes after connection to avoid some blocking cases on some platforms with small defaults (windows?)
- pop OSD message when relay connection fails
2026-03-05 19:09:51 +01:00
Henrik Rydgård 962d132e5f Make the adhoc server list data driven 2026-03-05 15:15:25 +01:00
Henrik Rydgård 2a1cefb58b (Fake-)load adhoc server list asynchronously when opening server list window. 2026-03-05 14:36:06 +01:00
Henrik Rydgård cc49e5079d Refactor a bit, preparing for async download 2026-03-05 14:30:32 +01:00
Henrik Rydgård a0327ff5d5 Adhoc: Update some discord links 2026-03-05 14:30:32 +01:00
Henrik Rydgård 0d8358827b Move the pre-loaded adhoc server address list logic to sceNetAdhoc.cpp
Yes, that file is growing too big...
2026-03-05 10:05:08 +01:00
Henrik Rydgård 61fd0430e5 Update strings for the adhoc mode message 2026-02-19 16:43:55 +01:00
Katharine Chui b3b9e90403 expand adhoc server list
Add various data fields and logic to handle:
- automatic adhoc data mode handling
- future UI expension on server list
- future support for automatically downloaded/user provided server list
2026-02-18 19:22:38 +01:00
Henrik Rydgård 4477396045 AdHoc relay server: Replace checkbox with "Auto" / "On" / "Off" 2026-02-18 19:18:42 +01:00
Katharine Chui 4c0d913d34 Fix FlatOut Head On in aemu_postoffice relay mode
PDP recv with buffer < packet size was not implemented correctly
as far as FlatOut Head On is concerned. Fix relay PDP recv
implementation to report required size without consuming the next
PDP packet so that it behaves like P2P mode does.
2026-02-17 22:23:42 +01:00
Henrik Rydgård f01aaeafb1 Split CopyDisplayToOutput in preparation for the next step 2026-02-08 01:06:32 +01:00
Katharine Chui 8292cb35cc fix code formatting 2026-02-06 15:00:59 +01:00
Katharine Chui b2e976360c aemu_postoffice: fragment huge ptp send requests in relay mode 2026-02-06 14:50:01 +01:00
Katharine Chui cb279b5ba1 sanitize adhoc recv buffer sizes in relay mode using library defines 2026-02-06 14:49:49 +01:00
Henrik Rydgård d6ebfed432 Fix some bugs and warnings from a pass of static analysis 2026-01-29 17:41:54 +01:00
Katharine Chui e3710af3c4 fix dirty pointer deref during relay DoBlockingPdpSend 2026-01-23 16:05:16 +01:00