Plugin folder vs plugin name
#1
I've been thinking about this and I keep noticing this needs more attention.

Currently the plugins are loaded based on the folder name. This folder name is in turn assigned into the plugin name variable; but that one can be changed by the plugin itself using the cPlugin:SetName() call. I've always wondered why this would be needed at all, and now I have a perfect usecase:

Consider someone downloads a plugin from GitHub using their ZIP download facility. When extracted, this results in a "<RepoName_master>" folder for the plugin. But if that plugin provides any kind of inter-plugin API (accessible via cPluginManager:CallPlugin), the calls won't work because they currently use the plugin's folder to identify the plugin, not the name.

So I have this proposal:
- Use plugin folder to identify plugins to load in the settings.ini
- Each plugin should use the cPlugin:SetName() function to set a well-defined name, if it exposes any functionality as a callable API
- Change MCServer so that it identifies plugin calls by the plugin name, rather than the folder
- Change cPluginManager:GetAllPlugins() binding so that it returns a map of PluginName -> cPlugin, rather than PluginFolder -> cPlugin
- Change Core's Plugin page to handle the changes correctly

What do you think, is this reasonable?
Reply
Thanks given by:


Messages In This Thread
Plugin folder vs plugin name - by xoft - 04-17-2015, 09:19 PM
RE: Plugin folder vs plugin name - by NiLSPACE - 04-17-2015, 09:21 PM
RE: Plugin folder vs plugin name - by tigerw - 04-18-2015, 09:18 AM
RE: Plugin folder vs plugin name - by xoft - 04-18-2015, 09:24 PM
RE: Plugin folder vs plugin name - by xoft - 04-19-2015, 07:25 PM
RE: Plugin folder vs plugin name - by jan64 - 04-23-2015, 08:55 PM
RE: Plugin folder vs plugin name - by NiLSPACE - 04-23-2015, 08:59 PM
RE: Plugin folder vs plugin name - by jan64 - 04-23-2015, 09:11 PM
RE: Plugin folder vs plugin name - by NiLSPACE - 04-23-2015, 09:41 PM
RE: Plugin folder vs plugin name - by xoft - 04-24-2015, 02:51 AM
RE: Plugin folder vs plugin name - by xoft - 04-24-2015, 03:42 AM



Users browsing this thread: 1 Guest(s)