[Feature Request] CLI switch for ini path
Add switch that would define, where ini files are. I would go with -S (settings) or -I (ini), since -C (as config) is taken.
I guess it would be defined in CServer::CommandLine, but it would have to be parsed elsewhere, before loading actual ini files. During CServerConfig::LoadIni and CServerConfig::LoadCryptIni it would check for input from switch or fallback to directory of sphereserver binary/excutable ./
This would help with windows service bug (the part with directory change could be removed, the path switch would be added as service parameter during creation) and it should enable placing config files on linux systems to /etc/ directory, where config files usually reside.
And maybe for pid file also, so it can be placed to /var/run/ on linux.
I see no harm on this! I see you are preparing some code/a PR for this
Yeah I've got Windows part working, but on Linux I had issue with similar to https://github.com/Sphereserver/Source-X/issues/1403 so I had to investigate.
The bigger reason for this is that I'm trying to make "linux server package". It would compile sphere to debian package, that would create dedicated user, install service files, install dependencies (mariadb-client), prepare default account and get ini settings to /etc/ folder, because when something changes there, it will popup action window what to do, similar to one bellow:
Configuration file '/etc/sphereserver/sphere.ini'
==> Modified (by you or by a script) since installation.
==> Package distributor has shipped an updated version.
What would you like to do about it ? Your options are:
Y or I : install the package maintainer's version
N or O : keep your currently-installed version
D : show the differences between the versions
Z : start a shell to examine the situation
The default action is to keep your current version.
This would be pretty nice to have Sphere shipped in a docker image and get scripts, ini, etc from a mounted volume.