From 298a18e1e27750ca8e6c6927376f3fa659adf91a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Fri, 17 Jan 2025 09:22:33 +0100 Subject: [PATCH] Parsing fix for infra-dns.json, minor logging improvement --- Core/HLE/NetInetConstants.cpp | 2 +- Core/HLE/sceNet.cpp | 22 ++++++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Core/HLE/NetInetConstants.cpp b/Core/HLE/NetInetConstants.cpp index ddb4cb8e09..b9af8719ac 100644 --- a/Core/HLE/NetInetConstants.cpp +++ b/Core/HLE/NetInetConstants.cpp @@ -563,7 +563,7 @@ int convertSockoptNamePSP2Host(int optname, int level) { #endif } } - return hleLogError(Log::sceNet, optname, "Unknown PSP's SockOpt Name (Level = %08x)", level); + return hleLogError(Log::sceNet, optname, "Unknown or unsupported PSP's SockOpt Name (Level = %08x)", level); } int convertSockoptNameHost2PSP(int optname, int level) { diff --git a/Core/HLE/sceNet.cpp b/Core/HLE/sceNet.cpp index 424475bacf..a68b440266 100644 --- a/Core/HLE/sceNet.cpp +++ b/Core/HLE/sceNet.cpp @@ -201,7 +201,7 @@ bool LoadDNSForGameID(std::string_view gameID, InfraDNSConfig *dns) { const JsonNode *workingIdsNode = game.getArray("known_working_ids"); const JsonNode *otherIdsNode = game.getArray("other_ids"); const JsonNode *notWorkingIdsNode = game.getArray("not_working_ids"); - if (!workingIdsNode) { + if (!workingIdsNode && !otherIdsNode && !notWorkingIdsNode) { // We ignore this game. continue; } @@ -209,12 +209,14 @@ bool LoadDNSForGameID(std::string_view gameID, InfraDNSConfig *dns) { bool found = false; std::vector ids; - JsonGet(workingIdsNode->value).getStringVector(&ids); - for (auto &id : ids) { - if (id == gameID) { - found = true; - dns->state = InfraGameState::Working; - break; + if (workingIdsNode) { + JsonGet(workingIdsNode->value).getStringVector(&ids); + for (auto &id : ids) { + if (id == gameID) { + found = true; + dns->state = InfraGameState::Working; + break; + } } } if (!found && notWorkingIdsNode) { @@ -229,7 +231,7 @@ bool LoadDNSForGameID(std::string_view gameID, InfraDNSConfig *dns) { } } if (!found && otherIdsNode) { - // Check the "other" array, not sure what we do with these. + // Check the "other" array, we're gonna try this, but less confidently :P JsonGet(otherIdsNode->value).getStringVector(&ids); for (auto &id : ids) { if (id == gameID) { @@ -994,10 +996,10 @@ void NetApctl_InitInfo(int confId) { // The reason we need autoconfig is that private Servers may need to use custom DNS Server - and most games are now // best played on private servers (only a few official ones remain, if any). if (g_Config.bInfrastructureAutoDNS) { - INFO_LOG(Log::sceNet, "Responding to game query with AutoDNS address"); + INFO_LOG(Log::sceNet, "Responding to game query with AutoDNS address: %s", g_infraDNSConfig.dns.c_str()); truncate_cpy(netApctlInfo.primaryDns, sizeof(netApctlInfo.primaryDns), g_infraDNSConfig.dns); } else { - INFO_LOG(Log::sceNet, "Responding to game query with manual DNS address"); + INFO_LOG(Log::sceNet, "Responding to game query with manual DNS address: %s", g_Config.sInfrastructureDNSServer.c_str()); truncate_cpy(netApctlInfo.primaryDns, sizeof(netApctlInfo.primaryDns), g_Config.sInfrastructureDNSServer); }