From 9a6653525b6b503d4852054710653b03f958a5dd Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Fri, 1 May 2020 20:21:33 +0200 Subject: [PATCH] unregister server if it was registered and the Central Server type is changed --- src/global.h | 7 ++----- src/serverdlg.cpp | 6 ++++++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/global.h b/src/global.h index 382f5599..88b39a9d 100755 --- a/src/global.h +++ b/src/global.h @@ -213,15 +213,12 @@ LED bar: lbr #define SERVLIST_TIME_PERMSERV_MINUTES 1440 // minutes, 1440 = 60 min * 24 h // registration response timeout -#define REGISTER_SERVER_TIME_OUT_MS 500 // ms +#define REGISTER_SERVER_TIME_OUT_MS 500 // ms // defines the maximum number of times to retry server registration // when no response is received within the timeout (before reverting // to SERVLIST_REGIST_INTERV_MINUTES) -#define REGISTER_SERVER_RETRY_LIMIT 5 // count - -// length of the moving average buffer for response time measurement -#define TIME_MOV_AV_RESPONSE_SECONDS 30 // seconds +#define REGISTER_SERVER_RETRY_LIMIT 5 // count // Maximum length of fader tag and text message strings (Since for chat messages diff --git a/src/serverdlg.cpp b/src/serverdlg.cpp index 0fbdf8c5..63b874b4 100755 --- a/src/serverdlg.cpp +++ b/src/serverdlg.cpp @@ -447,6 +447,12 @@ void CServerDlg::OnLocationCountryActivated ( int iCntryListItem ) void CServerDlg::OnCentServAddrTypeActivated ( int iTypeIdx ) { + // if server was registered, unregister first + if ( pServer->GetServerListEnabled() ) + { + pServer->UnregisterSlaveServer(); + } + // apply new setting to the server and update it pServer->SetCentralServerAddressType ( static_cast ( iTypeIdx ) ); pServer->UpdateServerList();