Description
[u][b]UpSync[/b][/u]
[b]YOU CAN ONLY USE UPSYNC IF YOR PLUGIN IS APPROVED AND INSTALLED WITH ES_INSTALL![/b]
[b][u]What is UpSync?[/u][/b]
UpSync is a .py file that you put in your addons directory (/eventscripts/URPLUGIN/upsync/upsync.py). It gives your plugin the ability to autoupdate or just update with a cmd.
[b][u]How do I add this to my plugin?[/u][/b]
Easy!
[b]Step 1[/b]: download upsync.py and place it in ../eventscripts/YOURADDONFOLDER/upsync/<place it here>.
[b]Step 2[/b]: change the 4 variables in the configuration section of upsync.py (you can open .py files with text editors!)
[code]# configurations
addonName = 'addonName'
addonESDM = 'addonEventscriptsDownloadManagerName'
addonUpdateCmd = 'updatemyprogram' # make it unique!
autoUpdateOnMapStart = True[/code]
set addonName to the addons directory name in eventscript/ ex. eventscripts/lol would be 'lol'
set addonESDM to the addons esdm name ex. http://addons.eventscripts.com/addons/view/[u]deathrunv2[/u] would be 'deathrunv2'
set addonUpdateCmd to the command you want to update with ex. 'myplugin_update'
you can keep autoUpdateOnMapStart to true if you want it to automaticly synchronize when the map changes.
if you dont set autoUpdateOnMapStart to true you should somewere add es.server.queuecmd('YOUR UPDATE CMD') to update your plugin!
[b]Step 3[/b]: add es_load YOURPLUGINNAME/upsync or es.load('YOURPLUGINNAME/upsync') to your addons load block.
AND if you set autoUpdateOnMapStart to false then you should also add es.server.queuecmd('yourupdatecmd') in the load block as well (after the es_load cmd!)