Use alternate dns name if name resolution fails for internet server (6dns.org seems to be unreliable, but is still the only one to provide both ipv4 and ipv6 name resolution for free).

This commit is contained in:
lotodore
2007-11-30 21:28:38 +00:00
parent 3838b2e22f
commit b97c56cd26
5 changed files with 31 additions and 2 deletions
+3 -1
View File
@@ -70,7 +70,8 @@ ClientThread::~ClientThread()
void
ClientThread::Init(
const string &serverAddress, unsigned serverPort, bool ipv6, bool sctp,
const string &serverAddress, const string &alternateServerAddress,
unsigned serverPort, bool ipv6, bool sctp,
const string &pwd, const string &playerName, const string &avatarFile)
{
if (IsRunning())
@@ -84,6 +85,7 @@ ClientThread::Init(
context.SetProtocol(sctp ? SOCKET_IPPROTO_SCTP : 0);
context.SetAddrFamily(ipv6 ? AF_INET6 : AF_INET);
context.SetServerAddr(serverAddress);
context.SetAlternateServerAddr(alternateServerAddress);
context.SetServerPort(serverPort);
context.SetPassword(pwd);
context.SetPlayerName(playerName);