new version number, added code for sending disconnect messages if a server was not correctly disconnected

This commit is contained in:
Volker Fischer 2011-05-05 19:39:48 +00:00
parent 6c5961be1f
commit 0fecef8aa8
5 changed files with 34 additions and 11 deletions

View file

@ -1,12 +1,19 @@
3.1.3
4.0.0
- new GUI style of the main window, added switch for selecting the GUI style
in the settings window
- ini-file is stored in the home directory instead of the application directory
- a list of available servers is shown on pressing the connect button, the list
is managed by a central server, any private server is added automatically if
the registering setting is enabled
- the Qt project file is now used for Linux, too
- ini-file is stored in the home directory instead of the application directory
- added server settings in the GUI for the server list and added ini file
support to store the settings
3.1.2

View file

@ -435,11 +435,7 @@ void CClient::Stop()
// receive mechanism with the next command, we do not evaluate any
// respond from the server, therefore we just hope that the message
// gets its way to the server, if not, the old behaviour time-out
// disconnects the connection anyway. Send the message three times
// to increase the probability that at least one message makes it
// through).
Channel.CreateAndImmSendDisconnectionMes();
Channel.CreateAndImmSendDisconnectionMes();
// disconnects the connection anyway).
Channel.CreateAndImmSendDisconnectionMes();
// disable channel

View file

@ -43,7 +43,7 @@
// version and application name (always use this version)
#undef VERSION
#define VERSION "3.1.3cvs"
#define VERSION "4.0.0cvs"
#define APP_NAME "llcon"
// default names of the ini-file for client and server

View file

@ -574,6 +574,12 @@ bool CProtocol::ParseConnectionLessMessage ( const CVector<uint8_t>& vecbyData,
if ( !ParseMessageFrame ( vecbyData, iNumBytes, iRecCounter, iRecID, vecData ) )
{
/*
// TEST channel implementation: randomly delete protocol messages (50 % loss)
if ( rand() < ( RAND_MAX / 2 ) ) return false;
*/
if ( IsConnectionLessMessageID ( iRecID ) )
{
// check which type of message we received and do action

View file

@ -127,9 +127,23 @@ void CSocket::OnDataReceived()
{
// this is an unknown address, try to parse connection less
// message
pConnLessProtocol->ParseConnectionLessMessage ( vecbyRecBuf,
iNumBytesRead,
RecHostAddr );
if ( pConnLessProtocol->ParseConnectionLessMessage ( vecbyRecBuf,
iNumBytesRead,
RecHostAddr ) )
{
// message coult not be parsed, check if the packet comes
// from the server we just connected -> if yes, send
// disconnect message since the server may not know that we
// are not connected anymore
if ( pChannel->GetAddress() == RecHostAddr )
{
// the channel has to be enabled for sending a message,
// disable the channel again afterwards
pChannel->SetEnable ( true );
pChannel->CreateAndImmSendDisconnectionMes();
pChannel->SetEnable ( false );
}
}
// do not perform any other action on this received packet
return;