Game.ini cannot be overridden? How does one override the Game.ini file?

https://answers.unrealengine.com/questions/154761/dedicated-server-build-ignores-and-deletes-gameini.html

I have packaged a game and then separately built a dedicated server (Development Server build configuration). I have tried running this in our server environment.

We have then created a Game.ini file that we put in the same directory as the GameServer.exe file and we started the server with the following GameServer.exe -log -gameini=Game.ini

The server starts up and the settings are not applied and the Game.ini file still exists but all of its contents have been removed sans 1 byte (Linux) or 2 bytes (Windows) for a windows newline "
".

I tried to figure out what is causing this to occur and really studied the source code. The engine picks up the file and even includes it in the correct section to be processed. It even ignores the other settings in the higher up files. Then it gets to this line in the FConfigCacheIni::LoadGlobalIniFile function:



     // don't write anything to disk in cooked builds - we will always use re-generated INI files anyway.
     if (!FPlatformProperties::RequiresCookedData() || bAllowGeneratedIniWhenCooked)
     {
         // Check the config system for any changes made to defaults and propagate through to the saved.
         NewConfigFile.ProcessSourceAndCheckAgainstBackup();
 
         if (bResult)
         {
             // if it was dirtied during the above function, save it out now
             NewConfigFile.Write(FinalIniFilename);
         }
     }


This is where the FPlatformProperties::RequiresCookedData() returns false getting us into this if statement where it checks the data against the backup in the CleanSourceConfigs and then overwrites the cached data and then deletes our ini file. The source needs some way of knowing that we were intending to append the Game.ini file and that we do not want to lose our settings. We are using the github release branch of the code which is currently the same as 4.6.1. I think the proper fix may be to convert the || to an && so that it will only overwrite when bAllowGeneratedIniWhenCooked is true and RequiresCookedData is false. Anyhow, we currently have no way of configuring our server through ini files.

I was trying to change my Game.ini file according to this: https://wiki.unrealengine.com/Servers_(Unreal_Tournament)

So does UT do something different to make this work or what?

Thanks,
Kory

So basically what I did was put the Game.ini on my dedicated linux server here (#6): https://docs.unrealengine.com/latest/INT/Programming/Basics/ConfigurationFiles/index.html#filehierarchy

I also happen to come across this post which implies it could be something with a Blueprint script that a level designer set on the level? So why would it overwrite user and password settings and completely clear out the INI file? https://forums.unrealengine.com/showthread.php?49810-How-to-properly-use-config-INIs-for-server-game-settings

It just seems like a glitch/bug to me. Anyone have any further insight?