From 967121a34bbc60e6b46c7ec470b151f668ef1fef Mon Sep 17 00:00:00 2001 From: sapier Date: Sun, 23 Jun 2013 18:30:21 +0200 Subject: Replace C++ mainmenu by formspec powered one --- src/mods.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/mods.cpp') diff --git a/src/mods.cpp b/src/mods.cpp index 9bcf73aa7..75c2dd89c 100644 --- a/src/mods.cpp +++ b/src/mods.cpp @@ -18,6 +18,7 @@ with this program; if not, write to the Free Software Foundation, Inc., */ #include "mods.h" +#include "main.h" #include "filesys.h" #include "strfnd.h" #include "log.h" @@ -25,6 +26,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "settings.h" #include "strfnd.h" #include +#include "convert_json.h" static bool parseDependsLine(std::istream &is, std::string &dep, std::set &symbols) @@ -389,3 +391,29 @@ void ModConfiguration::resolveDependencies() // Step 4: write back list of unsatisfied mods m_unsatisfied_mods.assign(unsatisfied.begin(), unsatisfied.end()); } + +#if USE_CURL +Json::Value getModstoreUrl(std::string url) +{ + struct curl_slist *chunk = NULL; + + bool special_http_header = true; + + try{ + special_http_header = g_settings->getBool("modstore_disable_special_http_header"); + } + catch(SettingNotFoundException &e) { + } + + if (special_http_header) + chunk = curl_slist_append(chunk, "Accept: application/vnd.minetest.mmdb-v1+json"); + + Json::Value retval = fetchJsonValue(url,chunk); + + if (chunk != NULL) + curl_slist_free_all(chunk); + + return retval; +} + +#endif -- cgit v1.2.3