Commit graph

29 commits

Author SHA1 Message Date
Elad 575a245f8d
IDM: Implement lock-free smart pointers (#16403)
Replaces `std::shared_pointer` with `stx::atomic_ptr` and `stx::shared_ptr`.

Notes to programmers:

* This pr kills the use of `dynamic_cast`, `std::dynamic_pointer_cast` and `std::weak_ptr` on IDM objects, possible replacement is to save the object ID on the base object, then use idm::check/get_unlocked to the destination type via the saved ID which may be null. Null pointer check is how you can tell type mismatch (as dynamic cast) or object destruction (as weak_ptr locking).
* Double-inheritance on IDM objects should be used with care, `stx::shared_ptr` does not support constant-evaluated pointer offsetting to parent/child type.
* `idm::check/get_unlocked` can now be used anywhere.

Misc fixes:
* Fixes some segfaults with RPCN with interaction with IDM.
* Fix deadlocks in access violation handler due locking recursion.
* Fixes race condition in process exit-spawn on memory containers read.
* Fix bug that theoretically can prevent RPCS3 from booting - fix `id_manager::typeinfo` comparison to compare members instead of `memcmp` which can fail spuriously on padding bytes.
* Ensure all IDM inherited types of base, either has `id_base` or `id_type` defined locally, this allows to make getters such as `idm::get_unlocked<lv2_socket, lv2_socket_raw>()` which were broken before. (requires save-states invalidation)
* Removes broken operator[] overload of `stx::shared_ptr` and `stx::single_ptr` for non-array types.
2024-12-22 20:59:48 +02:00
RipleyTom c68f42e0ee Fix sceNpScoreGetRankingByNpId when no score is registered 2024-11-05 20:48:05 +01:00
RipleyTom 9dd0b055d0 Fake sceNpMatching2GetLobbyInfoList 2024-09-26 21:12:10 +02:00
RipleyTom 3d9c8a670e Implement old matching API 2024-09-19 20:34:56 +02:00
RipleyTom dd9b3c651f Support old sceNpScoreRankData 2024-07-18 18:29:49 +02:00
RipleyTom 3e7ff4059e Add matching2 option handling 2024-05-16 22:38:11 +02:00
RipleyTom 397c2698ae Fix sceNpScoreGetRankingByNpId 2024-03-12 09:36:31 +02:00
RipleyTom 2168511e5b Add check for score transactions being reused 2024-02-28 02:14:37 +01:00
Megamouse cdfe3ee7c8 Name some threads 2024-01-31 16:33:29 +01:00
RipleyTom fe9a24a1b8
RPCN 1.0 (#15045) 2024-01-14 12:36:23 +01:00
Megamouse 59c58aa3cf fix some warnings 2023-12-30 19:07:35 +01:00
RipleyTom 03761c5dd4 rpcn 0.8 2023-12-29 19:22:49 +01:00
Megamouse 6555de6ef5 fix warnings 2023-04-21 16:41:06 +02:00
RipleyTom 450cb1771c Add better error handling for RequestSignalingInfos 2023-03-08 18:25:26 +01:00
Megamouse 1d7a00666e rpcn: throw exception when using rpcn features without a proper config 2023-03-03 11:30:39 +01:00
RipleyTom 6186ac0245 rpcn: signaling handler improvements & upnp
Simplify signaling by making Matching2 a layer over normal signaling.
Implements UPNP port forwarding
Implement sceNpMatching2AbortRequest
Fix reported bw in sceNpUtil
Hack for Fat Princess binding udp on 3658
Reenable CB for sceNpBasicAddPlayersHistoryAsync
Misc fixes
2023-02-21 15:41:41 +01:00
RipleyTom 880a4e3ca6 SceNpScore: improvements 2022-10-24 00:49:44 +02:00
RipleyTom 01c285fc4a RPCN v0.7
Bump protocol version
Improve signaling RTT calculation for client
Implement score game data functions
Various sceNpScore fixes
Verify flatbuffer buffers
Use std::variant for transaction specific data
2022-10-17 09:57:10 +02:00
RipleyTom 8170b91f76 sceNpScore: return error on 0 scores returned 2022-09-28 21:58:11 +02:00
RipleyTom d1a7bb0136 Fix faulty GetScoreFriendsRequest 2022-09-28 21:58:11 +02:00
RipleyTom eea73deab3 RPCN v0.6 2022-09-27 23:39:54 +03:00
Nekotekina 6ff6a4989a Implement at32() util
Works like .at() but uses source location for "exception".
2022-09-26 18:04:15 +03:00
RipleyTom 4479d99a9a Implement sceNpManagerGetTicketParam 2022-05-10 21:04:15 +02:00
RipleyTom cbc067b490 Fix get_roomdata_external_list callback event id 2022-04-10 15:42:26 +02:00
RipleyTom 8fb2d04ce8 rpcn: validate callbacks before queuing them 2022-04-10 00:23:32 +02:00
RipleyTom 6c5b8dc31c rpcn: add cookie impl to tickets 2022-02-03 13:25:15 +01:00
RipleyTom dc0793b731 NP: Implement sceNpMatching2DeleteServerContext 2021-11-08 13:10:40 +03:00
RipleyTom d41e405420 NP: Cache Manager + improvements 2021-11-08 13:10:40 +03:00
RipleyTom 516cb959cb rpcn: new allocator + refactoring of np_handler 2021-11-08 13:10:40 +03:00