Duke3d_w32 netcode... this compiles but doesn't work yet

git-svn-id: https://svn.eduke32.com/eduke32@362 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2006-11-28 04:16:20 +00:00
parent 5ebab8df83
commit d7d9e82be0
6 changed files with 1754 additions and 15 deletions

View file

@ -84,7 +84,7 @@ ENGINEOBJS+= \
$(OBJ)/lzf_c.$o \ $(OBJ)/lzf_c.$o \
$(OBJ)/lzf_d.$o \ $(OBJ)/lzf_d.$o \
$(OBJ)/md4.$o \ $(OBJ)/md4.$o \
$(OBJ)/mmulti.$o \ $(OBJ)/mmultirm.$o \
$(OBJ)/osd.$o \ $(OBJ)/osd.$o \
$(OBJ)/pragmas.$o \ $(OBJ)/pragmas.$o \
$(OBJ)/scriptfile.$o \ $(OBJ)/scriptfile.$o \

View file

@ -18,6 +18,7 @@ $(OBJ)/lzwnew.$o: $(SRC)/lzwnew.c
$(OBJ)/md4.$o: $(SRC)/md4.c $(INC)/md4.h $(INC)/compat.h $(OBJ)/md4.$o: $(SRC)/md4.c $(INC)/md4.h $(INC)/compat.h
$(OBJ)/mmulti_null.$o: $(SRC)/mmulti_null.c $(INC)/mmulti.h $(OBJ)/mmulti_null.$o: $(SRC)/mmulti_null.c $(INC)/mmulti.h
$(OBJ)/mmulti.$o: $(SRC)/mmulti.c $(OBJ)/mmulti.$o: $(SRC)/mmulti.c
$(OBJ)/mmultirm.$o: $(SRC)/mmultirm.c
$(OBJ)/osd.$o: $(SRC)/osd.c $(INC)/build.h $(INC)/osd.h $(INC)/compat.h $(INC)/baselayer.h $(OBJ)/osd.$o: $(SRC)/osd.c $(INC)/build.h $(INC)/osd.h $(INC)/compat.h $(INC)/baselayer.h
$(OBJ)/pragmas.$o: $(SRC)/pragmas.c $(INC)/compat.h $(OBJ)/pragmas.$o: $(SRC)/pragmas.c $(INC)/compat.h
$(OBJ)/scriptfile.$o: $(SRC)/scriptfile.c $(INC)/scriptfile.h $(INC)/cache1d.h $(INC)/compat.h $(OBJ)/scriptfile.$o: $(SRC)/scriptfile.c $(INC)/scriptfile.h $(INC)/cache1d.h $(INC)/compat.h

View file

