Cuberite Forum
Information on MCServer - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html)
+--- Forum: Discussion (https://forum.cuberite.org/forum-5.html)
+--- Thread: Information on MCServer (/thread-1910.html)

Pages: 1 2 3 4 5 6 7


RE: Information on MCServer - Shadowraix - 05-10-2015

(05-09-2015, 09:38 PM)worktycho Wrote: I'm going to start on TCLAP

Wooooooooo Big Grin


RE: Information on MCServer - worktycho - 05-10-2015

Just to warn everyone my design is going Java style Smile At least four new classes so far.


RE: Information on MCServer - worktycho - 05-10-2015

I seem to have designed myself into a hole here. I tried to build a wrapper class for cInifile to handle the overriding, but I didn't take into account that the cIniFile API makes it impossible to handle multiple sources.

Does anyone have some advice for what I can do short of rewriting cInifile?


RE: Information on MCServer - xoft - 05-11-2015

My choice would be to add a function to cIniFile that merges another cIniFile instance into the current one and overwrites any existing data. Then load the regular settings.ini and merge in the system-wide overrides.


RE: Information on MCServer - worktycho - 05-11-2015

That would causes any overrides to be written back. I think that overrides should be temporary.


RE: Information on MCServer - xoft - 05-11-2015

I don't think that's such a bad thing. The overrides are enforced by the provider, so let the customers see what kind of enforcements there are.

A bigger problem that I see is multi-value items, such as the plugins list. There's no reasonable way to define a merge on that.


RE: Information on MCServer - worktycho - 05-11-2015

Its more of a UX thing. It is extremely unusual for arguments that override config to set parameters. My expectation would be that either the parameters are forced overrides, or if they change the config file, to be able to change them whilst running. An example of this is MaxPlayers, I would expect it either to be a forced override, which can't be changed by plugins, or to change the config file, in which case I would expect plugins to be able to change it.


RE: Information on MCServer - xoft - 05-11-2015

Right, that makes sense.
My next idea was to add the capability of chaining multiple cIniFiles together. But then doing manual lookups using KeyID and ValueID, and iterating through all the values (as is sometimes used) will get broken.


RE: Information on MCServer - worktycho - 05-11-2015

That was what I tried to implement. Iteration is not the problem. The problem is that the keyIDs will conflict between the IDs. what I am trying out at the moment is to have the wrapper hand out its own IDs and then store a map of those to the child IDs, along with which child they came from. But the map just keeps annoying me, and also the way I'm assigning keys is based on order of access, which might break assumptions in iteration.


RE: Information on MCServer - tigerw - 05-11-2015

Is overriding the settings, as opposed to the linear process of writing them to file in main.cpp and having them loaded normally later, beneficial or necessary? It appears to be causing a large amount of code to written for a disproportionately small feature.