From 64a8e66bac90a3e776217e9b19678e368f085c9c Mon Sep 17 00:00:00 2001 From: TheLastRar Date: Thu, 26 Jan 2023 19:16:13 +0000 Subject: [PATCH] DEV9: Sockets, Treat UDP connections with nearby src/dst ports as fixed Only doing this for equal ports proved too strict for some games. --- pcsx2/DEV9/sockets.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pcsx2/DEV9/sockets.cpp b/pcsx2/DEV9/sockets.cpp index d7b1314a3c..da2fa2afc6 100644 --- a/pcsx2/DEV9/sockets.cpp +++ b/pcsx2/DEV9/sockets.cpp @@ -563,7 +563,7 @@ bool SocketAdapter::SendUDP(ConnectionKey Key, IP_Packet* ipPkt) { UDP_Session* s = nullptr; - if (udp.sourcePort == udp.destinationPort || //Used for LAN games that assume the destination port + if (abs(udp.sourcePort - udp.destinationPort) <= 10 || //Used for games that assume the destination/source port ipPkt->destinationIP == dhcpServer.broadcastIP || //Broadcast packets ipPkt->destinationIP == IP_Address{{{255, 255, 255, 255}}} || //Limited Broadcast packets (ipPkt->destinationIP.bytes[0] & 0xF0) == 0xE0) //Multicast address start with 0b1110