Add Multicast capabilities for LAN server scanning.

This commit is contained in:
Thilo Schulz 2008-04-09 14:37:42 +00:00
parent 32bd0ab5bd
commit eb3b59308b
10 changed files with 351 additions and 153 deletions

View file

@ -686,10 +686,9 @@ qboolean NET_StringToAdr( const char *s, netadr_t *a, netadrtype_t family ) {
return qtrue;
}
// look for a port number
Q_strncpyz( base, s, sizeof( base ) );
if(*base == '[')
if(*base == '[' || Q_CountChar(base, ':') > 1)
{
// This is an ipv6 address, handle it specially.
search = strchr(base, ']');
@ -702,10 +701,14 @@ qboolean NET_StringToAdr( const char *s, netadr_t *a, netadrtype_t family ) {
port = search + 1;
}
search = base + 1;
if(*base == '[')
search = base + 1;
else
search = base;
}
else
{
// look for a port number
port = strchr( base, ':' );
if ( port ) {