diff --git a/Core/Config.cpp b/Core/Config.cpp index bad932ae0f..d95bfac817 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -922,6 +922,7 @@ static const ConfigSetting networkSettings[] = { ConfigSetting("InfrastructureUsername", &g_Config.sInfrastructureUsername, &DefaultInfrastructureUsername, CfgFlag::PER_GAME), ConfigSetting("InfrastructureAutoDNS", &g_Config.bInfrastructureAutoDNS, true, CfgFlag::PER_GAME), ConfigSetting("AllowSavestateWhileConnected", &g_Config.bAllowSavestateWhileConnected, false, CfgFlag::DONT_SAVE), + ConfigSetting("DontDownloadInfraJson", &g_Config.bDontDownloadInfraJson, false, CfgFlag::DONT_SAVE), ConfigSetting("EnableNetworkChat", &g_Config.bEnableNetworkChat, false, CfgFlag::PER_GAME), ConfigSetting("ChatButtonPosition", &g_Config.iChatButtonPosition, (int)ScreenEdgePosition::BOTTOM_LEFT, CfgFlag::PER_GAME), diff --git a/Core/Config.h b/Core/Config.h index b5b520dd6c..c5d8a99607 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -475,7 +475,7 @@ public: int iWlanAdhocChannel; bool bWlanPowerSave; bool bEnableNetworkChat; - + bool bDontDownloadInfraJson; int iChatButtonPosition; int iChatScreenPosition; diff --git a/Core/HLE/proAdhoc.cpp b/Core/HLE/proAdhoc.cpp index 4db5c5854a..ea5023892d 100644 --- a/Core/HLE/proAdhoc.cpp +++ b/Core/HLE/proAdhoc.cpp @@ -1374,6 +1374,7 @@ int friendFinder() { // Reconnect when disconnected while Adhocctl is still inited if (metasocket == (int)INVALID_SOCKET && netAdhocctlInited && isAdhocctlNeedLogin) { if (g_Config.bEnableWlan) { + // Not really initNetwork. if (initNetwork(&product_code) == 0) { g_adhocServerConnected = true; INFO_LOG(Log::sceNet, "FriendFinder: Network [RE]Initialized"); @@ -1390,6 +1391,7 @@ int friendFinder() { } } } + // Prevent retrying to Login again unless it was on demand isAdhocctlNeedLogin = false; diff --git a/Core/HLE/sceNet.cpp b/Core/HLE/sceNet.cpp index 109edd57df..961202343e 100644 --- a/Core/HLE/sceNet.cpp +++ b/Core/HLE/sceNet.cpp @@ -342,6 +342,18 @@ bool PollInfraJsonDownload(std::string *jsonOutput) { return true; } + if (!g_Config.bDontDownloadInfraJson) { + NOTICE_LOG(Log::sceNet, "As specified by the ini setting DontDownloadInfraJson, using infra-dns.json from /assets"); + size_t jsonSize = 0; + std::unique_ptr jsonStr(g_VFS.ReadFile("infra-dns.json", &jsonSize)); + if (!jsonStr) { + jsonOutput->clear(); + return true; // A clear output but returning true means something vent very wrong. + } + *jsonOutput = std::string((const char *)jsonStr.get(), jsonSize); + return true; + } + if (!g_infraDL) { INFO_LOG(Log::sceNet, "No json download going on"); return false;