Plugin Autoupdater
3 Attachment(s)
Allows plugin writers to add a few lines of code to their plugin to let it update itself.
Requires the Socket Extension. Thanks to exvel for a seemingly endless stream of bug reports and p3tsin and Matthias Vance for help with downloading files. Cvars: sm_autoupdate_binary (1) - Download binaries? sm_autoupdate_source (1) - Download sources? sm_autoupdate_gamedata (1) - Download gamedata files? sm_autoupdate_other (1) - Download other files? sm_autoupdate_backup (1) - Save backups of old versions? When set to 1, saves backups of old versions to addons/sourcemod/plugins/disabled/backups Commands: sm_autoupdate_check [filename/idx] - Checks for updates but doesn't download anything. Leave idx blank to check all plugins. (logs results to sourcemod/logs/autoupdate.log) sm_autoupdate_download [filename/idx] - Checks for updates and downloads them. Leave idx blank to update all plugins. (logs results to sourcemod/logs/autoupdate.log) sm_autoupdate_list - Returns the list of plugins that will be updated. sm_autoupdate_rem <filename/idx> - Stops a plugin being autoupdated. Get idx from sm_autoupdate_list. sm_autoupdate_block_add <filename> - Adds a plugin to the block list. Plugins in the block list won't be added to the autoupdate list. (eg sm_autoupdate_block_add autoupdate.smx) sm_autoupdate_block_rem <filename/idx> - Removes a plugin from the block list. sm_autoupdate_block_list - Lists blocked plugins. Todo: Translation support Making your plugin autoupdate: Include autoupdate in your plugin and use the AutoUpdate_AddPlugin()/AutoUpdate_RemovePlugin() natives. Example plugin: PHP Code:
Code:
<plugin> When sm_autoupdate_download is ran, the plugin will try to download 127.0.0.1/auexample.smx, 127.0.0.1/auexample.sp, 127.0.0.1/folder/auexample.games.txt and so on. You do not need to add gamedata/source/other. (you only need the version, but what use would that be?) The plugin doesn't update itself because if I didn't keep making stupid mistakes it wouldn't need to :D |
Re: Plugin Autoupdater
Wow, this is AWESOME. Good work!
|
Re: Plugin Autoupdater
So I need a hosting for making a such plugin that is able to autoupdate, right?
Also if answer: yes, you can write a manual of how to post your plugin in free svn service or something like google code. |
Re: Plugin Autoupdater
Quote:
|
Re: Plugin Autoupdater
Quote:
p.s. anyway, good job +karma |
Re: Plugin Autoupdater
What should I write here? New version number or update description?
Quote:
|
Re: Plugin Autoupdater
Also about a suggestion that is already in your ToDo list. Custom files tag:
Quote:
p.s. google code example: http://code.google.com/p/showhealth/downloads/list |
Re: Plugin Autoupdater
Quote:
Quote:
Code:
<other dir="sounds">annoying1.mp3,annoying2.mp3,annoying3.mp3</other> |
Re: Plugin Autoupdater
Yeap this is very close to what I expected but this would be looks better I think:
Code:
<other dir="sounds">annoying1.mp3</other> Code:
sm_autoupdate_check |
Re: Plugin Autoupdater
Try AutoUpdate_AddPlugin("showhealth.googlecode.c om", "/files/version.xml", PLUGIN_VERSION);
edit: I don't know why it's adding a space :| |
Re: Plugin Autoupdater
Quote:
PHP Code:
Code:
sm_autoupdate_check |
Re: Plugin Autoupdater
Updated to 1.1 which fixes the datapack error (along with a few others) but I can't get it work for anything other than 127.0.0.1.
|
Re: Plugin Autoupdater
Step by step it works better and better. :)
Now I can download files but... Code:
sm_autoupdate_download PHP Code:
|
Re: Plugin Autoupdater
Would be 10x more useful if we could host our plugins to be auto-updated from the AlliedModders site.
Fast suggestions: * Add support for updating extensions. Delay overwriting the extension until the server is restarted? Notify the user to restart server when a new extension is downloaded. * Add some kind of checksum support, something simple like MD5. Don't want to download a file that's corrupt and have it overwrite our stuff, now do we? Very sweet btw, I wanted to do this feature myself for my plugin to make distribution simpler, but though that such a feature should be applicable across all plugins. Unfortunately I did not realize that plugins can call code from other plugins via CreateNative. What a nice breakthrough! |
Re: Plugin Autoupdater
Quote:
Quote:
|
Re: Plugin Autoupdater
I release updates that often add significant functionality updates (especially when its major bug fixes) to my plugins, so having a way to deploy it faster will be invaluable. Unfortunately I've also recently started to require an extension (that I also develop), so having a way to automatically update that would be prime.
BTW, MikeJS do you hang out on #sourcemod ? |
Re: Plugin Autoupdater
Quote:
|
Re: Plugin Autoupdater
Quote:
Quote:
|
Re: Plugin Autoupdater
MikeJS, did you find a problem that I wrote above? Or it is google code issue? I didn't find any other good file/code hostings so I hope you will change plugin to work with google code.
Also it is strnage that version.xml downloads without any problems but other files has this strange html code. |
Re: Plugin Autoupdater
Try using:
Code:
<binary>\files\showhealth.smx</binary> |
Re: Plugin Autoupdater
1 Attachment(s)
I've already tried adding empty gamedata file and the only differece is that now it downloads an another html code but not a real plugin's code.
I looked into the code and found that download processes for all files happen in one moment so maybe google refuses more than 1 connection at the moment? |
Re: Plugin Autoupdater
Ok upon thinking about this.. why do you need a plugin to add autoupdate support to itself via code? Why not do it via some kind of configuration file.
i.e. to add support to autoupdate a plugin called abc.smx we go to data/autoupdate/abc.txt and it is a key-value file with the URL to the XML file? Code:
//Filename: abc.txt ------------------ You could try iterating the plugins with GetPluginIterator/MorePlugins/ReadPlugin then with GetPluginFilename see if there's any matches entries in data/autoupdate and if there is then you just associate them with it. GetPluginInfo or "sm plugins list" to get the version of the loaded plugin :). |
Re: Plugin Autoupdater
Is it possible to add ftp support?
|
Re: Plugin Autoupdater
Quote:
Quote:
|
Re: Plugin Autoupdater
Quote:
I've been waiting for something like this guys. Keep up the good work! |
Re: Plugin Autoupdater
it working on Left 4 Dead SourceMod Plugin?
And i don't know how to use it- - Thanks a lot:) |
Re: Plugin Autoupdater
Tryed svn 2 http url:
http://code.google.com/p/showhealth/...wse/#svn/trunk showhealth.smx: http://showhealth.googlecode.com/svn...showhealth.smx showhealth.sp: http://showhealth.googlecode.com/svn.../showhealth.sp :( Same result. Text in .sp and .smx files: Quote:
|
Re: Plugin Autoupdater
Have you tried using code.google.com in the .sp and
Code:
<source>\p\showhealth\source\browse\trunk\scripting\showhealth.sp</source> |
Re: Plugin Autoupdater
http://code.google.com/p/showhealth/.../showhealth.sp is incorrect page, it shows info about file.
This one is a direct link: http://showhealth.googlecode.com/svn.../showhealth.sp and I tested plugin with it. Also version.xml downloads well so I think links are correct. Mike, please figure it out. I am sure that something wrong inside plugin's downloading code. Maybe it is better to make a line for downloading-files so they won't download at the same time. |
Re: Plugin Autoupdater
Updated the plugin so it actually works with something other than XAMPP (use "/" rather than "\" in the xml file now). Also added a public cvar because I forgot to add it before.
|
Re: Plugin Autoupdater
Jesus Christ! It works now.
Good job. :up: |
Re: Plugin Autoupdater
Waiting for custom files support. :)
p.s. or at least translations |
Re: Plugin Autoupdater
Updated to 1.3: can download multiple files of the same type (comma separated), can download "other" files and has cvars for controlling what it downloads.
Will be adding a config file and maybe translations shortly. |
Re: Plugin Autoupdater
I am glad to see that this awsome plugin is becoming better and better. I hope in the future there will be an admin menu so root admins would be able to update plugins or specific plugin just as easy as they can slay/slay players, etc. :)
Also, useful topic about MD5 hashing: http://forums.alliedmods.net/showthread.php?t=90326 |
Re: Plugin Autoupdater
Quote:
MD5: I forgot about that :mrgreen: |
Re: Plugin Autoupdater
Quote:
p.s. found a nice little prog for getting md5 checksum: http://diamondcs.com.au/freeutilities/md5.php |
Re: Plugin Autoupdater
Just to clarify, I could with some sp coding, store in a MySQL db, which plugins should be deployed (true/false flags and have the files store in one place) to which game servers, along with cfg and what every else I need in the way of data files too, have them sent on command.
Its not clear on their removal and also what happens if the file is already stored locally? Matt |
Re: Plugin Autoupdater
if you see http://forums.alliedmods.net/showthread.php?t=73119 you'll uderstand where I am going with the question.
Matt |
Re: Plugin Autoupdater
Quote:
Quote:
|
Re: Plugin Autoupdater
Do i need to download autoupdate.smx in order to make it works fine?
|
All times are GMT -4. The time now is 12:29. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.