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() void CreatePingMes()
{ Channel.CreatePingMes ( PreparePingMessage() ); } { Channel.CreatePingMes ( PreparePingMessage() ); }
void CreateCLPingMes ( const CHostAddress& InetAddr ) // TODO
{ ConnLessProtocol.CreateCLPingMes ( InetAddr, PreparePingMessage() ); } //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 ) void CreateCLReqServerListMes ( const CHostAddress& InetAddr )
{ ConnLessProtocol.CreateCLReqServerListMes ( InetAddr ); } { ConnLessProtocol.CreateCLReqServerListMes ( InetAddr ); }

View file

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

View file

@ -97,5 +97,5 @@ public slots:
signals: signals:
void ReqServerListQuery ( CHostAddress InetAddr ); 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 ) ), QObject::connect ( &ConnectDlg, SIGNAL ( ReqServerListQuery ( CHostAddress ) ),
this, SLOT ( OnReqServerListQuery ( CHostAddress ) ) ); this, SLOT ( OnReqServerListQuery ( CHostAddress ) ) );
QObject::connect ( &ConnectDlg, SIGNAL ( CreateCLPingMes ( CHostAddress ) ), QObject::connect ( &ConnectDlg, SIGNAL ( CreateCLServerListPingMes ( CHostAddress ) ),
this, SLOT ( OnCreateCLPingMes ( CHostAddress ) ) ); this, SLOT ( OnCreateCLServerListPingMes ( CHostAddress ) ) );
// Timers ------------------------------------------------------------------ // Timers ------------------------------------------------------------------

View file

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

View file

@ -147,8 +147,9 @@ CONNECTION LESS MESSAGES
- PROTMESSID_CLM_PING_MS: Connection less ping message (for measuring the ping - PROTMESSID_CLM_PING_MS: Connection less ping message (for measuring the ping
time) time)
note: same definition as PROTMESSID_PING_MS +-----------------------------+
| 4 bytes transmit time in ms |
+-----------------------------+
- PROTMESSID_CLM_PING_MS_WITHNUMCLIENTS: Connection less ping message (for - 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 CreateCLPingMes ( const CHostAddress& InetAddr, const int iMs );
void CreateCLPingWithNumClientsMes ( const CHostAddress& InetAddr, void CreateCLPingWithNumClientsMes ( const CHostAddress& InetAddr,
const int iMs, const int iMs,
const int iNumClients ); const int iNumClients );
void CreateCLServerFullMes ( const CHostAddress& InetAddr ); void CreateCLServerFullMes ( const CHostAddress& InetAddr );
void CreateCLRegisterServerMes ( const CHostAddress& InetAddr, void CreateCLRegisterServerMes ( const CHostAddress& InetAddr,
const CServerCoreInfo& ServerInfo ); const CServerCoreInfo& ServerInfo );

View file

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

View file

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