1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-02 16:38:41 +00:00

Add protocol_version and supported package types to ContentDB urls

This commit is contained in:
rubenwardy 2018-07-29 00:26:03 +01:00 committed by GitHub
parent 2b83af783b
commit 14011bdc7a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 6 deletions

View file

@ -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

View file

@ -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