diff options
author | sapier <Sapier at GMX dot net> | 2013-06-23 18:30:21 +0200 |
---|---|---|
committer | kwolekr <kwolekr@minetest.net> | 2013-07-02 19:58:20 -0400 |
commit | 967121a34bbc60e6b46c7ec470b151f668ef1fef (patch) | |
tree | e5cc5ec845d3c286bcb0e203e3a5f146950bfaf1 /src/mods.cpp | |
parent | fe4ce03d529f70346b2e2c4872223ebdcd37fffa (diff) | |
download | minetest-967121a34bbc60e6b46c7ec470b151f668ef1fef.tar.gz minetest-967121a34bbc60e6b46c7ec470b151f668ef1fef.tar.bz2 minetest-967121a34bbc60e6b46c7ec470b151f668ef1fef.zip |
Replace C++ mainmenu by formspec powered one
Diffstat (limited to 'src/mods.cpp')
-rw-r--r-- | src/mods.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
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 <cctype> +#include "convert_json.h" static bool parseDependsLine(std::istream &is, std::string &dep, std::set<char> &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 |