diff --git a/Common/Net/URL.h b/Common/Net/URL.h index c37162f51fd1..d9f42fae9211 100644 --- a/Common/Net/URL.h +++ b/Common/Net/URL.h @@ -106,8 +106,7 @@ struct UrlEncoder // Easy to swap out for a UrlEncoder. struct MultipartFormDataEncoder : UrlEncoder { - MultipartFormDataEncoder() : UrlEncoder() - { + MultipartFormDataEncoder() : UrlEncoder() { data.reserve(8192); int r1 = rand(); int r2 = rand(); diff --git a/Core/Config.cpp b/Core/Config.cpp index 6c9c1830e144..bd9900b11360 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -976,6 +976,11 @@ static const ConfigSetting networkSettings[] = { ConfigSetting("AllowSpeedControlWhileConnected", &g_Config.bAllowSpeedControlWhileConnected, false, CfgFlag::PER_GAME), ConfigSetting("DontDownloadInfraJson", &g_Config.bDontDownloadInfraJson, false, CfgFlag::DONT_SAVE), + // See comment in header + ConfigSetting("PSNNPID", &g_Config.sPSNNPID, "", CfgFlag::PER_GAME), + ConfigSetting("PSNPassword", &g_Config.sPSNPassword, "", CfgFlag::PER_GAME), + ConfigSetting("PSNToken", &g_Config.sPSNToken, "", CfgFlag::PER_GAME), + ConfigSetting("EnableNetworkChat", &g_Config.bEnableNetworkChat, false, CfgFlag::PER_GAME), ConfigSetting("ChatButtonPosition", &g_Config.iChatButtonPosition, (int)ScreenEdgePosition::BOTTOM_LEFT, CfgFlag::PER_GAME), ConfigSetting("ChatScreenPosition", &g_Config.iChatScreenPosition, (int)ScreenEdgePosition::BOTTOM_LEFT, CfgFlag::PER_GAME), diff --git a/Core/Config.h b/Core/Config.h index 1852e6c9bc37..f590fdd89bda 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -489,6 +489,11 @@ struct Config { bool bAllowSavestateWhileConnected; // Developer option, ini-only. No normal users need this, it's always wrong to save/load state when online. bool bAllowSpeedControlWhileConnected; // Useful in some games but not recommended. + // PSN revival servers (actual code in development by FoxLovesYou from Discord) + std::string sPSNNPID; + std::string sPSNPassword; + std::string sPSNToken; // This will be set by a login mechanism + bool bEnableWlan; std::map mHostToAlias; // Local DNS database stored in ini file bool bEnableUPnP; diff --git a/Core/HLE/sceNp.cpp b/Core/HLE/sceNp.cpp index c66a9f1799cb..96cbda5ce9e0 100644 --- a/Core/HLE/sceNp.cpp +++ b/Core/HLE/sceNp.cpp @@ -147,8 +147,9 @@ static int sceNpInit() ERROR_LOG(Log::sceNet, "UNIMPL %s()", __FUNCTION__); // We'll sanitize an extra time here, just to be safe from ini modifications. - if (g_Config.sInfrastructureUsername == SanitizeString(g_Config.sInfrastructureUsername, StringRestriction::AlphaNumDashUnderscore, 3, 16)) { - npOnlineId = g_Config.sInfrastructureUsername; + if (g_Config.sPSNNPID == SanitizeString(g_Config.sPSNNPID, StringRestriction::AlphaNumDashUnderscore, 3, 16)) { + npOnlineId = g_Config.sPSNNPID; + // There is also sPSNToken and sPSNPassword } else { npOnlineId.clear(); } diff --git a/UI/DeveloperToolsScreen.cpp b/UI/DeveloperToolsScreen.cpp index 457b9708e591..888e7bb02aa9 100644 --- a/UI/DeveloperToolsScreen.cpp +++ b/UI/DeveloperToolsScreen.cpp @@ -343,8 +343,17 @@ void DeveloperToolsScreen::CreateNetworkTab(UI::LinearLayout *list) { using namespace UI; auto dev = GetI18NCategory(I18NCat::DEVELOPER); auto ms = GetI18NCategory(I18NCat::MAINSETTINGS); + auto di = GetI18NCategory(I18NCat::DIALOG); list->Add(new ItemHeader(ms->T("Networking"))); list->Add(new CheckBox(&g_Config.bDontDownloadInfraJson, dev->T("Don't download infra-dns.json"))); + + // Note: Intensionally didn't use translation here, until we move these to the + // regular settings after the code is merged. + list->Add(new ItemHeader("PSN replacement")); + PopupTextInputChoice *usernameChoice = list->Add(new PopupTextInputChoice(GetRequesterToken(), &g_Config.sPSNNPID, di->T("Username"), "", 64, screenManager())); + usernameChoice->SetRestriction(StringRestriction::AlphaNumDashUnderscore, 3); + list->Add(new PopupTextInputChoice(GetRequesterToken(), &g_Config.sPSNPassword, di->T("Password"), "", 64, screenManager())); + list->Add(new PopupTextInputChoice(GetRequesterToken(), &g_Config.sPSNToken, "Token", "", 64, screenManager())); } void DeveloperToolsScreen::CreateGraphicsTab(UI::LinearLayout *list) {