This PR implements the Sony Clans subsystem for the RPCS3 emulator.
Used in:
- PlayStation Home [NPIA00005]
- ?
Addresses and closes
[#16464](https://github.com/RPCS3/rpcs3/issues/16464).
---
The source code for the server is available
[here](https://github.com/ZephyrCodesStuff/clans-rs) and is licensed
AGPLv3.
- It's written in Rust, with my best efforts in readability and
documentation.
- Every feature not-pertaining to RPCS3 has been feature-gated at
compile-time.
- Fully Dockerized deployment
- Ticket signature verification
NOTE: The server is fully compatible with the PS3 console as well, as it
follows the PS3 Clans Library specification.
---
The emulator code tries its best to follow on the steps of the RPCN
client code wherever possible; both in the Client as well as the
Settings and Config components.
Features:
- Clans client implementation in `clans_client.[h,cpp]`
- Syscalls implementation in `sceNpClans.[h,cpp]`
- A couple of missing structs and/or enum members have been added in
`sceNp.h`
- Qt GUI for selecting the desired Clans server to use (default: [HTTPS]
`clans.rpcs3.net`)
- Implemented in `clans_settings_dialog.[h,cpp]`
- Prevents modifying during emulator usage
- `clans.yml` config file for persistence
- Implemented in `clans_config.[h,cpp]`
---------
Signed-off-by: zeph <35661622+ZephyrCodesStuff@users.noreply.github.com>
Signed-off-by: zeph <zephyrzefa15@gmail.com>
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.
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