VOGONS


First post, by Da Easy Mitch

User metadata
Rank Newbie
Rank
Newbie

I'm currently trying to set up a network game for Fatal Racing. So far all ist working flawlessly, as long as I add the server name to the .conf-file I use to start the client session. I start the client game using a .cmd-file with the following syntax:
<PATH-TO-DOSBOX>dosbox.exe - c "set SERVER=<SERVERNAME OR IP>" - conf <PATH-TO-CONF-FILE>

The problem is: The variable for SERVER only gets set after the autoexec in the conf file is processed, so it isn't set yet whe the autoexec calls "ipxnet connet %SERVER%" almost at the bginning.

Is there any way to add commands before the autoexec is run?

Last edited by Da Easy Mitch on 2016-01-21, 14:00. Edited 1 time in total.

Reply 1 of 4, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Just as an explanation, it's because the settings in the conf are read and set before any user command.
Move the ipxnet command from the autoexec section into a batch file and call that also via -c (for example dosbox.exe -c path\connect.bat)

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 2 of 4, by Da Easy Mitch

User metadata
Rank Newbie
Rank
Newbie

Wouldn't that be the same, just adding another file to the process? I could, of course, add the connect command, followed by the start file of the game as well to the batch, so it doesn't get started from the autoexec before making the connection. But that would mean moving half of the autoexec in the batch, which I don't particularly like. Yeah, i know, it's just cosmetics, but I like my batch files clean and easy! 😉

If there's no way to run commands before the autoexec, I'll just show my friends where to change the server name in the .conf-file, I think that's the easiest way. I was only hoping to make it as easy as possible by having them to change only a one-line batch file instead of the whole .conf.

Reply 3 of 4, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

if you pass the -c set Server=... before the batch file, then no, it's not the same as before.
The order is then:
autoexec section of the conf, set SERVER..., connect.bat
IMO, having as little as possible in the autoexec is best as you are more likely to accidentally lose your config than the batch file 😀

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 4 of 4, by Da Easy Mitch

User metadata
Rank Newbie
Rank
Newbie

Ah, ok, I misunderstood what you meant earlier. Your idea is to keep only general settings in the autoexec section, then define the SERVER variable and then make the connection and start the game in another batch file. Yes, that should work as well. Thank you!

I set up a config and start batch for each game (and purpose), so neither should get lost. *crossing fingers* 😀