Merge pull request #9204 from ChillerDragon/pr_send_pass_on_reconnect

Send password on reconnect
This commit is contained in:
Dennis Felsing 2024-11-04 08:02:31 +00:00 committed by GitHub
commit 22571f19fd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -540,6 +540,9 @@ void CClient::Connect(const char *pAddress, const char *pPassword)
Disconnect();
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)
str_copy(m_aConnectAddressStr, pAddress);
@ -583,6 +586,12 @@ void CClient::Connect(const char *pAddress, const char *pPassword)
OnlySixup = false;
net_addr_str(&NextAddr, aNextAddr, sizeof(aNextAddr), true);
log_debug("client", "resolved connect address '%s' to %s", aBuffer, aNextAddr);
if(!str_comp(aNextAddr, aLastAddr))
{
m_SendPassword = true;
}
aConnectAddrs[NumConnectAddrs] = NextAddr;
NumConnectAddrs += 1;
}