summaryrefslogtreecommitdiff
path: root/src/content
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2018-07-29 00:26:03 +0100
committerGitHub <noreply@github.com>2018-07-29 00:26:03 +0100
commit14011bdc7a86f693409f218a8ce2c32dd8f4fe89 (patch)
tree89fa6b6e352d6ed98d256bfd33aba9b631e84c76 /src/content
parent2b83af783bc85963c8088d354ebc9eaea17a92b9 (diff)
downloadminetest-14011bdc7a86f693409f218a8ce2c32dd8f4fe89.tar.gz
minetest-14011bdc7a86f693409f218a8ce2c32dd8f4fe89.tar.bz2
minetest-14011bdc7a86f693409f218a8ce2c32dd8f4fe89.zip
Add protocol_version and supported package types to ContentDB urls
Diffstat (limited to 'src/content')
-rw-r--r--src/content/packages.cpp7
-rw-r--r--src/content/packages.h5
2 files changed, 7 insertions, 5 deletions
diff --git a/src/content/packages.cpp b/src/content/packages.cpp
index dd7574d48..2d488eb76 100644
--- a/src/content/packages.cpp
+++ b/src/content/packages.cpp
@@ -25,6 +25,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "content/mods.h"
#include "content/subgames.h"
+std::string Package::getDownloadURL(const std::string &baseURL) const
+{
+ return baseURL + "/packages/" + author + "/" + name + "/releases/" +
+ std::to_string(release) + "/download/";
+}
+
#if USE_CURL
std::vector<Package> getPackagesFromURL(const std::string &url)
{
@@ -60,5 +66,4 @@ std::vector<Package> getPackagesFromURL(const std::string &url)
return packages;
}
-
#endif
diff --git a/src/content/packages.h b/src/content/packages.h
index fc60d5703..9029475ef 100644
--- a/src/content/packages.h
+++ b/src/content/packages.h
@@ -39,10 +39,7 @@ struct Package
type.empty() || release <= 0);
}
- std::string getDownloadURL(const std::string &baseURL) const
- {
- return baseURL + "/packages/" + author + "/" + name + "/download/";
- }
+ std::string getDownloadURL(const std::string &baseURL) const;
};
#if USE_CURL