added new server registration result: SRR_VERSION_TOO_OLD
This commit is contained in:
parent
84d7887914
commit
5f579d7b96
4 changed files with 31 additions and 12 deletions
|
@ -2375,10 +2375,18 @@ bool CProtocol::EvaluateCLRegisterServerResp ( const CHostAddress& InetAddr,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ESvrRegResult eResult = static_cast<ESvrRegResult> ( GetValFromStream ( vecData, iPos, 1 ) );
|
// server registration result (1 byte)
|
||||||
|
const int iSvrRegResult = static_cast<int> ( GetValFromStream ( vecData, iPos, 1 ) );
|
||||||
|
|
||||||
|
if ( ( iSvrRegResult != SRR_REGISTERED ) &&
|
||||||
|
( iSvrRegResult != SRR_CENTRAL_SVR_FULL ) &&
|
||||||
|
( iSvrRegResult != SRR_VERSION_TOO_OLD ) )
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// invoke message action
|
// invoke message action
|
||||||
emit CLRegisterServerResp ( InetAddr, eResult );
|
emit CLRegisterServerResp ( InetAddr, static_cast<ESvrRegResult> ( iSvrRegResult ) );
|
||||||
|
|
||||||
return false; // no error
|
return false; // no error
|
||||||
}
|
}
|
||||||
|
|
|
@ -636,6 +636,7 @@ void CServerDlg::UpdateGUIDependencies()
|
||||||
case SRS_BAD_ADDRESS:
|
case SRS_BAD_ADDRESS:
|
||||||
case SRS_TIME_OUT:
|
case SRS_TIME_OUT:
|
||||||
case SRS_CENTRAL_SVR_FULL:
|
case SRS_CENTRAL_SVR_FULL:
|
||||||
|
case SRS_VERSION_TOO_OLD:
|
||||||
strStatus = "<font color=""red""><b>" + strStatus + "</b></font>";
|
strStatus = "<font color=""red""><b>" + strStatus + "</b></font>";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -511,6 +511,10 @@ void CServerListManager::StoreRegistrationResult ( ESvrRegResult eResult )
|
||||||
SetSvrRegStatus ( ESvrRegStatus::SRS_CENTRAL_SVR_FULL );
|
SetSvrRegStatus ( ESvrRegStatus::SRS_CENTRAL_SVR_FULL );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ESvrRegResult::SRR_VERSION_TOO_OLD:
|
||||||
|
SetSvrRegStatus ( ESvrRegStatus::SRS_VERSION_TOO_OLD );
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
SetSvrRegStatus ( ESvrRegStatus::SRS_UNKNOWN_RESP );
|
SetSvrRegStatus ( ESvrRegStatus::SRS_UNKNOWN_RESP );
|
||||||
break;
|
break;
|
||||||
|
|
26
src/util.h
26
src/util.h
|
@ -569,6 +569,7 @@ enum ELicenceType
|
||||||
// Server jam recorder state enum ----------------------------------------------
|
// Server jam recorder state enum ----------------------------------------------
|
||||||
enum ERecorderState
|
enum ERecorderState
|
||||||
{
|
{
|
||||||
|
// used for protocol -> enum values must be fixed!
|
||||||
RS_UNDEFINED = 0,
|
RS_UNDEFINED = 0,
|
||||||
RS_NOT_INITIALISED = 1,
|
RS_NOT_INITIALISED = 1,
|
||||||
RS_NOT_ENABLED = 2,
|
RS_NOT_ENABLED = 2,
|
||||||
|
@ -579,8 +580,8 @@ enum ERecorderState
|
||||||
// Channel sort type -----------------------------------------------------------
|
// Channel sort type -----------------------------------------------------------
|
||||||
enum EChSortType
|
enum EChSortType
|
||||||
{
|
{
|
||||||
ST_BY_NAME = 0,
|
ST_BY_NAME,
|
||||||
ST_BY_INSTRUMENT = 1
|
ST_BY_INSTRUMENT
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -624,13 +625,14 @@ inline QString csCentServAddrTypeToString ( ECSAddType eAddrType )
|
||||||
// Slave server registration state ---------------------------------------------
|
// Slave server registration state ---------------------------------------------
|
||||||
enum ESvrRegStatus
|
enum ESvrRegStatus
|
||||||
{
|
{
|
||||||
SRS_UNREGISTERED = 0,
|
SRS_UNREGISTERED,
|
||||||
SRS_BAD_ADDRESS = 1,
|
SRS_BAD_ADDRESS,
|
||||||
SRS_REQUESTED = 2,
|
SRS_REQUESTED,
|
||||||
SRS_TIME_OUT = 3,
|
SRS_TIME_OUT,
|
||||||
SRS_UNKNOWN_RESP = 4,
|
SRS_UNKNOWN_RESP,
|
||||||
SRS_REGISTERED = 5,
|
SRS_REGISTERED,
|
||||||
SRS_CENTRAL_SVR_FULL = 6
|
SRS_CENTRAL_SVR_FULL,
|
||||||
|
SRS_VERSION_TOO_OLD
|
||||||
};
|
};
|
||||||
|
|
||||||
inline QString svrRegStatusToString ( ESvrRegStatus eSvrRegStatus )
|
inline QString svrRegStatusToString ( ESvrRegStatus eSvrRegStatus )
|
||||||
|
@ -657,6 +659,9 @@ inline QString svrRegStatusToString ( ESvrRegStatus eSvrRegStatus )
|
||||||
|
|
||||||
case SRS_CENTRAL_SVR_FULL:
|
case SRS_CENTRAL_SVR_FULL:
|
||||||
return QCoreApplication::translate ( "CServerDlg", "Central Server full" );
|
return QCoreApplication::translate ( "CServerDlg", "Central Server full" );
|
||||||
|
|
||||||
|
case SRS_VERSION_TOO_OLD:
|
||||||
|
return QCoreApplication::translate ( "CServerDlg", "Your server version is too old" );
|
||||||
}
|
}
|
||||||
|
|
||||||
return QString ( QCoreApplication::translate ( "CServerDlg", "Unknown value " ) ).append ( eSvrRegStatus );
|
return QString ( QCoreApplication::translate ( "CServerDlg", "Unknown value " ) ).append ( eSvrRegStatus );
|
||||||
|
@ -668,7 +673,8 @@ enum ESvrRegResult
|
||||||
{
|
{
|
||||||
// used for protocol -> enum values must be fixed!
|
// used for protocol -> enum values must be fixed!
|
||||||
SRR_REGISTERED = 0,
|
SRR_REGISTERED = 0,
|
||||||
SRR_CENTRAL_SVR_FULL = 1
|
SRR_CENTRAL_SVR_FULL = 1,
|
||||||
|
SRR_VERSION_TOO_OLD = 2
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue