Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Common/Net/URL.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
5 changes: 5 additions & 0 deletions Core/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
5 changes: 5 additions & 0 deletions Core/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string, std::string> mHostToAlias; // Local DNS database stored in ini file
bool bEnableUPnP;
Expand Down
5 changes: 3 additions & 2 deletions Core/HLE/sceNp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
9 changes: 9 additions & 0 deletions UI/DeveloperToolsScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Loading