Basically, it is a system that downloads new versions of your plugins automatically without having to install them manually. It also has a 'license' type of system that checks the IP of the server before downloading updates for the registered plugins. This option can be disabled since some hosts make the use of get_user_ip(0, useless.
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:
PHP Code:
{
"1":{
"pluginname": "Your Plugin Name",
"filename": "yourpluginname.amxx",
"directory": "addons/amxmodx/plugins",
"version": "1.0",
"licensecheck": false
}
}
If
licensecheck is
true, the plugin will check the IP of the server into the database before downloading the file, otherwise, just will download it.
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.
PHP Code:
#define DATABASE_HOST "localhost"
#define DATABASE_USER "root"
#define DATABASE_PASS ""
#define DATABASE_NAME "servers"
(The EasyHTTP version doesn't use IP checker, it will download all the listed files since licensecheck key is not listed on the json-formated file).
Also, register your server links as well
CURL version:
PHP Code:
// 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"
EasyHTTP:
PHP Code:
// 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.