Change settings.ini plugins format? - Printable Version +- Cuberite Forum (https://forum.cuberite.org) +-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html) +--- Forum: Development (https://forum.cuberite.org/forum-13.html) +--- Thread: Change settings.ini plugins format? (/thread-764.html) |
Change settings.ini plugins format? - xoft - 01-26-2013 I'd like to propose a change in the settings.ini regarding the plugins. This change would make our ini file standards-conformant, and probably easier to manage, especially regarding the order of the plugins. Instead of listing each plugin separately on a line, I'm proposing a single value, "Enabled", which will have a comma-separated list of enabled plugins. This way it will be clear as to the loading order, no INI editor could mess that up, and we already have comma-separated list parser anyway. Also, as part of this change, it would be great to actually implement an API in cPluginManager to manipulate this list, something in the lines of: - EnablePlugin("Name", Position) - DisablePlugin("Name") - MovePluginUp("Name", NumPositions) - MovePluginDown("Name", NumPositions) - MovePluginToTop("Name") - MovePluginToBottom("Name") - GetPluginPosition("Name") - GetNumPlugins() - GetPlugins() How about that? RE: Change settings.ini plugins format? - Taugeshtu - 01-26-2013 I'm supporting API addition, but I'm against .ini change. Because eventually we would like to have millions of plugins, thus average plugins list on MCS server will be like 30-40 plugins long, therefore having then in one line doesn't seems to be a good idea to me (hard to read). Besides, it's MUCH easier to open settings.ini, comment plugin line, run server several times, delete ";", which commented some plugin and have server back to normal state. Helps when developing plugins. Pretty much same reason why you won't write your code in one line (although you could ) RE: Change settings.ini plugins format? - xoft - 01-26-2013 I'm not expecting too many people to actually edit the list by hand; rather, the webadmin UI will do that. So line length should not be much of a factor here. True, I can see you points, that's why I created a poll instead of doing it immediately I, too, like to disable plugins simply by commenting out lines; but even that shows one very big flaw - automated INI processors (such as MCServer) are not guaranteed to even support multiple same-value lines, and if they do, they don't guarantee that they'll keep the order in which the lines appear. MCServer currently happens to do that for regular lines, but it already moves all comments to the top of a section. Maybe we could devise an even better format: Code: [Plugins] Upon reading the file, MCServer would re-number the plugins and output them in the correct loading order, so that later maintenance of this file is easier. To add a plugin, a user would simply add a "NewPlugin=99999" line and it will get sorted out. If there are multiple plugins with the same priority number, let's say MCServer will decide (random) which one is first. RE: Change settings.ini plugins format? - Taugeshtu - 01-26-2013 Hmmm. Well, "PluginName = Priority" format is better, but I don't feel like it is a necessary change. Still, if you do - go ahead. And once you're up to .ini stuff, maybe you could add OreNest generator settings? RE: Change settings.ini plugins format? - bearbin - 01-26-2013 I think the pluginname=priority is a good format |