diff options
Diffstat (limited to 'demos/3rdparty/doom/d_net.c')
-rw-r--r-- | demos/3rdparty/doom/d_net.c | 58 |
1 files changed, 25 insertions, 33 deletions
diff --git a/demos/3rdparty/doom/d_net.c b/demos/3rdparty/doom/d_net.c index 75b5436e..dc577839 100644 --- a/demos/3rdparty/doom/d_net.c +++ b/demos/3rdparty/doom/d_net.c @@ -162,7 +162,8 @@ HSendPacket doomcom->command = CMD_SEND; doomcom->remotenode = node; doomcom->datalength = NetbufferSize (); - + +#if 0 // AJH HACK if (debugfile) { int i; @@ -172,15 +173,16 @@ HSendPacket else realretrans = -1; - fprintf (debugfile,"send (%i + %i, R %i) [%i] ", + I_DBGprintf("send (%i + %i, R %i) [%i] ", ExpandTics(netbuffer->starttic), netbuffer->numtics, realretrans, doomcom->datalength); for (i=0 ; i<doomcom->datalength ; i++) - fprintf (debugfile,"%i ",((byte *)netbuffer)[i]); + I_DBGprintf("%i ",((byte *)netbuffer)[i]); - fprintf (debugfile,"\n"); + I_DBGprintf("\n"); } +#endif I_NetCmd (); } @@ -213,25 +215,24 @@ boolean HGetPacket (void) if (doomcom->datalength != NetbufferSize ()) { - if (debugfile) - fprintf (debugfile,"bad packet length %i\n",doomcom->datalength); + I_DBGprintf("bad packet length %i\n",doomcom->datalength); return false; } if (NetbufferChecksum () != (netbuffer->checksum&NCMD_CHECKSUM) ) { - if (debugfile) - fprintf (debugfile,"bad packet checksum\n"); + I_DBGprintf("bad packet checksum\n"); return false; } +#if 0 // AJH uGFX Hack if (debugfile) { int realretrans; int i; if (netbuffer->checksum & NCMD_SETUP) - fprintf (debugfile,"setup packet\n"); + I_DBGprintf("setup packet\n"); else { if (netbuffer->checksum & NCMD_RETRANSMIT) @@ -239,16 +240,17 @@ boolean HGetPacket (void) else realretrans = -1; - fprintf (debugfile,"get %i = (%i + %i, R %i)[%i] ", + I_DBGprintf("get %i = (%i + %i, R %i)[%i] ", doomcom->remotenode, ExpandTics(netbuffer->starttic), netbuffer->numtics, realretrans, doomcom->datalength); for (i=0 ; i<doomcom->datalength ; i++) - fprintf (debugfile,"%i ",((byte *)netbuffer)[i]); - fprintf (debugfile,"\n"); + I_DBGprintf("%i ",((byte *)netbuffer)[i]); + I_DBGprintf("\n"); } } +#endif return true; } @@ -305,8 +307,7 @@ void GetPackets (void) && (netbuffer->checksum & NCMD_RETRANSMIT) ) { resendto[netnode] = ExpandTics(netbuffer->retransmitfrom); - if (debugfile) - fprintf (debugfile,"retransmit from %i\n", resendto[netnode]); + I_DBGprintf ("retransmit from %i\n", resendto[netnode]); resendcount[netnode] = RESENDCOUNT; } else @@ -318,9 +319,7 @@ void GetPackets (void) if (realend < nettics[netnode]) { - if (debugfile) - fprintf (debugfile, - "out of order packet (%i + %i)\n" , + I_DBGprintf ("out of order packet (%i + %i)\n" , realstart,netbuffer->numtics); continue; } @@ -329,9 +328,7 @@ void GetPackets (void) if (realstart > nettics[netnode]) { // stop processing until the other system resends the missed tics - if (debugfile) - fprintf (debugfile, - "missed tics from %i (%i - %i)\n", + I_DBGprintf("missed tics from %i (%i - %i)\n", netnode, realstart, nettics[netnode]); remoteresend[netnode] = true; continue; @@ -404,7 +401,7 @@ void NetUpdate (void) if (maketic - gameticdiv >= BACKUPTICS/2-1) break; // can't hold any more - //printf ("mk:%i ",maketic); + //I_printf("mk:%i ",maketic); G_BuildTiccmd (&localcmds[maketic%BACKUPTICS]); maketic++; } @@ -484,7 +481,7 @@ void D_ArbitrateNetStart (void) if (doomcom->consoleplayer) { // listen for setup info from key player - printf ("listening for network start info...\n"); + I_printf ("listening for network start info...\n"); while (1) { CheckAbort (); @@ -507,7 +504,7 @@ void D_ArbitrateNetStart (void) else { // key player, send the setup info - printf ("sending network start info...\n"); + I_printf ("sending network start info...\n"); do { CheckAbort (); @@ -574,7 +571,7 @@ void D_CheckNetGame (void) if (netgame) D_ArbitrateNetStart (); - printf ("startskill %i deathmatch: %i startmap: %i startepisode: %i\n", + I_printf ("startskill %i deathmatch: %i startmap: %i startepisode: %i\n", startskill, deathmatch, startmap, startepisode); // read values out of doomcom @@ -588,7 +585,7 @@ void D_CheckNetGame (void) for (i=0 ; i<doomcom->numnodes ; i++) nodeingame[i] = true; - printf ("player %i of %i (%i nodes)\n", + I_printf ("player %i of %i (%i nodes)\n", consoleplayer+1, doomcom->numplayers, doomcom->numnodes); } @@ -603,9 +600,6 @@ void D_QuitNetGame (void) { int i, j; - if (debugfile) - fclose (debugfile); - if (!netgame || !usergame || consoleplayer == -1 || demoplayback) return; @@ -678,9 +672,7 @@ void TryRunTics (void) frameon++; - if (debugfile) - fprintf (debugfile, - "=======real: %i avail: %i game: %i\n", + I_DBGprintf("=======real: %i avail: %i game: %i\n", realtics, availabletics,counts); if (!demoplayback) @@ -699,14 +691,14 @@ void TryRunTics (void) if (nettics[0] <= nettics[nodeforplayer[i]]) { gametime--; - // printf ("-"); + // I_printf ("-"); } frameskip[frameon&3] = (oldnettics > nettics[nodeforplayer[i]]); oldnettics = nettics[0]; if (frameskip[0] && frameskip[1] && frameskip[2] && frameskip[3]) { skiptics = 1; - // printf ("+"); + // I_printf ("+"); } } }// demoplayback |