Fixes and improvements into how serverinfo CVars are saved and archived
First and foremost, this merge request addresses https://zandronum.com/tracker/view.php?id=4168 on the tracker.
Before, when playing offline with multiplayer emulation and the user exits the game, any serverinfo
CVars were archived into "LocalServerInfo" and "LocalServerInfo.Mod" sections of the user's config file. Instead, they were being archived into "NetServerInfo" and "NetServerInfo" respectively which should only happen in online games (i.e. only the server should do this). This fix now makes it so whether the network state is NETSTATE_SINGLE
or NETSTATE_SINGLE_MULTIPLAYER
, serverinfo
CVars always get saved into the local sections.
Secondly, something I noticed when addressing this issue is that the server's settings (i.e. any serverinfo
CVars the server sends to the client) also get archived. Personally, I believe that any settings from the server should be discarded once I disconnect, and shouldn't be saved and overwrite my own settings. If I start a new offline game upon disconnecting, I'd like to use my own settings too. This comment from the source code also suggests that clients shouldn't be overwriting their serverinfo
CVars with the server's:
// Do not overwrite the serverinfo section if playing a netgame, and
// this machine was not the initial host.
I wouldn't consider this issue as a bug, but it's an improvement worth considering.