diff --git a/Core/Config.cpp b/Core/Config.cpp index bb95c18661..dad7351f36 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -349,6 +349,8 @@ static ConfigSetting generalSettings[] = { ConfigSetting("RemoteISOPort", &g_Config.iRemoteISOPort, 0, true, false), ConfigSetting("LastRemoteISOServer", &g_Config.sLastRemoteISOServer, ""), ConfigSetting("LastRemoteISOPort", &g_Config.iLastRemoteISOPort, 0), + ConfigSetting("RemoteISOManualConfig", &g_Config.bRemoteISOManual, false), + ConfigSetting("RemoteISOSubdir", &g_Config.sRemoteISOSubdir, "/"), #ifdef __ANDROID__ ConfigSetting("ScreenRotation", &g_Config.iScreenRotation, 1), diff --git a/Core/Config.h b/Core/Config.h index 6e51a279b9..c831cd10fe 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -143,6 +143,8 @@ public: int iRemoteISOPort; std::string sLastRemoteISOServer; int iLastRemoteISOPort; + bool bRemoteISOManual; + std::string sRemoteISOSubdir; bool bMemStickInserted; int iScreenRotation; // The rotation angle of the PPSSPP UI. Only supported on Android and possibly other mobile platforms. diff --git a/UI/RemoteISOScreen.cpp b/UI/RemoteISOScreen.cpp index d6fda4c00d..6bafc1f929 100644 --- a/UI/RemoteISOScreen.cpp +++ b/UI/RemoteISOScreen.cpp @@ -198,51 +198,52 @@ static bool FindServer(std::string &resultHost, int &resultPort) { return true; } - // Start by requesting a list of recent local ips for this network. - if (http.Resolve(REPORT_HOSTNAME, REPORT_PORT)) { - if (http.Connect()) { - code = http.GET("/match/list", &result); - http.Disconnect(); - } - } - - if (code != 200 || scanCancelled) { - return false; - } - - std::string json; - result.TakeAll(&json); - - JsonReader reader(json.c_str(), json.size()); - if (!reader.ok()) { - return false; - } - - const json_value *entries = reader.root(); - if (!entries) { - return false; - } - - std::vector servers; - const json_value *entry = entries->first_child; - while (entry) { - const char *host = entry->getString("ip", ""); - int port = entry->getInt("p", 0); - - char url[1024] = {}; - snprintf(url, sizeof(url), "http://%s:%d", host, port); - servers.push_back(url); - - if (http.Resolve(host, port) && http.Connect()) { - http.Disconnect(); - resultHost = host; - resultPort = port; - return true; + if(!g_Config.bRemoteISOManual) { + // Start by requesting a list of recent local ips for this network. + if (http.Resolve(REPORT_HOSTNAME, REPORT_PORT)) { + if (http.Connect()) { + code = http.GET("/match/list", &result); + http.Disconnect(); + } } - entry = entry->next_sibling; - } + if (code != 200 || scanCancelled) { + return false; + } + std::string json; + result.TakeAll(&json); + + JsonReader reader(json.c_str(), json.size()); + if (!reader.ok()) { + return false; + } + + const json_value *entries = reader.root(); + if (!entries) { + return false; + } + + std::vector servers; + const json_value *entry = entries->first_child; + while (entry) { + const char *host = entry->getString("ip", ""); + int port = entry->getInt("p", 0); + + char url[1024] = {}; + snprintf(url, sizeof(url), "http://%s:%d", host, port); + servers.push_back(url); + + if (http.Resolve(host, port) && http.Connect()) { + http.Disconnect(); + resultHost = host; + resultPort = port; + return true; + } + + entry = entry->next_sibling; + } + } // None of the local IPs were reachable. return false; } @@ -252,8 +253,13 @@ static bool LoadGameList(const std::string &host, int port, std::vector responseHeaders; + std::string subdir ="/"; - // Start by requesting a list of recent local ips for this network. + if (g_Config.bRemoteISOManual) { + subdir = g_Config.sRemoteISOSubdir; + } + + // Start by requesting the list of games from the server. if (http.Resolve(host.c_str(), port)) { if (http.Connect()) { code = http.GET("/", &result,responseHeaders); @@ -291,12 +297,12 @@ static bool LoadGameList(const std::string &host, int port, std::vector