Raised This Month: $51 Target: $400
 12% 

Updater


Post New Thread Reply   
 
Thread Tools Display Modes
GoD-Tony
Veteran Member
Join Date: Jul 2005
Old 10-24-2011 , 07:21   Re: Updater
Reply With Quote #31

Quote:
Originally Posted by klausenbusk View Post
Idea: I will make a plugin, who add auto-update feature to plugin there not have it.
If I'm understanding correctly, I don't think this will work because the Updater_AddPlugin native will only add the plugin that calls it.
__________________

Last edited by GoD-Tony; 10-24-2011 at 07:22.
GoD-Tony is offline
Thrawn2
Veteran Member
Join Date: Apr 2009
Old 10-24-2011 , 08:50   Re: Updater
Reply With Quote #32

Quote:
Originally Posted by GoD-Tony View Post
If I'm understanding correctly, I don't think this will work because the Updater_AddPlugin native will only add the plugin that calls it.
Damn it. Then i don't need to continue my proof-of-concept that this system could be the foundation to a sourcemod plugin repository.
The plan was to have a plugin that handles several repository-sources, much like /etc/apt/sources.list.
It would contain a repo-name + url to an updater config. The config would contain several trees (or to be precise: their package-lists) that repository provides and update them using Updater --> Part 1 is done, you have self-updating packagelists.
The same/Another plugin would then parse these package-lists, which basically contain all packages (as in plugins/extensions) in that tree and an URL to their updater config. It would hook itself into the admin menu and allow you to select packages you'd want to install by feeding the url from the package-info to Updater_AddPlugin(). -> Part 2 is done.

Second thought: I'll start with a question: Is the same plugin allowed to call Updater_AddPlugin() several times? Then this might be a non-problem, as i only care about installing those packages in the first place and all "new" files could be considered as belonging to the Installer-Plugin. Or does it unload itself when downloading starts or sth?
__________________
einmal mit profis arbeiten. einmal.
Thrawn2 is offline
klausenbusk
AlliedModders Donor
Join Date: Jan 2011
Old 10-24-2011 , 10:11   Re: Updater
Reply With Quote #33

Quote:
Originally Posted by GoD-Tony View Post
If I'm understanding correctly, I don't think this will work because the Updater_AddPlugin native will only add the plugin that calls it.
In this plugin you use:
PHP Code:
Updater_AddPlugin(GetMyHandle(), UPDATE_URL); 
Would it not also be possible to do like this?
PHP Code:
Updater_AddPlugin(FindPluginByFile("test.smx"), UPDATE_URL); 
klausenbusk is offline
GoD-Tony
Veteran Member
Join Date: Jul 2005
Old 10-24-2011 , 11:25   Re: Updater
Reply With Quote #34

Quote:
Originally Posted by Thrawn2 View Post
I'll start with a question: Is the same plugin allowed to call Updater_AddPlugin() several times?
Calling Updater_AddPlugin more than once only updates the URL for that plugin.

Quote:
Originally Posted by Thrawn2 View Post
Or does it unload itself when downloading starts or sth?
No plugins are automatically removed unless they are unload/reloaded.

Quote:
Originally Posted by klausenbusk View Post
In this plugin you use:
PHP Code:
Updater_AddPlugin(GetMyHandle(), UPDATE_URL); 
Would it not also be possible to do like this?
PHP Code:
Updater_AddPlugin(FindPluginByFile("test.smx"), UPDATE_URL); 
That's because Updater is calling it's own internal function, which is different from the native.

All of Updater's natives/fowards are only meant to interact with the single plugin that's being updated. The reason for it is to prevent plugins from conflicting with each others' updates. What would happen if you added an external plugin to Updater, and then that plugin itself included Updater support?

It sounds like you're looking for natives like these:
Code:
native Updater_AddExternalPlugin(Handle:plugin, const String:url[]); native Updater_RemoveExternalPlugin(Handle:plugin);
Your plugin still wouldn't know which plugins have been updated as there is no global forward for that either. I am open for suggestions, but I'd like to see a clear solution before I start adding new API.
__________________
GoD-Tony is offline
klausenbusk
AlliedModders Donor
Join Date: Jan 2011
Old 10-24-2011 , 12:19   Re: Updater
Reply With Quote #35

Quote:
Originally Posted by GoD-Tony View Post
It sounds like you're looking for natives like these: Code:
PHP Code:
native Updater_AddExternalPlugin(Handle:plugin, const String:url[]); 
native Updater_RemoveExternalPlugin(Handle:plugin); 
Your plugin still wouldn't know which plugins have been updated as there is no global forward for that either. I am open for suggestions, but I'd like to see a clear solution before I start adding new API.
Maybe:
PHP Code:
native Updater_AddExternalPlugin(Handle:plugin, &Handle:plugin2, const String:url[]); 
native Updater_RemoveExternalPlugin(Handle:plugin); 
Where plugin2, is where to send the forward. (plugin2 should be optional, can't remember how )
klausenbusk is offline
Thrawn2
Veteran Member
Join Date: Apr 2009
Old 10-24-2011 , 13:11   Re: Updater
Reply With Quote #36

After taking a peek at the code, it would indeed be tedious to implement what i'm trying to achieve without changing the whole concept.
Basically i would like to use the downloading+parsing but without the forced plugin relation.
I don't want to reinvent (the axis of) the wheel, any chance you could remove the plugin-specific stuff from your download-queue + parsing stuff and expose them as natives?
I might have missed something here because i only skimmed through, sorry if thats the case ;)

E.g.:
Create a function that takes an updater-url and downloads it.
Create another function to parse it for version information etc.
Create another function to download all files it mentioned.
Use these functions yourself, re-adding any plugin-relations you had before outside of their scope.
Expose these functions.

-> Both of our ideas should be doable then, using the same core.
__________________
einmal mit profis arbeiten. einmal.
Thrawn2 is offline
GoD-Tony
Veteran Member
Join Date: Jul 2005
Old 10-25-2011 , 05:46   Re: Updater
Reply With Quote #37

Updater 1.1.0 released - Changelog

Updater 1.1.1 released - Changelog
__________________

Last edited by GoD-Tony; 10-30-2011 at 06:56.
GoD-Tony is offline
GoD-Tony
Veteran Member
Join Date: Jul 2005
Old 10-25-2011 , 06:01   Re: Updater
Reply With Quote #38

Quote:
Originally Posted by r3dw3r3w0lf View Post
What is this, i don't even.
How did this happen? What were you testing?
__________________
GoD-Tony is offline
napalm00
Veteran Member
Join Date: Jun 2011
Location: Italy, sadly
Old 10-25-2011 , 06:04   Re: Updater
Reply With Quote #39

Maybe this?
__________________
napalm00 is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 10-25-2011 , 06:05   Re: Updater
Reply With Quote #40

That explains a lot, thanks. lol

Figured it was your plugin since it started to happen right after your last update. lol

Last edited by Drixevel; 10-25-2011 at 06:07.
Drixevel is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:52.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode