It uses json to parse the data and curl to download the json-formated file to the server. Right after it downloads the file from the website, it checks and parses the data to check some informations, they are:
1. Name of the plugin you want to "download"
2. filename.amxx
3. Version
4. Directory
5. License option (in case you want make the plugin licensed only)
The last parameter makes the system also download other files than just .amxx files, such as .ini, .cfgs, .txts etc.
This is how the json-formated file looks like:
Code: Select all
{
"1":{
"pluginname": "Your Plugin Name",
"filename": "yourpluginname.amxx",
"directory": "addons/amxmodx/plugins",
"version": "1.0",
"licensecheck": false
}
} It will check the version of the json-formated file and the version written in the plugin (AKA register_plugin()) before downloading it as well. So to trigger the download function, make the version value of the json-formated file different from the version registered with register_plugin() and thats it.
For files without this version trigger, it'll always download no matter the sizes or versions.
It seemed to be stable for most servers I tried. I also have another one that uses EasyHTTP module.
OBS: Make sure to register your database informations if USE_LICENSE is defined.
Code: Select all
#define DATABASE_HOST "localhost"
#define DATABASE_USER "root"
#define DATABASE_PASS ""
#define DATABASE_NAME "servers" Also, register your server links as well
CURL version:
Code: Select all
// this will be where the json-formated file will be located on your website. The plugin will download it first.
new const g_szWebsitePluginsListFile[] = "https://www.yourwebsite.com/pluginsList.res"
// this will be where the downloaded file will be stored on the server.
new const g_szJsonFileDirectory[] = "resource/pluginsList.res"
// this is where your auto-download plugins will be located and downloaded afterwards.
new const g_szWebsitePluginsLink[] = "https://www.yourwebsite.com/plugins" Code: Select all
// this will be where the json-formated file will be located on your website. The plugin will download it first.
new const g_szWebsitePluginsListFile[] = "http://www.yourwebsite.com/pluginsList.res"
// this will be where the downloaded file will be stored on the server.
new const g_szJsonFileDirectory[] = "resource/pluginsList.res"
// this is where your auto-download plugins will be located and downloaded afterwards.
new const g_szWebsitePluginsLink[] = "https://www.yourwebsite.com/plugins"Thats all.