@ -2477,6 +2477,7 @@ mdmodel *mdload (const char *filnam)
switch (B_LITTLE32(i)) switch (B_LITTLE32(i))
{ {
case 0x32504449: case 0x32504449:
initprintf("Warning: model '%s' is version IDP2; wanted version IDP3\n",filnam);
vm = (mdmodel*)md2load(fil,filnam); break; //IDP2 vm = (mdmodel*)md2load(fil,filnam); break; //IDP2
case 0x33504449: case 0x33504449:
vm = (mdmodel*)md3load(fil); break; //IDP3 vm = (mdmodel*)md3load(fil); break; //IDP3

1724
polymer/build/src/mmultirm.c Executable file

File diff suppressed because it is too large Load diff

View file

@ -224,7 +224,7 @@ extern void printstr(short x,short y,char string[],char attribute);
extern void Logo(void); extern void Logo(void);
extern void loadtmb(void); extern void loadtmb(void);
extern void compilecons(void); extern void compilecons(void);
extern void Startup(void); extern void Startup(long argc, char **argv);
extern void getnames(void); extern void getnames(void);
extern int main(int argc,char **argv); extern int main(int argc,char **argv);
extern char opendemoread(char which_demo); extern char opendemoread(char which_demo);

View file

@ -121,6 +121,8 @@ char user_quote[MAXUSERQUOTES][178];
#define MAXCACHE1DSIZE (32*1048576) #define MAXCACHE1DSIZE (32*1048576)
#endif #endif
#define RMNET 1
long tempwallptr; long tempwallptr;
long nonsharedtimer; long nonsharedtimer;
@ -482,6 +484,7 @@ void getpackets(void)
if (numplayers < 2) return; if (numplayers < 2) return;
while ((packbufleng = getpacket(&other,packbuf)) > 0) while ((packbufleng = getpacket(&other,packbuf)) > 0)
{ {
initprintf("RECEIVED PACKET: type: %d : len %d\n", packbuf[0], packbufleng);
switch (packbuf[0]) switch (packbuf[0])
{ {
case 254: case 254:
@ -895,6 +898,7 @@ void getpackets(void)
case 250: case 250:
playerreadyflag[other]++; playerreadyflag[other]++;
initprintf("Player %ld is ready...\n", other);
break; break;
case 255: case 255:
gameexit(" "); gameexit(" ");
@ -8411,9 +8415,12 @@ void checkcommandline(int argc,char **argv)
NoSetup = TRUE; NoSetup = TRUE;
if (argc > i+1) if (argc > i+1)
{ {
#ifndef RMNET
CommandNet = argv[i+1]; CommandNet = argv[i+1];
#endif
i++; i++;
} }
#ifndef RMNET
if (CommandNet) if (CommandNet)
{ {
if (load_rancid_net(CommandNet) != -1) if (load_rancid_net(CommandNet) != -1)
@ -8500,6 +8507,7 @@ void checkcommandline(int argc,char **argv)
netparam[j] = (char *)&rancid_local_port_string; netparam[j] = (char *)&rancid_local_port_string;
} }
} }
#endif
i++; i++;
continue; continue;
} }
@ -9175,7 +9183,7 @@ void sanitizegametype()
extern int startwin_run(void); extern int startwin_run(void);
void Startup(void) void Startup(long argc, char **argv)
{ {
int i; int i;
@ -9281,8 +9289,10 @@ void Startup(void)
tilesizx[MIRROR] = tilesizy[MIRROR] = 0; tilesizx[MIRROR] = tilesizy[MIRROR] = 0;
for (i=0;i<MAXPLAYERS;i++) playerreadyflag[i] = 0; for (i=0;i<MAXPLAYERS;i++)
playerreadyflag[i] = 0;
#ifndef RMNET
if (Bstrlen(rancid_ip_strings[MAXPLAYERS-1])) if (Bstrlen(rancid_ip_strings[MAXPLAYERS-1]))
{ {
initprintf("rmnet: Using %s as sort IP\n",rancid_ip_strings[MAXPLAYERS-1]); initprintf("rmnet: Using %s as sort IP\n",rancid_ip_strings[MAXPLAYERS-1]);
@ -9307,6 +9317,9 @@ void Startup(void)
if (netparam) Bfree(netparam); if (netparam) Bfree(netparam);
netparam = NULL; netparam = NULL;
netparamcount = 0; netparamcount = 0;
#else
initmultiplayers(argc,argv,0,0,0);
#endif
if (numplayers > 1) if (numplayers > 1)
initprintf("Multiplayer initialized.\n"); initprintf("Multiplayer initialized.\n");
@ -9316,8 +9329,6 @@ void Startup(void)
if (networkmode == 255) if (networkmode == 255)
networkmode = 1; networkmode = 1;
getnames();
} }
void sendscore(char *s) void sendscore(char *s)
@ -9393,7 +9404,6 @@ void getnames(void)
syncnames(); syncnames();
sendboardname(); sendboardname();
getpackets(); getpackets();
waitforeverybody(); waitforeverybody();
} }
@ -9717,9 +9727,8 @@ void app_main(int argc,char **argv)
initprintf("Please read LICENSE.DOC for more details.\n"); initprintf("Please read LICENSE.DOC for more details.\n");
} }
Startup(); // a bunch of stuff including compiling cons Startup(argc,argv); // a bunch of stuff including compiling cons
{
i = 1; i = 1;
for (j=numplayers;j<ud.multimode;j++) for (j=numplayers;j<ud.multimode;j++)
{ {
@ -9727,13 +9736,17 @@ void app_main(int argc,char **argv)
ps[j].team = ud.pteam[j] = i; ps[j].team = ud.pteam[j] = i;
i = 1-i; i = 1-i;
} }
}
if (quitevent) return; if (quitevent) return;
if (!loaddefinitionsfile(duke3ddef)) initprintf("Definitions file loaded.\n"); if (!loaddefinitionsfile(duke3ddef)) initprintf("Definitions file loaded.\n");
// initprintf("numplayers=%i\n",numplayers); // initprintf("numplayers=%i\n",numplayers);
#ifdef RMNET
if (natfree)
waitforeverybody();
#endif
if (numplayers > 1) if (numplayers > 1)
{ {
ud.multimode = numplayers; ud.multimode = numplayers;