fix for server on local host (for server list)
This commit is contained in:
parent
22591a4aae
commit
3a1c4510fa
1 changed files with 271 additions and 258 deletions
|
@ -215,6 +215,19 @@ void CServerListManager::QueryServerList ( const CHostAddress& InetAddr )
|
||||||
// copy list item
|
// copy list item
|
||||||
vecServerInfo[iIdx] = ServerList[iIdx];
|
vecServerInfo[iIdx] = ServerList[iIdx];
|
||||||
|
|
||||||
|
// check if the address of the client which is requesting the list
|
||||||
|
// is the same address as one server in the list -> in this case
|
||||||
|
// he has to connect to the local host address, unfortunately, the
|
||||||
|
// port number is not known (because of NAT port translating) so we
|
||||||
|
// assume that it is the default llcon port number
|
||||||
|
if ( vecServerInfo[iIdx].HostAddr == InetAddr )
|
||||||
|
{
|
||||||
|
vecServerInfo[iIdx].HostAddr.InetAddr.
|
||||||
|
setAddress ( QHostAddress::LocalHost );
|
||||||
|
|
||||||
|
vecServerInfo[iIdx].HostAddr.iPort = LLCON_DEFAULT_PORT_NUMBER;
|
||||||
|
}
|
||||||
|
|
||||||
// create "send empty message" for all registered servers (except
|
// create "send empty message" for all registered servers (except
|
||||||
// of the very first list entry since this is this server (central
|
// of the very first list entry since this is this server (central
|
||||||
// server) per definition)
|
// server) per definition)
|
||||||
|
|
Loading…
Reference in a new issue