diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 0fa59d745..f385b26ae 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -59,7 +59,8 @@ static int32 NoSetup = 0; static int32 CommandSoundToggleOff = 0; static int32 CommandMusicToggleOff = 0; static char *CommandMap = NULL; -static char *CommandName = NULL,*CommandNet = NULL; +static char *CommandName = NULL,*netcfg = NULL; +static int keepaddr = 0; int32 CommandWeaponChoice = 0; static struct strllist { @@ -444,6 +445,8 @@ void adduserquote(char *daquote) pub = NUMPAGES; } +long lastpackettime = 0; + void getpackets(void) { long i, j, k, l; @@ -482,6 +485,7 @@ void getpackets(void) if (numplayers < 2) return; while ((packbufleng = getpacket(&other,packbuf)) > 0) { + lastpackettime = totalclock; #ifdef TESTNET initprintf("RECEIVED PACKET: type: %d : len %d\n", packbuf[0], packbufleng); #endif @@ -2337,16 +2341,24 @@ void tics(void) j=(timer*AVERAGEFRAMES)/(i-frameval[framecnt]); if (ud.tickrate && !(ps[myconnectindex].gm&MODE_MENU)) { - int k = 1; + int ii, k = 0; if (ud.screen_size != 0 && GTFLAGS(GAMETYPE_FLAG_FRAGBAR) && ud.multimode > 1) { - k += 8; + k = 8; if (ud.multimode > 4) k += 8; } Bsprintf(b,"%ld",j>0?j:0); - minitext(320-strlen(b)*4,k,b,(timer*AVERAGEFRAMES)/(i-frameval[framecnt]) < 40?2:0,26); + minitext(320-strlen(b)*4,k+1,b,(timer*AVERAGEFRAMES)/(i-frameval[framecnt]) < 40?2:0,26); + + if (numplayers > 1) + if ((totalclock - lastpackettime) > 1) + { + for (ii = (totalclock - lastpackettime);ii>0 && ii<(xdim>>2);ii--) + printext256(4L*ii,scale(k,ydim,200),31,-1,".",0); + } + } framerate = j; frameval[framecnt] = i; @@ -8281,6 +8293,93 @@ static int stringsort(const char *p1, const char *p2) { return Bstrcmp(&p1[0],&p2[0]); } + +void setup_rancid_net(char *fn) +{ + int i; + + if (load_rancid_net(fn) != -1) + { + char tmp[32]; + + if (keepaddr == 0) + { + for (i=0;i 1) { - int keepaddr = 0; - while (i < argc) { c = argv[i]; @@ -8420,98 +8517,10 @@ void checkcommandline(int argc,char **argv) NoSetup = TRUE; networkmode = 1; #ifndef TESTNET - CommandNet = argv[i+1]; + netcfg = argv[i+1]; #endif i++; } -#ifndef TESTNET - if (CommandNet) - { - if (load_rancid_net(CommandNet) != -1) - { - char tmp[32]; - - CommandNet = 0; - - if (keepaddr == 0) - { - for (j=0;j