<div dir="ltr"><div>First, apologies if this is not appropriate for the opensim-dev list. I felt like the best fit at the time.</div><div><br></div>I have been recently attempting to implement a utility for OpenSim that, in part, handles configuration. Part of this utility is comprised of a component that reads OpenSim's INI files while taking advantage of those special helper comments that provide guidance about some options. An example might be:<div>
<br></div><div><div><font face="courier new, monospace">[NPC]</font></div><div><font face="courier new, monospace"> ;# {Enabled} {} {Enable Non Player Character (NPC) facilities} {true false} false</font></div><div><font face="courier new, monospace"> Enabled = true</font></div>
</div><div><br></div><div>Those helper comments (prefixed with ;# ) really are very potentially useful, but now that I've made some progress, I'm beginning to have some questions..I'm relying on many assumptions and expectations in my work, and I'd like to be certain my expectations have a reasonable basis. Helper comments currently always precede an actual key/value pair. I'd have to make further refinements in the off chance that the reverse could occur. (And who wants more work? Hehe.)</div>
<div><br></div><div>Anyway, currently what I'm doing is skipping all commented lines, with the exception of reading in all of the helper comments, These indicate that a section's key/value pair exist, what it's for, etc. I add the key/value pair, along with the other information provided by the helper comment to my data structure, and assign the default value, but mark the option as not enabled, allowing fallback to OpenSimDefault's values. If the helper comment is soon followed by a conventional, uncommented, matching key/value pair, I update it by taking the value from that, and then mark it as enabled.<br>
</div><div><br></div><div>The idea in the end is to load INI's into a GUI, allow configuration in a (hopefully) pretty UI, and then to write out INI files tailored for a user's simulator.It's much simpler for me to allow the INI files provided by the OpenSimulator project to act as my reference corpus, rather than to try to maintain my own ever changing database of options that would need to be updated myself with each significant change in options. Not to mention attempting to make such a database interoperable with different versions of OpenSim.</div>
<div><br></div><div>I've noticed that not all options have these helper comments, some examples being a few of XEngines options regarding threads or AppDomainLoading. Was this a deliberate omission to indicate they these should not be touched lightly? I can see cases where options should just be handled carefully, like anything dealing with database configuration. It looks to me like some of these really ought to be assessed by a user, like those in StandaloneCommon.ini's GridInfoService section, or the GridCommon.ini's many service URI options. Helper comments seem like they could be beneficial in these cases, and possibly others. </div>
<div><br></div><div>I'm also curious whether anyone else has made use of these helper comments, and to what degree of success?<br></div><div><br></div><div>Thanks,</div><div>Marcus Llewellyn</div></div>