mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-11 15:47:55 +00:00
engine: client: add support for parsing IPv6 server list
This commit is contained in:
parent
58177d9251
commit
266f9a6bc6
@ -2191,9 +2191,20 @@ void CL_ConnectionlessPacket( netadr_t from, sizebuf_t *msg )
|
|||||||
// serverlist got from masterserver
|
// serverlist got from masterserver
|
||||||
while( MSG_GetNumBitsLeft( msg ) > 8 )
|
while( MSG_GetNumBitsLeft( msg ) > 8 )
|
||||||
{
|
{
|
||||||
MSG_ReadBytes( msg, servadr.ip, sizeof( servadr.ip )); // 4 bytes for 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
|
servadr.port = MSG_ReadShort( msg ); // 2 bytes for Port
|
||||||
servadr.type = NA_IP;
|
|
||||||
|
|
||||||
// list is ends here
|
// list is ends here
|
||||||
if( !servadr.port )
|
if( !servadr.port )
|
||||||
|
Loading…
Reference in New Issue
Block a user