#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)
{
return packages;
}
-
#endif
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
*/
#define LATEST_PROTOCOL_VERSION 36
+#define LATEST_PROTOCOL_VERSION_STRING TOSTRING(LATEST_PROTOCOL_VERSION)
// Server's supported network protocol range
#define SERVER_PROTOCOL_VERSION_MIN 36
#include <IFileArchive.h>
#include <IFileSystem.h>
#include "client/renderingengine.h"
+#include "network/networkprotocol.h"
/******************************************************************************/
int ModApiMainMenu::l_get_package_list(lua_State *L)
{
std::string url = g_settings->get("contentdb_url");
- std::vector<Package> packages = getPackagesFromURL(url + "/api/packages/");
+ std::vector<Package> packages = getPackagesFromURL(url +
+ "/api/packages/?type=mod&type=game&type=txp&protocol_version="
+ LATEST_PROTOCOL_VERSION_STRING);
// Make table
lua_newtable(L);