Launching a server with specific ini values

Hey,

I’m planning on running several instances of a dedicated server using Steamworks, but on the same computer.
I’m using a bat file to launch my servers, and with a for loop I can modify the value of the port argument, so I don’t have a problem with ports.
However, I need to change the value of the GameServerQueryPort variable, in the DefaultEngine.ini file, which isn’t a problem if I modify it by hand.
On Unreal Engine 3, I used this argument to launch a server with particular ini values:

-ini:DefaultEngine:OnlineSubsystemSteam.GameServerQueryPort=27015

You can learn about this trick with this link, at the very bottom of the page.
The thing is this trick apparently doesn’t work anymore on Unreal Engine 4. So, here are my questions:

  • Does this trick still work, and I’m using it wrong?
  • Is there any other feature to simulate this behaviour with ini files?
  • If not, how can I achieve what I’m trying to achieve, without having to modify by hand the ini value between every server launch?

Thanks! :slight_smile:

Well, I didn’t manage to make it works, so instead, I modify the value in the ini file with a powershell command:

powershell -Command "(gc "MyProject\Config\DefaultEngine.ini") -replace 'GameServerQueryPort=27000', 'GameServerQueryPort=27010' | Out-File "MyProject\Config\DefaultEngine.ini""

And between each server launch, I wait 10 seconds to be sure that the server is launched:

timeout /t 10 /nobreak

Now, I just have to put this in a for loop :slight_smile: