Skip to content

Commit

Permalink
http: Save last-used port.
Browse files Browse the repository at this point in the history
This is necessary for better caching, in case you share often.
  • Loading branch information
unknownbrackets committed Jul 4, 2016
1 parent 057b9ed commit 9ddd7e4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Core/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ static ConfigSetting generalSettings[] = {
ConfigSetting("ReportingHost", &g_Config.sReportHost, "default"),
ConfigSetting("AutoSaveSymbolMap", &g_Config.bAutoSaveSymbolMap, false, true, true),
ConfigSetting("CacheFullIsoInRam", &g_Config.bCacheFullIsoInRam, false, true, true),
ConfigSetting("RemoteISOPort", &g_Config.iRemoteISOPort, 0, true, false),

#ifdef ANDROID
ConfigSetting("ScreenRotation", &g_Config.iScreenRotation, 1),
Expand All @@ -356,6 +357,7 @@ static ConfigSetting generalSettings[] = {
ConfigSetting("PauseWhenMinimized", &g_Config.bPauseWhenMinimized, false, true, true),
ConfigSetting("DumpDecryptedEboots", &g_Config.bDumpDecryptedEboot, false, true, true),
ConfigSetting("FullscreenOnDoubleclick", &g_Config.bFullscreenOnDoubleclick, true, false, false),

ConfigSetting(false),
};

Expand Down Expand Up @@ -510,7 +512,8 @@ static ConfigSetting graphicsSettings[] = {
ReportedConfigSetting("FragmentTestCache", &g_Config.bFragmentTestCache, true, true, true),

ConfigSetting("GfxDebugOutput", &g_Config.bGfxDebugOutput, false, false, false),
ConfigSetting(false),

ConfigSetting(false),
};

static ConfigSetting soundSettings[] = {
Expand Down Expand Up @@ -666,6 +669,7 @@ static ConfigSetting controlSettings[] = {
static ConfigSetting networkSettings[] = {
ConfigSetting("EnableWlan", &g_Config.bEnableWlan, false, true, true),
ConfigSetting("EnableAdhocServer", &g_Config.bEnableAdhocServer, false, true, true),

ConfigSetting(false),
};

Expand Down
1 change: 1 addition & 0 deletions Core/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ struct Config {
int iLockedCPUSpeed;
bool bAutoSaveSymbolMap;
bool bCacheFullIsoInRam;
int iRemoteISOPort;

int iScreenRotation; // The rotation angle of the PPSSPP UI. Only supported on Android and possibly other mobile platforms.
int iInternalScreenRotation; // The internal screen rotation angle. Useful for vertical SHMUPs and similar.
Expand Down
5 changes: 4 additions & 1 deletion UI/RemoteISOScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,12 @@ static void ExecuteServer() {
http->RegisterHandler(pair.first.c_str(), handler);
}

http->Listen(0);
if (!http->Listen(g_Config.iRemoteISOPort)) {
http->Listen(0);
}
UpdateStatus(ServerStatus::RUNNING);

g_Config.iRemoteISOPort = http->Port();
RegisterServer(http->Port());
double lastRegister = real_time_now();
while (RetrieveStatus() == ServerStatus::RUNNING) {
Expand Down

0 comments on commit 9ddd7e4

Please sign in to comment.