git-svn-id: https://svn.eduke32.com/eduke32@1136 1a8010ca-5511-0410-912e-c29ae57300e0

This commit is contained in:
terminx 2008-11-14 19:55:48 +00:00
parent 4f029a0097
commit a0b49f13e4
3 changed files with 155 additions and 150 deletions

View file

@ -1878,7 +1878,7 @@ static int parse_udp_config(int argc, char **argv, gcomtype *gcom)
if (isvalidipaddress(st)) if (isvalidipaddress(st))
{ {
// if ((danetmode == 1) && (daindex == myconnectindex)) daindex++; // if ((danetmode == 1) && (daindex == myconnectindex)) daindex++;
/* for (j=0;st[j];j++) /* for (j=0;st[j];j++)
{ {
if (st[j] == ':') if (st[j] == ':')
{ allowed_addresses[daindex].port = htons((unsigned short)atol(&st[j+1])); st[j] = 0; break; } { allowed_addresses[daindex].port = htons((unsigned short)atol(&st[j+1])); st[j] = 0; break; }
@ -1888,7 +1888,7 @@ static int parse_udp_config(int argc, char **argv, gcomtype *gcom)
initprintf("mmulti_unstable: Player %d at %s:%d\n",daindex,st,allowed_addresses[daindex].port); initprintf("mmulti_unstable: Player %d at %s:%d\n",daindex,st,allowed_addresses[daindex].port);
daindex++; daindex++;
} }
/* else else
{ {
struct hostent * lph; struct hostent * lph;
unsigned short pt = BUILD_DEFAULT_UDP_PORT; unsigned short pt = BUILD_DEFAULT_UDP_PORT;
@ -1898,15 +1898,15 @@ static int parse_udp_config(int argc, char **argv, gcomtype *gcom)
{ pt = (unsigned short)atol(&st[j+1]); st[j] = 0; break; } { pt = (unsigned short)atol(&st[j+1]); st[j] = 0; break; }
if ((lph = gethostbyname(st))) if ((lph = gethostbyname(st)))
{ {
if ((danetmode == 1) && (daindex == myconnectindex)) daindex++; // if ((danetmode == 1) && (daindex == myconnectindex)) daindex++;
allowed_addresses[daindex].host = *(int *)lph->h_addr; allowed_addresses[daindex].host = ntohl(*(int *)lph->h_addr);
allowed_addresses[daindex].port = pt; allowed_addresses[daindex].port = pt;
initprintf("mmulti: Player %d at %s:%d (%s)\n",daindex, initprintf("mmulti_unstable: Player %d at %s:%d (%s)\n",daindex,
inet_ntoa(*(struct in_addr *)lph->h_addr),ntohs(pt),argv[i]); inet_ntoa(*(struct in_addr *)lph->h_addr),pt,argv[i]);
daindex++; daindex++;
} }
else initprintf("mmulti: Failed resolving %s\n",argv[i]); else initprintf("mmulti_unstable: Failed resolving %s\n",argv[i]);
} */ }
free(st); free(st);
} }
if ((danetmode == 255) && (daindex)) { gcom->numplayers = 2; udpmode = udpmode_client; } //an IP w/o /n# defaults to /n0 if ((danetmode == 255) && (daindex)) { gcom->numplayers = 2; udpmode = udpmode_client; } //an IP w/o /n# defaults to /n0

View file

@ -1539,13 +1539,13 @@ static void checksync(void)
printext256(4L,130L,31,0,"Out Of Sync - Please restart game",0); printext256(4L,130L,31,0,"Out Of Sync - Please restart game",0);
printext256(4L,138L,31,0,"RUN DN3DHELP.EXE for information.",0); printext256(4L,138L,31,0,"RUN DN3DHELP.EXE for information.",0);
} }
#if 0 #if 0
if (syncstate) if (syncstate)
{ {
printext256(4L,160L,31,0,"Missed Network packet!",0); printext256(4L,160L,31,0,"Missed Network packet!",0);
printext256(4L,138L,31,0,"RUN DN3DHELP.EXE for information.",0); printext256(4L,138L,31,0,"RUN DN3DHELP.EXE for information.",0);
} }
#endif #endif
} }
void check_fta_sounds(int i) void check_fta_sounds(int i)
@ -10523,7 +10523,7 @@ static void Startup(void)
for (i=0;i<MAXPLAYERS;i++) for (i=0;i<MAXPLAYERS;i++)
g_player[i].playerreadyflag = 0; g_player[i].playerreadyflag = 0;
#ifndef RANCID_NETWORKING #ifndef RANCID_NETWORKING
// enet regression // enet regression
if (CommandNet) if (CommandNet)
{ {
@ -10535,9 +10535,9 @@ static void Startup(void)
} }
CommandNet = NULL; CommandNet = NULL;
} }
#endif #endif
#ifdef RANCID_NETWORKING #ifdef RANCID_NETWORKING
// TODO: split this up in the same fine-grained manner as eduke32 network backend, to // TODO: split this up in the same fine-grained manner as eduke32 network backend, to
// allow for event handling // allow for event handling
initmultiplayers(netparamcount,netparam); initmultiplayers(netparamcount,netparam);
@ -10548,7 +10548,7 @@ static void Startup(void)
return; return;
} }
#else #else
if (initmultiplayersparms(netparamcount,netparam)) if (initmultiplayersparms(netparamcount,netparam))
{ {
initprintf("Waiting for players...\n"); initprintf("Waiting for players...\n");
@ -10562,7 +10562,7 @@ static void Startup(void)
} }
} }
} }
#endif #endif
if (netparam) Bfree(netparam); if (netparam) Bfree(netparam);
netparam = NULL; netparam = NULL;
@ -13180,11 +13180,16 @@ FRAGBONUS:
fadepal(0,0,0, 63,0,-7); fadepal(0,0,0, 63,0,-7);
KB_FlushKeyboardQueue(); KB_FlushKeyboardQueue();
{
int tc = totalclock;
while (KB_KeyWaiting()==0) while (KB_KeyWaiting()==0)
{ {
if (totalclock > tc + 600) break;
handleevents(); handleevents();
getpackets(); getpackets();
} }
}
if (bonusonly || ud.multimode > 1) return; if (bonusonly || ud.multimode > 1) return;

View file

@ -1538,11 +1538,11 @@ void waitforeverybody()
while (1) while (1)
{ {
idle(); idle();
/* /*
sampletimer(); sampletimer();
handleevents(); handleevents();
AudioUpdate(); AudioUpdate();
*/ */
if (quitevent || keystatus[1]) gameexit(""); if (quitevent || keystatus[1]) gameexit("");