Skip to content

Commit

Permalink
add IPv6 master support
Browse files Browse the repository at this point in the history
  • Loading branch information
ghost committed Jan 9, 2024
1 parent 58177d9 commit afec716
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions engine/client/cl_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2191,9 +2191,22 @@ void CL_ConnectionlessPacket( netadr_t from, sizebuf_t *msg )
// serverlist got from masterserver
while( MSG_GetNumBitsLeft( msg ) > 8 )
{
MSG_ReadBytes( msg, servadr.ip, sizeof( servadr.ip )); // 4 bytes for IP
servadr.port = MSG_ReadShort( msg ); // 2 bytes for Port
servadr.type = NA_IP;

uint8_t addr[16];

if( from.type6 == NA_IP6 ) // IPv6 master server only sends IPv6 addresses
{
MSG_ReadBytes( msg, addr, sizeof( addr ));
NET_IP6BytesToNetadr( &servadr, addr );
servadr.type6 = NA_IP6;
}
else
{
MSG_ReadBytes( msg, servadr.ip, sizeof( servadr.ip )); // 4 bytes for IP
servadr.type = NA_IP;
}

servadr.port = MSG_ReadShort( msg ); // 2 bytes for Port

// list is ends here
if( !servadr.port )
Expand Down Expand Up @@ -2457,7 +2470,7 @@ void CL_ProcessFile( qboolean successfully_received, const char *filename )
if( !Q_strnicmp( filename, "downloaded/", 11 ))
{
// skip "downloaded/" part to avoid mismatch with needed resources list
filename += 11;
filename += 11;
}
}
else if( !successfully_received )
Expand Down

0 comments on commit afec716

Please sign in to comment.