When (successfully) using dyn_dns, remove fixed lookups.

Additionally some various cleanup.
This commit is contained in:
Henrik Rydgård committed 2025-04-08 00:32:40 +02:00
1 parent 1d97dfe432
commit ebcf6be42c
5 files changed
+18 -17

No files matched your search

+1 -2
View File
@@ -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?
+5 -2
View File
@@ -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);
}
/*
+6 -7
View File
@@ -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?
+3 -3
View File
@@ -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[] = {
+3 -3
View File
@@ -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": [