Conversation
…ished#817 Co-authored-by: Sebastian Schmidt <schro.sb@gmail.com> Co-authored-by: Thomas “illwieckz” Debesse <dev@illwieckz.net>
|
I have not implemented the master server list because I don't know how to do it. |
|
Here is another We may also name the file |
32aacdb to
b418fcf
Compare
b418fcf to
01c9ec8
Compare
|
I added an implementation of master server list from |
01c9ec8 to
5971855
Compare
daa987f to
6241602
Compare
|
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 Unvanquished/Unvanquished#817 (comment)
So maybe this will interest you. I'll appreciate reviews and improvements. =) |
|
Spearmint engine has a similar features with a file named This is similar to my suggest from #16 (comment) |
slipher
left a comment
There was a problem hiding this comment.
The feature to override the default of any cvar sounds good (instead of only specifically allowed ones). We've talked about that sort of thing in the past, like maybe Xonotic would need to allow symlinks in paks by default or something.
Some other things I want to look at (I might fix them myself):
- Don't add stuff to q_shared.h or qcommon.h
- Avoid macros with va() or other function calls in them
- Parsing should be case-insensitive
- Consider moving CMake conf copying stuff into Daemon. It's similar to DLLs - a required file that must be copied to the engine dir.
- Sanity check cvars that are used in filesystem paths
| std::string uriprotocol() const; | ||
| private: | ||
| Gameinfo() : _name("MISSING_NAME"), _version("UNKNOWN") {}; | ||
| std::string _name; |
There was a problem hiding this comment.
I don't see any reason for private fields + getter functions. Just expose a const reference to a Gameinfo struct, and then the fields can be read (e.g. Gameinfo::getInstanc().basepak), but not modified.
There was a problem hiding this comment.
That was code by @DefaultUser, if there is better way to do it then we can do it.
src/engine/qcommon/gameinfo.cpp
Outdated
| /* The key names and values MUST NOT be quoted | ||
| in the daemon.conf */ | ||
|
|
||
| /* Display name, can contain special characters, |
There was a problem hiding this comment.
The documentation of each field should go in the struct definition rather than parsing code.
Alternatively the parser could support comments and this could go in the template. It's always annoying to use languages without comments...
There was a problem hiding this comment.
We need a better parser anyway, I currently reused the one that was proposed in #16 but I'm not happy with it.
src/engine/server/sv_init.cpp
Outdated
| Cvar_Get( "layout", "", CVAR_SERVERINFO ); | ||
| Cvar_Get( "g_layouts", "", 0 ); // FIXME | ||
| sv_hostname = Cvar_Get( "sv_hostname", UNNAMED_SERVER, CVAR_SERVERINFO ); | ||
| sv_hostname = Cvar_Get( "sv_hostname", Gameinfo::getInstance().unnamedservername().c_str(), CVAR_SERVERINFO ); |
src/engine/qcommon/gameinfo.cpp
Outdated
| return temp; | ||
| } | ||
|
|
||
| std::string Gameinfo::name_upper() const |
There was a problem hiding this comment.
Yes, there are also some others to purge before merging (master ones).
|
Everything works but the master servers. They are properly registered but the listing doesn't work. I suspect that the |
|
We now use a This makes it easy to declare arrays, like master servers. In the future we will be able to use an array as well for extra basepaks, the list of pak names to prevent accidental upgrade through autodownload. |
|
The default We need a way to change a Cvar default after startup and set the cvar to this value when the hardcoded default wasn't modified. |
Fixed. |
Read game information from
daemon.conffile, 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
unvinunv://) from a configuration file stored next todaemonbinary.This is based on @DefaultUser work.
This PR obsoletes #16:
Thing that is required to consider this PR complete:
Thing that is outside of the scope of this PR: