diff options
| author | oy <Tom_Adams@web.de> | 2012-03-04 12:47:16 +0100 |
|---|---|---|
| committer | oy <Tom_Adams@web.de> | 2013-02-24 17:26:59 +0100 |
| commit | 13d06e45ac14d5f584462d0611f85a4e1dafcf17 (patch) | |
| tree | 473e7b8e8bff5c9efb0c06b51acef10e6a1a5a43 /src/engine/client/client.cpp | |
| parent | ffd89938d7caebe2ecd7bf18d00283e6aadea981 (diff) | |
| download | zcatch-13d06e45ac14d5f584462d0611f85a4e1dafcf17.tar.gz zcatch-13d06e45ac14d5f584462d0611f85a4e1dafcf17.zip | |
fixed used nettype in server browser and try to use ipv4 and ipv6 socket when using a bindaddr. Closes #940
Diffstat (limited to 'src/engine/client/client.cpp')
| -rw-r--r-- | src/engine/client/client.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/engine/client/client.cpp b/src/engine/client/client.cpp index d5da647b..6d1d8f4f 100644 --- a/src/engine/client/client.cpp +++ b/src/engine/client/client.cpp @@ -1746,14 +1746,19 @@ void CClient::Run() // open socket { NETADDR BindAddr; - if(g_Config.m_Bindaddr[0] == 0 || net_host_lookup(g_Config.m_Bindaddr, &BindAddr, NETTYPE_ALL) != 0) + if(g_Config.m_Bindaddr[0] && net_host_lookup(g_Config.m_Bindaddr, &BindAddr, NETTYPE_ALL) == 0) + { + // got bindaddr + BindAddr.type = NETTYPE_ALL; + } + else { mem_zero(&BindAddr, sizeof(BindAddr)); BindAddr.type = NETTYPE_ALL; } if(!m_NetClient.Open(BindAddr, 0)) { - dbg_msg("client", "couldn't start network"); + dbg_msg("client", "couldn't open socket"); return; } } |