From ebcf6be42c60dbb021f1debe45cabf9befd52093 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 8 Apr 2025 00:32:40 +0200 Subject: [PATCH] When (successfully) using dyn_dns, remove fixed lookups. Additionally some various cleanup. --- Core/Dialog/PSPNetconfDialog.cpp | 3 +-- Core/HLE/sceNet.cpp | 7 +++++-- Core/HLE/sceNetInet.cpp | 13 ++++++------- Core/HLE/sceNetResolver.cpp | 6 +++--- assets/infra-dns.json | 6 +++--- 5 files changed, 18 insertions(+), 17 deletions(-) diff --git a/Core/Dialog/PSPNetconfDialog.cpp b/Core/Dialog/PSPNetconfDialog.cpp index 7313e22b5e..303779d133 100644 --- a/Core/Dialog/PSPNetconfDialog.cpp +++ b/Core/Dialog/PSPNetconfDialog.cpp @@ -116,13 +116,12 @@ int PSPNetconfDialog::Update(int animSpeed) { std::string json; if (!jsonReady_ && PollInfraJsonDownload(&json)) { if (!json.empty()) { - INFO_LOG(Log::sceNet, "PollInfraJsonDownload returned a string"); if (!LoadAutoDNS(json)) { // If the JSON parse fails, throw away the cache file at least. ERROR_LOG(Log::sceNet, "Failed to parse bad json. Deleting cache file."); DeleteAutoDNSCacheFile(); } else { - INFO_LOG(Log::sceNet, "Got and processed the AutoDNS json."); + DEBUG_LOG(Log::sceNet, "Got and processed the AutoDNS json."); } } else { // TODO: Show a notice? diff --git a/Core/HLE/sceNet.cpp b/Core/HLE/sceNet.cpp index 6a35c95568..00fc2d5968 100644 --- a/Core/HLE/sceNet.cpp +++ b/Core/HLE/sceNet.cpp @@ -348,8 +348,11 @@ bool LoadAutoDNS(std::string_view json) { if (inet_ntop(ptr->ai_family, &(((struct sockaddr_in*)ptr->ai_addr)->sin_addr), ipstr, sizeof(ipstr)) != 0) { INFO_LOG(Log::sceNet, "Successfully resolved '%s' to '%s', overriding DNS.", dyn_dns.c_str(), ipstr); if (g_infraDNSConfig.dns != ipstr) { - WARN_LOG(Log::sceNet, "Replacing specified DNS IP %s with dyndns %s!", g_infraDNSConfig.dns.c_str(), ipstr); + INFO_LOG(Log::sceNet, "Replacing specified DNS IP %s with dyndns %s!", g_infraDNSConfig.dns.c_str(), ipstr); g_infraDNSConfig.dns = ipstr; + // If dyndns is working, we do not need the fixed lookups. So let's kick them. + INFO_LOG(Log::sceNet, "Clearing fixed DNS lookups."); + g_infraDNSConfig.fixedDNS.clear(); } else { INFO_LOG(Log::sceNet, "DynDNS: %s already up to date", g_infraDNSConfig.dns.c_str()); } @@ -871,7 +874,7 @@ static u32 sceNetTerm() { // Give time to make sure everything are cleaned up hleEatMicro(adhocDefaultDelay); - return hleLogWarning(Log::sceNet, retval, "at %08x", currentMIPS->pc); + return hleLogInfo(Log::sceNet, retval); } /* diff --git a/Core/HLE/sceNetInet.cpp b/Core/HLE/sceNetInet.cpp index f199d8b369..52ea5b00e2 100644 --- a/Core/HLE/sceNetInet.cpp +++ b/Core/HLE/sceNetInet.cpp @@ -67,7 +67,7 @@ static int sceNetInetInit() { } static int sceNetInetTerm() { - WARN_LOG(Log::sceNet, "UNIMPL sceNetInetTerm()"); + INFO_LOG(Log::sceNet, "sceNetInetTerm()"); __NetInetShutdown(); return hleLogDebug(Log::sceNet, 0); } @@ -429,8 +429,7 @@ static int sceNetInetSend(int socket, u32 bufPtr, u32 bufLen, u32 flags) { } static int sceNetInetSocket(int domain, int type, int protocol) { - // Still using WARN_LOG to make this stand out in the log. - WARN_LOG(Log::sceNet, "sceNetInetSocket(%i, %i, %i) at %08x - Socket: Domain = %s, Type = %s, Protocol = %s", + INFO_LOG(Log::sceNet, "sceNetInetSocket(%d, %d, %d) at %08x - Socket: Domain = %s, Type = %s, Protocol = %s", domain, type, protocol, currentMIPS->pc, inetSocketDomain2str(domain).c_str(), inetSocketType2str(type).c_str(), inetSocketProto2str(protocol).c_str()); int socket; @@ -459,7 +458,7 @@ static int sceNetInetSetsockopt(int socket, int level, int optname, u32 optvalPt } u32 optval = optvalPtr ? Memory::Read_U32(optvalPtr) : 0; - WARN_LOG(Log::sceNet, "sceNetInetSetsockopt(%i, %i, %i, %08x, %i) at %08x: Level = %s, OptName = %s, OptValue = %d", + INFO_LOG(Log::sceNet, "sceNetInetSetsockopt(%i, %i, %i, %08x, %i) at %08x: Level = %s, OptName = %s, OptValue = %d", socket, level, optname, optvalPtr, optlen, currentMIPS->pc, inetSockoptLevel2str(level).c_str(), inetSockoptName2str(optname, level).c_str(), optval); @@ -617,7 +616,7 @@ static int sceNetInetBind(int socket, u32 namePtr, int namelen) { // Get Local IP Address sockaddr_in sockAddr{}; getLocalIp(&sockAddr); - WARN_LOG(Log::sceNet, "Bind: Address Replacement = %s => %s", ip2str(saddr.in.sin_addr).c_str(), ip2str(sockAddr.sin_addr).c_str()); + INFO_LOG(Log::sceNet, "Bind: Address Replacement = %s => %s", ip2str(saddr.in.sin_addr).c_str(), ip2str(sockAddr.sin_addr).c_str()); saddr.in.sin_addr.s_addr = sockAddr.sin_addr.s_addr; } // TODO: Make use Port Offset only for PPSSPP to PPSSPP communications (ie. IP addresses available in the group/friendlist), otherwise should be considered as Online Service thus should use the port as is. @@ -848,7 +847,7 @@ static int sceNetInetRecvfrom(int socket, u32 bufferPtr, int len, int flags, u32 VERBOSE_LOG(Log::sceNet, "Data Dump (%d bytes):\n%s", retval, datahex.c_str()); // Using hleDelayResult as a workaround for games that need blocking-socket to be implemented (ie. Coded Arms Contagion) - return hleDelayResult(hleLogInfo(Log::sceNet, retval, + return hleDelayResult(hleLogDebug(Log::sceNet, retval, "RecvFrom: Address = %s, Port = %d", ip2str(saddr.in.sin_addr).c_str(), ntohs(saddr.in.sin_port)), "workaround until blocking-socket", 500); } @@ -921,7 +920,7 @@ static int sceNetInetSendto(int socket, u32 bufferPtr, int len, int flags, u32 t } } - return hleLogInfo(Log::sceNet, retval, "SendTo: Address = %s, Port = %d", ip2str(saddr.in.sin_addr).c_str(), ntohs(saddr.in.sin_port)); + return hleLogDebug(Log::sceNet, retval, "SendTo: Address = %s, Port = %d", ip2str(saddr.in.sin_addr).c_str(), ntohs(saddr.in.sin_port)); } // Similar to POSIX's sendmsg or Winsock2's WSASendMsg? Are their packets compatible one another? diff --git a/Core/HLE/sceNetResolver.cpp b/Core/HLE/sceNetResolver.cpp index dcafede224..756f823635 100644 --- a/Core/HLE/sceNetResolver.cpp +++ b/Core/HLE/sceNetResolver.cpp @@ -259,7 +259,7 @@ static int sceNetResolverCreate(u32 resolverIdPtr, u32 bufferPtr, int bufferLen) }; Memory::WriteUnchecked_U32(currentNetResolverId, resolverIdPtr); - return hleLogInfo(Log::sceNet, 0, "ID: %d", currentNetResolverId); + return hleLogDebug(Log::sceNet, 0, "ID: %d", currentNetResolverId); } static int sceNetResolverStop(u32 resolverId) { @@ -278,7 +278,7 @@ static int sceNetResolverStop(u32 resolverId) { } resolverIter->second.isRunning = false; - return hleLogInfo(Log::sceNet, 0); + return hleLogDebug(Log::sceNet, 0); } static int sceNetResolverDelete(u32 resolverId) { @@ -292,7 +292,7 @@ static int sceNetResolverDelete(u32 resolverId) { } g_netResolvers.erase(resolverIter); - return hleLogInfo(Log::sceNet, 0); + return hleLogDebug(Log::sceNet, 0); } const HLEFunction sceNetResolver[] = { diff --git a/assets/infra-dns.json b/assets/infra-dns.json index 87d8142f2c..6b8d8b0a85 100644 --- a/assets/infra-dns.json +++ b/assets/infra-dns.json @@ -17,11 +17,11 @@ "group": "MOHH Revival", "url": "https://mohh-revival.pages.dev/" }, - "dns": "ablondel.ddns.net", + "dns": "86.223.243.173", "dyn_dns": "ablondel.ddns.net", "domains": { - "pspmoh07.ea.com": "ablondel.ddns.net", - "tos.ea.com": "ablondel.ddns.net" + "pspmoh07.ea.com": "86.223.243.173", + "tos.ea.com": "86.223.243.173" }, "score": 5, "known_working_ids": [