WIP: Begin rewriting serverbrowser

This commit is contained in:
nillerusr
2023-01-29 19:26:04 +03:00
parent 548be38a0b
commit 41aa50e66e
27 changed files with 265 additions and 333 deletions

View File

@@ -293,7 +293,10 @@ void CDialogGameInfo::PerformLayout()
}
SetControlString("PlayersText", buf);
if ( m_Server.m_NetAdr.GetIP() && m_Server.m_NetAdr.GetQueryPort() )
SetControlString("ServerIPText", m_Server.m_NetAdr.GetConnectionAddressString() );
m_pConnectButton->SetEnabled(true);
/* if ( m_Server.m_NetAdr.GetIP() && m_Server.m_NetAdr.GetQueryPort() )
{
SetControlString("ServerIPText", m_Server.m_NetAdr.GetConnectionAddressString() );
m_pConnectButton->SetEnabled(true);
@@ -312,7 +315,7 @@ void CDialogGameInfo::PerformLayout()
{
SetControlString("ServerIPText", "");
m_pConnectButton->SetEnabled(false);
}
}*/
if ( m_Server.m_bHadSuccessfulResponse )
{
@@ -405,7 +408,11 @@ void CDialogGameInfo::OnConnect()
// need to refresh server before attempting to connect, to make sure there is enough room on the server
m_iRequestRetry = 0;
RequestInfo();
ConnectToServer();
//TODO(nillerusr): restore this later
//RequestInfo();
}
//-----------------------------------------------------------------------------
@@ -633,17 +640,6 @@ void CDialogGameInfo::ConnectToServer()
{
m_bConnecting = false;
// check VAC status
if ( m_Server.m_bSecure && ServerBrowser().IsVACBannedFromGame( m_Server.m_nAppID ) )
{
// refuse the user
CVACBannedConnRefusedDialog *pDlg = new CVACBannedConnRefusedDialog( GetVParent(), "VACBannedConnRefusedDialog" );
pDlg->Activate();
Close();
return;
}
// check to see if we need a password
if ( m_Server.m_bPassword && !m_szPassword[0] )
{
@@ -654,7 +650,9 @@ void CDialogGameInfo::ConnectToServer()
}
// check the player count
if ( m_Server.m_nPlayers >= m_Server.m_nMaxPlayers )
// nillerusr
/*if ( m_Server.m_nPlayers >= m_Server.m_nMaxPlayers )
{
// mark why we cannot connect
m_bServerFull = true;
@@ -662,7 +660,7 @@ void CDialogGameInfo::ConnectToServer()
m_bShowAutoRetryToggle = true;
InvalidateLayout();
return;
}
}*/
// tell the engine to connect
const char *gameDir = m_Server.m_szGameDir;