d1x->d2x
This commit is contained in:
parent
fa75b6a63f
commit
7bbe8f1669
|
@ -1,13 +1,16 @@
|
|||
/*
|
||||
* $Source: /cvs/cvsroot/d2x/main/ip_base.cpp,v $
|
||||
* $Revision: 1.2 $
|
||||
* $Revision: 1.3 $
|
||||
* $Author: bradleyb $
|
||||
* $Date: 2002-02-13 10:39:21 $
|
||||
* $Date: 2002-02-14 09:24:19 $
|
||||
*
|
||||
* ip_base.cpp - base for NAT-compatible udp/ip code.
|
||||
* added 2000/02/07 Matt Mueller
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.2 2002/02/13 10:39:21 bradleyb
|
||||
* Lotsa networking stuff from d1x
|
||||
*
|
||||
* Revision 1.1 2002/02/06 09:22:41 bradleyb
|
||||
* Adding d1x network code
|
||||
*
|
||||
|
@ -147,7 +150,7 @@ ip_handshake_relay::ip_handshake_relay(ip_peer *torelay):ip_handshake_base(1){
|
|||
void ip_peer::send_handshake(ip_handshake_base*hsb){
|
||||
ubyte buf[256];
|
||||
int s=0;
|
||||
memcpy(buf+s,DXXcfgid,4);s+=4;
|
||||
memcpy(buf+s,D2Xcfgid,4);s+=4;
|
||||
s+=hsb->fillbuf(buf+s);
|
||||
assert(s<256);
|
||||
if (addr.goodaddr==NULL){
|
||||
|
|
|
@ -1,13 +1,16 @@
|
|||
/*
|
||||
* $Source: /cvs/cvsroot/d2x/main/ip_base.h,v $
|
||||
* $Revision: 1.2 $
|
||||
* $Revision: 1.3 $
|
||||
* $Author: bradleyb $
|
||||
* $Date: 2002-02-13 10:45:49 $
|
||||
* $Date: 2002-02-14 09:24:19 $
|
||||
*
|
||||
* ip_base.h - base for NAT-compatible udp/ip code.
|
||||
* added 2000/02/07 Matt Mueller
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.2 2002/02/13 10:45:49 bradleyb
|
||||
* Lotsa networking stuff from d1x
|
||||
*
|
||||
* Revision 1.1 2002/02/06 09:22:41 bradleyb
|
||||
* Adding d1x network code
|
||||
*
|
||||
|
@ -51,9 +54,9 @@ unsigned short ip_portshift(unsigned short baseport, const char *cs);
|
|||
#define MAX_PACKETSIZE 8192
|
||||
|
||||
// Length HAS TO BE 2!
|
||||
#define DXXid "\xdxx"
|
||||
#define D2Xid "\xd2x"
|
||||
// Length HAS TO BE 4!
|
||||
#define DXXcfgid "\xcfg\xdxx"
|
||||
#define D2Xcfgid "\xcfg\xd2x"
|
||||
|
||||
|
||||
//cfg packet types
|
||||
|
|
|
@ -1,13 +1,16 @@
|
|||
/*
|
||||
* $Source: /cvs/cvsroot/d2x/main/ipclient.cpp,v $
|
||||
* $Revision: 1.1 $
|
||||
* $Revision: 1.2 $
|
||||
* $Author: bradleyb $
|
||||
* $Date: 2002-02-06 09:22:42 $
|
||||
* $Date: 2002-02-14 09:27:09 $
|
||||
*
|
||||
* ipclient.cpp - udp/ip client code
|
||||
* added 2000/02/07 Matt Mueller
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.1 2002/02/06 09:22:42 bradleyb
|
||||
* Adding d1x network code
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -131,7 +134,7 @@ static int ipx_ip_SendPacket(IPXPacket_t *IPXHeader,
|
|||
return -1;
|
||||
}
|
||||
chk(buf=(char*)alloca(2+dataLen));
|
||||
memcpy(buf+0,D1Xid ,2);
|
||||
memcpy(buf+0,D2Xid ,2);
|
||||
memcpy(buf+2,data,dataLen);
|
||||
|
||||
#ifdef UDPDEBUG
|
||||
|
@ -192,8 +195,8 @@ static int ipx_ip_ReceivePacket(char *outbuf, int outbufsize,
|
|||
|
||||
memcpy(&fromaddr,rd->src_node,sizeof(ip_addr*));
|
||||
|
||||
if (memcmp(outbuf+0,D1Xid,2)) {
|
||||
if (memcmp(outbuf+0,D1Xcfgid,4)) {
|
||||
if (memcmp(outbuf+0,D2Xid,2)) {
|
||||
if (memcmp(outbuf+0,D2Xcfgid,4)) {
|
||||
mprintf((0,MSGHDR"no valid header\n"));
|
||||
return -1;
|
||||
}
|
||||
|
|
13
main/multi.h
13
main/multi.h
|
@ -13,13 +13,16 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
|
|||
|
||||
/*
|
||||
* $Source: /cvs/cvsroot/d2x/main/multi.h,v $
|
||||
* $Revision: 1.3 $
|
||||
* $Revision: 1.4 $
|
||||
* $Author: bradleyb $
|
||||
* $Date: 2002-02-13 10:39:21 $
|
||||
* $Date: 2002-02-14 09:24:19 $
|
||||
*
|
||||
* FIXME: put description here
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.3 2002/02/13 10:39:21 bradleyb
|
||||
* Lotsa networking stuff from d1x
|
||||
*
|
||||
* Revision 1.2 2001/10/25 02:15:56 bradleyb
|
||||
* conditionalize including multi.h and network.h, fix backslashes
|
||||
*
|
||||
|
@ -48,11 +51,11 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
|
|||
// 3 Descent II Shareware
|
||||
// 4 Descent II Commercial
|
||||
|
||||
#define MULTI_PROTO_DXX_VER 5
|
||||
#define MULTI_PROTO_D2X_VER 5
|
||||
|
||||
//edit 4/18/99 Matt Mueller - Needed to add data onto netgame_lite packet for flags.
|
||||
//Incrementing this seems the only way possible. Still stays backwards compitible.
|
||||
#define MULTI_PROTO_DXX_MINOR 1
|
||||
#define MULTI_PROTO_D2X_MINOR 1
|
||||
//end edit -MM
|
||||
|
||||
// Save multiplayer games?
|
||||
|
@ -302,7 +305,7 @@ typedef struct netplayer_info {
|
|||
ubyte rank;
|
||||
|
||||
#ifndef SHAREWARE
|
||||
/* following DXX only */
|
||||
/* following D2X only */
|
||||
ubyte sub_protocol;
|
||||
#endif
|
||||
} netplayer_info;
|
||||
|
|
|
@ -1,13 +1,16 @@
|
|||
/*
|
||||
* $Source: /cvs/cvsroot/d2x/main/netlist.c,v $
|
||||
* $Revision: 1.1 $
|
||||
* $Revision: 1.2 $
|
||||
* $Author: bradleyb $
|
||||
* $Date: 2002-02-14 09:05:33 $
|
||||
* $Date: 2002-02-14 09:24:19 $
|
||||
*
|
||||
* Descent II-a-like network game join menu
|
||||
* Arne de Bruijn, 1998
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.1 2002/02/14 09:05:33 bradleyb
|
||||
* Lotsa networking stuff from d1x
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -84,8 +87,8 @@ char *network_mode_text(const netgame_info *game) {
|
|||
#ifndef SHAREWARE
|
||||
if (game->gamemode >= 4 ||
|
||||
(game->protocol_version != MULTI_PROTO_VERSION &&
|
||||
(game->protocol_version != MULTI_PROTO_DXX_VER ||
|
||||
game->required_subprotocol > MULTI_PROTO_DXX_MINOR)))
|
||||
(game->protocol_version != MULTI_PROTO_D2X_VER ||
|
||||
game->required_subprotocol > MULTI_PROTO_D2X_MINOR)))
|
||||
return "UNSUP";
|
||||
#endif
|
||||
return names[game->gamemode];
|
||||
|
@ -113,7 +116,7 @@ static void network_update_item(const netgame_info *game, const AllNetPlayers_in
|
|||
for (i = 0; i < game->numplayers; i++)
|
||||
if (players->players[i].connected)
|
||||
activeplayers++;
|
||||
strcpy(li[1].value, game->protocol_version == MULTI_PROTO_DXX_VER ? "+" : "");
|
||||
strcpy(li[1].value, game->protocol_version == MULTI_PROTO_D2X_VER ? "+" : "");
|
||||
strcpy(li[2].value, game->game_name);
|
||||
strcpy(li[3].value, network_mode_text(game));
|
||||
|
||||
|
@ -283,15 +286,15 @@ int show_game_stats(netgame_info game, AllNetPlayers_info players, int awesomefl
|
|||
{
|
||||
case 1 : info+=sprintf(info,"\nPrtcl: Shareware"); break;
|
||||
case 2 : info+=sprintf(info,"\nPrtcl: Normal"); break;
|
||||
case 3 : info+=sprintf(info,"\nPrtcl: DXX only"); break;
|
||||
case 0 : info+=sprintf(info,"\nPrtcl: DXX hybrid"); break;
|
||||
case 3 : info+=sprintf(info,"\nPrtcl: D2X only"); break;
|
||||
case 0 : info+=sprintf(info,"\nPrtcl: D2X hybrid"); break;
|
||||
default: info+=sprintf(info,"\nPrtcl: Unknown"); break;
|
||||
}
|
||||
|
||||
if(game.game_flags & NETGAME_FLAG_SHOW_MAP)
|
||||
info+=sprintf(info,"\n Players on Map");
|
||||
//edited 04/19/99 Matt Mueller - check protocol_ver too.
|
||||
if (game.protocol_version==MULTI_PROTO_DXX_VER
|
||||
if (game.protocol_version==MULTI_PROTO_D2X_VER
|
||||
#ifndef SHAREWARE
|
||||
&& game.subprotocol>=1
|
||||
#endif
|
||||
|
@ -441,7 +444,7 @@ int get_and_show_netgame_info(ubyte *server, ubyte *node, ubyte *net_address){
|
|||
memcpy( me.player.callsign, Players[Player_num].callsign, CALLSIGN_LEN+1 );
|
||||
memcpy( me.player.network.ipx.node, ipx_get_my_local_address(), 6 );
|
||||
memcpy( me.player.network.ipx.server, ipx_get_my_server_address(), 4 );
|
||||
me.type = PID_DXX_GAME_INFO_REQ;//get full info.
|
||||
me.type = PID_D2X_GAME_INFO_REQ;//get full info.
|
||||
|
||||
send_sequence_packet( me, server,node,net_address);
|
||||
}
|
||||
|
|
|
@ -13,14 +13,17 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
|
|||
|
||||
/*
|
||||
* $Source: /cvs/cvsroot/d2x/main/netpkt.c,v $
|
||||
* $Revision: 1.1 $
|
||||
* $Revision: 1.2 $
|
||||
* $Author: bradleyb $
|
||||
* $Date: 2002-02-14 09:05:33 $
|
||||
* $Date: 2002-02-14 09:24:19 $
|
||||
*
|
||||
* Network packet conversions
|
||||
* Based on macnet.c from MAC version of Descent 1
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.1 2002/02/14 09:05:33 bradleyb
|
||||
* Lotsa networking stuff from d1x
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -38,21 +41,21 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
|
|||
#include "ipx.h"
|
||||
#include "netpkt.h"
|
||||
|
||||
void receive_netplayer_info(ubyte *data, netplayer_info *info, int dxx)
|
||||
void receive_netplayer_info(ubyte *data, netplayer_info *info, int d2x)
|
||||
{
|
||||
int loc = 0;
|
||||
|
||||
memcpy(info->callsign, &(data[loc]), CALLSIGN_LEN); loc += CALLSIGN_LEN;
|
||||
info->callsign[CALLSIGN_LEN] = 0;
|
||||
if (!dxx) loc++;
|
||||
if (!d2x) loc++;
|
||||
memcpy(&(info->network.ipx.server), &(data[loc]), 4); loc += 4;
|
||||
memcpy(&(info->network.ipx.node), &(data[loc]), 6); loc += 6;
|
||||
memcpy(&(info->socket), &(data[loc]), 2); loc += 2;
|
||||
//MWA don't think we need to swap this because we need it in high order info->socket = swapshort(info->socket);
|
||||
info->connected = data[loc]; loc++;
|
||||
#ifndef SHAREWARE
|
||||
//edited 03/04/99 Matt Mueller - sub_protocol was being set wrong in non-dxx games.. I still think its screwed somewhere else too though
|
||||
if (dxx){
|
||||
//edited 03/04/99 Matt Mueller - sub_protocol was being set wrong in non-d2x games.. I still think its screwed somewhere else too though
|
||||
if (d2x){
|
||||
info->sub_protocol = data[loc]; loc++;
|
||||
// printf ("%i "__FUNCTION__ " name=%s sub_protocol=%i\n",Player_num,info->callsign,info->sub_protocol);
|
||||
}else
|
||||
|
@ -75,7 +78,7 @@ void send_sequence_packet(sequence_packet seq, ubyte *server, ubyte *node, ubyte
|
|||
tmps = swapshort(seq.player.socket);
|
||||
memcpy(&(out_buffer[loc]), &tmps, 2); loc += 2;
|
||||
out_buffer[loc] = seq.player.connected; loc++;
|
||||
out_buffer[loc] = MULTI_PROTO_DXX_MINOR; loc++;
|
||||
out_buffer[loc] = MULTI_PROTO_D2X_MINOR; loc++;
|
||||
|
||||
if (net_address != NULL)
|
||||
ipx_send_packet_data( out_buffer, loc, server, node, net_address);
|
||||
|
@ -102,8 +105,8 @@ void send_netgame_packet(ubyte *server, ubyte *node)
|
|||
int loc = 0;
|
||||
|
||||
#ifndef SHAREWARE
|
||||
if (Netgame.protocol_version == MULTI_PROTO_DXX_VER) {
|
||||
send_dxx_netgame_packet(server, node);
|
||||
if (Netgame.protocol_version == MULTI_PROTO_D2X_VER) {
|
||||
send_d2x_netgame_packet(server, node);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
@ -124,7 +127,7 @@ void send_netgame_packet(ubyte *server, ubyte *node)
|
|||
memcpy(&(out_buffer[loc]), &(NetPlayers.players[i].socket), 2); loc += 2;
|
||||
memcpy(&(out_buffer[loc]), &(NetPlayers.players[i].connected), 1); loc++;
|
||||
}
|
||||
if (Netgame.protocol_version == MULTI_PROTO_DXX_VER) {
|
||||
if (Netgame.protocol_version == MULTI_PROTO_D2X_VER) {
|
||||
for (i = 0; i < MAX_PLAYERS; i++) {
|
||||
out_buffer[loc] = Netgame.locations[i]; loc++;
|
||||
}
|
||||
|
@ -177,7 +180,7 @@ void send_netgame_packet(ubyte *server, ubyte *node)
|
|||
}
|
||||
memcpy(&(out_buffer[loc]), Netgame.mission_name, 9); loc += 9;
|
||||
memcpy(&(out_buffer[loc]), Netgame.mission_title, MISSION_NAME_LEN+1); loc += (MISSION_NAME_LEN+1);
|
||||
if (Netgame.protocol_version == MULTI_PROTO_DXX_VER) {
|
||||
if (Netgame.protocol_version == MULTI_PROTO_D2X_VER) {
|
||||
out_buffer[loc] = Netgame.PacketsPerSec; loc++;
|
||||
tmpi = swapint(Netgame.flags);
|
||||
memcpy(&out_buffer[loc], &tmpi, 4); loc += 4;
|
||||
|
@ -190,13 +193,13 @@ void send_netgame_packet(ubyte *server, ubyte *node)
|
|||
ipx_send_internetwork_packet_data( out_buffer, loc, server, node );
|
||||
}
|
||||
|
||||
void receive_netgame_packet(ubyte *data, netgame_info *netgame, AllNetPlayers_info *netplayers, int dxx)
|
||||
void receive_netgame_packet(ubyte *data, netgame_info *netgame, AllNetPlayers_info *netplayers, int d2x)
|
||||
{
|
||||
int i, j;
|
||||
int loc = 0;
|
||||
#ifndef SHAREWARE
|
||||
if (dxx) {
|
||||
receive_dxx_netgame_packet(data, netgame, netplayers);
|
||||
if (d2x) {
|
||||
receive_d2x_netgame_packet(data, netgame, netplayers);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
@ -215,7 +218,7 @@ void receive_netgame_packet(ubyte *data, netgame_info *netgame, AllNetPlayers_in
|
|||
loc += sizeof(netplayer_info);//NETPLAYER_ORIG_SIZE;
|
||||
}
|
||||
#if 0
|
||||
if (dxx) {
|
||||
if (d2x) {
|
||||
for (i = 0; i < MAX_PLAYERS; i++) {
|
||||
netgame->locations[i] = data[loc]; loc++;
|
||||
}
|
||||
|
@ -275,7 +278,7 @@ void receive_netgame_packet(ubyte *data, netgame_info *netgame, AllNetPlayers_in
|
|||
memcpy(netgame->mission_name, &(data[loc]), 9); loc += 9;
|
||||
memcpy(netgame->mission_title, &(data[loc]), MISSION_NAME_LEN+1); loc += (MISSION_NAME_LEN+1);
|
||||
#if 0
|
||||
if (dxx && netgame->protocol_version == MULTI_PROTO_DXX_VER) {
|
||||
if (d2x && netgame->protocol_version == MULTI_PROTO_D2X_VER) {
|
||||
netgame->packets_per_sec = data[loc]; loc++;
|
||||
memcpy(&netgame->flags, &data[loc], 4); loc += 4;
|
||||
netgame->flags = swapint(netgame->flags);
|
||||
|
@ -285,21 +288,21 @@ void receive_netgame_packet(ubyte *data, netgame_info *netgame, AllNetPlayers_in
|
|||
}
|
||||
|
||||
#ifndef SHAREWARE
|
||||
void store_netplayer_info(ubyte *data, netplayer_info *player, int dxx)
|
||||
void store_netplayer_info(ubyte *data, netplayer_info *player, int d2x)
|
||||
{
|
||||
memcpy(data, player->callsign, CALLSIGN_LEN); data += CALLSIGN_LEN;
|
||||
if (!dxx) *(data++) = 0;
|
||||
if (!d2x) *(data++) = 0;
|
||||
memcpy(data, player->network.ipx.server, 4); data += 4;
|
||||
memcpy(data, player->network.ipx.node, 6); data += 6;
|
||||
memcpy(data, &player->socket, 2); data += 2;
|
||||
*data = player->connected; data++;
|
||||
if (dxx) {
|
||||
if (d2x) {
|
||||
*data = player->sub_protocol; data++;
|
||||
// printf ("%i "__FUNCTION__ " name=%s sub_protocol=%i\n",Player_num,player->callsign,player->sub_protocol);
|
||||
}
|
||||
}
|
||||
|
||||
void send_dxx_netgame_packet(ubyte *server, ubyte *node)
|
||||
void send_d2x_netgame_packet(ubyte *server, ubyte *node)
|
||||
{
|
||||
uint tmpi;
|
||||
ushort tmps;
|
||||
|
@ -308,7 +311,7 @@ void send_dxx_netgame_packet(ubyte *server, ubyte *node)
|
|||
|
||||
memset(out_buffer, 0, IPX_MAX_DATA_SIZE);
|
||||
out_buffer[loc] = Netgame.type; loc++;
|
||||
out_buffer[loc] = MULTI_PROTO_DXX_VER; loc++;
|
||||
out_buffer[loc] = MULTI_PROTO_D2X_VER; loc++;
|
||||
out_buffer[loc] = Netgame.subprotocol; loc++;
|
||||
out_buffer[loc] = Netgame.required_subprotocol; loc++;
|
||||
memcpy(&(out_buffer[loc]), Netgame.game_name, NETGAME_NAME_LEN); loc += NETGAME_NAME_LEN;
|
||||
|
@ -321,7 +324,7 @@ void send_dxx_netgame_packet(ubyte *server, ubyte *node)
|
|||
out_buffer[loc] = Netgame.game_flags; loc++;
|
||||
out_buffer[loc] = Netgame.max_numplayers; loc++;
|
||||
out_buffer[loc] = Netgame.team_vector; loc++;
|
||||
if (Netgame.type == PID_DXX_GAME_LITE) {
|
||||
if (Netgame.type == PID_D2X_GAME_LITE) {
|
||||
int master = -1;
|
||||
j = 0;
|
||||
for (i = 0; i < Netgame.numplayers; i++)
|
||||
|
@ -333,18 +336,18 @@ void send_dxx_netgame_packet(ubyte *server, ubyte *node)
|
|||
out_buffer[loc] = j; loc++; /* numconnected */
|
||||
if (master == -1) /* should not happen, but... */
|
||||
master = Player_num;
|
||||
store_netplayer_info(&(out_buffer[loc]), &NetPlayers.players[master], 1); loc += sizeof(netplayer_info); //NETPLAYER_DXX_SIZE;
|
||||
store_netplayer_info(&(out_buffer[loc]), &NetPlayers.players[master], 1); loc += sizeof(netplayer_info); //NETPLAYER_D2X_SIZE;
|
||||
//added 4/18/99 Matt Mueller - send .flags as well, so 'I' can show them
|
||||
tmpi = swapint(Netgame.flags);
|
||||
memcpy(&out_buffer[loc], &tmpi, 4); loc += 4;
|
||||
//end addition -MM
|
||||
} else {
|
||||
out_buffer[loc] = Netgame.numplayers; loc++;
|
||||
out_buffer[loc] = sizeof(netplayer_info); //NETPLAYER_DXX_SIZE; // sizeof netplayer struct
|
||||
out_buffer[loc] = sizeof(netplayer_info); //NETPLAYER_D2X_SIZE; // sizeof netplayer struct
|
||||
loc++;
|
||||
for (i = 0; i < MAX_PLAYERS; i++) {
|
||||
store_netplayer_info(&(out_buffer[loc]), &NetPlayers.players[i], 1);
|
||||
loc += sizeof(netplayer_info); //NETPLAYER_DXX_SIZE;
|
||||
loc += sizeof(netplayer_info); //NETPLAYER_D2X_SIZE;
|
||||
}
|
||||
memcpy(&(out_buffer[loc]), Netgame.team_name[0], CALLSIGN_LEN); loc += CALLSIGN_LEN;
|
||||
memcpy(&(out_buffer[loc]), Netgame.team_name[1], CALLSIGN_LEN); loc += CALLSIGN_LEN;
|
||||
|
@ -393,14 +396,14 @@ void send_dxx_netgame_packet(ubyte *server, ubyte *node)
|
|||
ipx_send_internetwork_packet_data(out_buffer, loc, server, node);
|
||||
}
|
||||
|
||||
void receive_dxx_netgame_packet(ubyte *data, netgame_info *netgame, AllNetPlayers_info *netplayers) {
|
||||
void receive_d2x_netgame_packet(ubyte *data, netgame_info *netgame, AllNetPlayers_info *netplayers) {
|
||||
int i, j;
|
||||
int loc = 0;
|
||||
|
||||
netgame->type = data[loc]; loc++;
|
||||
if (netgame->type == PID_DXX_GAME_LITE) {
|
||||
if (netgame->type == PID_D2X_GAME_LITE) {
|
||||
memset(netgame, 0, sizeof(netgame_info));
|
||||
netgame->type = PID_DXX_GAME_LITE;
|
||||
netgame->type = PID_D2X_GAME_LITE;
|
||||
}
|
||||
netgame->protocol_version = data[loc]; loc++;
|
||||
netgame->subprotocol = data[loc]; loc++;
|
||||
|
@ -418,11 +421,11 @@ void receive_dxx_netgame_packet(ubyte *data, netgame_info *netgame, AllNetPlayer
|
|||
netgame->game_flags = data[loc]; loc++;
|
||||
netgame->max_numplayers = data[loc]; loc++;
|
||||
netgame->team_vector = data[loc]; loc++;
|
||||
if (netgame->type == PID_DXX_GAME_LITE) {
|
||||
if (netgame->type == PID_D2X_GAME_LITE) {
|
||||
j = netgame->numplayers = data[loc]; loc++;
|
||||
for (i = 0; i < j; i++)
|
||||
netplayers->players[i].connected = 1;
|
||||
receive_netplayer_info(&(data[loc]), &(netplayers->players[0]), 1);loc += sizeof(netplayer_info); //NETPLAYER_DXX_SIZE;
|
||||
receive_netplayer_info(&(data[loc]), &(netplayers->players[0]), 1);loc += sizeof(netplayer_info); //NETPLAYER_D2X_SIZE;
|
||||
//added 4/18/99 Matt Mueller - send .flags as well, so 'I' can show them
|
||||
if (netgame->subprotocol>=1){
|
||||
memcpy(&netgame->flags, &data[loc], 4); loc += 4;
|
||||
|
|
|
@ -10,15 +10,15 @@
|
|||
|
||||
byte out_buffer[IPX_MAX_DATA_SIZE]; // used for tmp netgame packets as well as sending object data
|
||||
extern frame_info MySyncPack;
|
||||
void send_dxx_netgame_packet(ubyte *server, ubyte *node);
|
||||
void receive_dxx_netgame_packet(ubyte *data, netgame_info *netgame, AllNetPlayers_info *netplayers);
|
||||
void send_d2x_netgame_packet(ubyte *server, ubyte *node);
|
||||
void receive_d2x_netgame_packet(ubyte *data, netgame_info *netgame, AllNetPlayers_info *netplayers);
|
||||
//end change
|
||||
|
||||
void receive_netplayer_info(ubyte *data, netplayer_info *info, int dxx);
|
||||
void receive_netplayer_info(ubyte *data, netplayer_info *info, int d2x);
|
||||
void send_sequence_packet(sequence_packet seq, ubyte *server, ubyte *node, ubyte *net_address);
|
||||
void receive_sequence_packet(ubyte *data, sequence_packet *seq);
|
||||
void send_netgame_packet(ubyte *server, ubyte *node);
|
||||
void receive_netgame_packet(ubyte *data, netgame_info *netgame, AllNetPlayers_info *netplayers, int dxx);
|
||||
void receive_netgame_packet(ubyte *data, netgame_info *netgame, AllNetPlayers_info *netplayers, int d2x);
|
||||
void send_frameinfo_packet(ubyte *server, ubyte *node, ubyte *address, int short_packet);
|
||||
void receive_frameinfo_packet(ubyte *data, frame_info *info, int short_packet);
|
||||
void send_endlevel_packet(endlevel_info *info, ubyte *server, ubyte *node, ubyte *address);
|
||||
|
|
|
@ -13,13 +13,16 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
|
|||
|
||||
/*
|
||||
* $Source: /cvs/cvsroot/d2x/main/network.c,v $
|
||||
* $Revision: 1.7 $
|
||||
* $Revision: 1.8 $
|
||||
* $Author: bradleyb $
|
||||
* $Date: 2002-02-13 10:39:21 $
|
||||
* $Date: 2002-02-14 09:24:19 $
|
||||
*
|
||||
* FIXME: put description here
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.7 2002/02/13 10:39:21 bradleyb
|
||||
* Lotsa networking stuff from d1x
|
||||
*
|
||||
* Revision 1.6 2001/10/23 22:03:03 bradleyb
|
||||
* No longer #ifdef'ing out the whole file. RCS header added
|
||||
*
|
||||
|
@ -4346,14 +4349,14 @@ int network_do_join_game(netgame_info *jgame, AllNetPlayers_info *jplayers){
|
|||
}
|
||||
|
||||
if ((jgame->protocol_version != MULTI_PROTO_VERSION) &&
|
||||
(jgame->protocol_version != MULTI_PROTO_DXX_VER))
|
||||
(jgame->protocol_version != MULTI_PROTO_D2X_VER))
|
||||
{
|
||||
nm_messagebox(TXT_SORRY, 1, TXT_OK, TXT_VERSION_MISMATCH);
|
||||
return 0;
|
||||
}
|
||||
#ifndef SHAREWARE
|
||||
if (jgame->protocol_version == MULTI_PROTO_DXX_VER &&
|
||||
jgame->required_subprotocol > MULTI_PROTO_DXX_MINOR)
|
||||
if (jgame->protocol_version == MULTI_PROTO_D2X_VER &&
|
||||
jgame->required_subprotocol > MULTI_PROTO_D2X_MINOR)
|
||||
{
|
||||
nm_messagebox(TXT_SORRY, 1, TXT_OK, "This game uses features\nnot present in this version.");
|
||||
return 0;
|
||||
|
|
|
@ -13,13 +13,16 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
|
|||
|
||||
/*
|
||||
* $Source: /cvs/cvsroot/d2x/main/network.h,v $
|
||||
* $Revision: 1.5 $
|
||||
* $Revision: 1.6 $
|
||||
* $Author: bradleyb $
|
||||
* $Date: 2002-02-13 10:39:22 $
|
||||
* $Date: 2002-02-14 09:24:19 $
|
||||
*
|
||||
* FIXME: put description here
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.5 2002/02/13 10:39:22 bradleyb
|
||||
* Lotsa networking stuff from d1x
|
||||
*
|
||||
* Revision 1.4 2001/10/25 02:15:57 bradleyb
|
||||
* conditionalize including multi.h and network.h, fix backslashes
|
||||
*
|
||||
|
@ -187,8 +190,8 @@ int HoardEquipped();
|
|||
#define PID_NAMES_RETURN 64
|
||||
|
||||
#define PID_SHORTPDATA 42
|
||||
#define PID_DXX_GAME_INFO_REQ 65
|
||||
#define PID_DXX_GAME_LITE 68
|
||||
#define PID_D2X_GAME_INFO_REQ 65
|
||||
#define PID_D2X_GAME_LITE 68
|
||||
#define PID_PDATA_SHORT2 70
|
||||
|
||||
#define NETGAME_ANARCHY 0
|
||||
|
|
Loading…
Reference in a new issue