mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-14 20:18:19 +00:00
Merge pull request #9204 from ChillerDragon/pr_send_pass_on_reconnect
Send password on reconnect
This commit is contained in:
commit
22571f19fd
|
@ -540,6 +540,9 @@ void CClient::Connect(const char *pAddress, const char *pPassword)
|
||||||
Disconnect();
|
Disconnect();
|
||||||
dbg_assert(m_State == IClient::STATE_OFFLINE, "Disconnect must ensure that client is offline");
|
dbg_assert(m_State == IClient::STATE_OFFLINE, "Disconnect must ensure that client is offline");
|
||||||
|
|
||||||
|
char aLastAddr[NETADDR_MAXSTRSIZE];
|
||||||
|
net_addr_str(&ServerAddress(), aLastAddr, sizeof(aLastAddr), true);
|
||||||
|
|
||||||
if(pAddress != m_aConnectAddressStr)
|
if(pAddress != m_aConnectAddressStr)
|
||||||
str_copy(m_aConnectAddressStr, pAddress);
|
str_copy(m_aConnectAddressStr, pAddress);
|
||||||
|
|
||||||
|
@ -583,6 +586,12 @@ void CClient::Connect(const char *pAddress, const char *pPassword)
|
||||||
OnlySixup = false;
|
OnlySixup = false;
|
||||||
net_addr_str(&NextAddr, aNextAddr, sizeof(aNextAddr), true);
|
net_addr_str(&NextAddr, aNextAddr, sizeof(aNextAddr), true);
|
||||||
log_debug("client", "resolved connect address '%s' to %s", aBuffer, aNextAddr);
|
log_debug("client", "resolved connect address '%s' to %s", aBuffer, aNextAddr);
|
||||||
|
|
||||||
|
if(!str_comp(aNextAddr, aLastAddr))
|
||||||
|
{
|
||||||
|
m_SendPassword = true;
|
||||||
|
}
|
||||||
|
|
||||||
aConnectAddrs[NumConnectAddrs] = NextAddr;
|
aConnectAddrs[NumConnectAddrs] = NextAddr;
|
||||||
NumConnectAddrs += 1;
|
NumConnectAddrs += 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue