code style changes
This commit is contained in:
parent
ddfa045419
commit
e32d80b9db
1 changed files with 437 additions and 434 deletions
|
@ -59,15 +59,14 @@ CServerListManager::CServerListManager ( const quint16 iNPortNum,
|
|||
// init server list entry (server info for this server) with defaults, per
|
||||
// definition the client substitudes the IP address of the central server
|
||||
// itself for his server list
|
||||
CServerListEntry ThisServerListEntry (
|
||||
CHostAddress(),
|
||||
iPortNumber,
|
||||
"",
|
||||
"",
|
||||
QLocale::system().country(),
|
||||
"",
|
||||
iNumChannels,
|
||||
true );
|
||||
CServerListEntry ThisServerListEntry ( CHostAddress(),
|
||||
iPortNumber,
|
||||
"",
|
||||
"",
|
||||
QLocale::system().country(),
|
||||
"",
|
||||
iNumChannels,
|
||||
true );
|
||||
|
||||
// parse the server info string according to definition:
|
||||
// [this server name];[this server city]; ...
|
||||
|
@ -107,15 +106,14 @@ CServerListManager::CServerListManager ( const quint16 iNPortNum,
|
|||
( iNumPredefinedServers <= MAX_NUM_SERVERS_IN_SERVER_LIST ) )
|
||||
{
|
||||
// create a new server list entry
|
||||
CServerListEntry NewServerListEntry (
|
||||
CHostAddress(),
|
||||
0, // port number not used
|
||||
"",
|
||||
"",
|
||||
QLocale::AnyCountry,
|
||||
"",
|
||||
iNumChannels,
|
||||
true );
|
||||
CServerListEntry NewServerListEntry ( CHostAddress(),
|
||||
0, // port number not used
|
||||
"",
|
||||
"",
|
||||
QLocale::AnyCountry,
|
||||
"",
|
||||
iNumChannels,
|
||||
true );
|
||||
|
||||
// [server n address]
|
||||
LlconNetwUtil().ParseNetworkAddress (
|
||||
|
@ -136,8 +134,8 @@ CServerListManager::CServerListManager ( const quint16 iNPortNum,
|
|||
|
||||
if ( ( iCountry >= 0 ) && ( iCountry <= QLocale::LastCountry ) )
|
||||
{
|
||||
NewServerListEntry.eCountry = static_cast<QLocale::Country> (
|
||||
iCountry );
|
||||
NewServerListEntry.eCountry =
|
||||
static_cast<QLocale::Country> ( iCountry );
|
||||
}
|
||||
|
||||
// add the new server to the server list
|
||||
|
@ -146,6 +144,7 @@ CServerListManager::CServerListManager ( const quint16 iNPortNum,
|
|||
// we have used four items and have created one predefined server
|
||||
// (adjust counters)
|
||||
iCurUsedServInfoSplitItems += 4;
|
||||
|
||||
iNumPredefinedServers++;
|
||||
}
|
||||
|
||||
|
@ -269,6 +268,7 @@ void CServerListManager::CentralServerRegisterServer ( const CHostAddress& In
|
|||
// a server. The very first list entry must not be checked since
|
||||
// this is per definition the central server (i.e., this server)
|
||||
int iSelIdx = ciInvalidIdx; // initialize with an illegal value
|
||||
|
||||
for ( int iIdx = 1; iIdx < iCurServerListSize; iIdx++ )
|
||||
{
|
||||
if ( ServerList[iIdx].HostAddr == InetAddr )
|
||||
|
@ -285,6 +285,8 @@ void CServerListManager::CentralServerRegisterServer ( const CHostAddress& In
|
|||
if ( iSelIdx == ciInvalidIdx )
|
||||
{
|
||||
// create a new server list entry and init with received data
|
||||
// (note that the "update registration" is called in the
|
||||
// constructor of the server list entry)
|
||||
ServerList.append ( CServerListEntry ( InetAddr, ServerInfo ) );
|
||||
}
|
||||
else
|
||||
|
@ -349,7 +351,7 @@ void CServerListManager::CentralServerQueryServerList ( const CHostAddress& Inet
|
|||
|
||||
// copy the list (we have to copy it since the message requires
|
||||
// a vector but the list is actually stored in a QList object and
|
||||
// not in a vector object
|
||||
// not in a vector object)
|
||||
for ( int iIdx = 0; iIdx < iCurServerListSize; iIdx++ )
|
||||
{
|
||||
// copy list item
|
||||
|
@ -416,6 +418,7 @@ void CServerListManager::SlaveServerRegisterServer ( const bool bIsRegister )
|
|||
// it is an URL of a dynamic IP address, the IP address might have
|
||||
// changed in the meanwhile.
|
||||
CHostAddress HostAddress;
|
||||
|
||||
if ( LlconNetwUtil().ParseNetworkAddress ( strCurCentrServAddr,
|
||||
HostAddress ) )
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue