mirror of
https://github.com/ZDoom/Raze.git
synced 2025-02-25 12:51:04 +00:00
Only get the external IP if no peers have internal IPs and the IP we're using is a LAN IP
git-svn-id: https://svn.eduke32.com/eduke32@137 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
bf48c4c4dc
commit
51b54cf6ad
1 changed files with 48 additions and 43 deletions
|
@ -7607,7 +7607,10 @@ void checkcommandline(int argc,char **argv)
|
||||||
}
|
}
|
||||||
if(CommandNet)
|
if(CommandNet)
|
||||||
{
|
{
|
||||||
load_rancid_net(CommandNet);
|
if(load_rancid_net(CommandNet) != -1)
|
||||||
|
{
|
||||||
|
char tmp[16];
|
||||||
|
|
||||||
qsort((char *)rancid_ip_strings, rancid_players, sizeof(rancid_ip_strings[0]), (int(*)(const void*,const void*))stringsort);
|
qsort((char *)rancid_ip_strings, rancid_players, sizeof(rancid_ip_strings[0]), (int(*)(const void*,const void*))stringsort);
|
||||||
CommandNet = 0;
|
CommandNet = 0;
|
||||||
netparamcount = rancid_players;
|
netparamcount = rancid_players;
|
||||||
|
@ -7618,7 +7621,6 @@ void checkcommandline(int argc,char **argv)
|
||||||
{
|
{
|
||||||
if(Bstrcmp(rancid_ip_strings[j],rancid_ip_strings[MAXPLAYERS]) != 0)
|
if(Bstrcmp(rancid_ip_strings[j],rancid_ip_strings[MAXPLAYERS]) != 0)
|
||||||
{
|
{
|
||||||
char tmp[16];
|
|
||||||
Bstrncpy(tempbuf,rancid_ip_strings[j], 8);
|
Bstrncpy(tempbuf,rancid_ip_strings[j], 8);
|
||||||
Bstrcpy(tmp,strtok(tempbuf,"."));
|
Bstrcpy(tmp,strtok(tempbuf,"."));
|
||||||
if(Bstrcmp(tmp,"10") == 0)
|
if(Bstrcmp(tmp,"10") == 0)
|
||||||
|
@ -7637,7 +7639,9 @@ void checkcommandline(int argc,char **argv)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(j == rancid_players)
|
Bstrcpy(tempbuf,rancid_ip_strings[MAXPLAYERS]);
|
||||||
|
Bstrcpy(tmp,strtok(tempbuf,"."));
|
||||||
|
if(j == rancid_players && ((Bstrcmp(tmp,"192") == 0) || (Bstrcmp(tmp,"172") == 0) || (Bstrcmp(tmp,"10") == 0)))
|
||||||
{
|
{
|
||||||
Bsprintf(tempbuf, getexternaladdress());
|
Bsprintf(tempbuf, getexternaladdress());
|
||||||
if(tempbuf[0])
|
if(tempbuf[0])
|
||||||
|
@ -7660,7 +7664,8 @@ void checkcommandline(int argc,char **argv)
|
||||||
}
|
}
|
||||||
if(j != netparamcount)
|
if(j != netparamcount)
|
||||||
netparam[j] = rancid_local_port_string;
|
netparam[j] = rancid_local_port_string;
|
||||||
initprintf("ip: %s\n",rancid_ip_strings[MAXPLAYERS]);
|
}
|
||||||
|
// initprintf("ip: %s\n",rancid_ip_strings[MAXPLAYERS]);
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in a new issue