Allright, what the heck am I doing wrong here? Master-slave mode never starts and peer-to-peer is funked in it's own strange way! Starting one p2p mode game in Unkillable makes the player walk at twice her normal speed, starting another seperate p2p game gives a "waiting for other players" screen that never ends (player one (you) is ready, but player two never is).
Here's the relevant bits from the game startup routine:
j = 0; netparm = -1;
for(j = 1; j < argc; j++)
{
initprintf("-> argv[%d] = \"%s\"\n", j, argv[j]);
if(!Bstrcasecmp("/map",argv[j]))
{
Kawa_MapHack = 1;
Bstrcpy(boardfilename, argv[j+1]);
if(!Bstrrchr(boardfilename,'.')) Bstrcat(boardfilename,".map");
j++;
}
if(!Bstrcasecmp("/music",argv[j]))
{
Bstrcpy(musicfilename, argv[j+1]);
if(!Bstrrchr(musicfilename,'.')) Bstrcat(musicfilename,".mod");
j++;
}
if(!Bstrcasecmp("/net", argv[j]))
{
netparm = j;
if(argv[j+1][0] == '/')
{
if ((argv[j+1][1] == 'n') && (argv[j+1][2] == '0')) { initprintf("Network mode: Master/Slave\n"); networkmode = 0; }
if ((argv[j+1][1] == 'n') && (argv[j+1][2] == '1')) { initprintf("Network mode: Peer to Peer\n"); networkmode = 1; }
}
if (!isvalidipaddress(argv[j+2])) { wm_msgbox("Oops","Invalid IP address"); Kawa_ShutDown(); }
}
if(!Bstrcasecmp("/nomouse", argv[j])) eggnog=1;
if(!Bstrcasecmp("/config", argv[j])) wanttoconfig = 1;
}
...
...
...
initinput();
initmouse();
inittimer(TIMERINTSPERSECOND);
if(netparm == -1)
{
initprintf("Init game for single play...\n");
initmultiplayers(0,NULL,0,0,0);
} else {
initprintf("Init game for network play...\n");
//if(initmultiplayersparms(argc-netparm,&argv[netparm]))
if(initmultiplayersparms(_buildargc-netparm,&_buildargv[netparm]))
{
initprintf("initmultiplayerscycle...\n");
while (initmultiplayerscycle())
{
handleevents();
if (quitevent) Kawa_ShutDown();
}
}
option[4] = (numplayers >= 2);
initprintf("Ended up with %d players.\n",numplayers);
}
And here's what I get with the two network modes:
-> argv[1] = "/map"
-> argv[3] = "/net"
Network mode: Master/Slave
-> argv[4] = "/n0"
-> argv[5] = "127.0.0.1"
<system starts up...>
Initialising mouse
Initialising timer
Init game for network play...
initmultiplayerscycle...
<Nothing happens, and I click the Close button>
Uninitialising DirectInput...
-> argv[1] = "/map"
<That's my menu-skipping map parameter. Argv[2] is the file name.>
-> argv[3] = "/net"
Network mode: Peer to Peer
-> argv[4] = "/n1"
-> argv[5] = "127.0.0.1"
<system starts up...>
Initialising mouse
Initialising timer
Init game for network play...
initmultiplayerscycle...
Ended up with 2 players.
<Map is loaded...>
Preparing board "_zoo.map"...
Your connection index: 0
WaitForEverybody(): numplayers = 2
Entering waitloop...
Welcome to Unkillable. Enjoy the ride.
<The map I chose with the /map param appears. All seemingly works.>
<I open the menu...>
newmenu()...
Frame still locked 1 times when showframe() called.
<...and choose Exit>
Exiting menu with value 1...
Music OFF!
Uninitialising DirectInput...
I just don't get this stuff. Everything seems to be in place, compared to both KenBuild -and- Shadow Warrior (which is somewhat more readable than Duke). I'm doing something wrong, but am not nearly leet enough to see it. :(