From 075fa42d0cada1eca6f4817dcdcb53df7ce44a7e Mon Sep 17 00:00:00 2001 From: Geoffrey Merck F4FXL - KC3FRA Date: Sat, 23 Mar 2019 08:17:42 +0100 Subject: [PATCH] Allow direct connection using XLX instead of DCS --- Common/DCSHandler.cpp | 33 +++++++++++-------- Common/DCSHandler.h | 4 +++ Common/IRCDDBGatewayConfig.cpp | 21 +++--------- Common/IRCDDBGatewayConfig.h | 4 +-- GUICommon/XLXSet.cpp | 24 +------------- GUICommon/XLXSet.h | 4 +-- ircDDBGateway/IRCDDBGatewayApp.cpp | 6 ++-- ircDDBGateway/IRCDDBGatewayAppD.cpp | 7 ++-- ircDDBGateway/IRCDDBGatewayThread.cpp | 17 +++------- ircDDBGateway/IRCDDBGatewayThread.h | 3 +- .../IRCDDBGatewayConfigFrame.cpp | 8 ++--- 11 files changed, 47 insertions(+), 84 deletions(-) diff --git a/Common/DCSHandler.cpp b/Common/DCSHandler.cpp index 85888d2..ad5281d 100644 --- a/Common/DCSHandler.cpp +++ b/Common/DCSHandler.cpp @@ -39,6 +39,8 @@ CCallsignList* CDCSHandler::m_blackList = NULL; CDCSHandler::CDCSHandler(IReflectorCallback* handler, const wxString& reflector, const wxString& repeater, CDCSProtocolHandler* protoHandler, const in_addr& address, unsigned int port, DIRECTION direction) : m_reflector(reflector.Clone()), +m_xlxReflector(_T("")), +m_isXlx(false), m_repeater(repeater.Clone()), m_handler(protoHandler), m_yourAddress(address), @@ -78,6 +80,11 @@ m_rptCall2() m_linkState = DCS_LINKED; } else { m_linkState = DCS_LINKING; + m_isXlx = m_reflector.StartsWith(_T("XLX")); + if(m_isXlx) { + m_xlxReflector = m_reflector.Clone(); + m_reflector = _T("DCS") + m_reflector.Right(m_reflector.length() - 3); + } m_tryTimer.start(); } } @@ -634,10 +641,10 @@ bool CDCSHandler::processInt(CConnectData& connect, CD_TYPE type) return false; if (m_linkState == DCS_LINKING) { - wxLogMessage(wxT("DCS ACK message received from %s"), m_reflector.c_str()); + wxLogMessage(wxT("DCS ACK message received from %s"), GET_DISP_REFLECTOR(this).c_str()); if (m_direction == DIR_OUTGOING && m_destination != NULL) - m_destination->linkUp(DP_DCS, m_reflector); + m_destination->linkUp(DP_DCS, GET_DISP_REFLECTOR(this)); m_tryTimer.stop(); m_stateChange = true; @@ -651,16 +658,16 @@ bool CDCSHandler::processInt(CConnectData& connect, CD_TYPE type) return false; if (m_linkState == DCS_LINKING) { - wxLogMessage(wxT("DCS NAK message received from %s"), m_reflector.c_str()); + wxLogMessage(wxT("DCS NAK message received from %s"), GET_DISP_REFLECTOR(this).c_str()); if (m_direction == DIR_OUTGOING && m_destination != NULL) - m_destination->linkRefused(DP_DCS, m_reflector); + m_destination->linkRefused(DP_DCS, GET_DISP_REFLECTOR(this)); return true; } if (m_linkState == DCS_UNLINKING) { - wxLogMessage(wxT("DCS NAK message received from %s"), m_reflector.c_str()); + wxLogMessage(wxT("DCS NAK message received from %s"), GET_DISP_REFLECTOR(this).c_str()); if (m_direction == DIR_OUTGOING && m_destination != NULL) m_destination->linkFailed(DP_DCS, m_reflector, false); @@ -675,10 +682,10 @@ bool CDCSHandler::processInt(CConnectData& connect, CD_TYPE type) return false; if (m_linkState == DCS_LINKED) { - wxLogMessage(wxT("DCS disconnect message received from %s"), m_reflector.c_str()); + wxLogMessage(wxT("DCS disconnect message received from %s"), GET_DISP_REFLECTOR(this).c_str()); if (m_direction == DIR_OUTGOING && m_destination != NULL) - m_destination->linkFailed(DP_DCS, m_reflector, false); + m_destination->linkFailed(DP_DCS, GET_DISP_REFLECTOR(this), false); m_stateChange = true; } @@ -706,20 +713,20 @@ bool CDCSHandler::clockInt(unsigned int ms) switch (m_linkState) { case DCS_LINKING: - wxLogMessage(wxT("DCS link to %s has failed to connect"), m_reflector.c_str()); + wxLogMessage(wxT("DCS link to %s has failed to connect"), GET_DISP_REFLECTOR(this).c_str()); break; case DCS_LINKED: - wxLogMessage(wxT("DCS link to %s has failed (poll inactivity)"), m_reflector.c_str()); + wxLogMessage(wxT("DCS link to %s has failed (poll inactivity)"), GET_DISP_REFLECTOR(this).c_str()); break; case DCS_UNLINKING: - wxLogMessage(wxT("DCS link to %s has failed to disconnect cleanly"), m_reflector.c_str()); + wxLogMessage(wxT("DCS link to %s has failed to disconnect cleanly"), GET_DISP_REFLECTOR(this).c_str()); break; default: break; } if (m_direction == DIR_OUTGOING) { - bool reconnect = m_destination->linkFailed(DP_DCS, m_reflector, true); + bool reconnect = m_destination->linkFailed(DP_DCS, GET_DISP_REFLECTOR(this), true); if (reconnect) { CConnectData reply(m_gatewayType, m_repeater, m_reflector, CT_LINK1, m_yourAddress, m_yourPort); m_handler->writeConnect(reply); @@ -844,7 +851,7 @@ void CDCSHandler::writeStatus(wxFFile& file) wxString text; text.Printf(wxT("%04d-%02d-%02d %02d:%02d:%02d: DCS link - Type: Repeater Rptr: %s Refl: %s Dir: Outgoing\n"), tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec, - reflector->m_repeater.c_str(), reflector->m_reflector.c_str()); + reflector->m_repeater.c_str(), GET_DISP_REFLECTOR(reflector).c_str()); file.Write(text); } break; @@ -854,7 +861,7 @@ void CDCSHandler::writeStatus(wxFFile& file) wxString text; text.Printf(wxT("%04d-%02d-%02d %02d:%02d:%02d: DCS link - Type: Repeater Rptr: %s Refl: %s Dir: Incoming\n"), tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec, - reflector->m_repeater.c_str(), reflector->m_reflector.c_str()); + reflector->m_repeater.c_str(), GET_DISP_REFLECTOR(reflector).c_str()); file.Write(text); } break; diff --git a/Common/DCSHandler.h b/Common/DCSHandler.h index d54334a..8cd1caa 100644 --- a/Common/DCSHandler.h +++ b/Common/DCSHandler.h @@ -39,6 +39,8 @@ #include #include +#define GET_DISP_REFLECTOR(refl) (refl->m_isXlx ? refl->m_xlxReflector : refl->m_reflector) + enum DCS_STATE { DCS_LINKING, DCS_LINKED, @@ -109,6 +111,8 @@ private: static CCallsignList* m_blackList; wxString m_reflector; + wxString m_xlxReflector; + bool m_isXlx; wxString m_repeater; CDCSProtocolHandler* m_handler; in_addr m_yourAddress; diff --git a/Common/IRCDDBGatewayConfig.cpp b/Common/IRCDDBGatewayConfig.cpp index 3748933..cbf98f4 100644 --- a/Common/IRCDDBGatewayConfig.cpp +++ b/Common/IRCDDBGatewayConfig.cpp @@ -141,7 +141,6 @@ const wxString KEY_DCS_ENABLED = wxT("dcsEnabled"); const wxString KEY_CCS_ENABLED = wxT("ccsEnabled"); const wxString KEY_CCS_HOST = wxT("ccsHost"); const wxString KEY_XLX_ENABLED = wxT("xlxEnabled"); -const wxString KEY_XLX_OVERRIDE_LOCAL = wxT("xlxOverrideLocal"); const wxString KEY_XLX_HOSTS_FILE_URL = wxT("xlxHostsFileUrl"); const wxString KEY_STARNET_BAND1 = wxT("starNetBand1"); const wxString KEY_STARNET_CALLSIGN1 = wxT("starNetCallsign1"); @@ -267,8 +266,7 @@ const bool DEFAULT_DCS_ENABLED = true; const bool DEFAULT_CCS_ENABLED = true; const wxString DEFAULT_CCS_HOST = wxT("CCS704 "); const bool DEFAULT_XLX_ENABLED = true; -const bool DEFAULT_XLX_OVERRIDE_LOCAL = true; -const wxString DEFAULT_XLX_HOSTS_FILE_URL = _T("http://xlxapi.rlx.lu/api.php?do=GetReflectorHostname"); +const wxString DEFAULT_XLX_HOSTS_FILE_URL = _T("http://xlxapi.rlx.lu/api.php?do=GetXLXDMRMaster");//we use the XLXDMRMaster list because it starts with XLX instead of DCS, XRF etc .... const wxString DEFAULT_STARNET_BAND = wxEmptyString; const wxString DEFAULT_STARNET_CALLSIGN = wxEmptyString; const wxString DEFAULT_STARNET_LOGOFF = wxEmptyString; @@ -422,7 +420,6 @@ m_dcsEnabled(DEFAULT_DCS_ENABLED), m_ccsEnabled(DEFAULT_CCS_ENABLED), m_ccsHost(DEFAULT_CCS_HOST), m_xlxEnabled(DEFAULT_XLX_ENABLED), -m_xlxOverrideLocal(DEFAULT_XLX_OVERRIDE_LOCAL), m_xlxHostsFileUrl(DEFAULT_XLX_HOSTS_FILE_URL), m_starNet1Band(DEFAULT_STARNET_BAND), m_starNet1Callsign(DEFAULT_STARNET_CALLSIGN), @@ -761,9 +758,7 @@ m_y(DEFAULT_WINDOW_Y) m_config->Read(m_name + KEY_CCS_HOST, &m_ccsHost, DEFAULT_CCS_HOST); m_config->Read(m_name + KEY_XLX_ENABLED, &m_xlxEnabled, DEFAULT_XLX_ENABLED); - - m_config->Read(m_name + KEY_XLX_OVERRIDE_LOCAL, &m_xlxOverrideLocal, DEFAULT_XLX_OVERRIDE_LOCAL); - + m_config->Read(m_name + KEY_XLX_HOSTS_FILE_URL, &m_xlxHostsFileUrl, DEFAULT_XLX_HOSTS_FILE_URL); m_config->Read(m_name + KEY_STARNET_BAND1, &m_starNet1Band, DEFAULT_STARNET_BAND); @@ -1045,7 +1040,6 @@ m_dcsEnabled(DEFAULT_DCS_ENABLED), m_ccsEnabled(DEFAULT_CCS_ENABLED), m_ccsHost(DEFAULT_CCS_HOST), m_xlxEnabled(DEFAULT_XLX_ENABLED), -m_xlxOverrideLocal(DEFAULT_XLX_OVERRIDE_LOCAL), m_xlxHostsFileUrl(DEFAULT_XLX_HOSTS_FILE_URL), m_starNet1Band(DEFAULT_STARNET_BAND), m_starNet1Callsign(DEFAULT_STARNET_CALLSIGN), @@ -1438,9 +1432,6 @@ m_y(DEFAULT_WINDOW_Y) } else if (key.IsSameAs(KEY_XLX_ENABLED)) { val.ToLong(&temp1); m_xlxEnabled = temp1 == 1L; - } else if (key.IsSameAs(KEY_XLX_OVERRIDE_LOCAL)) { - val.ToLong(&temp1); - m_xlxOverrideLocal = temp1 == 1L; } else if (key.IsSameAs(KEY_XLX_HOSTS_FILE_URL)) { m_xlxHostsFileUrl = val; } else if (key.IsSameAs(KEY_STARNET_BAND1)) { @@ -1968,17 +1959,15 @@ void CIRCDDBGatewayConfig::setDCS(bool dcsEnabled, bool ccsEnabled, const wxStri m_ccsHost = ccsHost; } -void CIRCDDBGatewayConfig::getXLX(bool& xlxEnabled, bool& xlxOverrideLocal, wxString& xlxHostsFileUrl) +void CIRCDDBGatewayConfig::getXLX(bool& xlxEnabled, wxString& xlxHostsFileUrl) { xlxEnabled = m_xlxEnabled; - xlxOverrideLocal = m_xlxOverrideLocal; xlxHostsFileUrl = m_xlxHostsFileUrl; } -void CIRCDDBGatewayConfig::setXLX(bool xlxEnabled, bool xlxOverrideLocal, wxString xlxHostsFileUrl) +void CIRCDDBGatewayConfig::setXLX(bool xlxEnabled, wxString xlxHostsFileUrl) { m_xlxEnabled = xlxEnabled; - m_xlxOverrideLocal = xlxOverrideLocal; m_xlxHostsFileUrl = xlxHostsFileUrl; } @@ -2419,7 +2408,6 @@ bool CIRCDDBGatewayConfig::write() m_config->Write(m_name + KEY_CCS_ENABLED, m_ccsEnabled); m_config->Write(m_name + KEY_CCS_HOST, m_ccsHost); m_config->Write(m_name + KEY_XLX_ENABLED, m_xlxEnabled); - m_config->Write(m_name + KEY_XLX_OVERRIDE_LOCAL, m_xlxOverrideLocal); m_config->Write(m_name + KEY_XLX_HOSTS_FILE_URL, m_xlxHostsFileUrl); m_config->Write(m_name + KEY_STARNET_BAND1, m_starNet1Band); m_config->Write(m_name + KEY_STARNET_CALLSIGN1, m_starNet1Callsign); @@ -2630,7 +2618,6 @@ bool CIRCDDBGatewayConfig::write() buffer.Printf(wxT("%s=%d"), KEY_CCS_ENABLED.c_str(), m_ccsEnabled ? 1 : 0); file.AddLine(buffer); buffer.Printf(wxT("%s=%s"), KEY_CCS_HOST.c_str(), m_ccsHost.c_str()); file.AddLine(buffer); buffer.Printf(wxT("%s=%d"), KEY_XLX_ENABLED.c_str(), m_xlxEnabled ? 1 : 0); file.AddLine(buffer); - buffer.Printf(wxT("%s=%d"), KEY_XLX_OVERRIDE_LOCAL.c_str(), m_xlxOverrideLocal ? 1 : 0); file.AddLine(buffer); buffer.Printf(wxT("%s=%s"), KEY_XLX_HOSTS_FILE_URL.c_str(), m_xlxHostsFileUrl.c_str()); file.AddLine(buffer); buffer.Printf(wxT("%s=%s"), KEY_STARNET_BAND1.c_str(), m_starNet1Band.c_str()); file.AddLine(buffer); buffer.Printf(wxT("%s=%s"), KEY_STARNET_CALLSIGN1.c_str(), m_starNet1Callsign.c_str()); file.AddLine(buffer); diff --git a/Common/IRCDDBGatewayConfig.h b/Common/IRCDDBGatewayConfig.h index b3a1dc9..962ae31 100644 --- a/Common/IRCDDBGatewayConfig.h +++ b/Common/IRCDDBGatewayConfig.h @@ -71,8 +71,8 @@ public: void getDCS(bool& dcsEnabled, bool& ccsEnabled, wxString& ccsHost) const; void setDCS(bool dcsEnabled, bool ccsEnabled, const wxString& ccsHost); - void getXLX(bool& xlxEnabled, bool& xlxOverrideLocal, wxString& xlxHostsFileUrl); - void setXLX(bool xlxEnabled, bool xlxOverrideLocal, wxString xlxHostsFileUrl); + void getXLX(bool& xlxEnabled, wxString& xlxHostsFileUrl); + void setXLX(bool xlxEnabled, wxString xlxHostsFileUrl); #if defined(DEXTRA_LINK) || defined(DCS_LINK) void getStarNet1(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const; diff --git a/GUICommon/XLXSet.cpp b/GUICommon/XLXSet.cpp index 616e6c0..d1497e1 100644 --- a/GUICommon/XLXSet.cpp +++ b/GUICommon/XLXSet.cpp @@ -34,11 +34,10 @@ BEGIN_EVENT_TABLE(CXLXSet, wxPanel) END_EVENT_TABLE() -CXLXSet::CXLXSet(wxWindow* parent, int id, const wxString& title, bool xlxEnabled, bool xlxOverrideLocal, const wxString& xlxHostsFileUrl) : +CXLXSet::CXLXSet(wxWindow* parent, int id, const wxString& title, bool xlxEnabled, const wxString& xlxHostsFileUrl) : wxPanel(parent, id), m_title(title), m_xlxEnabled(NULL), -m_xlxOverrideLocal(NULL), m_xlxHostsFileUrl(NULL) { wxFlexGridSizer* sizer = new wxFlexGridSizer(2); @@ -51,15 +50,6 @@ m_xlxHostsFileUrl(NULL) m_xlxEnabled->Append(_("Enabled")); sizer->Add(m_xlxEnabled, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); m_xlxEnabled->SetSelection(xlxEnabled ? 1 : 0); - - wxStaticText* xlxOverrideLocalLabel = new wxStaticText(this, -1, _("Override local hosts files")); - sizer->Add(xlxOverrideLocalLabel, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE); - - m_xlxOverrideLocal = new wxChoice(this, CHOICE_ENABLED, wxDefaultPosition, wxSize(CONTROL_WIDTH, -1)); - m_xlxOverrideLocal->Append(_("No")); - m_xlxOverrideLocal->Append(_("Yes")); - sizer->Add(m_xlxOverrideLocal, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); - m_xlxOverrideLocal->SetSelection(xlxOverrideLocal ? 1 : 0); wxStaticText* xlxHostsFileUrlLabel = new wxStaticText(this, -1, _("Hosts file URL")); sizer->Add(xlxHostsFileUrlLabel, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE); @@ -88,10 +78,6 @@ bool CXLXSet::Validate() int n = m_xlxEnabled->GetCurrentSelection(); if (n == wxNOT_FOUND) return false; - - n = m_xlxOverrideLocal->GetCurrentSelection(); - if (n == wxNOT_FOUND) - return false; // TODO F4FXL try to figure out why below symbols are not found under ubuntu /*wxString value = m_xlxHostsFileUrl->GetValue(); @@ -102,14 +88,6 @@ bool CXLXSet::Validate() return true; } -bool CXLXSet::getXLXOverrideLocal() const -{ - int c = m_xlxEnabled->GetCurrentSelection(); - if (c == wxNOT_FOUND) - return false; - - return c == 1; -} bool CXLXSet::getXLXEnabled() const { diff --git a/GUICommon/XLXSet.h b/GUICommon/XLXSet.h index f765b55..fee249f 100644 --- a/GUICommon/XLXSet.h +++ b/GUICommon/XLXSet.h @@ -23,13 +23,12 @@ class CXLXSet : public wxPanel { public: - CXLXSet(wxWindow* parent, int id, const wxString& title, bool xlxEnabled, bool xlxOverrideLocal, const wxString& xlxHostsFileUrl); + CXLXSet(wxWindow* parent, int id, const wxString& title, bool xlxEnabled, const wxString& xlxHostsFileUrl); virtual ~CXLXSet(); virtual bool Validate(); virtual bool getXLXEnabled() const; - virtual bool getXLXOverrideLocal() const; virtual wxString getXLXHostsFileUrl() const; virtual void onEnabled(wxCommandEvent& event); @@ -37,7 +36,6 @@ public: private: wxString m_title; wxChoice* m_xlxEnabled; - wxChoice* m_xlxOverrideLocal; wxTextCtrl* m_xlxHostsFileUrl; DECLARE_EVENT_TABLE() diff --git a/ircDDBGateway/IRCDDBGatewayApp.cpp b/ircDDBGateway/IRCDDBGatewayApp.cpp index 7c50b4b..e135d48 100644 --- a/ircDDBGateway/IRCDDBGatewayApp.cpp +++ b/ircDDBGateway/IRCDDBGatewayApp.cpp @@ -889,8 +889,8 @@ void CIRCDDBGatewayApp::createThread() bool xlxEnabled; bool xlxOverrideLocal; wxString xlxHostsFileUrl; - m_config->getXLX(xlxEnabled, xlxOverrideLocal, xlxHostsFileUrl); - wxLogInfo(wxT("XLX enabled: %d, Override Local %d, Hosts file url: %s"), int(xlxEnabled), int(xlxOverrideLocal), xlxHostsFileUrl.c_str()); + m_config->getXLX(xlxEnabled, xlxHostsFileUrl); + wxLogInfo(wxT("XLX enabled: %d, Hosts file url: %s"), int(xlxEnabled), xlxHostsFileUrl.c_str()); if (repeaterBand1.Len() > 1U || repeaterBand2.Len() > 1U || repeaterBand3.Len() > 1U || repeaterBand4.Len() > 1U) { @@ -960,7 +960,7 @@ void CIRCDDBGatewayApp::createThread() thread->setDExtra(dextraEnabled, dextraMaxDongles); thread->setDCS(dcsEnabled); thread->setCCS(ccsEnabled, ccsHost); - thread->setXLX(xlxEnabled, xlxOverrideLocal, xlxEnabled ? CXLXHostsFileDownloader::Download(xlxHostsFileUrl) : wxString(wxEmptyString)); + thread->setXLX(xlxEnabled, xlxEnabled ? CXLXHostsFileDownloader::Download(xlxHostsFileUrl) : wxString(wxEmptyString)); thread->setInfoEnabled(infoEnabled); thread->setEchoEnabled(echoEnabled); thread->setDTMFEnabled(dtmfEnabled); diff --git a/ircDDBGateway/IRCDDBGatewayAppD.cpp b/ircDDBGateway/IRCDDBGatewayAppD.cpp index fa59b7f..4ea6d25 100644 --- a/ircDDBGateway/IRCDDBGatewayAppD.cpp +++ b/ircDDBGateway/IRCDDBGatewayAppD.cpp @@ -876,10 +876,9 @@ bool CIRCDDBGatewayAppD::createThread() wxLogInfo(wxT("DCS enabled: %d, CCS enabled: %d, server: %s"), int(dcsEnabled), int(ccsEnabled), ccsHost.c_str()); bool xlxEnabled; - bool xlxOverrideLocal; wxString xlxHostsFileUrl; - config.getXLX(xlxEnabled, xlxOverrideLocal, xlxHostsFileUrl); - wxLogInfo(wxT("XLX enabled: %d, Override Local %d, Hosts file url: %s"), int(xlxEnabled), int(xlxOverrideLocal), xlxHostsFileUrl.c_str()); + config.getXLX(xlxEnabled, xlxHostsFileUrl); + wxLogInfo(wxT("XLX enabled: %d, Override Local %d, Hosts file url: %s"), int(xlxEnabled), xlxHostsFileUrl.c_str()); if (repeaterBand1.Len() > 1U || repeaterBand2.Len() > 1U || repeaterBand3.Len() > 1U || repeaterBand4.Len() > 1U) { @@ -948,7 +947,7 @@ bool CIRCDDBGatewayAppD::createThread() m_thread->setDExtra(dextraEnabled, dextraMaxDongles); m_thread->setDCS(dcsEnabled); m_thread->setCCS(ccsEnabled, ccsHost); - m_thread->setXLX(xlxEnabled, xlxOverrideLocal, xlxEnabled ? CXLXHostsFileDownloader::Download(xlxHostsFileUrl): wxString(wxEmptyString)); + m_thread->setXLX(xlxEnabled, xlxEnabled ? CXLXHostsFileDownloader::Download(xlxHostsFileUrl): wxString(wxEmptyString)); m_thread->setInfoEnabled(infoEnabled); m_thread->setEchoEnabled(echoEnabled); m_thread->setDTMFEnabled(dtmfEnabled); diff --git a/ircDDBGateway/IRCDDBGatewayThread.cpp b/ircDDBGateway/IRCDDBGatewayThread.cpp index 6ac8fda..24419a2 100644 --- a/ircDDBGateway/IRCDDBGatewayThread.cpp +++ b/ircDDBGateway/IRCDDBGatewayThread.cpp @@ -583,11 +583,10 @@ void CIRCDDBGatewayThread::setDCS(bool enabled) m_dcsEnabled = enabled; } -void CIRCDDBGatewayThread::setXLX(bool enabled, bool overrideLocal, const wxString& xlxHostsFileName) +void CIRCDDBGatewayThread::setXLX(bool enabled, const wxString& xlxHostsFileName) { m_xlxEnabled = enabled; m_xlxHostsFileName = xlxHostsFileName; - m_xlxOverrideLocal = overrideLocal; } void CIRCDDBGatewayThread::setCCS(bool enabled, const wxString& host) @@ -1118,9 +1117,7 @@ void CIRCDDBGatewayThread::loadGateways() void CIRCDDBGatewayThread::loadReflectors() { - if(m_xlxEnabled && !m_xlxOverrideLocal) { - loadXLXReflectors(); - } + loadXLXReflectors(); if (m_dplusEnabled) { wxFileName fileName(wxFileName::GetHomeDir(), DPLUS_HOSTS_FILE_NAME); @@ -1163,10 +1160,6 @@ void CIRCDDBGatewayThread::loadReflectors() if (fileName.IsFileReadable()) loadDCSReflectors(fileName.GetFullPath()); } - - if(m_xlxEnabled && m_xlxOverrideLocal) { - loadXLXReflectors(); - } } void CIRCDDBGatewayThread::loadDExtraReflectors(const wxString& fileName) @@ -1284,10 +1277,10 @@ void CIRCDDBGatewayThread::loadXLXReflectors() reflector.Truncate(LONG_CALLSIGN_LENGTH - 1U); reflector.Append(wxT("G")); - if(m_dcsEnabled && reflector.StartsWith(wxT("DCS"))) + //if(m_dcsEnabled && reflector.StartsWith(wxT("DCS"))) m_cache.updateGateway(reflector, addrText, DP_DCS, lock, true); - else if(m_dextraEnabled && reflector.StartsWith(wxT("XRF"))) - m_cache.updateGateway(reflector, addrText, DP_DEXTRA, lock, true); + //else if(m_dextraEnabled && reflector.StartsWith(wxT("XRF"))) + // m_cache.updateGateway(reflector, addrText, DP_DEXTRA, lock, true); count++; } diff --git a/ircDDBGateway/IRCDDBGatewayThread.h b/ircDDBGateway/IRCDDBGatewayThread.h index a580a8e..f89361b 100644 --- a/ircDDBGateway/IRCDDBGatewayThread.h +++ b/ircDDBGateway/IRCDDBGatewayThread.h @@ -61,7 +61,7 @@ public: virtual void setDExtra(bool enabled, unsigned int maxDongles); virtual void setDPlus(bool enabled, unsigned int maxDongles, const wxString& login); virtual void setDCS(bool enabled); - virtual void setXLX(bool enabled, bool overrideLocal, const wxString& fileName); + virtual void setXLX(bool enabled, const wxString& fileName); virtual void setCCS(bool enabled, const wxString& host); virtual void setLog(bool enabled); virtual void setAPRSWriter(CAPRSWriter* writer); @@ -109,7 +109,6 @@ private: wxString m_dplusLogin; bool m_dcsEnabled; bool m_xlxEnabled; - bool m_xlxOverrideLocal; wxString m_xlxHostsFileName; bool m_ccsEnabled; wxString m_ccsHost; diff --git a/ircDDBGatewayConfig/IRCDDBGatewayConfigFrame.cpp b/ircDDBGatewayConfig/IRCDDBGatewayConfigFrame.cpp index 1f2765e..80907cd 100644 --- a/ircDDBGatewayConfig/IRCDDBGatewayConfigFrame.cpp +++ b/ircDDBGatewayConfig/IRCDDBGatewayConfigFrame.cpp @@ -104,9 +104,8 @@ m_miscellaneous(NULL) m_config->getDCS(dcsEnabled, ccsEnabled, ccsHost); bool xlxEnabled; - bool xlxOverrideLocal; wxString xlxHostsFileUrl; - m_config->getXLX(xlxEnabled, xlxOverrideLocal, xlxHostsFileUrl); + m_config->getXLX(xlxEnabled, xlxHostsFileUrl); GATEWAY_TYPE gatewayType; wxString gatewayCallsign, gatewayAddress, icomAddress, hbAddress, description1, description2, url; @@ -212,7 +211,7 @@ m_miscellaneous(NULL) m_dcs = new CDCSSet(noteBook, -1, APPLICATION_NAME, dcsEnabled, ccsEnabled, ccsHost); noteBook->AddPage(m_dcs, _("DCS and CCS"), false); - m_xlx = new CXLXSet(noteBook, -1, APPLICATION_NAME, xlxEnabled, xlxOverrideLocal, xlxHostsFileUrl); + m_xlx = new CXLXSet(noteBook, -1, APPLICATION_NAME, xlxEnabled, xlxHostsFileUrl); noteBook->AddPage(m_xlx, _("XLX Hosts File"), false); #if defined(DEXTRA_LINK) || defined(DCS_LINK) @@ -526,9 +525,8 @@ void CIRCDDBGatewayConfigFrame::onSave(wxCommandEvent&) m_config->setDCS(dcsEnabled, ccsEnabled, ccsHost); bool xlxEnabled = m_xlx->getXLXEnabled(); - bool xlxOverrideLocal = m_xlx->getXLXOverrideLocal(); wxString xlxHostsFileUrl = m_xlx->getXLXHostsFileUrl(); - m_config->setXLX(xlxEnabled, xlxOverrideLocal, xlxHostsFileUrl); + m_config->setXLX(xlxEnabled, xlxHostsFileUrl); wxString starNetBand1 = m_starNet1->getBand(); wxString starNetCallsign1 = m_starNet1->getCallsign();