Net Server: Verify password in Authenticate

Follows 1a8de6d2b8.
Validate the password when a client joins a game, so even a player that
knows the connection data cannot join.

Refs #3556, Refs #5913

Differential Revision: https://code.wildfiregames.com/D3438
This was SVN commit r24775.
This commit is contained in:
wraitii
2021-01-23 18:04:36 +00:00
parent 498f5eb083
commit 4cc824d620
8 changed files with 68 additions and 8 deletions
+6 -1
View File
@@ -175,6 +175,11 @@ void CNetClient::SetHostingPlayerName(const CStr& hostingPlayerName)
m_HostingPlayerName = hostingPlayerName;
}
void CNetClient::SetGamePassword(const CStr& hashedPassword)
{
m_Password = hashedPassword;
}
bool CNetClient::SetupConnection(ENetHost* enetClient)
{
CNetClientSession* session = new CNetClientSession(*this);
@@ -570,7 +575,7 @@ void CNetClient::SendAuthenticateMessage()
{
CAuthenticateMessage authenticate;
authenticate.m_Name = m_UserName;
authenticate.m_Password = L""; // TODO
authenticate.m_Password = m_Password;
authenticate.m_IsLocalClient = m_IsLocalClient;
SendMessage(&authenticate);
}