Poll: Should I change the format?
You do not have permission to vote in this poll.
Yes, change it to one-line
75.00%
3 75.00%
No, don't change it, but implement the (relevant parts of the) API
25.00%
1 25.00%
No, don't touch it at all
0%
0 0%
Total 4 vote(s) 100%
* You voted for this item. [Show Results]

Change settings.ini plugins format?
#1
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?
Reply
Thanks given by:
#2
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 Smile)
Reply
Thanks given by:
#3
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 Wink 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]
PluginNameGHI=2
PluginNameDEF=4
PluginNameABC=1
-> This would load plugins "PluginNameABC", "PluginNameGHI" and "PluginNameDEF", in this order. The order is given by the ascending numbers (missing numbers don't matter) and you still get the ability to comment out plugins simply. And all the values have different names now. Yay!
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.
Reply
Thanks given by:
#4
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? Smile
Reply
Thanks given by:
#5
I think the pluginname=priority is a good format
Reply
Thanks given by:




Users browsing this thread: 2 Guest(s)