View Single Post
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 11-29-2023 , 04:02   Re: [AMX] Auto Updater
Reply With Quote #4

Quote:
Originally Posted by fysiks View Post
The concept of a license makes absolutely no sense in a plugin so I'm not sure why you would think it makes any sense here. I have a feeling that what you're doing here has nothing to do with "licensing" and probably needs renamed to something more accurate.
Well maybe you are right. Licensing was the first thing that came up on my mind for me to name something that means that the plugin needs make sure whether the server is allowed to download the updated version of the plugin for some reason. This feature was on the cURL version since the beginning when I started building this and I stopped using it on the EasyHTTP afterwards.

Quote:
Originally Posted by fysiks View Post
Also, for the cURL version (the only one I looked at), you provide no information about cURL which you should provide since it's not part of AMX Mod X. Even if it's a link, it would be better than nothing.
On the link constants, there are descriptions on how you set ip up to be able to connect. I thought it was enough for people to understand.

Quote:
Originally Posted by fysiks View Post
However, overall, I don't really understand the purpose of this plugin. It looks like it only makes sense for a single server and you have to do all the work to put the plugin and its files onto a website with the proper organization so why not just put them on the server directly?
Think a little: the system downloads plugins automatically without you having to touch the server. Imagine you have 20 servers using 7 plugins you created. With this, you just upload all 7 plugins on your website and the system will download all updated plugins for all servers at once without you having to install them manually on all 20 servers. It helped me a while ago with a lot of plugins I built for users. Sometimes I lost the FTP data or had too much auto connections registered on File Zilla. With this all I had to do was update the plugin from my website and all servers got the plugin updated, saving me a lot of time.

Quote:
Originally Posted by fysiks View Post
Speaking of file organization on your website for being downloaded, what exactly is the required setup there? You mention being able to download plugin resources but I don't see how, do you have an example of this configuration?
Lets say your site is named www.forums.alliedmods.net
On the cURL, it will be:

PHP Code:
new const g_szWebsitePluginsListFile[] =     "https://www.forums.alliedmods.net/pluginsList.res"
new const g_szJsonFileDirectory[] =         "resource/pluginsList.res"
new const g_szWebsitePluginsLink[] =     "https://www.forums.alliedmods.net/plugins" 
All the plugins you want to auto update will be inside the plugins folder on your website.
The json-formated file will be also hosted on your website (pluginsList.res), it will be the first download the plugin will do to check the informations before starting to download the new versions avaliable.

So lets say I want to update a plugin called Kill Display, with filename killdisplay.amxx

On the json-formated file, it'll be

PHP Code:
{
    
"1":{
        
"pluginname""Kill Display",
        
"filename""killdisplay.amxx",
        
"directory""addons/amxmodx/plugins",
        
"version""1.1"// To trigger the download, I changed the previous version to the same version registered in register_plugin("Kill Display", "1.1", "EFFEX"), before it was 1.0
        
"licensecheck"false // this will ignore the IP check, everybody can update this plugin
    
}

With EasyHTTP:

PHP Code:
new const g_szWebsitePluginsListFile[] =     "http://www.forums.alliedmods.net/pluginsList.res"
new const g_szJsonFileDirectory[] =         "resource/pluginsList.res"
new const g_szWebsitePluginsLink[] =     "https://www.forums.alliedmods.net/plugins" 
Json-formated file:

PHP Code:
{
    
"1":{
        
"pluginname""Kill Display",
        
"filename""killdisplay.amxx",
        
"directory""addons/amxmodx/plugins",
        
"version""1.1" // To trigger the download, I changed the previous version to the same version registered in register_plugin("Kill Display", "1.1", "EFFEX"), before it was 1.0
    
}

To register any other file:

PHP Code:
{
    
"1":{
        
"pluginname""Plugins Languages",
        
"filename""translations.txt",
        
"directory""addons/amxmodx/data/lang"
    
}

In this case, it will be always downloaded on every map start since there is no version or file size checking avaliable for me to use before the download feature to trigger.
So in the end:

cURL:

PHP Code:
{
    
"1":{
        
"pluginname""Kill Display",
        
"filename""killdisplay.amxx",
        
"directory""addons/amxmodx/plugins",
        
"version""1.1"// To trigger the download, I changed the previous version to the same version registered in register_plugin("Kill Display", "1.1", "EFFEX"), before it was 1.0
        
"licensecheck"false // this will ignore the IP check, everybody can update this plugin
    
},
    
"2":{
        
"pluginname""Plugins Languages",
        
"filename""translations.txt",
        
"directory""addons/amxmodx/data/lang",
        
"licensecheck"false // this will ignore the IP check, everybody can update this .txt file
    
}

EasyHTTP:

PHP Code:
{
    
"1":{
        
"pluginname""Kill Display",
        
"filename""killdisplay.amxx",
        
"directory""addons/amxmodx/plugins",
        
"version""1.1" // To trigger the download, I changed the previous version to the same version registered in register_plugin("Kill Display", "1.1", "EFFEX"), before it was 1.0
    
},
    
"2":{
        
"pluginname""Plugins Languages",
        
"filename""translations.txt",
        
"directory""addons/amxmodx/data/lang"
    
}

__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 11-29-2023 at 11:32.
EFFx is offline