Make the client and server IPv6 aware

This commit is contained in:
Yamagi Burmeister 2011-10-15 16:18:26 +00:00
parent 75e9f6cf85
commit 07ed4c8b5a
5 changed files with 650 additions and 213 deletions

14
README
View File

@ -452,5 +452,17 @@ How do I disable friendly fire in coop mode?
open the console and type "dmflags 336" für skinbased teamplay and
"dmflags 400" for modelbased teamplay.
Can I connect to an IPv6 server?
- Yes, the same way as connecting to an IPv4 server. Since the Quake II
console has problems with the characters ":", "[" and "]" we suggest
to submit the connection command as command line argument:
./quake2 +connect "[2001:db8::1]"
For your server to show up in the server list you need to supply a
multicast interface to both the client and the server:
./q2ded +set multicast eth0
./quake2 +set multicast eth0
Normaly the server will listen to all IPv4 and IPv6 addresses. You
can bind it to an address with:
./q2ded +set ip "[2001:db8::1]"
===============================================================================
==============================================================================

View File

@ -456,6 +456,11 @@ void CL_PingServers_f (void)
adr.type = NA_BROADCAST;
adr.port = BigShort(PORT_SERVER);
Netchan_OutOfBandPrint (NS_CLIENT, adr, va("info %i", PROTOCOL_VERSION));
Com_Printf ("pinging multicast...\n");
adr.type = NA_MULTICAST6;
adr.port = BigShort(PORT_SERVER);
Netchan_OutOfBandPrint (NS_CLIENT, adr, va("info %i", PROTOCOL_VERSION));
}
noipx = Cvar_Get ("noipx", "0", CVAR_NOSET);

View File

@ -2165,7 +2165,7 @@ void M_AddToServerList (netadr_t adr, char *info) {
return;
local_server_netadr[m_num_servers] = adr;
snprintf (local_server_names[m_num_servers], sizeof(local_server_names[m_num_servers])-1, "%d. %s", m_num_servers+1, info);
Com_sprintf(local_server_names[m_num_servers], sizeof(local_server_names[0])-1, "%s %s", info, NET_AdrToString(adr));
m_num_servers++;
}

View File

@ -456,14 +456,24 @@ extern qboolean userinfo_modified;
#define MAX_MSGLEN 1400 /* max length of a message */
#define PACKET_HEADER 10 /* two ints and a short */
typedef enum {NA_LOOPBACK, NA_BROADCAST, NA_IP, NA_IPX, NA_BROADCAST_IPX} netadrtype_t;
typedef enum
{
NA_LOOPBACK,
NA_BROADCAST,
NA_IP,
NA_IPX,
NA_BROADCAST_IPX,
NA_IP6,
NA_MULTICAST6
} netadrtype_t;
typedef enum {NS_CLIENT, NS_SERVER} netsrc_t;
typedef struct
{
netadrtype_t type;
byte ip[4];
byte ip[16];
unsigned int scope_id;
byte ipx[10];
unsigned short port;

File diff suppressed because it is too large Load Diff