mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-11 09:05:38 +00:00
Add a hidden option to not download infra-dns.json, instead use the file from assets
This commit is contained in:
parent
41b93c895c
commit
8818e440ad
@ -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),
|
||||
|
@ -475,7 +475,7 @@ public:
|
||||
int iWlanAdhocChannel;
|
||||
bool bWlanPowerSave;
|
||||
bool bEnableNetworkChat;
|
||||
|
||||
bool bDontDownloadInfraJson;
|
||||
int iChatButtonPosition;
|
||||
int iChatScreenPosition;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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<uint8_t[]> 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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user