Commit graph

137 commits

Author SHA1 Message Date
Henrik Rydgård
c3aa0f7452 Centralize socket-related includes, introduce socket_errno
This resolves some weird inconsistentes and include order problems
related to errno. Needed for the next steps.
2025-01-08 12:42:45 +01:00
Henrik Rydgård
9b82a9f180 Move all the Inet enum mappers to Core/HLE/NetInetConstants. Other cleanup. 2025-01-07 19:45:16 +01:00
Henrik Rydgård
895d8eb7fa Try ANR2ME's sceNetInet implementation 2025-01-07 10:31:32 +01:00
Henrik Rydgård
1c16c31b49 Log level tweaks, fix dodgy string tricks that failed the memory sanitizer 2025-01-06 17:51:59 +01:00
White Blood Cell
ee0b0fce6c sceNetInet and sceNetResolver support.
Co-authored-by: AdamN <anr2000@gmail.com>
2025-01-04 17:28:36 +01:00
Nemoumbra
96f9749e2e Split out the matching code from sceNetAdhoc.cpp 2025-01-03 04:59:26 +03:00
Henrik Rydgård
080798b5dd Move out two more functions from Core.cpp. Clean up Windows includes 2024-12-08 12:12:02 +01:00
Henrik Rydgård
5c368cb965 More buildfixes 2024-07-26 15:22:35 +02:00
Henrik Rydgård
9fb97add3f Bugfixes 2024-07-26 14:22:31 +02:00
Henrik Rydgård
5926886c0c Some include cleanup, delete some obsolete code 2024-07-25 14:52:41 +02:00
AdamN
6cccb9cb72
add SD_RECEIVE definition 2024-06-29 00:29:15 +07:00
Herman Semenov
af41281761 [Core/Dialog/ELF/FileSystems/HLE/HW/Util] Added const reference for function params 2023-12-14 14:22:24 +03:00
ANR2ME
47efec2782 Treat WSAEINVAL similar to WSAEALREADY during connect for backward-compatibility to Winsock 1.1, but might confuses with an actual invalid argument error on newer Winsock. 2023-08-26 06:25:09 +07:00
Unknown W. Brackets
a7b7bf7826 Global: Set many read-only params as const.
This makes what they do and which args to use clearer, if nothing else.
2022-12-10 21:13:36 -08:00
ANR2ME
ea6e5c8f74 Mask some part of public IP in the logs for security reason. 2022-06-23 00:41:41 +07:00
ANR2ME
d86dc0bff6 Fix sceNetAdhocPtpConnect issue on Windows (ie. Tales of VS) due to getpeername on Windows can return a success when the other side haven't Accepted the connection yet. 2022-05-18 06:18:15 +07:00
ANR2ME
799c721fa6 Added a note regarding select on Linux. 2022-05-18 01:11:56 +07:00
ANR2ME
d5152752d2 Added a function to get SO_ERROR on a socket. 2022-03-24 08:34:03 +07:00
ANR2ME
6b0cb78b3b Recreate the socket before attempting to connect again after ECONNREFUSED/ENETUNREACH error, since reusing the socket only works on Windows. 2022-03-24 08:34:02 +07:00
ANR2ME
267757a5e4 Caches IP-specific Port Offset to avoid recalculating them. 2022-03-24 08:34:02 +07:00
Unknown W. Brackets
2479d52202 Global: Reduce includes of common headers.
In many places, string, map, or Common.h were included but not needed.
2022-01-30 16:35:33 -08:00
ANR2ME
a1accc87d4 Added comment related to EVENT_HELLO 2022-01-20 03:00:22 +07:00
ANR2ME
9a714249a6 Changing most frequently used global vars to atomic to avoid possible multi-threading issue on friendFinder thread which communicates with AdhocServer in background.
PS: There are more global vars being used here (too many actually), so we should find a better approach in the future (ie. using PSPThread instead).
2021-09-28 20:44:03 +07:00
ANR2ME
6a79f59c06 Fix threading issue when exiting PPSSPP due to unjoined AdhocServer thread when AdhocServer failed to bind the socket and exited the thread early. 2021-09-28 20:44:03 +07:00
ANR2ME
2bda9c1c84 Keep tracks of the sender/source port on GameMode for further communication, in case it was remapped by router or ISP for some reason. 2021-09-19 10:55:03 +07:00
ANR2ME
2305de42f0 Keeping track the source port of received data on AdhocMatching to be used for further communication, in the case the port was re-mapped for some reason. 2021-09-17 12:36:56 +07:00
Unknown W. Brackets
9403947b67 UI: Decouple new chat display and tracking logic. 2021-09-14 18:08:16 -07:00
Unknown W. Brackets
be0b0cd88d UI: Track chat log changes more clearly.
This also makes it easier to have multiple views or etc. reading from it.
We want data flowing a single direction, chat system -> UI.
2021-09-14 18:08:16 -07:00
ANR2ME
7a06103cc6 Create GameMode's socket after Master and all Replicas have been created so we will know the largest buffer size. 2021-05-31 04:37:09 +07:00
ANR2ME
206ab4345e Attempts to reconnect to Adhoc Server only when Creating/Joining/Connecting to a group or Scanning for groups, instead of on 2 seconds interval. 2021-04-02 12:19:02 +07:00
ANR2ME
e3228ca1b5 Use a function to check for loopback address 2021-04-02 12:18:12 +07:00
M4xw
4cc322466a Switch: Workaround several missing toolchain defs. 2021-03-04 21:24:57 -08:00
ANR2ME
758fb12fc3 Making sure there are no warnings related to deprecated inet_ntoa function 2021-03-01 01:45:27 +07:00
ANR2ME
0ce2c2c6e9 Windows recvfrom doesn't support MSG_TRUNC, so we're using dummy buffer with max size as alternative for peeking actual size of the next pending message. 2021-02-11 07:40:35 +07:00
ANR2ME
fc452c0dfd Fix frozen (0 FPS) issue on Kao Challengers and Asterix & Obelix XX (probably also fix other games from the same developer with similar issue) https://github.com/hrydgard/ppsspp/issues/14103 2021-02-11 03:44:25 +07:00
ANR2ME
849fe4ade1 Updated PdpStat to prevent rcv_sb_cc from exceeding the buffer size arg (since we use larger buffer size to prevent micro stutters or disconnection issue due to too many dropped packets with small buffer size).
TODO: May need to improve it to be able to calculate the correct size if there are multiple datagram messages
2021-02-04 10:31:01 +07:00
ANR2ME
a51036ffaf Updated PdpStat and PtpStat 2021-02-02 03:39:04 +07:00
ANR2ME
d907906c74 Fix connection issue on Dynasty Warriors (Shin Sangoku Musou) games when playing with more than 2 players. 2021-01-30 15:20:24 +07:00
ANR2ME
b10797db95 Fixed an issue where sometimes a player unable to join a host on Warriors Orochi 2 (should also fix similar issue on other games that use PDP/UDP on Windows) 2020-12-25 00:27:35 +07:00
ANR2ME
38d887ce88 Change socket's MSS based on PSP_ADHOC_PTP_MSS 2020-11-16 19:03:11 +07:00
ANR2ME
4eca124710 Blocks current thread to synchronize initial GameMode data. Fixes desync issue when GameMode multiplayer mission is being started. 2020-10-29 06:08:51 +07:00
ANR2ME
399f56f73b Implementing Adhocctl Busy state to prevent getting kicked out from Adhoc Server on games that tries to leave the group multiple times in a row.
Also Updated Adhocctl behavior.
2020-10-29 06:04:22 +07:00
ANR2ME
0157fe4988 Updated GameMode API (Fixed Pocket Pool) 2020-10-29 06:00:16 +07:00
ANR2ME
bff18c07d0 Fixed unable to see game room issue on Air Conflicts - Aces Of World War 2, should also fix other games with similar issue (due to invalid group mode) 2020-10-29 06:00:16 +07:00
ANR2ME
e5a02cebb4 Added Connection Refused error code on PtpConnect 2020-10-19 19:08:10 +07:00
ANR2ME
d395611135 Fixed disconnection issue when multiplayer game started on Shaun White Snowboarding, and improved multiplayer performance on games that use GameMode. 2020-10-19 19:08:10 +07:00
ANR2ME
59e2bab7ec Added some network-related missing error codes. 2020-10-11 09:57:56 +07:00
ANR2ME
731461ad4c Minor changes. 2020-10-10 01:01:35 +07:00
ANR2ME
93e2a1b586 Updated AdhocPollSocket implementation to fix Bleach Heat the Soul 7, Fate Unlimited Codes, Carnage Heart EXA 2020-10-10 01:01:12 +07:00
ANR2ME
8b2073cd7f Prevent Dissidia 012 from opening too many ports when failed to connect continuously. 2020-10-10 01:00:32 +07:00