Read game information from daemon.conf file, fix Unvanquished/Unvanquished#817
Read game information from daemon.conf file, fix Unvanquished/Unvanquished#817.
See also Unvanquished/Unvanquished#1777 on Unvanquished side.
This makes the engine truly repurposable without recompilation.
The idea is to set default home path, game name, game version, basepak, gamename string (thing used by master servers to filter out games), master servers, www_baseurl and uri proto (like unv in unv://) from a configuration file stored next to daemon binary.
This is based on @DefaultUser work.
This PR obsoletes #16.
Thing that is required to consider this PR complete:
- [ ] Implement the master server list.
Thing that is outside of the scope of this PR:
- Provide a generic Windows icon and a way for a game to compile the engine with a custom Windows icon.
I have not implemented the master server list because I don't know how to do it.
Here is another gameinfo.conf syntax suggestion: https://github.com/DaemonEngine/Daemon/pull/16#issuecomment-576027299
We may also name the file game.conf or daemon.conf or something else.
I added an implementation of master server list from gameinfo.conf file. I find it a bit hacky and I'm not super happy with it but the problem is that the server master cvar list looks to be initialized before we read that file…
We MUST split on lines and consider everything following a key to be the value (stripping leading and trailing spaces. Especially, game names may contain white space! It looks like the current implementation iterates every word!
@Kangz you said there https://github.com/Unvanquished/Unvanquished/issues/817#issuecomment-150836648
This was on my TODO list after the "Application" refactor
So maybe this will interest you. I'll appreciate reviews and improvements. =)
Spearmint engine has a similar features with a file named mint-game.settings: https://github.com/zturtleman/spearmint/wiki/New-Game#game-separation
cvarDefault com_homepath "Jump Land Adventure"
cvarDefault com_gamename JumpLand
cvarDefault com_demoext jumplanddemo
This is similar to my suggest from https://github.com/DaemonEngine/Daemon/pull/16#issuecomment-576027299