From 02b418e711fd6404238a46e818066efde7e021a4 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 7 Oct 2018 14:53:38 -0700 Subject: [PATCH] http: Allow pbp and ppdmp files too. Also cleanup a bit. --- Core/WebServer.cpp | 19 +++++++++++++++++- Core/WebServer.h | 2 ++ UI/RemoteISOScreen.cpp | 44 +++++++++++++++++------------------------- 3 files changed, 38 insertions(+), 27 deletions(-) diff --git a/Core/WebServer.cpp b/Core/WebServer.cpp index 284c1c0333..92fb5b2c39 100644 --- a/Core/WebServer.cpp +++ b/Core/WebServer.cpp @@ -106,6 +106,23 @@ static void RegisterServer(int port) { } } +bool RemoteISOFileSupported(const std::string &filename) { + // Disc-like files. + if (endsWithNoCase(filename, ".cso") || endsWithNoCase(filename, ".iso")) { + return true; + } + // May work - but won't have supporting files. + if (endsWithNoCase(filename, ".pbp")) { + return true; + } + // Debugging files. + if (endsWithNoCase(filename, ".ppdmp")) { + return true; + } + return false; + +} + static void RegisterDiscHandlers(http::Server *http, std::unordered_map *paths) { for (std::string filename : g_Config.recentIsos) { #ifdef _WIN32 @@ -118,7 +135,7 @@ static void RegisterDiscHandlers(http::Server *http, std::unordered_map responseHeaders; - std::string subdir ="/"; + std::string subdir = "/"; size_t offset; if (g_Config.bRemoteISOManual) { subdir = g_Config.sRemoteISOSubdir; offset=subdir.find_last_of("/"); if (offset != subdir.length() - 1 && offset != subdir.npos) { - //truncate everything after last / + // Truncate everything after last / subdir.erase(offset + 1); } } @@ -136,7 +136,7 @@ static bool LoadGameList(const std::string &host, int port, std::vector