AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   Updater (https://forums.alliedmods.net/showthread.php?t=169095)

GoD-Tony 10-24-2011 07:21

Re: Updater
 
Quote:

Originally Posted by klausenbusk (Post 1582356)
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.

Thrawn2 10-24-2011 08:50

Re: Updater
 
Quote:

Originally Posted by GoD-Tony (Post 1582380)
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?

klausenbusk 10-24-2011 10:11

Re: Updater
 
Quote:

Originally Posted by GoD-Tony (Post 1582380)
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); 


GoD-Tony 10-24-2011 11:25

Re: Updater
 
Quote:

Originally Posted by Thrawn2 (Post 1582422)
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 (Post 1582422)
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 (Post 1582454)
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.

klausenbusk 10-24-2011 12:19

Re: Updater
 
Quote:

Originally Posted by GoD-Tony (Post 1582490)
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 :D)

Thrawn2 10-24-2011 13:11

Re: Updater
 
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.

GoD-Tony 10-25-2011 05:46

Re: Updater
 
Updater 1.1.0 released - Changelog

Updater 1.1.1 released - Changelog

GoD-Tony 10-25-2011 06:01

Re: Updater
 
Quote:

Originally Posted by r3dw3r3w0lf (Post 1582860)
What is this, i don't even.

How did this happen? What were you testing?

napalm00 10-25-2011 06:04

Re: Updater
 
Maybe this?

Drixevel 10-25-2011 06:05

Re: Updater
 
That explains a lot, thanks. lol

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


All times are GMT -4. The time now is 19:40.

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