NetServerInfo not saved after the exit cleanup

Mon Oct 05, 2020 10:32 am

It's about this code in FGameConfigFile::ArchiveGameData:
Code:
   // Do not overwrite the serverinfo section if playing a netgame, and
   // this machine was not the initial host.
   if (!netgame || consoleplayer == 0)
   {
      strncpy (subsection, netgame ? "NetServerInfo" : "LocalServerInfo", sublen);
      SetSection (section, true);
      ClearCurrentSection ();
      C_ArchiveCVars (this, CVAR_ARCHIVE|CVAR_SERVERINFO);

      if (bModSetup)
      {
         strncpy (subsection, netgame ? "NetServerInfo.Mod" : "LocalServerInfo.Mod", sublen);
         SetSection (section, true);
         ClearCurrentSection ();
         C_ArchiveCVars (this, CVAR_MOD|CVAR_ARCHIVE|CVAR_AUTO|CVAR_SERVERINFO);
      }
   }

I've made a PR: https://github.com/coelckers/gzdoom/pull/1203

Re: NetServerInfo not saved after the exit cleanup

Tue Oct 06, 2020 2:25 am

I've done another PR but apparently it isn't good either and i can't think of a better way to fix it: https://github.com/coelckers/gzdoom/pull/1204
It's not a big deal unless you have an old ini with that section becouse the settings there override those in LocalServerInfo. With a fresh ini you could play with the SP settings.

Re: NetServerInfo not saved after the exit cleanup

Tue Oct 06, 2020 4:45 am

You fix the condition right in the place where things go wrong top cover your case, but don't massage some global variables to make the condition become true.

Re: NetServerInfo not saved after the exit cleanup

Tue Oct 06, 2020 5:05 am

Actually that was what i attempted first but after messing with it i could not find a solution without using netgame.