I have an autohost app for Space Empires which I use to process turns in multiplayer games, but when I hook it up to the Steam instance of SE5, I find that it uploads the turn before it finishes processing!
Here is the command line I'm using in my batch file:
"C:\Users\edkol\Documents\Apps\Steam\steam.exe" -applaunch 1690 %*
And the arguments that get passed in as %* are just the standard SE5 command line arguments to process a turn, something like this template:
"{EnginePath}\Savegame\{GameCode}.gam" "{Password}" -moddir "{ModPath}"
So is there something I can add to my command line to wait for SE5 to exit before returning?
11 Answer
So, when you launch the game with the Steam executable in your example, adding /wait to the command will launch the game and wait until Steam quits (even if you quit the game long before)
You will need to find the game executable and launch it directly (if the game was installed with Steam, launching the game directly should also launch the Steam client, and that is OK):
start /wait "" /D"<STEAM ROOT>\SteamApps\common\<GAME DIR>" "<GAME LAUNCHER>.exe" Now, this will not work for every game. Some launchers are merely a stub that will launch another executable that is the real game. This varies by game, and you might need to dig around to figure out what the parameters are to launch the real game directly.
My only real success with running an application that had a stub launcher has been with Arduino 1.8.11. And there, I simply got lucky: it is a Java application and all the launch parameters were visible in the stub launcher binary as plain text
