use different ping message for server list ping

This commit is contained in:
Volker Fischer 2011-05-24 18:44:51 +00:00
parent b28daa079a
commit 3b8a04a829
9 changed files with 27 additions and 15 deletions

View File

@ -227,8 +227,17 @@ public:
void CreatePingMes()
{ Channel.CreatePingMes ( PreparePingMessage() ); }
void CreateCLPingMes ( const CHostAddress& InetAddr )
{ ConnLessProtocol.CreateCLPingMes ( InetAddr, PreparePingMessage() ); }
// TODO
//void CreateCLPingMes ( const CHostAddress& InetAddr )
// { ConnLessProtocol.CreateCLPingMes ( InetAddr, PreparePingMessage() ); }
void CreateCLServerListPingMes ( const CHostAddress& InetAddr )
{
ConnLessProtocol.CreateCLPingWithNumClientsMes ( InetAddr,
PreparePingMessage(),
0 /* dummy */ );
}
void CreateCLReqServerListMes ( const CHostAddress& InetAddr )
{ ConnLessProtocol.CreateCLReqServerListMes ( InetAddr ); }

View File

@ -351,7 +351,7 @@ void CConnectDlg::OnTimerPing()
CurServerAddress ) )
{
// if address is valid, send ping
emit CreateCLPingMes ( CurServerAddress );
emit CreateCLServerListPingMes ( CurServerAddress );
}
}
}

View File

@ -97,5 +97,5 @@ public slots:
signals:
void ReqServerListQuery ( CHostAddress InetAddr );
void CreateCLPingMes ( CHostAddress InetAddr );
void CreateCLServerListPingMes ( CHostAddress InetAddr );
};

View File

@ -399,8 +399,8 @@ CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP,
QObject::connect ( &ConnectDlg, SIGNAL ( ReqServerListQuery ( CHostAddress ) ),
this, SLOT ( OnReqServerListQuery ( CHostAddress ) ) );
QObject::connect ( &ConnectDlg, SIGNAL ( CreateCLPingMes ( CHostAddress ) ),
this, SLOT ( OnCreateCLPingMes ( CHostAddress ) ) );
QObject::connect ( &ConnectDlg, SIGNAL ( CreateCLServerListPingMes ( CHostAddress ) ),
this, SLOT ( OnCreateCLServerListPingMes ( CHostAddress ) ) );
// Timers ------------------------------------------------------------------

View File

@ -153,8 +153,8 @@ public slots:
void OnReqServerListQuery ( CHostAddress InetAddr )
{ pClient->CreateCLReqServerListMes ( InetAddr ); }
void OnCreateCLPingMes ( CHostAddress InetAddr )
{ pClient->CreateCLPingMes ( InetAddr ); }
void OnCreateCLServerListPingMes ( CHostAddress InetAddr )
{ pClient->CreateCLServerListPingMes ( InetAddr ); }
void OnCLServerListReceived ( CHostAddress InetAddr,
CVector<CServerInfo> vecServerInfo )

View File

@ -147,8 +147,9 @@ CONNECTION LESS MESSAGES
- PROTMESSID_CLM_PING_MS: Connection less ping message (for measuring the ping
time)
note: same definition as PROTMESSID_PING_MS
+-----------------------------+
| 4 bytes transmit time in ms |
+-----------------------------+
- PROTMESSID_CLM_PING_MS_WITHNUMCLIENTS: Connection less ping message (for

View File

@ -99,8 +99,8 @@ public:
void CreateCLPingMes ( const CHostAddress& InetAddr, const int iMs );
void CreateCLPingWithNumClientsMes ( const CHostAddress& InetAddr,
const int iMs,
const int iNumClients );
const int iMs,
const int iNumClients );
void CreateCLServerFullMes ( const CHostAddress& InetAddr );
void CreateCLRegisterServerMes ( const CHostAddress& InetAddr,
const CServerCoreInfo& ServerInfo );

View File

@ -285,8 +285,8 @@ CServer::CServer ( const int iNewNumChan,
this, SLOT ( OnSendCLProtMessage ( CHostAddress, CVector<uint8_t> ) ) );
QObject::connect ( &ConnLessProtocol,
SIGNAL ( CLPingReceived ( CHostAddress, int ) ),
this, SLOT ( OnCLPingReceived ( CHostAddress, int ) ) );
SIGNAL ( CLPingWithNumClientsReceived ( CHostAddress, int, int ) ),
this, SLOT ( OnCLPingWithNumClientsReceived ( CHostAddress, int, int ) ) );
QObject::connect ( &ConnLessProtocol,
SIGNAL ( CLRegisterServerReceived ( CHostAddress, CServerCoreInfo ) ),

View File

@ -249,7 +249,9 @@ public slots:
const int iNumBytes,
const CHostAddress& InetAddr );
void OnCLPingReceived ( CHostAddress InetAddr, int iMs )
void OnCLPingWithNumClientsReceived ( CHostAddress InetAddr,
int iMs,
int )
{
ConnLessProtocol.CreateCLPingWithNumClientsMes ( InetAddr,
iMs,