diff --git a/.gitignore b/.gitignore index 5b78d6c..4ea9011 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,18 @@ Release .vs *.a *.d +APRSTransmit/aprstransmitd +RemoteControl/remotecontrol +RemoteControl/remotecontrold +StarNetServer/starnetserver +StarNetServer/starnetserverd +TextTransmit/texttransmitd +TimeServer/timeserver +TimeServer/timeserverd +TimerControl/timercontrol +TimerControl/timercontrold +VoiceTransmit/voicetransmitd +ircDDBGateway/ircddbgateway +ircDDBGateway/ircddbgatewayd +GitVersion.h + diff --git a/Common/APRSWriter.cpp b/Common/APRSWriter.cpp index 985555e..2a75369 100644 --- a/Common/APRSWriter.cpp +++ b/Common/APRSWriter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2014,2018,2020 by Jonathan Naylor G4KLX + * Copyright (C) 2010-2014,2018,2020,2023 by Jonathan Naylor G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,10 +17,14 @@ */ #include "APRSWriter.h" +#include "MQTTConnection.h" #include "DStarDefines.h" #include "Defs.h" +// In MQTTLog.cpp +extern CMQTTConnection* m_mqtt; + CAPRSEntry::CAPRSEntry(const wxString& callsign, const wxString& band, double frequency, double offset, double range, double latitude, double longitude, double agl) : m_callsign(callsign), m_band(band), @@ -118,13 +122,10 @@ bool CAPRSEntry::isOK() } } -CAPRSWriter::CAPRSWriter(const wxString& address, unsigned int port, const wxString& gateway) : +CAPRSWriter::CAPRSWriter(const wxString& gateway) : m_idTimer(1000U), m_gateway(), -m_array(), -m_aprsAddress(), -m_aprsPort(port), -m_aprsSocket() +m_array() #if defined(USE_GPSD) ,m_gpsdEnabled(false), m_gpsdAddress(), @@ -132,15 +133,11 @@ m_gpsdPort(), m_gpsdData() #endif { - wxASSERT(!address.IsEmpty()); - wxASSERT(port > 0U); wxASSERT(!gateway.IsEmpty()); m_gateway = gateway; m_gateway.Truncate(LONG_CALLSIGN_LENGTH - 1U); m_gateway.Trim(); - - m_aprsAddress = CUDPReaderWriter::lookup(address); } CAPRSWriter::~CAPRSWriter() @@ -193,12 +190,6 @@ bool CAPRSWriter::open() wxLogMessage(wxT("Connected to GPSD")); } #endif - bool ret = m_aprsSocket.open(); - if (!ret) - return false; - - wxLogMessage(wxT("Opened connection to the APRS Gateway")); - m_idTimer.setTimeout(60U); m_idTimer.start(); @@ -284,7 +275,7 @@ void CAPRSWriter::writeData(const wxString& callsign, const CAMBEData& data) wxLogDebug(wxT("APRS ==> %s"), output.c_str()); - m_aprsSocket.write((unsigned char*)ascii, (unsigned int)::strlen(ascii), m_aprsAddress, m_aprsPort); + m_mqtt->publish("aprs-gateway/aprs", ascii); collector->reset(); } @@ -316,8 +307,6 @@ void CAPRSWriter::clock(unsigned int ms) void CAPRSWriter::close() { - m_aprsSocket.close(); - #if defined(USE_GPSD) if (m_gpsdEnabled) { ::gps_stream(&m_gpsdData, WATCH_DISABLE, NULL); @@ -419,7 +408,7 @@ void CAPRSWriter::sendIdFramesFixed() wxLogDebug(wxT("APRS ==> %s"), output.c_str()); - m_aprsSocket.write((unsigned char*)ascii, (unsigned int)::strlen(ascii), m_aprsAddress, m_aprsPort); + m_mqtt->publish("aprs-gateway/aprs", ascii); if (entry->getBand().Len() == 1U) { output.Printf(wxT("%s-%s>APDG02,TCPIP*,qAC,%s-%sS:!%s%cD%s%c&RNG%04.0lf/A=%06.0lf %s %s\r\n"), @@ -434,7 +423,7 @@ void CAPRSWriter::sendIdFramesFixed() wxLogDebug(wxT("APRS ==> %s"), output.c_str()); - m_aprsSocket.write((unsigned char*)ascii, (unsigned int)::strlen(ascii), m_aprsAddress, m_aprsPort); + m_mqtt->publish("aprs-gateway/aprs", ascii); } } } diff --git a/Common/APRSWriter.h b/Common/APRSWriter.h index b4d48c3..4080355 100644 --- a/Common/APRSWriter.h +++ b/Common/APRSWriter.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010,2011,2012,2018,2020 by Jonathan Naylor G4KLX + * Copyright (C) 2010,2011,2012,2018,2020.2023 by Jonathan Naylor G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,7 +19,6 @@ #ifndef APRSWriter_H #define APRSWriter_H -#include "UDPReaderWriter.h" #include "APRSCollector.h" #include "DStarDefines.h" #include "HeaderData.h" @@ -71,7 +70,7 @@ WX_DECLARE_STRING_HASH_MAP(CAPRSEntry*, CEntry_t); class CAPRSWriter { public: - CAPRSWriter(const wxString& address, unsigned int port, const wxString& gateway); + CAPRSWriter(const wxString& gateway); ~CAPRSWriter(); bool open(); @@ -92,9 +91,6 @@ private: CTimer m_idTimer; wxString m_gateway; CEntry_t m_array; - in_addr m_aprsAddress; - unsigned int m_aprsPort; - CUDPReaderWriter m_aprsSocket; #if defined(USE_GPSD) bool m_gpsdEnabled; wxString m_gpsdAddress; diff --git a/Common/IRCDDBGatewayConfig.cpp b/Common/IRCDDBGatewayConfig.cpp index 4931656..e3ff595 100644 --- a/Common/IRCDDBGatewayConfig.cpp +++ b/Common/IRCDDBGatewayConfig.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2015,2018,2020 by Jonathan Naylor G4KLX + * Copyright (C) 2010-2015,2018,2020,2023 by Jonathan Naylor G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -116,21 +116,19 @@ const wxString KEY_IRCDDB_ENABLED1 = wxT("ircddbEnabled"); const wxString KEY_IRCDDB_HOSTNAME1 = wxT("ircddbHostname"); const wxString KEY_IRCDDB_USERNAME1 = wxT("ircddbUsername"); const wxString KEY_IRCDDB_PASSWORD1 = wxT("ircddbPassword"); -const wxString KEY_IRCDDB_ENABLED2 = wxT("ircddbEnabled2"); +const wxString KEY_IRCDDB_ENABLED2 = wxT("ircddbEnabled2"); const wxString KEY_IRCDDB_HOSTNAME2 = wxT("ircddbHostname2"); const wxString KEY_IRCDDB_USERNAME2 = wxT("ircddbUsername2"); const wxString KEY_IRCDDB_PASSWORD2 = wxT("ircddbPassword2"); -const wxString KEY_IRCDDB_ENABLED3 = wxT("ircddbEnabled3"); +const wxString KEY_IRCDDB_ENABLED3 = wxT("ircddbEnabled3"); const wxString KEY_IRCDDB_HOSTNAME3 = wxT("ircddbHostname3"); const wxString KEY_IRCDDB_USERNAME3 = wxT("ircddbUsername3"); const wxString KEY_IRCDDB_PASSWORD3 = wxT("ircddbPassword3"); -const wxString KEY_IRCDDB_ENABLED4 = wxT("ircddbEnabled4"); +const wxString KEY_IRCDDB_ENABLED4 = wxT("ircddbEnabled4"); const wxString KEY_IRCDDB_HOSTNAME4 = wxT("ircddbHostname4"); const wxString KEY_IRCDDB_USERNAME4 = wxT("ircddbUsername4"); const wxString KEY_IRCDDB_PASSWORD4 = wxT("ircddbPassword4"); const wxString KEY_APRS_ENABLED = wxT("aprsEnabled"); -const wxString KEY_APRS_ADDRESS = wxT("aprsAddress"); -const wxString KEY_APRS_PORT = wxT("aprsPort"); const wxString KEY_DEXTRA_ENABLED = wxT("dextraEnabled"); const wxString KEY_DEXTRA_MAXDONGLES = wxT("dextraMaxDongles"); const wxString KEY_DPLUS_ENABLED = wxT("dplusEnabled"); @@ -139,7 +137,7 @@ const wxString KEY_DPLUS_LOGIN = wxT("dplusLogin"); 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_ENABLED = wxT("xlxEnabled"); const wxString KEY_XLX_HOSTS_FILE_URL = wxT("xlxHostsFileUrl"); const wxString KEY_STARNET_BAND1 = wxT("starNetBand1"); const wxString KEY_STARNET_CALLSIGN1 = wxT("starNetCallsign1"); @@ -203,6 +201,9 @@ const wxString KEY_DTMF_ENABLED = wxT("dtmfEnabled"); const wxString KEY_GPSD_ENABLED = wxT("gpsdEnabled"); const wxString KEY_GPSD_ADDRESS = wxT("gpsdAddress"); const wxString KEY_GPSD_PORT = wxT("gpsdPort"); +const wxString KEY_MQTT_ADDRESS = wxT("mqttAddress"); +const wxString KEY_MQTT_PORT = wxT("mqttPort"); +const wxString KEY_MQTT_KEEPALIVE = wxT("mqttKeepalive"); const wxString KEY_WINDOW_X = wxT("windowX"); const wxString KEY_WINDOW_Y = wxT("windowY"); @@ -240,21 +241,19 @@ const bool DEFAULT_IRCDDB_ENABLED1 = true; const wxString DEFAULT_IRCDDB_HOSTNAME1 = wxT("group1-irc.ircddb.net"); const wxString DEFAULT_IRCDDB_USERNAME1 = wxEmptyString; const wxString DEFAULT_IRCDDB_PASSWORD1 = wxEmptyString; -const bool DEFAULT_IRCDDB_ENABLED2 = true; -const wxString DEFAULT_IRCDDB_HOSTNAME2 = wxT("rr.openquad.net"); -const wxString DEFAULT_IRCDDB_USERNAME2 = wxEmptyString; -const wxString DEFAULT_IRCDDB_PASSWORD2 = wxEmptyString; -const bool DEFAULT_IRCDDB_ENABLED3 = false; +const bool DEFAULT_IRCDDB_ENABLED2 = true; +const wxString DEFAULT_IRCDDB_HOSTNAME2 = wxT("rr.openquad.net"); +const wxString DEFAULT_IRCDDB_USERNAME2 = wxEmptyString; +const wxString DEFAULT_IRCDDB_PASSWORD2 = wxEmptyString; +const bool DEFAULT_IRCDDB_ENABLED3 = false; const wxString DEFAULT_IRCDDB_HOSTNAME3 = wxEmptyString; -const wxString DEFAULT_IRCDDB_USERNAME3 = wxEmptyString; -const wxString DEFAULT_IRCDDB_PASSWORD3 = wxEmptyString; -const bool DEFAULT_IRCDDB_ENABLED4 = false; -const wxString DEFAULT_IRCDDB_HOSTNAME4 = wxEmptyString; -const wxString DEFAULT_IRCDDB_USERNAME4 = wxEmptyString; -const wxString DEFAULT_IRCDDB_PASSWORD4 = wxEmptyString; +const wxString DEFAULT_IRCDDB_USERNAME3 = wxEmptyString; +const wxString DEFAULT_IRCDDB_PASSWORD3 = wxEmptyString; +const bool DEFAULT_IRCDDB_ENABLED4 = false; +const wxString DEFAULT_IRCDDB_HOSTNAME4 = wxEmptyString; +const wxString DEFAULT_IRCDDB_USERNAME4 = wxEmptyString; +const wxString DEFAULT_IRCDDB_PASSWORD4 = wxEmptyString; const bool DEFAULT_APRS_ENABLED = false; -const wxString DEFAULT_APRS_ADDRESS = wxT("127.0.0.1"); -const unsigned int DEFAULT_APRS_PORT = 8673U; const bool DEFAULT_DEXTRA_ENABLED = true; const unsigned int DEFAULT_DEXTRA_MAXDONGLES = 5U; const bool DEFAULT_DPLUS_ENABLED = false; @@ -263,7 +262,7 @@ const wxString DEFAULT_DPLUS_LOGIN = wxEmptyString; 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_ENABLED = true; const wxString DEFAULT_XLX_HOSTS_FILE_URL = wxT("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; @@ -287,6 +286,9 @@ const bool DEFAULT_DTMF_ENABLED = true; const bool DEFAULT_GPSD_ENABLED = false; const wxString DEFAULT_GPSD_ADDRESS = wxT("127.0.0.1"); const wxString DEFAULT_GPSD_PORT = wxT("2947"); +const wxString DEFAULT_MQTT_ADDRESS = wxT("127.0.0.1"); +const unsigned short DEFAULT_MQTT_PORT = 1883U; +const unsigned int DEFAULT_MQTT_KEEPALIVE = 60U; const int DEFAULT_WINDOW_X = -1; const int DEFAULT_WINDOW_Y = -1; @@ -406,8 +408,6 @@ m_ircddbHostname4(DEFAULT_IRCDDB_HOSTNAME4), m_ircddbUsername4(DEFAULT_IRCDDB_USERNAME4), m_ircddbPassword4(DEFAULT_IRCDDB_PASSWORD4), m_aprsEnabled(DEFAULT_APRS_ENABLED), -m_aprsAddress(DEFAULT_APRS_ADDRESS), -m_aprsPort(DEFAULT_APRS_PORT), m_dextraEnabled(DEFAULT_DEXTRA_ENABLED), m_dextraMaxDongles(DEFAULT_DEXTRA_MAXDONGLES), m_dplusEnabled(DEFAULT_DPLUS_ENABLED), @@ -480,6 +480,9 @@ m_dtmfEnabled(DEFAULT_DTMF_ENABLED), m_gpsdEnabled(DEFAULT_GPSD_ENABLED), m_gpsdAddress(DEFAULT_GPSD_ADDRESS), m_gpsdPort(DEFAULT_GPSD_PORT), +m_mqttAddress(DEFAULT_MQTT_ADDRESS), +m_mqttPort(DEFAULT_MQTT_PORT), +m_mqttKeepalive(DEFAULT_MQTT_KEEPALIVE), m_x(DEFAULT_WINDOW_X), m_y(DEFAULT_WINDOW_Y) { @@ -729,11 +732,6 @@ m_y(DEFAULT_WINDOW_Y) m_config->Read(m_name + KEY_APRS_ENABLED, &m_aprsEnabled, DEFAULT_APRS_ENABLED); - m_config->Read(m_name + KEY_APRS_ADDRESS, &m_aprsAddress, DEFAULT_APRS_ADDRESS); - - m_config->Read(m_name + KEY_APRS_PORT, &temp, long(DEFAULT_APRS_PORT)); - m_aprsPort = (unsigned int)temp; - m_config->Read(m_name + KEY_DEXTRA_ENABLED, &m_dextraEnabled, DEFAULT_DEXTRA_ENABLED); m_config->Read(m_name + KEY_DEXTRA_MAXDONGLES, &temp, long(DEFAULT_DEXTRA_MAXDONGLES)); @@ -900,6 +898,14 @@ m_y(DEFAULT_WINDOW_Y) m_config->Read(m_name + KEY_GPSD_PORT, &temp, long(DEFAULT_GPSD_PORT)); m_gpsdPort = (unsigned int)temp; + m_config->Read(m_name + KEY_MQTT_ADDRESS, &m_mqttAddress, DEFAULT_MQTT_ADDRESS); + + m_config->Read(m_name + KEY_MQTT_PORT, &temp, long(DEFAULT_MQTT_PORT)); + m_mqttPort = (unsigned short)temp; + + m_config->Read(m_name + KEY_MQTT_KEEPALIVE, &temp, long(DEFAULT_MQTT_KEEPALIVE)); + m_mqttKeepalive = (unsigned int)temp; + m_config->Read(m_name + KEY_WINDOW_X, &temp, long(DEFAULT_WINDOW_X)); m_x = int(temp); @@ -1025,8 +1031,6 @@ m_ircddbHostname4(DEFAULT_IRCDDB_HOSTNAME4), m_ircddbUsername4(DEFAULT_IRCDDB_USERNAME4), m_ircddbPassword4(DEFAULT_IRCDDB_PASSWORD4), m_aprsEnabled(DEFAULT_APRS_ENABLED), -m_aprsAddress(DEFAULT_APRS_ADDRESS), -m_aprsPort(DEFAULT_APRS_PORT), m_dextraEnabled(DEFAULT_DEXTRA_ENABLED), m_dextraMaxDongles(DEFAULT_DEXTRA_MAXDONGLES), m_dplusEnabled(DEFAULT_DPLUS_ENABLED), @@ -1099,6 +1103,9 @@ m_dtmfEnabled(DEFAULT_DTMF_ENABLED), m_gpsdEnabled(DEFAULT_GPSD_ENABLED), m_gpsdAddress(DEFAULT_GPSD_ADDRESS), m_gpsdPort(DEFAULT_GPSD_PORT), +m_mqttAddress(DEFAULT_MQTT_ADDRESS), +m_mqttPort(DEFAULT_MQTT_PORT), +m_mqttKeepalive(DEFAULT_MQTT_KEEPALIVE), m_x(DEFAULT_WINDOW_X), m_y(DEFAULT_WINDOW_Y) { @@ -1396,11 +1403,6 @@ m_y(DEFAULT_WINDOW_Y) } else if (key.IsSameAs(KEY_APRS_ENABLED)) { val.ToLong(&temp1); m_aprsEnabled = temp1 == 1L; - } else if (key.IsSameAs(KEY_APRS_ADDRESS)) { - m_aprsAddress = val; - } else if (key.IsSameAs(KEY_APRS_PORT)) { - val.ToULong(&temp2); - m_aprsPort = (unsigned int)temp2; } else if (key.IsSameAs(KEY_DEXTRA_ENABLED)) { val.ToLong(&temp1); m_dextraEnabled = temp1 == 1L; @@ -1581,6 +1583,14 @@ m_y(DEFAULT_WINDOW_Y) m_gpsdAddress = val; } else if (key.IsSameAs(KEY_GPSD_PORT)) { m_gpsdPort = val; + } else if (key.IsSameAs(KEY_MQTT_ADDRESS)) { + m_mqttAddress = val; + } else if (key.IsSameAs(KEY_MQTT_PORT)) { + val.ToULong(&temp2); + m_mqttPort = (unsigned short)temp2; + } else if (key.IsSameAs(KEY_MQTT_KEEPALIVE)) { + val.ToULong(&temp2); + m_mqttKeepalive = (unsigned int)temp2; } else if (key.IsSameAs(KEY_WINDOW_X)) { val.ToLong(&temp1); m_x = int(temp1); @@ -1888,18 +1898,14 @@ void CIRCDDBGatewayConfig::setIrcDDB4(bool enabled, const wxString& hostname, co m_ircddbPassword4 = password; } -void CIRCDDBGatewayConfig::getDPRS(bool& enabled, wxString& address, unsigned int& port) const +void CIRCDDBGatewayConfig::getDPRS(bool& enabled) const { enabled = m_aprsEnabled; - address = m_aprsAddress; - port = m_aprsPort; } -void CIRCDDBGatewayConfig::setDPRS(bool enabled, const wxString& address, unsigned int port) +void CIRCDDBGatewayConfig::setDPRS(bool enabled) { - m_aprsEnabled = enabled; - m_aprsAddress = address; - m_aprsPort = port; + m_aprsEnabled = enabled; } void CIRCDDBGatewayConfig::getDExtra(bool& enabled, unsigned int& maxDongles) const @@ -2212,6 +2218,13 @@ void CIRCDDBGatewayConfig::setGPSD(bool enabled, const wxString& address, const m_gpsdPort = port; } +void CIRCDDBGatewayConfig::getMQTT(wxString& address, unsigned short& port, unsigned int& keepalive) const +{ + address = m_mqttAddress; + port = m_mqttPort; + keepalive = m_mqttKeepalive; +} + void CIRCDDBGatewayConfig::getPosition(int& x, int& y) const { x = m_x; @@ -2379,8 +2392,6 @@ bool CIRCDDBGatewayConfig::write() m_config->Write(m_name + KEY_IRCDDB_USERNAME4, m_ircddbUsername4); m_config->Write(m_name + KEY_IRCDDB_PASSWORD4, m_ircddbPassword4); m_config->Write(m_name + KEY_APRS_ENABLED, m_aprsEnabled); - m_config->Write(m_name + KEY_APRS_ADDRESS, m_aprsAddress); - m_config->Write(m_name + KEY_APRS_PORT, long(m_aprsPort)); m_config->Write(m_name + KEY_DEXTRA_ENABLED, m_dextraEnabled); m_config->Write(m_name + KEY_DEXTRA_MAXDONGLES, long(m_dextraMaxDongles)); m_config->Write(m_name + KEY_DPLUS_ENABLED, m_dplusEnabled); @@ -2453,6 +2464,9 @@ bool CIRCDDBGatewayConfig::write() m_config->Write(m_name + KEY_GPSD_ENABLED, m_gpsdEnabled); m_config->Write(m_name + KEY_GPSD_ADDRESS, m_gpsdAddress); m_config->Write(m_name + KEY_GPSD_PORT, m_gpsdPort); + m_config->Write(m_name + KEY_MQTT_ADDRESS, m_mqttAddress); + m_config->Write(m_name + KEY_MQTT_PORT, long(m_mqttPort)); + m_config->Write(m_name + KEY_MQTT_KEEPALIVE, long(m_mqttKeepalive)); m_config->Write(m_name + KEY_WINDOW_X, long(m_x)); m_config->Write(m_name + KEY_WINDOW_Y, long(m_y)); m_config->Flush(); @@ -2588,8 +2602,6 @@ bool CIRCDDBGatewayConfig::write() buffer.Printf("%s=%s", KEY_IRCDDB_USERNAME4.c_str(), m_ircddbUsername4.c_str()); file.AddLine(buffer); buffer.Printf("%s=%s", KEY_IRCDDB_PASSWORD4.c_str(), m_ircddbPassword4.c_str()); file.AddLine(buffer); buffer.Printf(wxT("%s=%d"), KEY_APRS_ENABLED.c_str(), m_aprsEnabled ? 1 : 0); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_APRS_ADDRESS.c_str(), m_aprsAddress.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%u"), KEY_APRS_PORT.c_str(), m_aprsPort); file.AddLine(buffer); buffer.Printf(wxT("%s=%d"), KEY_DEXTRA_ENABLED.c_str(), m_dextraEnabled ? 1 : 0); file.AddLine(buffer); buffer.Printf(wxT("%s=%u"), KEY_DEXTRA_MAXDONGLES.c_str(), m_dextraMaxDongles); file.AddLine(buffer); buffer.Printf(wxT("%s=%d"), KEY_DPLUS_ENABLED.c_str(), m_dplusEnabled ? 1 : 0); file.AddLine(buffer); @@ -2662,6 +2674,9 @@ bool CIRCDDBGatewayConfig::write() buffer.Printf(wxT("%s=%d"), KEY_GPSD_ENABLED.c_str(), m_gpsdEnabled ? 1 : 0); file.AddLine(buffer); buffer.Printf(wxT("%s=%s"), KEY_GPSD_ADDRESS.c_str(), m_gpsdAddress.c_str()); file.AddLine(buffer); buffer.Printf(wxT("%s=%s"), KEY_GPSD_PORT.c_str(), m_gpsdPort.c_str()); file.AddLine(buffer); + buffer.Printf(wxT("%s=%s"), KEY_MQTT_ADDRESS.c_str(), m_mqttAddress.c_str()); file.AddLine(buffer); + buffer.Printf(wxT("%s=%u"), KEY_MQTT_PORT.c_str(), m_mqttPort); file.AddLine(buffer); + buffer.Printf(wxT("%s=%u"), KEY_MQTT_KEEPALIVE.c_str(), m_mqttKeepalive); file.AddLine(buffer); buffer.Printf(wxT("%s=%d"), KEY_WINDOW_X.c_str(), m_x); file.AddLine(buffer); buffer.Printf(wxT("%s=%d"), KEY_WINDOW_Y.c_str(), m_y); file.AddLine(buffer); diff --git a/Common/IRCDDBGatewayConfig.h b/Common/IRCDDBGatewayConfig.h index c97eab6..ff58809 100644 --- a/Common/IRCDDBGatewayConfig.h +++ b/Common/IRCDDBGatewayConfig.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2014,2018,2020 by Jonathan Naylor G4KLX + * Copyright (C) 2010-2014,2018,2020,2023 by Jonathan Naylor G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -59,8 +59,8 @@ public: void setIrcDDB3(bool enabled, const wxString& hostname, const wxString& username, const wxString& password); void setIrcDDB4(bool enabled, const wxString& hostname, const wxString& username, const wxString& password); - void getDPRS(bool& enabled, wxString& address, unsigned int& port) const; - void setDPRS(bool enabled, const wxString& address, unsigned int port); + void getDPRS(bool& enabled) const; + void setDPRS(bool enabled); void getDExtra(bool& enabled, unsigned int& maxDongles) const; void setDExtra(bool enabled, unsigned int maxDongles); @@ -118,6 +118,8 @@ public: void getPosition(int& x, int& y) const; void setPosition(int x, int y); + void getMQTT(wxString& address, unsigned short& port, unsigned int& keepalive) const; + bool write(); private: @@ -235,8 +237,6 @@ private: wxString m_ircddbUsername4; wxString m_ircddbPassword4; bool m_aprsEnabled; - wxString m_aprsAddress; - unsigned int m_aprsPort; bool m_dextraEnabled; unsigned int m_dextraMaxDongles; bool m_dplusEnabled; @@ -310,6 +310,9 @@ private: bool m_gpsdEnabled; wxString m_gpsdAddress; wxString m_gpsdPort; + wxString m_mqttAddress; + unsigned short m_mqttPort; + unsigned int m_mqttKeepalive; int m_x; int m_y; }; diff --git a/Common/Logger.cpp b/Common/Logger.cpp index 6aa789b..6953cf8 100644 --- a/Common/Logger.cpp +++ b/Common/Logger.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002,2003,2009,2011,2012,2019 by Jonathan Naylor G4KLX + * Copyright (C) 2002,2003,2009,2011,2012,2019,2023 by Jonathan Naylor G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,49 +17,24 @@ */ #include "Logger.h" +#include "MQTTLog.h" -CLogger::CLogger(const wxString& directory, const wxString& name) : -wxLog(), -m_name(name), -m_file(NULL), -m_fileName(), -m_day(0) +// In MQTTLog.cpp +extern CMQTTConnection* m_mqtt; + +CLogger::CLogger() : +wxLog() { - m_file = new wxFFile; - - m_fileName.SetPath(directory); - m_fileName.SetExt(wxT("log")); - - time_t timestamp; - ::time(×tamp); - struct tm* tm = ::gmtime(×tamp); - - wxString text; - text.Printf(wxT("%s-%04d-%02d-%02d"), m_name.c_str(), tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday); - - m_day = tm->tm_yday; - m_fileName.SetName(text); - - bool ret = m_file->Open(m_fileName.GetFullPath(), wxT("a+t")); - if (!ret) { - wxLogError(wxT("Cannot open %s file for appending"), m_fileName.GetFullPath().c_str()); - return; - } + MQTTLogInitialise(); } CLogger::~CLogger() { - wxASSERT(m_file != NULL); - - m_file->Close(); - delete m_file; + MQTTLogFinalise(); } void CLogger::DoLogRecord(wxLogLevel level, const wxString& msg, const wxLogRecordInfo& info) { - wxASSERT(m_file != NULL); - wxASSERT(m_file->IsOpened()); - wxString letter; switch (level) { @@ -79,38 +54,10 @@ void CLogger::DoLogRecord(wxLogLevel level, const wxString& msg, const wxLogReco wxString message; message.Printf(wxT("%s: %04d-%02d-%02d %02d:%02d:%02d: %s\n"), letter.c_str(), tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec, msg.c_str()); - writeLog(message.c_str(), info.timestamp); + if (m_mqtt != NULL) + m_mqtt->publish("log", message.c_str()); if (level == wxLOG_FatalError) ::abort(); } -void CLogger::writeLog(const wxChar* msg, time_t timestamp) -{ - wxASSERT(m_file != NULL); - wxASSERT(m_file->IsOpened()); - wxASSERT(msg != NULL); - - struct tm* tm = ::gmtime(×tamp); - - int day = tm->tm_yday; - if (day != m_day) { - wxString text; - text.Printf(wxT("%s-%04d-%02d-%02d"), m_name.c_str(), tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday); - - m_day = day; - m_fileName.SetName(text); - - m_file->Close(); - - bool ret = m_file->Open(m_fileName.GetFullPath(), wxT("a+t")); - if (!ret) { - wxLogError(wxT("Cannot open %s file for appending"), m_fileName.GetFullPath().c_str()); - return; - } - } - - m_file->Write(wxString(msg)); - m_file->Flush(); -} - diff --git a/Common/Logger.h b/Common/Logger.h index b9ca2c2..1fefb0e 100644 --- a/Common/Logger.h +++ b/Common/Logger.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002,2003,2009,2011,2012,2019 by Jonathan Naylor G4KLX + * Copyright (C) 2002,2003,2009,2011,2012,2019,2023 by Jonathan Naylor G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,23 +20,15 @@ #define Logger_H #include -#include -#include class CLogger : public wxLog { public: - CLogger(const wxString& directory, const wxString& name); + CLogger(); virtual ~CLogger(); virtual void DoLogRecord(wxLogLevel level, const wxString& msg, const wxLogRecordInfo& info); private: - wxString m_name; - wxFFile* m_file; - wxFileName m_fileName; - int m_day; - - void writeLog(const wxChar* msg, time_t timestamp); }; #endif diff --git a/Common/MQTTConnection.cpp b/Common/MQTTConnection.cpp new file mode 100644 index 0000000..c283fe7 --- /dev/null +++ b/Common/MQTTConnection.cpp @@ -0,0 +1,211 @@ +/* + * Copyright (C) 2022,2023 by Jonathan Naylor G4KLX + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include "MQTTConnection.h" + +#include +#include +#include + + +CMQTTConnection::CMQTTConnection(const wxString& host, unsigned short port, const wxString& name, const std::vector>& subs, unsigned int keepalive, MQTT_QOS qos) : +m_host(host), +m_port(port), +m_name(name), +m_subs(subs), +m_keepalive(keepalive), +m_qos(qos), +m_mosq(NULL), +m_connected(false) +{ + assert(!host.IsEmpty()); + assert(port > 0U); + assert(!name.IsEmpty()); + assert(keepalive >= 5U); + + ::mosquitto_lib_init(); +} + +CMQTTConnection::~CMQTTConnection() +{ + ::mosquitto_lib_cleanup(); +} + +bool CMQTTConnection::open() +{ + m_mosq = ::mosquitto_new(m_name.c_str(), true, this); + if (m_mosq == NULL){ + ::fprintf(stderr, "MQTT Error newing: Out of memory.\n"); + return false; + } + + ::mosquitto_connect_callback_set(m_mosq, onConnect); + ::mosquitto_subscribe_callback_set(m_mosq, onSubscribe); + ::mosquitto_message_callback_set(m_mosq, onMessage); + ::mosquitto_disconnect_callback_set(m_mosq, onDisconnect); + + int rc = ::mosquitto_connect(m_mosq, m_host.c_str(), m_port, m_keepalive); + if (rc != MOSQ_ERR_SUCCESS) { + ::mosquitto_destroy(m_mosq); + m_mosq = NULL; + ::fprintf(stderr, "MQTT Error connecting: %s\n", ::mosquitto_strerror(rc)); + return false; + } + + rc = ::mosquitto_loop_start(m_mosq); + if (rc != MOSQ_ERR_SUCCESS) { + ::mosquitto_disconnect(m_mosq); + ::mosquitto_destroy(m_mosq); + m_mosq = NULL; + ::fprintf(stderr, "MQTT Error loop starting: %s\n", ::mosquitto_strerror(rc)); + return false; + } + + return true; +} + +bool CMQTTConnection::publish(const char* topic, const char* text) +{ + assert(topic != NULL); + assert(text != NULL); + + return publish(topic, (unsigned char*)text, ::strlen(text)); +} + +bool CMQTTConnection::publish(const char* topic, const std::string& text) +{ + assert(topic != NULL); + + return publish(topic, (unsigned char*)text.c_str(), text.size()); +} + +bool CMQTTConnection::publish(const char* topic, const unsigned char* data, unsigned int len) +{ + assert(topic != NULL); + assert(data != NULL); + + if (!m_connected) + return false; + + if (::strchr(topic, '/') == NULL) { + char topicEx[100U]; + ::sprintf(topicEx, "%s/%s", (char*)m_name.char_str(), topic); + + int rc = ::mosquitto_publish(m_mosq, NULL, topicEx, len, data, static_cast(m_qos), false); + if (rc != MOSQ_ERR_SUCCESS) { + ::fprintf(stderr, "MQTT Error publishing: %s\n", ::mosquitto_strerror(rc)); + return false; + } + } else { + int rc = ::mosquitto_publish(m_mosq, NULL, topic, len, data, static_cast(m_qos), false); + if (rc != MOSQ_ERR_SUCCESS) { + ::fprintf(stderr, "MQTT Error publishing: %s\n", ::mosquitto_strerror(rc)); + return false; + } + } + + return true; +} + +void CMQTTConnection::close() +{ + if (m_mosq != NULL) { + ::mosquitto_disconnect(m_mosq); + ::mosquitto_destroy(m_mosq); + m_mosq = NULL; + } +} + +void CMQTTConnection::onConnect(mosquitto* mosq, void* obj, int rc) +{ + assert(mosq != NULL); + assert(obj != NULL); + + ::fprintf(stdout, "MQTT: on_connect: %s\n", ::mosquitto_connack_string(rc)); + if (rc != 0) { + ::mosquitto_disconnect(mosq); + return; + } + + CMQTTConnection* p = static_cast(obj); + p->m_connected = true; + + for (std::vector>::const_iterator it = p->m_subs.cbegin(); it != p->m_subs.cend(); ++it) { + wxString topic = (*it).first; + + if (topic.find_first_of('/') == std::string::npos) { + char topicEx[100U]; + ::sprintf(topicEx, "%s/%s", (char*)p->m_name.char_str(), (char*)topic.char_str()); + + rc = ::mosquitto_subscribe(mosq, NULL, topicEx, static_cast(p->m_qos)); + if (rc != MOSQ_ERR_SUCCESS) { + ::fprintf(stderr, "MQTT: error subscribing to %s - %s\n", topicEx, ::mosquitto_strerror(rc)); + ::mosquitto_disconnect(mosq); + } + } else { + rc = ::mosquitto_subscribe(mosq, NULL, topic.c_str(), static_cast(p->m_qos)); + if (rc != MOSQ_ERR_SUCCESS) { + ::fprintf(stderr, "MQTT: error subscribing to %s - %s\n", (char*)topic.char_str(), ::mosquitto_strerror(rc)); + ::mosquitto_disconnect(mosq); + } + } + } +} + +void CMQTTConnection::onSubscribe(mosquitto* mosq, void* obj, int mid, int qosCount, const int* grantedQOS) +{ + assert(mosq != NULL); + assert(obj != NULL); + assert(grantedQOS != NULL); + + for (int i = 0; i < qosCount; i++) + ::fprintf(stdout, "MQTT: on_subscribe: %d:%d\n", i, grantedQOS[i]); +} + +void CMQTTConnection::onMessage(mosquitto* mosq, void* obj, const mosquitto_message* message) +{ + assert(mosq != NULL); + assert(obj != NULL); + assert(message != NULL); + + CMQTTConnection* p = static_cast(obj); + + for (std::vector>::const_iterator it = p->m_subs.cbegin(); it != p->m_subs.cend(); ++it) { + wxString topic = (*it).first; + + char topicEx[100U]; + ::sprintf(topicEx, "%s/%s", (char*)p->m_name.char_str(), (char*)topic.char_str()); + + if (::strcmp(topicEx, message->topic) == 0) { + (*it).second((unsigned char*)message->payload, message->payloadlen); + break; + } + } +} + +void CMQTTConnection::onDisconnect(mosquitto* mosq, void* obj, int rc) +{ + assert(mosq != NULL); + assert(obj != NULL); + + ::fprintf(stdout, "MQTT: on_disconnect: %s\n", ::mosquitto_reason_string(rc)); + + CMQTTConnection* p = static_cast(obj); + p->m_connected = false; +} + diff --git a/Common/MQTTConnection.h b/Common/MQTTConnection.h new file mode 100644 index 0000000..8faf69e --- /dev/null +++ b/Common/MQTTConnection.h @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2022,2023 by Jonathan Naylor G4KLX + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#if !defined(MQTTPUBLISHER_H) +#define MQTTPUBLISHER_H + +#include + +#include + +#include +#include + +enum MQTT_QOS { + MQTT_QOS_AT_MODE_ONCE = 0U, + MQTT_QOS_AT_LEAST_ONCE = 1U, + MQTT_QOS_EXACTLY_ONCE = 2U +}; + +class CMQTTConnection { +public: + CMQTTConnection(const wxString& host, unsigned short port, const wxString& name, const std::vector>& subs, unsigned int keepalive, MQTT_QOS qos = MQTT_QOS_EXACTLY_ONCE); + ~CMQTTConnection(); + + bool open(); + + bool publish(const char* topic, const char* text); + bool publish(const char* topic, const std::string& text); + bool publish(const char* topic, const unsigned char* data, unsigned int len); + + void close(); + +private: + wxString m_host; + unsigned short m_port; + wxString m_name; + std::vector> m_subs; + unsigned int m_keepalive; + MQTT_QOS m_qos; + mosquitto* m_mosq; + bool m_connected; + + static void onConnect(mosquitto* mosq, void* obj, int rc); + static void onSubscribe(mosquitto* mosq, void* obj, int mid, int qosCount, const int* grantedQOS); + static void onMessage(mosquitto* mosq, void* obj, const mosquitto_message* message); + static void onDisconnect(mosquitto* mosq, void* obj, int rc); +}; + +#endif + diff --git a/StarNetServer/StarNetServerThreadHelper.h b/Common/MQTTLog.cpp similarity index 57% rename from StarNetServer/StarNetServerThreadHelper.h rename to Common/MQTTLog.cpp index 17796e8..318fa20 100644 --- a/StarNetServer/StarNetServerThreadHelper.h +++ b/Common/MQTTLog.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012,2013 by Jonathan Naylor G4KLX + * Copyright (C) 2015,2016,2020,2022,2023 by Jonathan Naylor G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,27 +16,38 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifndef StarNetServerThreadHelper_H -#define StarNetServerThreadHelper_H +#include "MQTTLog.h" -#include "StarNetServerThread.h" +#include +#include +#include +#include +#include +#include -#include +CMQTTConnection* m_mqtt = NULL; -class CStarNetServerThreadHelper : public wxThread { +void MQTTLogInitialise() +{ +} -public: - CStarNetServerThreadHelper(CStarNetServerThread* thread); - virtual ~CStarNetServerThreadHelper(); +void MQTTLogFinalise() +{ + if (m_mqtt != NULL) { + m_mqtt->close(); + delete m_mqtt; + m_mqtt = NULL; + } +} - virtual void start(); +void WriteJSON(const std::string& topLevel, nlohmann::json& json) +{ + if (m_mqtt != NULL) { + nlohmann::json top; - virtual void* Entry(); + top[topLevel] = json; - virtual void kill(); + m_mqtt->publish("json", top.dump()); + } +} -private: - CStarNetServerThread* m_thread; -}; - -#endif diff --git a/StarNetServer/StarNetServerLogRedirect.h b/Common/MQTTLog.h similarity index 64% rename from StarNetServer/StarNetServerLogRedirect.h rename to Common/MQTTLog.h index 753d3b4..9b562b6 100644 --- a/StarNetServer/StarNetServerLogRedirect.h +++ b/Common/MQTTLog.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002,2003,2009-2011,2018 by Jonathan Naylor G4KLX + * Copyright (C) 2015,2016,2020,2022,2023 by Jonathan Naylor G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,20 +16,18 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifndef StarNetServerLogRedirect_H -#define StarNetServerLogRedirect_H +#if !defined(MQTTLOG_H) +#define MQTTLOG_H -#include -#include +#include "MQTTConnection.h" -class CStarNetServerLogRedirect : public wxLog { -public: - CStarNetServerLogRedirect(); - virtual ~CStarNetServerLogRedirect(); +#include - virtual void DoLogRecord(wxLogLevel level, const wxString& msg, const wxLogRecordInfo& info); +#include -private: -}; +extern void MQTTLogInitialise(); +extern void MQTTLogFinalise(); + +extern void WriteJSON(const std::string& topLevel, nlohmann::json& json); #endif diff --git a/Common/Makefile b/Common/Makefile index b684c8d..9153bfc 100644 --- a/Common/Makefile +++ b/Common/Makefile @@ -4,7 +4,7 @@ OBJECTS = AMBEData.o AnnouncementUnit.o APRSCollector.o APRSWriter.o AudioUnit.o DPlusAuthenticator.o DPlusHandler.o DPlusProtocolHandler.o DPlusProtocolHandlerPool.o DRATSServer.o DTMF.o \ DummyRepeaterProtocolHandler.o DVTOOLFileReader.o EchoUnit.o G2Handler.o G2ProtocolHandler.o GatewayCache.o \ HBRepeaterProtocolHandler.o HeaderData.o HeaderLogger.o HeardData.o HostFile.o IcomRepeaterProtocolHandler.o IRCDDBGatewayConfig.o \ - LogEvent.o Logger.o NatTraversalHandler.o PollData.o RemoteHandler.o RemoteLinkData.o RemoteProtocolHandler.o RemoteRepeaterData.o RemoteStarNetGroup.o \ + LogEvent.o Logger.o MQTTConnection.o MQTTLog.o NatTraversalHandler.o PollData.o RemoteHandler.o RemoteLinkData.o RemoteProtocolHandler.o RemoteRepeaterData.o RemoteStarNetGroup.o \ RemoteStarNetUser.o RepeaterCache.o RepeaterHandler.o SHA256.o SlowDataEncoder.o StarNetHandler.o StatusData.o \ TCPReaderWriterClient.o TCPReaderWriterServer.o TextCollector.o TextData.o Timer.o UDPReaderWriter.o UserCache.o Utils.o \ VersionUnit.o XLXHostsFileDownloader.o diff --git a/Common/Utils.cpp b/Common/Utils.cpp index 3cb449b..2e4c239 100644 --- a/Common/Utils.cpp +++ b/Common/Utils.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009,2013 Jonathan Naylor, G4KLX + * Copyright (C) 2009,2013,2023 Jonathan Naylor, G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -13,6 +13,13 @@ #include "Utils.h" +#if defined(_WIN32) || defined(_WIN64) +#include +#else +#include +#include +#endif + void CUtils::dump(const wxChar* title, const bool* data, unsigned int length) { wxASSERT(title != NULL); @@ -255,3 +262,25 @@ void CUtils::clean(wxString &str, const wxString& allowed) str.SetChar(i, wxT(' ')); } } + +std::string CUtils::createTimestamp() +{ + char buffer[100U]; + +#if defined(_WIN32) || defined(_WIN64) + SYSTEMTIME st; + ::GetSystemTime(&st); + + ::sprintf(buffer, "%04u-%02u-%02u %02u:%02u:%02u.%03u", st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond, st.wMilliseconds); +#else + struct timeval now; + ::gettimeofday(&now, NULL); + + struct tm* tm = ::gmtime(&now.tv_sec); + + ::sprintf(buffer, "%04d-%02d-%02d %02d:%02d:%02d.%03lld", tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec, now.tv_usec / 1000LL); +#endif + + return buffer; +} + diff --git a/Common/Utils.h b/Common/Utils.h index 2f51ab5..ece1008 100644 --- a/Common/Utils.h +++ b/Common/Utils.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009,2013 by Jonathan Naylor, G4KLX + * Copyright (C) 2009,2013,2023 by Jonathan Naylor, G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -34,6 +34,8 @@ public: static wxString latLonToLoc(double latitude, double longitude); static void clean(wxString& str, const wxString& allowed); + static std::string createTimestamp(); + private: }; diff --git a/Common/Version.h b/Common/Version.h index 477d0c1..43e2f0d 100644 --- a/Common/Version.h +++ b/Common/Version.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2015,2018,2019,2020 by Jonathan Naylor G4KLX + * Copyright (C) 2010-2015,2018,2019,2020,2023 by Jonathan Naylor G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,9 +24,9 @@ const wxString VENDOR_NAME = wxT("G4KLX"); #if defined(__WXDEBUG__) -const wxString VERSION = wxT("20200621 - DEBUG"); +const wxString VERSION = wxT("20230718 - DEBUG"); #else -const wxString VERSION = wxT("20190621"); +const wxString VERSION = wxT("20230718"); #endif #endif diff --git a/Makefile b/Makefile index b3610d3..e9891cd 100644 --- a/Makefile +++ b/Makefile @@ -26,14 +26,14 @@ ifeq ($(BUILD), debug) else ifeq ($(BUILD), release) export CFLAGS := $(CFLAGS) $(RELEASEFLAGS) endif -export LIBS := $(shell wx-config --libs base,net) +export LIBS := $(shell wx-config --libs base,net) -lmosquitto export LDFLAGS := .PHONY: all all: ircDDBGateway/ircddbgatewayd APRSTransmit/aprstransmitd RemoteControl/remotecontrold \ - StarNetServer/starnetserverd TextTransmit/texttransmitd TimerControl/timercontrold TimeServer/timeserverd VoiceTransmit/voicetransmitd + TextTransmit/texttransmitd TimerControl/timercontrold TimeServer/timeserverd VoiceTransmit/voicetransmitd -ircDDBGateway/ircddbgatewayd: Common/Common.a ircDDB/IRCDDB.a force +ircDDBGateway/ircddbgatewayd: GitVersion.h Common/Common.a ircDDB/IRCDDB.a force $(MAKE) -C ircDDBGateway APRSTransmit/aprstransmitd: Common/Common.a force @@ -42,9 +42,6 @@ APRSTransmit/aprstransmitd: Common/Common.a force RemoteControl/remotecontrold: Common/Common.a force $(MAKE) -C RemoteControl -StarNetServer/starnetserverd: Common/Common.a ircDDB/IRCDDB.a force - $(MAKE) -C StarNetServer - TextTransmit/texttransmitd: Common/Common.a force $(MAKE) -C TextTransmit @@ -63,6 +60,18 @@ Common/Common.a: force ircDDB/IRCDDB.a: force $(MAKE) -C ircDDB +Common/Common.a: GitVersion.h + +.PHONY: GitVersion.h + +# Export the current git version if the index file exists, else 000... +GitVersion.h: +ifneq ("$(wildcard .git/index)","") + echo "const wxChar *gitversion = wxT(\"$(shell git rev-parse HEAD)\");" > $@ +else + echo "const wxChar *gitversion = wxT(\"0000000000000000000000000000000000000000\");" > $@ +endif + .PHONY: installdirs installdirs: force /bin/mkdir -p $(DESTDIR)$(DATADIR) $(DESTDIR)$(LOGDIR) $(DESTDIR)$(CONFDIR) $(DESTDIR)$(BINDIR) @@ -85,7 +94,6 @@ endif $(MAKE) -C APRSTransmit install $(MAKE) -C ircDDBGateway install $(MAKE) -C RemoteControl install - $(MAKE) -C StarNetServer install $(MAKE) -C TextTransmit install $(MAKE) -C TimerControl install $(MAKE) -C TimeServer install @@ -98,7 +106,6 @@ clean: $(MAKE) -C APRSTransmit clean $(MAKE) -C ircDDBGateway clean $(MAKE) -C RemoteControl clean - $(MAKE) -C StarNetServer clean $(MAKE) -C TextTransmit clean $(MAKE) -C TimerControl clean $(MAKE) -C TimeServer clean @@ -116,7 +123,6 @@ endif rm $(DESTDIR)$(BINDIR)/aprstransmitd || true rm $(DESTDIR)$(BINDIR)/ircddbgatewayd || true rm $(DESTDIR)$(BINDIR)/remotecontrold || true - rm $(DESTDIR)$(BINDIR)/starnetserverd || true rm $(DESTDIR)$(BINDIR)/texttransmitd || true rm $(DESTDIR)$(BINDIR)/timercontrold || true rm $(DESTDIR)$(BINDIR)/timeserverd || true diff --git a/MakefileGUI b/MakefileGUI index 7bec5e2..4ffe300 100644 --- a/MakefileGUI +++ b/MakefileGUI @@ -19,12 +19,12 @@ endif export CXX := $(shell wx-config --cxx) export CFLAGS := -O2 -Wall $(shell wx-config --cxxflags) -DLOG_DIR='$(LOGDIR)' -DCONF_DIR='$(CONFDIR)' -DDATA_DIR='$(DATADIR)' export GUILIBS := $(shell wx-config --libs adv,core,base) -export LIBS := $(shell wx-config --libs base,net) +export LIBS := $(shell wx-config --libs base,net) -lmosquitto export LDFLAGS := .PHONY: all all: ircDDBGateway/ircddbgateway ircDDBGatewayConfig/ircddbgatewayconfig APRSTransmit/aprstransmitd RemoteControl/remotecontrol \ - StarNetServer/starnetserver TextTransmit/texttransmitd TimerControl/timercontrol TimeServer/timeserver VoiceTransmit/voicetransmitd + TextTransmit/texttransmitd TimerControl/timercontrol TimeServer/timeserver VoiceTransmit/voicetransmitd ircDDBGateway/ircddbgateway: GUICommon/GUICommon.a Common/Common.a ircDDB/IRCDDB.a force $(MAKE) -C ircDDBGateway -f MakefileGUI @@ -38,9 +38,6 @@ APRSTransmit/aprstransmitd: Common/Common.a force RemoteControl/remotecontrol: Common/Common.a force $(MAKE) -C RemoteControl -f MakefileGUI -StarNetServer/starnetserver: Common/Common.a ircDDB/IRCDDB.a force - $(MAKE) -C StarNetServer -f MakefileGUI - TextTransmit/texttransmitd: Common/Common.a force $(MAKE) -C TextTransmit @@ -62,13 +59,24 @@ Common/Common.a: force ircDDB/IRCDDB.a: force $(MAKE) -C ircDDB +Common/Common.a: GitVersion.h + +.PHONY: GitVersion.h + +# Export the current git version if the index file exists, else 000... +GitVersion.h: +ifneq ("$(wildcard .git/index)","") + echo "const wxChar *gitversion = wxT(\"$(shell git rev-parse HEAD)\");" > $@ +else + echo "const wxChar *gitversion = wxT(\"0000000000000000000000000000000000000000\");" > $@ +endif + .PHONY: install install: all $(MAKE) -C Data install $(MAKE) -C APRSTransmit install $(MAKE) -C ircDDBGateway -f MakefileGUI install $(MAKE) -C RemoteControl -f MakefileGUI install - $(MAKE) -C StarNetServer -f MakefileGUI install $(MAKE) -C TextTransmit install $(MAKE) -C TimerControl -f MakefileGUI install $(MAKE) -C TimeServer -f MakefileGUI install @@ -83,7 +91,6 @@ clean: $(MAKE) -C APRSTransmit clean $(MAKE) -C ircDDBGateway -f MakefileGUI clean $(MAKE) -C RemoteControl -f MakefileGUI clean - $(MAKE) -C StarNetServer -f MakefileGUI clean $(MAKE) -C TextTransmit clean $(MAKE) -C TimerControl -f MakefileGUI clean $(MAKE) -C TimeServer -f MakefileGUI clean diff --git a/StarNetServer/Makefile b/StarNetServer/Makefile deleted file mode 100644 index a12de40..0000000 --- a/StarNetServer/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -OBJECTS = StarNetServerAppD.o StarNetServerConfig.o StarNetServerThread.o StarNetServerThreadHelper.o - -.PHONY: all -all: starnetserverd - -starnetserverd: $(OBJECTS) ../Common/Common.a ../ircDDB/IRCDDB.a - $(CXX) $(OBJECTS) ../Common/Common.a ../ircDDB/IRCDDB.a $(LDFLAGS) $(LIBS) -o starnetserverd - --include $(OBJECTS:.o=.d) - -%.o: %.cpp - $(CXX) -DwxUSE_GUI=0 $(CFLAGS) -I../Common -I../ircDDB -c -o $@ $< - $(CXX) -MM -DwxUSE_GUI=0 $(CFLAGS) -I../Common -I../ircDDB $< > $*.d - -.PHONY: install -install: - install -g root -o root -m 0755 starnetserverd $(DESTDIR)$(BINDIR) - -.PHONY: clean -clean: - $(RM) starnetserverd *.o *.d *.bak *~ - -../Common/Common.a: -../ircDDB/IRCDDB.a: diff --git a/StarNetServer/MakefileGUI b/StarNetServer/MakefileGUI deleted file mode 100644 index 61fe271..0000000 --- a/StarNetServer/MakefileGUI +++ /dev/null @@ -1,26 +0,0 @@ -OBJECTS = StarNetServerApp.o StarNetServerCallsignSet.o StarNetServerConfig.o StarNetServerFrame.o StarNetServerIrcDDBSet.o \ - StarNetServerLogRedirect.o StarNetServerMiscellaneousSet.o StarNetServerPreferences.o StarNetServerThread.o \ - StarNetServerThreadHelper.o - -.PHONY: all -all: starnetserver - -starnetserver: $(OBJECTS) ../GUICommon/GUICommon.a ../Common/Common.a - $(CXX) $(OBJECTS) ../GUICommon/GUICommon.a ../Common/Common.a ../ircDDB/IRCDDB.a $(LDFLAGS) $(GUILIBS) -o starnetserver - --include $(OBJECTS:.o=.d) - -%.o: %.cpp - $(CXX) $(CFLAGS) -I../Common -I../GUICommon -I../ircDDB -c -o $@ $< - $(CXX) -MM $(CFLAGS) -I../Common -I../GUICommon -I../ircDDB $< > $*.d - -.PHONY: install -install: - install -g bin -o root -m 0775 starnetserver $(BINDIR) - -.PHONY: clean -clean: - $(RM) starnetserver *.o *.d *.bak *~ - -../GUICommon/GUICommon.a: -../Common/Common.a: diff --git a/StarNetServer/StarNetServer.vcxproj b/StarNetServer/StarNetServer.vcxproj deleted file mode 100644 index 7536891..0000000 --- a/StarNetServer/StarNetServer.vcxproj +++ /dev/null @@ -1,214 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {4E9989C8-80D4-4F6E-BCA1-754DCED3AF5F} - StarNetServer - Win32Proj - 10.0 - - - - Application - v142 - Unicode - true - - - Application - v142 - Unicode - true - - - Application - v142 - Unicode - - - Application - v142 - Unicode - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>14.0.24720.0 - - - $(SolutionDir)$(Configuration)\ - $(Configuration)\ - true - $(WXWIN)\include;$(WXWIN)\lib\vc_dll\mswud;$(IncludePath) - - - true - $(WXWIN)\include;$(WXWIN)\lib\vc_x64_dll\mswud;$(IncludePath) - - - $(SolutionDir)$(Configuration)\ - $(Configuration)\ - false - $(WXWIN)\include;$(WXWIN)\lib\vc_dll\mswu;$(IncludePath) - - - false - $(WXWIN)\include;$(WXWIN)\lib\vc_x64_dll\mswu;$(IncludePath) - - - - Disabled - $(WXWIN)\include\msvc;$(WXWIN)\include;../Common;../GUICommon;../ircDDB;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;WINVER=0x0400;__WXMSW__;WXUSINGDLL;wxUSE_GUI=1;__WXDEBUG__;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;DCS_LINK;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - Level4 - EditAndContinue - - - ws2_32.lib;%(AdditionalDependencies) - $(WXWIN)\lib\vc_dll;%(AdditionalLibraryDirectories) - true - Windows - MachineX86 - - - - - Disabled - $(WXWIN)\include\msvc;$(WXWIN)\include;../Common;../GUICommon;../ircDDB;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;WINVER=0x0400;__WXMSW__;WXUSINGDLL;wxUSE_GUI=1;__WXDEBUG__;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;DCS_LINK;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - - - Level4 - ProgramDatabase - - - ws2_32.lib;%(AdditionalDependencies) - $(WXWIN)\lib\vc_x64_dll;%(AdditionalLibraryDirectories) - true - Windows - - - - - MaxSpeed - true - $(WXWIN)\include\msvc;$(WXWIN)\include;../ircDDB;../Common;../GUICommon;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;WINVER=0x0400;__WXMSW__;WXUSINGDLL;wxUSE_GUI=1;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - MultiThreadedDLL - true - - Level3 - ProgramDatabase - - - ws2_32.lib;%(AdditionalDependencies) - $(WXWIN)\lib\vc_dll;%(AdditionalLibraryDirectories) - true - Windows - true - true - MachineX86 - - - - - MaxSpeed - true - $(WXWIN)\include\msvc;$(WXWIN)\include;../ircDDB;../Common;../GUICommon;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;WINVER=0x0400;__WXMSW__;WXUSINGDLL;wxUSE_GUI=1;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - MultiThreadedDLL - true - - - Level3 - ProgramDatabase - - - ws2_32.lib;%(AdditionalDependencies) - $(WXWIN)\lib\vc_x64_dll;%(AdditionalLibraryDirectories) - true - Windows - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {e793cb8e-2ac9-431a-bbfc-3f52537bb3cf} - false - - - {02d03515-0bbe-4553-8c40-566a597478f8} - false - - - {276bc54d-5581-4a0c-afd5-a5bdc947f0ad} - false - - - - - - \ No newline at end of file diff --git a/StarNetServer/StarNetServer.vcxproj.filters b/StarNetServer/StarNetServer.vcxproj.filters deleted file mode 100644 index 1cd5368..0000000 --- a/StarNetServer/StarNetServer.vcxproj.filters +++ /dev/null @@ -1,80 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - \ No newline at end of file diff --git a/StarNetServer/StarNetServerApp.cpp b/StarNetServer/StarNetServerApp.cpp deleted file mode 100644 index d95e1b3..0000000 --- a/StarNetServer/StarNetServerApp.cpp +++ /dev/null @@ -1,947 +0,0 @@ -/* - * Copyright (C) 2010,2011,2012,2015,2018 by Jonathan Naylor G4KLX - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include "StarNetServerLogRedirect.h" -#include "StarNetServerThread.h" -#include "StarNetServerDefs.h" -#include "StarNetServerApp.h" -#include "Version.h" -#include "Logger.h" -#include "IRCDDBClient.h" - -#include -#include -#include - -wxIMPLEMENT_APP(CStarNetServerApp); - -const wxChar* NOLOGGING_SWITCH = wxT("nolog"); -const wxChar* GUI_SWITCH = wxT("gui"); -const wxChar* LOGDIR_OPTION = wxT("logdir"); -const wxChar* CONFDIR_OPTION = wxT("confdir"); - -CStarNetServerApp::CStarNetServerApp() : -wxApp(), -m_nolog(false), -m_gui(false), -m_logDir(), -m_confDir(), -m_frame(NULL), -m_thread(NULL), -m_config(NULL), -m_logChain(NULL) -{ -} - -CStarNetServerApp::~CStarNetServerApp() -{ -} - -bool CStarNetServerApp::OnInit() -{ -#if defined(__WINDOWS__) - WSAData data; - int wsaRet = ::WSAStartup(MAKEWORD(2, 2), &data); - if (wsaRet != 0) { - wxLogError(wxT("Error from WSAStartup")); - return false; - } -#endif - - SetVendorName(VENDOR_NAME); - - if (!wxApp::OnInit()) - return false; - - if (!m_nolog) { -#if defined(__WINDOWS__) - if (m_logDir.IsEmpty()) - m_logDir = ::wxGetHomeDir(); -#else - if (m_logDir.IsEmpty()) - m_logDir = wxT(LOG_DIR); -#endif - - wxLog* log = new CLogger(m_logDir, LOG_BASE_NAME); - wxLog::SetActiveTarget(log); - } else { - new wxLogNull; - } - - m_logChain = new wxLogChain(new CStarNetServerLogRedirect); - -#if defined(__WINDOWS__) - if (m_confDir.IsEmpty()) - m_confDir = wxGetHomeDir(); - - m_config = new CStarNetServerConfig(new wxConfig(APPLICATION_NAME), m_confDir); -#else - if (m_confDir.IsEmpty()) - m_confDir = wxT(CONF_DIR); - - m_config = new CStarNetServerConfig(m_confDir); -#endif - - wxPoint position = wxDefaultPosition; - - int x, y; - getPosition(x, y); - if (x >= 0 && y >= 0) - position = wxPoint(x, y); - - m_frame = new CStarNetServerFrame(APPLICATION_NAME + wxT(" - ") + VERSION, position, m_gui); - m_frame->Show(); - - SetTopWindow(m_frame); - - wxLogInfo(wxT("Starting ") + APPLICATION_NAME + wxT(" - ") + VERSION); - - // Log the version of wxWidgets and the Operating System - wxLogInfo(wxT("Using wxWidgets %d.%d.%d on %s"), wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER, ::wxGetOsDescription().c_str()); - - createThread(); - - return true; -} - -int CStarNetServerApp::OnExit() -{ - m_logChain->SetLog(NULL); - - wxLogInfo(APPLICATION_NAME + wxT(" is exiting")); - - m_thread->kill(); - - delete m_config; - -#if defined(__WINDOWS__) - ::WSACleanup(); -#endif - - return 0; -} - -void CStarNetServerApp::OnInitCmdLine(wxCmdLineParser& parser) -{ - parser.AddSwitch(NOLOGGING_SWITCH, wxEmptyString, wxEmptyString, wxCMD_LINE_PARAM_OPTIONAL); - parser.AddSwitch(GUI_SWITCH, wxEmptyString, wxEmptyString, wxCMD_LINE_PARAM_OPTIONAL); - parser.AddOption(LOGDIR_OPTION, wxEmptyString, wxEmptyString, wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL); - parser.AddOption(CONFDIR_OPTION, wxEmptyString, wxEmptyString, wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL); - - wxApp::OnInitCmdLine(parser); -} - -bool CStarNetServerApp::OnCmdLineParsed(wxCmdLineParser& parser) -{ - if (!wxApp::OnCmdLineParsed(parser)) - return false; - - m_nolog = parser.Found(NOLOGGING_SWITCH); - m_gui = parser.Found(GUI_SWITCH); - - wxString logDir; - bool found = parser.Found(LOGDIR_OPTION, &logDir); - if (found) - m_logDir = logDir; - - wxString confDir; - found = parser.Found(CONFDIR_OPTION, &confDir); - if (found) - m_confDir = confDir; - - return true; -} - -#if defined(__WXDEBUG__) -void CStarNetServerApp::OnAssertFailure(const wxChar* file, int line, const wxChar* func, const wxChar* cond, const wxChar* msg) -{ - wxLogFatalError(wxT("Assertion failed on line %d in file %s and function %s: %s %s"), line, file, func, cond, msg); -} -#endif - -void CStarNetServerApp::showLog(const wxString& text) -{ - m_frame->showLog(text); -} - -void CStarNetServerApp::getGateway(wxString& callsign, wxString& address) const -{ - m_config->getGateway(callsign, address); -} - -void CStarNetServerApp::setGateway(const wxString& callsign, const wxString& address) -{ - m_config->setGateway(callsign, address); -} - -void CStarNetServerApp::getIrcDDB(wxString& hostname, wxString& username, wxString& password) const -{ - m_config->getIrcDDB(hostname, username, password); -} - -void CStarNetServerApp::setIrcDDB(const wxString& hostname, const wxString& username, const wxString& password) -{ - m_config->setIrcDDB(hostname, username, password); -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -void CStarNetServerApp::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 -{ - m_config->getStarNet1(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector); -} - -void CStarNetServerApp::setStarNet1(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector) -{ - m_config->setStarNet1(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector); -} - -void CStarNetServerApp::getStarNet2(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 -{ - m_config->getStarNet2(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector); -} - -void CStarNetServerApp::setStarNet2(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector) -{ - m_config->setStarNet2(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector); -} - -void CStarNetServerApp::getStarNet3(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 -{ - m_config->getStarNet3(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector); -} - -void CStarNetServerApp::setStarNet3(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector) -{ - m_config->setStarNet3(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector); -} - -void CStarNetServerApp::getStarNet4(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 -{ - m_config->getStarNet4(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector); -} - -void CStarNetServerApp::setStarNet4(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector) -{ - m_config->setStarNet4(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector); -} - -void CStarNetServerApp::getStarNet5(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 -{ - m_config->getStarNet5(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector); -} - -void CStarNetServerApp::setStarNet5(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector) -{ - m_config->setStarNet5(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector); -} - -void CStarNetServerApp::getStarNet6(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 -{ - m_config->getStarNet6(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector); -} - -void CStarNetServerApp::setStarNet6(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector) -{ - m_config->setStarNet6(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector); -} - -void CStarNetServerApp::getStarNet7(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 -{ - m_config->getStarNet7(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector); -} - -void CStarNetServerApp::setStarNet7(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector) -{ - m_config->setStarNet7(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector); -} - -void CStarNetServerApp::getStarNet8(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 -{ - m_config->getStarNet8(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector); -} - -void CStarNetServerApp::setStarNet8(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector) -{ - m_config->setStarNet8(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector); -} - -void CStarNetServerApp::getStarNet9(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 -{ - m_config->getStarNet9(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector); -} - -void CStarNetServerApp::setStarNet9(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector) -{ - m_config->setStarNet9(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector); -} - -void CStarNetServerApp::getStarNet10(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 -{ - m_config->getStarNet10(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector); -} - -void CStarNetServerApp::setStarNet10(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector) -{ - m_config->setStarNet10(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector); -} - -void CStarNetServerApp::getStarNet11(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 -{ - m_config->getStarNet11(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector); -} - -void CStarNetServerApp::setStarNet11(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector) -{ - m_config->setStarNet11(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector); -} - -void CStarNetServerApp::getStarNet12(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 -{ - m_config->getStarNet12(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector); -} - -void CStarNetServerApp::setStarNet12(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector) -{ - m_config->setStarNet12(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector); -} - -void CStarNetServerApp::getStarNet13(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 -{ - m_config->getStarNet13(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector); -} - -void CStarNetServerApp::setStarNet13(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector) -{ - m_config->setStarNet13(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector); -} - -void CStarNetServerApp::getStarNet14(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 -{ - m_config->getStarNet14(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector); -} - -void CStarNetServerApp::setStarNet14(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector) -{ - m_config->setStarNet14(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector); -} - -void CStarNetServerApp::getStarNet15(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 -{ - m_config->getStarNet15(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector); -} - -void CStarNetServerApp::setStarNet15(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector) -{ - m_config->setStarNet15(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector); -} -#else -void CStarNetServerApp::getStarNet1(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const -{ - m_config->getStarNet1(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch); -} - -void CStarNetServerApp::setStarNet1(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch) -{ - m_config->setStarNet1(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch); -} - -void CStarNetServerApp::getStarNet2(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const -{ - m_config->getStarNet2(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch); -} - -void CStarNetServerApp::setStarNet2(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch) -{ - m_config->setStarNet2(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch); -} - -void CStarNetServerApp::getStarNet3(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const -{ - m_config->getStarNet3(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch); -} - -void CStarNetServerApp::setStarNet3(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch) -{ - m_config->setStarNet3(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch); -} - -void CStarNetServerApp::getStarNet4(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const -{ - m_config->getStarNet4(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch); -} - -void CStarNetServerApp::setStarNet4(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch) -{ - m_config->setStarNet4(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch); -} - -void CStarNetServerApp::getStarNet5(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const -{ - m_config->getStarNet5(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch); -} - -void CStarNetServerApp::setStarNet5(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch) -{ - m_config->setStarNet5(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch); -} - -void CStarNetServerApp::getStarNet6(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const -{ - m_config->getStarNet6(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch); -} - -void CStarNetServerApp::setStarNet6(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch) -{ - m_config->setStarNet6(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch); -} - -void CStarNetServerApp::getStarNet7(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const -{ - m_config->getStarNet7(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch); -} - -void CStarNetServerApp::setStarNet7(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch) -{ - m_config->setStarNet7(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch); -} - -void CStarNetServerApp::getStarNet8(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const -{ - m_config->getStarNet8(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch); -} - -void CStarNetServerApp::setStarNet8(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch) -{ - m_config->setStarNet8(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch); -} - -void CStarNetServerApp::getStarNet9(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const -{ - m_config->getStarNet9(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch); -} - -void CStarNetServerApp::setStarNet9(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch) -{ - m_config->setStarNet9(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch); -} - -void CStarNetServerApp::getStarNet10(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const -{ - m_config->getStarNet10(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch); -} - -void CStarNetServerApp::setStarNet10(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch) -{ - m_config->setStarNet10(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch); -} - -void CStarNetServerApp::getStarNet11(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const -{ - m_config->getStarNet11(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch); -} - -void CStarNetServerApp::setStarNet11(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch) -{ - m_config->setStarNet11(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch); -} - -void CStarNetServerApp::getStarNet12(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const -{ - m_config->getStarNet12(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch); -} - -void CStarNetServerApp::setStarNet12(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch) -{ - m_config->setStarNet12(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch); -} - -void CStarNetServerApp::getStarNet13(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const -{ - m_config->getStarNet13(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch); -} - -void CStarNetServerApp::setStarNet13(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch) -{ - m_config->setStarNet13(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch); -} - -void CStarNetServerApp::getStarNet14(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const -{ - m_config->getStarNet14(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch); -} - -void CStarNetServerApp::setStarNet14(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch) -{ - m_config->setStarNet14(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch); -} - -void CStarNetServerApp::getStarNet15(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const -{ - m_config->getStarNet15(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch); -} - -void CStarNetServerApp::setStarNet15(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch) -{ - m_config->setStarNet15(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch); -} -#endif - -void CStarNetServerApp::getRemote(bool& enabled, wxString& password, unsigned int& port) const -{ - m_config->getRemote(enabled, password, port); -} - -void CStarNetServerApp::setRemote(bool enabled, const wxString& password, unsigned int port) -{ - m_config->setRemote(enabled, password, port); -} - -void CStarNetServerApp::getMiscellaneous(bool& logEnabled) const -{ - m_config->getMiscellaneous(logEnabled); -} - -void CStarNetServerApp::setMiscellaneous(bool logEnabled) -{ - m_config->setMiscellaneous(logEnabled); -} - -void CStarNetServerApp::getPosition(int& x, int& y) const -{ - m_config->getPosition(x, y); -} - -void CStarNetServerApp::setPosition(int x, int y) -{ - m_config->setPosition(x, y); -} - -bool CStarNetServerApp::writeConfig() -{ - return m_config->write(); -} - -void CStarNetServerApp::createThread() -{ - CStarNetServerThread* thread = new CStarNetServerThread(m_nolog, m_logDir); - - wxString callsign, address; - getGateway(callsign, address); - - callsign.Append(wxT(" ")); - callsign.Truncate(LONG_CALLSIGN_LENGTH - 1U); - callsign.Append(wxT("G")); - - wxLogInfo(wxT("Gateway callsign set to %s, local address set to %s"), callsign.c_str(), address.c_str()); - - bool logEnabled; - getMiscellaneous(logEnabled); - wxLogInfo(wxT("Log enabled set to %d"), int(logEnabled)); - - wxString hostname, username, password; - getIrcDDB(hostname, username, password); - wxLogInfo(wxT("ircDDB host set to %s, username set to %s"), hostname.c_str(), username.c_str()); - - if (!hostname.IsEmpty() && !username.IsEmpty()) { -#if defined(__WINDOWS__) - CIRCDDB* ircDDB = new CIRCDDBClient(hostname, 9007U, username, password, wxT("win_") + LOG_BASE_NAME + wxT("-") + VERSION, address); -#else - CIRCDDB* ircDDB = new CIRCDDBClient(hostname, 9007U, username, password, wxT("linux_") + LOG_BASE_NAME + wxT("-") + VERSION, address); -#endif - bool res = ircDDB->open(); - if (!res) - wxLogError(wxT("Cannot initialise the ircDDB protocol handler")); - else - thread->setIRC(ircDDB); - } - - wxString starNetBand1, starNetCallsign1, starNetLogoff1, starNetInfo1, starNetPermanent1, starNetLink1; // DEXTRA_LINK || DCS_LINK - unsigned int starNetUserTimeout1, starNetGroupTimeout1; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch1; - bool starNetTXMsgSwitch1; - getStarNet1(starNetBand1, starNetCallsign1, starNetLogoff1, starNetInfo1, starNetPermanent1, starNetUserTimeout1, starNetGroupTimeout1, starNetCallsignSwitch1, starNetTXMsgSwitch1 -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - ,starNetLink1 -#endif -); - - if (!starNetCallsign1.IsEmpty() && !starNetCallsign1.IsSameAs(wxT(" "))) { - wxString repeater = callsign; - repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U); - repeater.Append(starNetBand1); - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - thread->addStarNet(starNetCallsign1, starNetLogoff1, repeater, starNetInfo1, starNetPermanent1, starNetUserTimeout1, starNetGroupTimeout1, starNetCallsignSwitch1, starNetTXMsgSwitch1, starNetLink1); - wxLogInfo(wxT("StarNet 1 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign1.c_str(), starNetLogoff1.c_str(), repeater.c_str(), starNetInfo1.c_str(), starNetPermanent1.c_str(), starNetUserTimeout1, starNetGroupTimeout1, int(starNetCallsignSwitch1), int(starNetTXMsgSwitch1), starNetLink1.c_str()); -#else - thread->addStarNet(starNetCallsign1, starNetLogoff1, repeater, starNetInfo1, starNetPermanent1, starNetUserTimeout1, starNetGroupTimeout1, starNetCallsignSwitch1, starNetTXMsgSwitch1); - wxLogInfo(wxT("StarNet 1 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign1.c_str(), starNetLogoff1.c_str(), repeater.c_str(), starNetInfo1.c_str(), starNetPermanent1.c_str(), starNetUserTimeout1, starNetGroupTimeout1, int(starNetCallsignSwitch1), int(starNetTXMsgSwitch1)); -#endif - } - - wxString starNetBand2, starNetCallsign2, starNetLogoff2, starNetInfo2, starNetPermanent2, starNetLink2; // DEXTRA_LINK || DCS_LINK - unsigned int starNetUserTimeout2, starNetGroupTimeout2; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch2; - bool starNetTXMsgSwitch2; - getStarNet2(starNetBand2, starNetCallsign2, starNetLogoff2, starNetInfo2, starNetPermanent2, starNetUserTimeout2, starNetGroupTimeout2, starNetCallsignSwitch2, starNetTXMsgSwitch2 -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - ,starNetLink2 -#endif -); - - if (!starNetCallsign2.IsEmpty() && !starNetCallsign2.IsSameAs(wxT(" "))) { - wxString repeater = callsign; - repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U); - repeater.Append(starNetBand2); - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - thread->addStarNet(starNetCallsign2, starNetLogoff2, repeater, starNetInfo2, starNetPermanent2, starNetUserTimeout2, starNetGroupTimeout2, starNetCallsignSwitch2, starNetTXMsgSwitch2, starNetLink2); - wxLogInfo(wxT("StarNet 2 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign2.c_str(), starNetLogoff2.c_str(), repeater.c_str(), starNetInfo2.c_str(), starNetPermanent2.c_str(), starNetUserTimeout2, starNetGroupTimeout2, int(starNetCallsignSwitch2), int(starNetTXMsgSwitch2), starNetLink2.c_str()); -#else - thread->addStarNet(starNetCallsign2, starNetLogoff2, repeater, starNetInfo2, starNetPermanent2, starNetUserTimeout2, starNetGroupTimeout2, starNetCallsignSwitch2, starNetTXMsgSwitch2); - wxLogInfo(wxT("StarNet 2 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign2.c_str(), starNetLogoff2.c_str(), repeater.c_str(), starNetInfo2.c_str(), starNetPermanent2.c_str(), starNetUserTimeout2, starNetGroupTimeout2, int(starNetCallsignSwitch2), int(starNetTXMsgSwitch2)); -#endif - } - - wxString starNetBand3, starNetCallsign3, starNetLogoff3, starNetInfo3, starNetPermanent3, starNetLink3; // DEXTRA_LINK || DCS_LINK - unsigned int starNetUserTimeout3, starNetGroupTimeout3; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch3; - bool starNetTXMsgSwitch3; - getStarNet3(starNetBand3, starNetCallsign3, starNetLogoff3, starNetInfo3, starNetPermanent3, starNetUserTimeout3, starNetGroupTimeout3, starNetCallsignSwitch3, starNetTXMsgSwitch3 -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - ,starNetLink3 -#endif -); - - if (!starNetCallsign3.IsEmpty() && !starNetCallsign3.IsSameAs(wxT(" "))) { - wxString repeater = callsign; - repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U); - repeater.Append(starNetBand3); - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - thread->addStarNet(starNetCallsign3, starNetLogoff3, repeater, starNetInfo3, starNetPermanent3, starNetUserTimeout3, starNetGroupTimeout3, starNetCallsignSwitch3, starNetTXMsgSwitch3, starNetLink3); - wxLogInfo(wxT("StarNet 3 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign3.c_str(), starNetLogoff3.c_str(), repeater.c_str(), starNetInfo3.c_str(), starNetPermanent3.c_str(), starNetUserTimeout3, starNetGroupTimeout3, int(starNetCallsignSwitch3), int(starNetTXMsgSwitch3), starNetLink3.c_str()); -#else - thread->addStarNet(starNetCallsign3, starNetLogoff3, repeater, starNetInfo3, starNetPermanent3, starNetUserTimeout3, starNetGroupTimeout3, starNetCallsignSwitch3, starNetTXMsgSwitch3); - wxLogInfo(wxT("StarNet 3 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign3.c_str(), starNetLogoff3.c_str(), repeater.c_str(), starNetInfo3.c_str(), starNetPermanent3.c_str(), starNetUserTimeout3, starNetGroupTimeout3, int(starNetCallsignSwitch3), int(starNetTXMsgSwitch3)); -#endif - } - - wxString starNetBand4, starNetCallsign4, starNetLogoff4, starNetInfo4, starNetPermanent4, starNetLink4; // DEXTRA_LINK || DCS_LINK - unsigned int starNetUserTimeout4, starNetGroupTimeout4; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch4; - bool starNetTXMsgSwitch4; - getStarNet4(starNetBand4, starNetCallsign4, starNetLogoff4, starNetInfo4, starNetPermanent4, starNetUserTimeout4, starNetGroupTimeout4, starNetCallsignSwitch4, starNetTXMsgSwitch4 -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - ,starNetLink4 -#endif -); - - if (!starNetCallsign4.IsEmpty() && !starNetCallsign4.IsSameAs(wxT(" "))) { - wxString repeater = callsign; - repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U); - repeater.Append(starNetBand4); - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - thread->addStarNet(starNetCallsign4, starNetLogoff4, repeater, starNetInfo4, starNetPermanent4, starNetUserTimeout4, starNetGroupTimeout4, starNetCallsignSwitch4, starNetTXMsgSwitch4, starNetLink4); - wxLogInfo(wxT("StarNet 4 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign4.c_str(), starNetLogoff4.c_str(), repeater.c_str(), starNetInfo4.c_str(), starNetPermanent4.c_str(), starNetUserTimeout4, starNetGroupTimeout4, int(starNetCallsignSwitch4), int(starNetTXMsgSwitch4), starNetLink4.c_str()); -#else - thread->addStarNet(starNetCallsign4, starNetLogoff4, repeater, starNetInfo4, starNetPermanent4, starNetUserTimeout4, starNetGroupTimeout4, starNetCallsignSwitch4, starNetTXMsgSwitch4); - wxLogInfo(wxT("StarNet 4 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign4.c_str(), starNetLogoff4.c_str(), repeater.c_str(), starNetInfo4.c_str(), starNetPermanent4.c_str(), starNetUserTimeout4, starNetGroupTimeout4, int(starNetCallsignSwitch4), int(starNetTXMsgSwitch4)); -#endif - } - - wxString starNetBand5, starNetCallsign5, starNetLogoff5, starNetInfo5, starNetPermanent5, starNetLink5; // DEXTRA_LINK || DCS_LINK - unsigned int starNetUserTimeout5, starNetGroupTimeout5; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch5; - bool starNetTXMsgSwitch5; - getStarNet5(starNetBand5, starNetCallsign5, starNetLogoff5, starNetInfo5, starNetPermanent5, starNetUserTimeout5, starNetGroupTimeout5, starNetCallsignSwitch5, starNetTXMsgSwitch5 -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - ,starNetLink5 -#endif -); - - if (!starNetCallsign5.IsEmpty() && !starNetCallsign5.IsSameAs(wxT(" "))) { - wxString repeater = callsign; - repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U); - repeater.Append(starNetBand5); - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - thread->addStarNet(starNetCallsign5, starNetLogoff5, repeater, starNetInfo5, starNetPermanent5, starNetUserTimeout5, starNetGroupTimeout5, starNetCallsignSwitch5, starNetTXMsgSwitch5, starNetLink5); - wxLogInfo(wxT("StarNet 5 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign5.c_str(), starNetLogoff5.c_str(), repeater.c_str(), starNetInfo5.c_str(), starNetPermanent5.c_str(), starNetUserTimeout5, starNetGroupTimeout5, int(starNetCallsignSwitch5), int(starNetTXMsgSwitch5), starNetLink5.c_str()); -#else - thread->addStarNet(starNetCallsign5, starNetLogoff5, repeater, starNetInfo5, starNetPermanent5, starNetUserTimeout5, starNetGroupTimeout5, starNetCallsignSwitch5, starNetTXMsgSwitch5); - wxLogInfo(wxT("StarNet 5 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign5.c_str(), starNetLogoff5.c_str(), repeater.c_str(), starNetInfo5.c_str(), starNetPermanent5.c_str(), starNetUserTimeout5, starNetGroupTimeout5, int(starNetCallsignSwitch5), int(starNetTXMsgSwitch5)); -#endif - } - - wxString starNetBand6, starNetCallsign6, starNetLogoff6, starNetInfo6, starNetPermanent6, starNetLink6; // DEXTRA_LINK || DCS_LINK - unsigned int starNetUserTimeout6, starNetGroupTimeout6; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch6; - bool starNetTXMsgSwitch6; - getStarNet6(starNetBand6, starNetCallsign6, starNetLogoff6, starNetInfo6, starNetPermanent6, starNetUserTimeout6, starNetGroupTimeout6, starNetCallsignSwitch6, starNetTXMsgSwitch6 -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - ,starNetLink6 -#endif -); - - if (!starNetCallsign6.IsEmpty() && !starNetCallsign6.IsSameAs(wxT(" "))) { - wxString repeater = callsign; - repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U); - repeater.Append(starNetBand6); - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - thread->addStarNet(starNetCallsign6, starNetLogoff6, repeater, starNetInfo6, starNetPermanent6, starNetUserTimeout6, starNetGroupTimeout6, starNetCallsignSwitch6, starNetTXMsgSwitch6, starNetLink6); - wxLogInfo(wxT("StarNet 6 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign6.c_str(), starNetLogoff6.c_str(), repeater.c_str(), starNetInfo6.c_str(), starNetPermanent6.c_str(), starNetUserTimeout6, starNetGroupTimeout6, int(starNetCallsignSwitch6), int(starNetTXMsgSwitch6), starNetLink6.c_str()); -#else - thread->addStarNet(starNetCallsign6, starNetLogoff6, repeater, starNetInfo6, starNetPermanent6, starNetUserTimeout6, starNetGroupTimeout6, starNetCallsignSwitch6, starNetTXMsgSwitch6); - wxLogInfo(wxT("StarNet 6 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign6.c_str(), starNetLogoff6.c_str(), repeater.c_str(), starNetInfo6.c_str(), starNetPermanent6.c_str(), starNetUserTimeout6, starNetGroupTimeout6, int(starNetCallsignSwitch6), int(starNetTXMsgSwitch6)); -#endif - } - - wxString starNetBand7, starNetCallsign7, starNetLogoff7, starNetInfo7, starNetPermanent7, starNetLink7; // DEXTRA_LINK || DCS_LINK - unsigned int starNetUserTimeout7, starNetGroupTimeout7; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch7; - bool starNetTXMsgSwitch7; - getStarNet7(starNetBand7, starNetCallsign7, starNetLogoff7, starNetInfo7, starNetPermanent7, starNetUserTimeout7, starNetGroupTimeout7, starNetCallsignSwitch7, starNetTXMsgSwitch7 -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - ,starNetLink7 -#endif -); - - if (!starNetCallsign7.IsEmpty() && !starNetCallsign7.IsSameAs(wxT(" "))) { - wxString repeater = callsign; - repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U); - repeater.Append(starNetBand7); - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - thread->addStarNet(starNetCallsign7, starNetLogoff7, repeater, starNetInfo7, starNetPermanent7, starNetUserTimeout7, starNetGroupTimeout7, starNetCallsignSwitch7, starNetTXMsgSwitch7, starNetLink7); - wxLogInfo(wxT("StarNet 7 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign7.c_str(), starNetLogoff7.c_str(), repeater.c_str(), starNetInfo7.c_str(), starNetPermanent7.c_str(), starNetUserTimeout7, starNetGroupTimeout7, int(starNetCallsignSwitch7), int(starNetTXMsgSwitch7), starNetLink7.c_str()); -#else - thread->addStarNet(starNetCallsign7, starNetLogoff7, repeater, starNetInfo7, starNetPermanent7, starNetUserTimeout7, starNetGroupTimeout7, starNetCallsignSwitch7, starNetTXMsgSwitch7); - wxLogInfo(wxT("StarNet 7 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign7.c_str(), starNetLogoff7.c_str(), repeater.c_str(), starNetInfo7.c_str(), starNetPermanent7.c_str(), starNetUserTimeout7, starNetGroupTimeout7, int(starNetCallsignSwitch7), int(starNetTXMsgSwitch7)); -#endif - } - - wxString starNetBand8, starNetCallsign8, starNetLogoff8, starNetInfo8, starNetPermanent8, starNetLink8; // DEXTRA_LINK || DCS_LINK - unsigned int starNetUserTimeout8, starNetGroupTimeout8; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch8; - bool starNetTXMsgSwitch8; - getStarNet8(starNetBand8, starNetCallsign8, starNetLogoff8, starNetInfo8, starNetPermanent8, starNetUserTimeout8, starNetGroupTimeout8, starNetCallsignSwitch8, starNetTXMsgSwitch8 -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - ,starNetLink8 -#endif -); - - if (!starNetCallsign8.IsEmpty() && !starNetCallsign8.IsSameAs(wxT(" "))) { - wxString repeater = callsign; - repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U); - repeater.Append(starNetBand8); - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - thread->addStarNet(starNetCallsign8, starNetLogoff8, repeater, starNetInfo8, starNetPermanent8, starNetUserTimeout8, starNetGroupTimeout8, starNetCallsignSwitch8, starNetTXMsgSwitch8, starNetLink8); - wxLogInfo(wxT("StarNet 8 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign8.c_str(), starNetLogoff8.c_str(), repeater.c_str(), starNetInfo8.c_str(), starNetPermanent8.c_str(), starNetUserTimeout8, starNetGroupTimeout8, int(starNetCallsignSwitch8), int(starNetTXMsgSwitch8), starNetLink8.c_str()); -#else - thread->addStarNet(starNetCallsign8, starNetLogoff8, repeater, starNetInfo8, starNetPermanent8, starNetUserTimeout8, starNetGroupTimeout8, starNetCallsignSwitch8, starNetTXMsgSwitch8); - wxLogInfo(wxT("StarNet 8 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign8.c_str(), starNetLogoff8.c_str(), repeater.c_str(), starNetInfo8.c_str(), starNetPermanent8.c_str(), starNetUserTimeout8, starNetGroupTimeout8, int(starNetCallsignSwitch8), int(starNetTXMsgSwitch8)); -#endif - } - - wxString starNetBand9, starNetCallsign9, starNetLogoff9, starNetInfo9, starNetPermanent9, starNetLink9; // DEXTRA_LINK || DCS_LINK - unsigned int starNetUserTimeout9, starNetGroupTimeout9; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch9; - bool starNetTXMsgSwitch9; - getStarNet9(starNetBand9, starNetCallsign9, starNetLogoff9, starNetInfo9, starNetPermanent9, starNetUserTimeout9, starNetGroupTimeout9, starNetCallsignSwitch9, starNetTXMsgSwitch9 -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - ,starNetLink9 -#endif -); - - if (!starNetCallsign9.IsEmpty() && !starNetCallsign9.IsSameAs(wxT(" "))) { - wxString repeater = callsign; - repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U); - repeater.Append(starNetBand9); - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - thread->addStarNet(starNetCallsign9, starNetLogoff9, repeater, starNetInfo9, starNetPermanent9, starNetUserTimeout9, starNetGroupTimeout9, starNetCallsignSwitch9, starNetTXMsgSwitch9, starNetLink9); - wxLogInfo(wxT("StarNet 9 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign9.c_str(), starNetLogoff9.c_str(), repeater.c_str(), starNetInfo9.c_str(), starNetPermanent9.c_str(), starNetUserTimeout9, starNetGroupTimeout9, int(starNetCallsignSwitch9), int(starNetTXMsgSwitch9), starNetLink9.c_str()); -#else - thread->addStarNet(starNetCallsign9, starNetLogoff9, repeater, starNetInfo9, starNetPermanent9, starNetUserTimeout9, starNetGroupTimeout9, starNetCallsignSwitch9, starNetTXMsgSwitch9); - wxLogInfo(wxT("StarNet 9 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign9.c_str(), starNetLogoff9.c_str(), repeater.c_str(), starNetInfo9.c_str(), starNetPermanent9.c_str(), starNetUserTimeout9, starNetGroupTimeout9, int(starNetCallsignSwitch9), int(starNetTXMsgSwitch9)); -#endif - } - - wxString starNetBand10, starNetCallsign10, starNetLogoff10, starNetInfo10, starNetPermanent10, starNetLink10; // DEXTRA_LINK || DCS_LINK - unsigned int starNetUserTimeout10, starNetGroupTimeout10; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch10; - bool starNetTXMsgSwitch10; - getStarNet10(starNetBand10, starNetCallsign10, starNetLogoff10, starNetInfo10, starNetPermanent10, starNetUserTimeout10, starNetGroupTimeout10, starNetCallsignSwitch10, starNetTXMsgSwitch10 -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - ,starNetLink10 -#endif -); - - if (!starNetCallsign10.IsEmpty() && !starNetCallsign10.IsSameAs(wxT(" "))) { - wxString repeater = callsign; - repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U); - repeater.Append(starNetBand10); - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - thread->addStarNet(starNetCallsign10, starNetLogoff10, repeater, starNetInfo10, starNetPermanent10, starNetUserTimeout10, starNetGroupTimeout10, starNetCallsignSwitch10, starNetTXMsgSwitch10, starNetLink10); - wxLogInfo(wxT("StarNet 10 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign10.c_str(), starNetLogoff10.c_str(), repeater.c_str(), starNetInfo10.c_str(), starNetPermanent10.c_str(), starNetUserTimeout10, starNetGroupTimeout10, int(starNetCallsignSwitch10), int(starNetTXMsgSwitch10), starNetLink10.c_str()); -#else - thread->addStarNet(starNetCallsign10, starNetLogoff10, repeater, starNetInfo10, starNetPermanent10, starNetUserTimeout10, starNetGroupTimeout10, starNetCallsignSwitch10, starNetTXMsgSwitch10); - wxLogInfo(wxT("StarNet 10 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign10.c_str(), starNetLogoff10.c_str(), repeater.c_str(), starNetInfo10.c_str(), starNetPermanent10.c_str(), starNetUserTimeout10, starNetGroupTimeout10, int(starNetCallsignSwitch10), int(starNetTXMsgSwitch10)); -#endif - } - - wxString starNetBand11, starNetCallsign11, starNetLogoff11, starNetInfo11, starNetPermanent11, starNetLink11; // DEXTRA_LINK || DCS_LINK - unsigned int starNetUserTimeout11, starNetGroupTimeout11; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch11; - bool starNetTXMsgSwitch11; - getStarNet11(starNetBand11, starNetCallsign11, starNetLogoff11, starNetInfo11, starNetPermanent11, starNetUserTimeout11, starNetGroupTimeout11, starNetCallsignSwitch11, starNetTXMsgSwitch11 -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - ,starNetLink11 -#endif -); - - if (!starNetCallsign11.IsEmpty() && !starNetCallsign11.IsSameAs(wxT(" "))) { - wxString repeater = callsign; - repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U); - repeater.Append(starNetBand11); - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - thread->addStarNet(starNetCallsign11, starNetLogoff11, repeater, starNetInfo11, starNetPermanent11, starNetUserTimeout11, starNetGroupTimeout11, starNetCallsignSwitch11, starNetTXMsgSwitch11, starNetLink11); - wxLogInfo(wxT("StarNet 11 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign11.c_str(), starNetLogoff11.c_str(), repeater.c_str(), starNetInfo11.c_str(), starNetPermanent11.c_str(), starNetUserTimeout11, starNetGroupTimeout11, int(starNetCallsignSwitch11), int(starNetTXMsgSwitch11), starNetLink11.c_str()); -#else - thread->addStarNet(starNetCallsign11, starNetLogoff11, repeater, starNetInfo11, starNetPermanent11, starNetUserTimeout11, starNetGroupTimeout11, starNetCallsignSwitch11, starNetTXMsgSwitch11); - wxLogInfo(wxT("StarNet 11 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign11.c_str(), starNetLogoff11.c_str(), repeater.c_str(), starNetInfo11.c_str(), starNetPermanent11.c_str(), starNetUserTimeout11, starNetGroupTimeout11, int(starNetCallsignSwitch11), int(starNetTXMsgSwitch11)); -#endif - } - - wxString starNetBand12, starNetCallsign12, starNetLogoff12, starNetInfo12, starNetPermanent12, starNetLink12; // DEXTRA_LINK || DCS_LINK - unsigned int starNetUserTimeout12, starNetGroupTimeout12; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch12; - bool starNetTXMsgSwitch12; - getStarNet12(starNetBand12, starNetCallsign12, starNetLogoff12, starNetInfo12, starNetPermanent12, starNetUserTimeout12, starNetGroupTimeout12, starNetCallsignSwitch12, starNetTXMsgSwitch12 -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - ,starNetLink12 -#endif -); - - if (!starNetCallsign12.IsEmpty() && !starNetCallsign12.IsSameAs(wxT(" "))) { - wxString repeater = callsign; - repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U); - repeater.Append(starNetBand12); - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - thread->addStarNet(starNetCallsign12, starNetLogoff12, repeater, starNetInfo12, starNetPermanent12, starNetUserTimeout12, starNetGroupTimeout12, starNetCallsignSwitch12, starNetTXMsgSwitch12, starNetLink12); - wxLogInfo(wxT("StarNet 12 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign12.c_str(), starNetLogoff12.c_str(), repeater.c_str(), starNetInfo12.c_str(), starNetPermanent12.c_str(), starNetUserTimeout12, starNetGroupTimeout12, int(starNetCallsignSwitch12), int(starNetTXMsgSwitch12), starNetLink12.c_str()); -#else - thread->addStarNet(starNetCallsign12, starNetLogoff12, repeater, starNetInfo12, starNetPermanent12, starNetUserTimeout12, starNetGroupTimeout12, starNetCallsignSwitch12, starNetTXMsgSwitch12); - wxLogInfo(wxT("StarNet 12 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign12.c_str(), starNetLogoff12.c_str(), repeater.c_str(), starNetInfo12.c_str(), starNetPermanent12.c_str(), starNetUserTimeout12, starNetGroupTimeout12, int(starNetCallsignSwitch12), int(starNetTXMsgSwitch12)); -#endif - } - - wxString starNetBand13, starNetCallsign13, starNetLogoff13, starNetInfo13, starNetPermanent13, starNetLink13; // DEXTRA_LINK || DCS_LINK - unsigned int starNetUserTimeout13, starNetGroupTimeout13; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch13; - bool starNetTXMsgSwitch13; - getStarNet13(starNetBand13, starNetCallsign13, starNetLogoff13, starNetInfo13, starNetPermanent13, starNetUserTimeout13, starNetGroupTimeout13, starNetCallsignSwitch13, starNetTXMsgSwitch13 -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - ,starNetLink13 -#endif -); - - if (!starNetCallsign13.IsEmpty() && !starNetCallsign13.IsSameAs(wxT(" "))) { - wxString repeater = callsign; - repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U); - repeater.Append(starNetBand13); - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - thread->addStarNet(starNetCallsign13, starNetLogoff13, repeater, starNetInfo13, starNetPermanent13, starNetUserTimeout13, starNetGroupTimeout13, starNetCallsignSwitch13, starNetTXMsgSwitch13, starNetLink13); - wxLogInfo(wxT("StarNet 13 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign13.c_str(), starNetLogoff13.c_str(), repeater.c_str(), starNetInfo13.c_str(), starNetPermanent13.c_str(), starNetUserTimeout13, starNetGroupTimeout13, int(starNetCallsignSwitch13), int(starNetTXMsgSwitch13), starNetLink13.c_str()); -#else - thread->addStarNet(starNetCallsign13, starNetLogoff13, repeater, starNetInfo13, starNetPermanent13, starNetUserTimeout13, starNetGroupTimeout13, starNetCallsignSwitch13, starNetTXMsgSwitch13); - wxLogInfo(wxT("StarNet 13 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign13.c_str(), starNetLogoff13.c_str(), repeater.c_str(), starNetInfo13.c_str(), starNetPermanent13.c_str(), starNetUserTimeout13, starNetGroupTimeout13, int(starNetCallsignSwitch13), int(starNetTXMsgSwitch13)); -#endif - } - - wxString starNetBand14, starNetCallsign14, starNetLogoff14, starNetInfo14, starNetPermanent14, starNetLink14; // DEXTRA_LINK || DCS_LINK - unsigned int starNetUserTimeout14, starNetGroupTimeout14; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch14; - bool starNetTXMsgSwitch14; - getStarNet14(starNetBand14, starNetCallsign14, starNetLogoff14, starNetInfo14, starNetPermanent14, starNetUserTimeout14, starNetGroupTimeout14, starNetCallsignSwitch14, starNetTXMsgSwitch14 -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - ,starNetLink14 -#endif -); - - if (!starNetCallsign14.IsEmpty() && !starNetCallsign14.IsSameAs(wxT(" "))) { - wxString repeater = callsign; - repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U); - repeater.Append(starNetBand14); - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - thread->addStarNet(starNetCallsign14, starNetLogoff14, repeater, starNetInfo14, starNetPermanent14, starNetUserTimeout14, starNetGroupTimeout14, starNetCallsignSwitch14, starNetTXMsgSwitch14, starNetLink14); - wxLogInfo(wxT("StarNet 14 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign14.c_str(), starNetLogoff14.c_str(), repeater.c_str(), starNetInfo14.c_str(), starNetPermanent14.c_str(), starNetUserTimeout14, starNetGroupTimeout14, int(starNetCallsignSwitch14), int(starNetTXMsgSwitch14), starNetLink14.c_str()); -#else - thread->addStarNet(starNetCallsign14, starNetLogoff14, repeater, starNetInfo14, starNetPermanent14, starNetUserTimeout14, starNetGroupTimeout14, starNetCallsignSwitch14, starNetTXMsgSwitch14); - wxLogInfo(wxT("StarNet 14 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign14.c_str(), starNetLogoff14.c_str(), repeater.c_str(), starNetInfo14.c_str(), starNetPermanent14.c_str(), starNetUserTimeout14, starNetGroupTimeout14, int(starNetCallsignSwitch14), int(starNetTXMsgSwitch14)); -#endif - } - - wxString starNetBand15, starNetCallsign15, starNetLogoff15, starNetInfo15, starNetPermanent15, starNetLink15; // DEXTRA_LINK || DCS_LINK - unsigned int starNetUserTimeout15, starNetGroupTimeout15; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch15; - bool starNetTXMsgSwitch15; - getStarNet15(starNetBand15, starNetCallsign15, starNetLogoff15, starNetInfo15, starNetPermanent15, starNetUserTimeout15, starNetGroupTimeout15, starNetCallsignSwitch15, starNetTXMsgSwitch15 -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - ,starNetLink15 -#endif -); - - if (!starNetCallsign15.IsEmpty() && !starNetCallsign15.IsSameAs(wxT(" "))) { - wxString repeater = callsign; - repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U); - repeater.Append(starNetBand15); - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - thread->addStarNet(starNetCallsign15, starNetLogoff15, repeater, starNetInfo15, starNetPermanent15, starNetUserTimeout15, starNetGroupTimeout15, starNetCallsignSwitch15, starNetTXMsgSwitch15, starNetLink15); - wxLogInfo(wxT("StarNet 15 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign15.c_str(), starNetLogoff15.c_str(), repeater.c_str(), starNetInfo15.c_str(), starNetPermanent15.c_str(), starNetUserTimeout15, starNetGroupTimeout15, int(starNetCallsignSwitch15), int(starNetTXMsgSwitch15), starNetLink15.c_str()); -#else - thread->addStarNet(starNetCallsign15, starNetLogoff15, repeater, starNetInfo15, starNetPermanent15, starNetUserTimeout15, starNetGroupTimeout15, starNetCallsignSwitch15, starNetTXMsgSwitch15); - wxLogInfo(wxT("StarNet 15 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign15.c_str(), starNetLogoff15.c_str(), repeater.c_str(), starNetInfo15.c_str(), starNetPermanent15.c_str(), starNetUserTimeout15, starNetGroupTimeout15, int(starNetCallsignSwitch15), int(starNetTXMsgSwitch15)); -#endif - } - - bool remoteEnabled; - wxString remotePassword; - unsigned int remotePort; - getRemote(remoteEnabled, remotePassword, remotePort); - wxLogInfo(wxT("Remote enabled set to %d, port set to %u"), int(remoteEnabled), remotePort); - thread->setRemote(remoteEnabled, remotePassword, remotePort); - - thread->setLog(logEnabled); - thread->setAddress(address); - thread->setCallsign(callsign); - - // Convert the worker class into a thread - m_thread = new CStarNetServerThreadHelper(thread); - m_thread->start(); -} diff --git a/StarNetServer/StarNetServerApp.h b/StarNetServer/StarNetServerApp.h deleted file mode 100644 index de7adfc..0000000 --- a/StarNetServer/StarNetServerApp.h +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Copyright (C) 2010,2011,2012,2018 by Jonathan Naylor G4KLX - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef StarNetServerApp_H -#define StarNetServerApp_H - -#include "StarNetServerThreadHelper.h" -#include "StarNetServerConfig.h" -#include "StarNetServerFrame.h" -#include "Defs.h" - -#include - -class CStarNetServerApp : public wxApp { - -public: - CStarNetServerApp(); - virtual ~CStarNetServerApp(); - - virtual bool OnInit(); - virtual int OnExit(); - - virtual void OnInitCmdLine(wxCmdLineParser& parser); - virtual bool OnCmdLineParsed(wxCmdLineParser& parser); - - // This is overridden because dialog boxes from threads are bad news -#if defined(__WXDEBUG__) - virtual void OnAssertFailure(const wxChar* file, int line, const wxChar* func, const wxChar* cond, const wxChar* msg); -#endif - - virtual void showLog(const wxString& text); - - virtual void getGateway(wxString& callsign, wxString& address) const; - virtual void setGateway(const wxString& callsign, const wxString& address); - - virtual void getIrcDDB(wxString& hostname, wxString& username, wxString& password) const; - virtual void setIrcDDB(const wxString& hostname, const wxString& username, const wxString& password); - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - virtual 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; - virtual void setStarNet1(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector); - - virtual void getStarNet2(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; - virtual void setStarNet2(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector); - - virtual void getStarNet3(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; - virtual void setStarNet3(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector); - - virtual void getStarNet4(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; - virtual void setStarNet4(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector); - - virtual void getStarNet5(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; - virtual void setStarNet5(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector); - - virtual void getStarNet6(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; - virtual void setStarNet6(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector); - - virtual void getStarNet7(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; - virtual void setStarNet7(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector); - - virtual void getStarNet8(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; - virtual void setStarNet8(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector); - - virtual void getStarNet9(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; - virtual void setStarNet9(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector); - - virtual void getStarNet10(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; - virtual void setStarNet10(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector); - - virtual void getStarNet11(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; - virtual void setStarNet11(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector); - - virtual void getStarNet12(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; - virtual void setStarNet12(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector); - - virtual void getStarNet13(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; - virtual void setStarNet13(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector); - - virtual void getStarNet14(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; - virtual void setStarNet14(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector); - - virtual void getStarNet15(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; - virtual void setStarNet15(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector); -#else - virtual void getStarNet1(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const; - virtual void setStarNet1(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch); - - virtual void getStarNet2(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const; - virtual void setStarNet2(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch); - - virtual void getStarNet3(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const; - virtual void setStarNet3(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch); - - virtual void getStarNet4(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const; - virtual void setStarNet4(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch); - - virtual void getStarNet5(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const; - virtual void setStarNet5(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch); - - virtual void getStarNet6(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const; - virtual void setStarNet6(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch); - - virtual void getStarNet7(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const; - virtual void setStarNet7(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch); - - virtual void getStarNet8(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const; - virtual void setStarNet8(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch); - - virtual void getStarNet9(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const; - virtual void setStarNet9(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch); - - virtual void getStarNet10(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const; - virtual void setStarNet10(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch); - - virtual void getStarNet11(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const; - virtual void setStarNet11(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch); - - virtual void getStarNet12(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const; - virtual void setStarNet12(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch); - - virtual void getStarNet13(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const; - virtual void setStarNet13(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch); - - virtual void getStarNet14(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const; - virtual void setStarNet14(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch); - - virtual void getStarNet15(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const; - virtual void setStarNet15(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch); -#endif - - virtual void getRemote(bool& enabled, wxString& password, unsigned int& port) const; - virtual void setRemote(bool enabled, const wxString& password, unsigned int port); - - virtual void getMiscellaneous(bool& logEnabled) const; - virtual void setMiscellaneous(bool logEnabled); - - virtual void getPosition(int& x, int& y) const; - virtual void setPosition(int x, int y); - - virtual bool writeConfig(); - -private: - bool m_nolog; - bool m_gui; - wxString m_logDir; - wxString m_confDir; - CStarNetServerFrame* m_frame; - CStarNetServerThreadHelper* m_thread; - CStarNetServerConfig* m_config; - wxLogChain* m_logChain; - - void createThread(); -}; - -wxDECLARE_APP(CStarNetServerApp); - -#endif diff --git a/StarNetServer/StarNetServerAppD.cpp b/StarNetServer/StarNetServerAppD.cpp deleted file mode 100644 index 5fd1610..0000000 --- a/StarNetServer/StarNetServerAppD.cpp +++ /dev/null @@ -1,561 +0,0 @@ -/* - * Copyright (C) 2010-2015 by Jonathan Naylor G4KLX - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include "IcomRepeaterProtocolHandler.h" -#include "HBRepeaterProtocolHandler.h" -#include "StarNetServerConfig.h" -#include "StarNetServerAppD.h" -#include "StarNetServerDefs.h" -#include "APRSWriter.h" -#include "Version.h" -#include "Logger.h" -#include "IRCDDBClient.h" - -#include -#include -#include -#include - -#include -#include -#include - -const wxChar* NOLOGGING_SWITCH = wxT("nolog"); -const wxChar* LOGDIR_OPTION = wxT("logdir"); -const wxChar* CONFDIR_OPTION = wxT("confdir"); -const wxChar* DAEMON_SWITCH = wxT("daemon"); - - -int main(int argc, char** argv) -{ - bool res = ::wxInitialize(); - if (!res) { - ::fprintf(stderr, "starnetserverd: failed to initialise the wxWidgets library, exiting\n"); - return -1; - } - - wxCmdLineParser parser(argc, argv); - parser.AddSwitch(NOLOGGING_SWITCH, wxEmptyString, wxEmptyString, wxCMD_LINE_PARAM_OPTIONAL); - parser.AddSwitch(DAEMON_SWITCH, wxEmptyString, wxEmptyString, wxCMD_LINE_PARAM_OPTIONAL); - parser.AddOption(LOGDIR_OPTION, wxEmptyString, wxEmptyString, wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL); - parser.AddOption(CONFDIR_OPTION, wxEmptyString, wxEmptyString, wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL); - - int cmd = parser.Parse(); - if (cmd != 0) { - ::wxUninitialize(); - return 0; - } - - bool nolog = parser.Found(NOLOGGING_SWITCH); - bool daemon = parser.Found(DAEMON_SWITCH); - - wxString logDir; - bool found = parser.Found(LOGDIR_OPTION, &logDir); - if (!found) - logDir.Clear(); - - wxString confDir; - found = parser.Found(CONFDIR_OPTION, &confDir); - if (!found) - confDir = wxT(CONF_DIR); - - if (daemon) { - pid_t pid = ::fork(); - - if (pid < 0) { - ::fprintf(stderr, "starnetserverd: error in fork(), exiting\n"); - ::wxUninitialize(); - return 1; - } - - // If this is the parent, exit - if (pid > 0) - return 0; - - // We are the child from here onwards - ::setsid(); - - ::chdir("/"); - - ::umask(0); - } - - CStarNetServerAppD gateway(nolog, logDir, confDir); - - if (!gateway.init()) { - ::wxUninitialize(); - return 1; - } - - gateway.run(); - - ::wxUninitialize(); - return 0; -} - -CStarNetServerAppD::CStarNetServerAppD(bool nolog, const wxString& logDir, const wxString& confDir) : -m_nolog(nolog), -m_logDir(logDir), -m_confDir(confDir), -m_thread(NULL) -{ -} - -CStarNetServerAppD::~CStarNetServerAppD() -{ -} - -bool CStarNetServerAppD::init() -{ - if (!m_nolog) { - if (m_logDir.IsEmpty()) - m_logDir = wxT(LOG_DIR); - - wxLog* log = new CLogger(m_logDir, LOG_BASE_NAME); - wxLog::SetActiveTarget(log); - } else { - new wxLogNull; - } - - wxLogInfo(wxT("Starting ") + APPLICATION_NAME + wxT(" daemon - ") + VERSION); - - // Log the version of wxWidgets and the Operating System - wxLogInfo(wxT("Using wxWidgets %d.%d.%d on %s"), wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER, ::wxGetOsDescription().c_str()); - - return createThread(); -} - -void CStarNetServerAppD::run() -{ - m_thread->run(); - - wxLogInfo(APPLICATION_NAME + wxT(" is exiting")); -} - -bool CStarNetServerAppD::createThread() -{ - CStarNetServerConfig config(m_confDir); - - m_thread = new CStarNetServerThread(m_nolog, m_logDir); - - wxString callsign, address; - config.getGateway(callsign, address); - - callsign.Append(wxT(" ")); - callsign.Truncate(LONG_CALLSIGN_LENGTH - 1U); - callsign.Append(wxT("G")); - - wxLogInfo(wxT("Gateway callsign set to %s, local address set to %s"), callsign.c_str(), address.c_str()); - - bool logEnabled; - config.getMiscellaneous(logEnabled); - wxLogInfo(wxT("Log enabled set to %d"), int(logEnabled)); - - wxString hostname, username, password; - config.getIrcDDB(hostname, username, password); - wxLogInfo(wxT("ircDDB host set to %s, username set to %s"), hostname.c_str(), username.c_str()); - - if (!hostname.IsEmpty() && !username.IsEmpty()) { -#if defined(__WINDOWS__) - CIRCDDB* ircDDB = new CIRCDDBClient(hostname, 9007U, username, password, wxT("win_") + LOG_BASE_NAME + wxT("-") + VERSION, address); -#else - CIRCDDB* ircDDB = new CIRCDDBClient(hostname, 9007U, username, password, wxT("linux_") + LOG_BASE_NAME + wxT("-") + VERSION, address); -#endif - bool res = ircDDB->open(); - if (!res) { - wxLogError(wxT("Cannot initialise the ircDDB protocol handler")); - return false; - } - - m_thread->setIRC(ircDDB); - } - - wxString starNetBand1, starNetCallsign1, starNetLogoff1, starNetInfo1, starNetPermanent1, starNetLink1; // DEXTRA_LINK || DCS_LINK - unsigned int starNetUserTimeout1, starNetGroupTimeout1; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch1; - bool starNetTXMsgSwitch1; - config.getStarNet1(starNetBand1, starNetCallsign1, starNetLogoff1, starNetInfo1, starNetPermanent1, starNetUserTimeout1, starNetGroupTimeout1, starNetCallsignSwitch1, starNetTXMsgSwitch1 -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - ,starNetLink1 -#endif -); - - if (!starNetCallsign1.IsEmpty() && !starNetCallsign1.IsSameAs(wxT(" "))) { - wxString repeater = callsign; - repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U); - repeater.Append(starNetBand1); - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - m_thread->addStarNet(starNetCallsign1, starNetLogoff1, repeater, starNetInfo1, starNetPermanent1, starNetUserTimeout1, starNetGroupTimeout1, starNetCallsignSwitch1, starNetTXMsgSwitch1, starNetLink1); - wxLogInfo(wxT("StarNet 1 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign1.c_str(), starNetLogoff1.c_str(), repeater.c_str(), starNetInfo1.c_str(), starNetPermanent1.c_str(), starNetUserTimeout1, starNetGroupTimeout1, int(starNetCallsignSwitch1), int(starNetTXMsgSwitch1), starNetLink1.c_str()); -#else - m_thread->addStarNet(starNetCallsign1, starNetLogoff1, repeater, starNetInfo1, starNetPermanent1, starNetUserTimeout1, starNetGroupTimeout1, starNetCallsignSwitch1, starNetTXMsgSwitch1); - wxLogInfo(wxT("StarNet 1 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign1.c_str(), starNetLogoff1.c_str(), repeater.c_str(), starNetInfo1.c_str(), starNetPermanent1.c_str(), starNetUserTimeout1, starNetGroupTimeout1, int(starNetCallsignSwitch1), int(starNetTXMsgSwitch1)); -#endif - } - - wxString starNetBand2, starNetCallsign2, starNetLogoff2, starNetInfo2, starNetPermanent2, starNetLink2; // DEXTRA_LINK || DCS_LINK - unsigned int starNetUserTimeout2, starNetGroupTimeout2; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch2; - bool starNetTXMsgSwitch2; - config.getStarNet2(starNetBand2, starNetCallsign2, starNetLogoff2, starNetInfo2, starNetPermanent2, starNetUserTimeout2, starNetGroupTimeout2, starNetCallsignSwitch2, starNetTXMsgSwitch2 -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - ,starNetLink2 -#endif -); - - if (!starNetCallsign2.IsEmpty() && !starNetCallsign2.IsSameAs(wxT(" "))) { - wxString repeater = callsign; - repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U); - repeater.Append(starNetBand2); - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - m_thread->addStarNet(starNetCallsign2, starNetLogoff2, repeater, starNetInfo2, starNetPermanent2, starNetUserTimeout2, starNetGroupTimeout2, starNetCallsignSwitch2, starNetTXMsgSwitch2, starNetLink2); - wxLogInfo(wxT("StarNet 2 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign2.c_str(), starNetLogoff2.c_str(), repeater.c_str(), starNetInfo2.c_str(), starNetPermanent2.c_str(), starNetUserTimeout2, starNetGroupTimeout2, int(starNetCallsignSwitch2), int(starNetTXMsgSwitch2), starNetLink2.c_str()); -#else - m_thread->addStarNet(starNetCallsign2, starNetLogoff2, repeater, starNetInfo2, starNetPermanent2, starNetUserTimeout2, starNetGroupTimeout2, starNetCallsignSwitch2, starNetTXMsgSwitch2); - wxLogInfo(wxT("StarNet 2 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign2.c_str(), starNetLogoff2.c_str(), repeater.c_str(), starNetInfo2.c_str(), starNetPermanent2.c_str(), starNetUserTimeout2, starNetGroupTimeout2, int(starNetCallsignSwitch2), int(starNetTXMsgSwitch2)); -#endif - } - - wxString starNetBand3, starNetCallsign3, starNetLogoff3, starNetInfo3, starNetPermanent3, starNetLink3; // DEXTRA_LINK || DCS_LINK - unsigned int starNetUserTimeout3, starNetGroupTimeout3; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch3; - bool starNetTXMsgSwitch3; - config.getStarNet3(starNetBand3, starNetCallsign3, starNetLogoff3, starNetInfo3, starNetPermanent3, starNetUserTimeout3, starNetGroupTimeout3, starNetCallsignSwitch3, starNetTXMsgSwitch3 -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - ,starNetLink3 -#endif -); - - if (!starNetCallsign3.IsEmpty() && !starNetCallsign3.IsSameAs(wxT(" "))) { - wxString repeater = callsign; - repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U); - repeater.Append(starNetBand3); - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - m_thread->addStarNet(starNetCallsign3, starNetLogoff3, repeater, starNetInfo3, starNetPermanent3, starNetUserTimeout3, starNetGroupTimeout3, starNetCallsignSwitch3, starNetTXMsgSwitch3, starNetLink3); - wxLogInfo(wxT("StarNet 3 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign3.c_str(), starNetLogoff3.c_str(), repeater.c_str(), starNetInfo3.c_str(), starNetPermanent3.c_str(), starNetUserTimeout3, starNetGroupTimeout3, int(starNetCallsignSwitch3), int(starNetTXMsgSwitch3), starNetLink3.c_str()); -#else - m_thread->addStarNet(starNetCallsign3, starNetLogoff3, repeater, starNetInfo3, starNetPermanent3, starNetUserTimeout3, starNetGroupTimeout3, starNetCallsignSwitch3, starNetTXMsgSwitch3); - wxLogInfo(wxT("StarNet 3 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign3.c_str(), starNetLogoff3.c_str(), repeater.c_str(), starNetInfo3.c_str(), starNetPermanent3.c_str(), starNetUserTimeout3, starNetGroupTimeout3, int(starNetCallsignSwitch3), int(starNetTXMsgSwitch3)); -#endif - } - - wxString starNetBand4, starNetCallsign4, starNetLogoff4, starNetInfo4, starNetPermanent4, starNetLink4; // DEXTRA_LINK || DCS_LINK - unsigned int starNetUserTimeout4, starNetGroupTimeout4; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch4; - bool starNetTXMsgSwitch4; - config.getStarNet4(starNetBand4, starNetCallsign4, starNetLogoff4, starNetInfo4, starNetPermanent4, starNetUserTimeout4, starNetGroupTimeout4, starNetCallsignSwitch4, starNetTXMsgSwitch4 -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - ,starNetLink4 -#endif -); - - if (!starNetCallsign4.IsEmpty() && !starNetCallsign4.IsSameAs(wxT(" "))) { - wxString repeater = callsign; - repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U); - repeater.Append(starNetBand4); - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - m_thread->addStarNet(starNetCallsign4, starNetLogoff4, repeater, starNetInfo4, starNetPermanent4, starNetUserTimeout4, starNetGroupTimeout4, starNetCallsignSwitch4, starNetTXMsgSwitch4, starNetLink4); - wxLogInfo(wxT("StarNet 4 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign4.c_str(), starNetLogoff4.c_str(), repeater.c_str(), starNetInfo4.c_str(), starNetPermanent4.c_str(), starNetUserTimeout4, starNetGroupTimeout4, int(starNetCallsignSwitch4), int(starNetTXMsgSwitch4), starNetLink4.c_str()); -#else - m_thread->addStarNet(starNetCallsign4, starNetLogoff4, repeater, starNetInfo4, starNetPermanent4, starNetUserTimeout4, starNetGroupTimeout4, starNetCallsignSwitch4, starNetTXMsgSwitch4); - wxLogInfo(wxT("StarNet 4 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign4.c_str(), starNetLogoff4.c_str(), repeater.c_str(), starNetInfo4.c_str(), starNetPermanent4.c_str(), starNetUserTimeout4, starNetGroupTimeout4, int(starNetCallsignSwitch4), int(starNetTXMsgSwitch4)); -#endif - } - - wxString starNetBand5, starNetCallsign5, starNetLogoff5, starNetInfo5, starNetPermanent5, starNetLink5; // DEXTRA_LINK || DCS_LINK - unsigned int starNetUserTimeout5, starNetGroupTimeout5; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch5; - bool starNetTXMsgSwitch5; - config.getStarNet5(starNetBand5, starNetCallsign5, starNetLogoff5, starNetInfo5, starNetPermanent5, starNetUserTimeout5, starNetGroupTimeout5, starNetCallsignSwitch5, starNetTXMsgSwitch5 -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - ,starNetLink5 -#endif -); - - if (!starNetCallsign5.IsEmpty() && !starNetCallsign5.IsSameAs(wxT(" "))) { - wxString repeater = callsign; - repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U); - repeater.Append(starNetBand5); - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - m_thread->addStarNet(starNetCallsign5, starNetLogoff5, repeater, starNetInfo5, starNetPermanent5, starNetUserTimeout5, starNetGroupTimeout5, starNetCallsignSwitch5, starNetTXMsgSwitch5, starNetLink5); - wxLogInfo(wxT("StarNet 5 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign5.c_str(), starNetLogoff5.c_str(), repeater.c_str(), starNetInfo5.c_str(), starNetPermanent5.c_str(), starNetUserTimeout5, starNetGroupTimeout5, int(starNetCallsignSwitch5), int(starNetTXMsgSwitch5), starNetLink5.c_str()); -#else - m_thread->addStarNet(starNetCallsign5, starNetLogoff5, repeater, starNetInfo5, starNetPermanent5, starNetUserTimeout5, starNetGroupTimeout5, starNetCallsignSwitch5, starNetTXMsgSwitch5); - wxLogInfo(wxT("StarNet 5 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign5.c_str(), starNetLogoff5.c_str(), repeater.c_str(), starNetInfo5.c_str(), starNetPermanent5.c_str(), starNetUserTimeout5, starNetGroupTimeout5, int(starNetCallsignSwitch5), int(starNetTXMsgSwitch5)); -#endif - } - - wxString starNetBand6, starNetCallsign6, starNetLogoff6, starNetInfo6, starNetPermanent6, starNetLink6; // DEXTRA_LINK || DCS_LINK - unsigned int starNetUserTimeout6, starNetGroupTimeout6; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch6; - bool starNetTXMsgSwitch6; - config.getStarNet6(starNetBand6, starNetCallsign6, starNetLogoff6, starNetInfo6, starNetPermanent6, starNetUserTimeout6, starNetGroupTimeout6, starNetCallsignSwitch6, starNetTXMsgSwitch6 -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - ,starNetLink6 -#endif -); - - if (!starNetCallsign6.IsEmpty() && !starNetCallsign6.IsSameAs(wxT(" "))) { - wxString repeater = callsign; - repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U); - repeater.Append(starNetBand6); - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - m_thread->addStarNet(starNetCallsign6, starNetLogoff6, repeater, starNetInfo6, starNetPermanent6, starNetUserTimeout6, starNetGroupTimeout6, starNetCallsignSwitch6, starNetTXMsgSwitch6, starNetLink6); - wxLogInfo(wxT("StarNet 6 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign6.c_str(), starNetLogoff6.c_str(), repeater.c_str(), starNetInfo6.c_str(), starNetPermanent6.c_str(), starNetUserTimeout6, starNetGroupTimeout6, int(starNetCallsignSwitch6), int(starNetTXMsgSwitch6), starNetLink6.c_str()); -#else - m_thread->addStarNet(starNetCallsign6, starNetLogoff6, repeater, starNetInfo6, starNetPermanent6, starNetUserTimeout6, starNetGroupTimeout6, starNetCallsignSwitch6, starNetTXMsgSwitch6); - wxLogInfo(wxT("StarNet 6 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign6.c_str(), starNetLogoff6.c_str(), repeater.c_str(), starNetInfo6.c_str(), starNetPermanent6.c_str(), starNetUserTimeout6, starNetGroupTimeout6, int(starNetCallsignSwitch6), int(starNetTXMsgSwitch6)); -#endif - } - - wxString starNetBand7, starNetCallsign7, starNetLogoff7, starNetInfo7, starNetPermanent7, starNetLink7; // DEXTRA_LINK || DCS_LINK - unsigned int starNetUserTimeout7, starNetGroupTimeout7; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch7; - bool starNetTXMsgSwitch7; - config.getStarNet7(starNetBand7, starNetCallsign7, starNetLogoff7, starNetInfo7, starNetPermanent7, starNetUserTimeout7, starNetGroupTimeout7, starNetCallsignSwitch7, starNetTXMsgSwitch7 -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - ,starNetLink7 -#endif -); - - if (!starNetCallsign7.IsEmpty() && !starNetCallsign7.IsSameAs(wxT(" "))) { - wxString repeater = callsign; - repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U); - repeater.Append(starNetBand7); - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - m_thread->addStarNet(starNetCallsign7, starNetLogoff7, repeater, starNetInfo7, starNetPermanent7, starNetUserTimeout7, starNetGroupTimeout7, starNetCallsignSwitch7, starNetTXMsgSwitch7, starNetLink7); - wxLogInfo(wxT("StarNet 7 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign7.c_str(), starNetLogoff7.c_str(), repeater.c_str(), starNetInfo7.c_str(), starNetPermanent7.c_str(), starNetUserTimeout7, starNetGroupTimeout7, int(starNetCallsignSwitch7), int(starNetTXMsgSwitch7), starNetLink7.c_str()); -#else - m_thread->addStarNet(starNetCallsign7, starNetLogoff7, repeater, starNetInfo7, starNetPermanent7, starNetUserTimeout7, starNetGroupTimeout7, starNetCallsignSwitch7, starNetTXMsgSwitch7); - wxLogInfo(wxT("StarNet 7 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign7.c_str(), starNetLogoff7.c_str(), repeater.c_str(), starNetInfo7.c_str(), starNetPermanent7.c_str(), starNetUserTimeout7, starNetGroupTimeout7, int(starNetCallsignSwitch7), int(starNetTXMsgSwitch7)); -#endif - } - - wxString starNetBand8, starNetCallsign8, starNetLogoff8, starNetInfo8, starNetPermanent8, starNetLink8; // DEXTRA_LINK || DCS_LINK - unsigned int starNetUserTimeout8, starNetGroupTimeout8; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch8; - bool starNetTXMsgSwitch8; - config.getStarNet8(starNetBand8, starNetCallsign8, starNetLogoff8, starNetInfo8, starNetPermanent8, starNetUserTimeout8, starNetGroupTimeout8, starNetCallsignSwitch8, starNetTXMsgSwitch8 -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - ,starNetLink8 -#endif -); - - if (!starNetCallsign8.IsEmpty() && !starNetCallsign8.IsSameAs(wxT(" "))) { - wxString repeater = callsign; - repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U); - repeater.Append(starNetBand8); - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - m_thread->addStarNet(starNetCallsign8, starNetLogoff8, repeater, starNetInfo8, starNetPermanent8, starNetUserTimeout8, starNetGroupTimeout8, starNetCallsignSwitch8, starNetTXMsgSwitch8, starNetLink8); - wxLogInfo(wxT("StarNet 8 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign8.c_str(), starNetLogoff8.c_str(), repeater.c_str(), starNetInfo8.c_str(), starNetPermanent8.c_str(), starNetUserTimeout8, starNetGroupTimeout8, int(starNetCallsignSwitch8), int(starNetTXMsgSwitch8), starNetLink8.c_str()); -#else - m_thread->addStarNet(starNetCallsign8, starNetLogoff8, repeater, starNetInfo8, starNetPermanent8, starNetUserTimeout8, starNetGroupTimeout8, starNetCallsignSwitch8, starNetTXMsgSwitch8); - wxLogInfo(wxT("StarNet 8 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign8.c_str(), starNetLogoff8.c_str(), repeater.c_str(), starNetInfo8.c_str(), starNetPermanent8.c_str(), starNetUserTimeout8, starNetGroupTimeout8, int(starNetCallsignSwitch8), int(starNetTXMsgSwitch8)); -#endif - } - - wxString starNetBand9, starNetCallsign9, starNetLogoff9, starNetInfo9, starNetPermanent9, starNetLink9; // DEXTRA_LINK || DCS_LINK - unsigned int starNetUserTimeout9, starNetGroupTimeout9; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch9; - bool starNetTXMsgSwitch9; - config.getStarNet9(starNetBand9, starNetCallsign9, starNetLogoff9, starNetInfo9, starNetPermanent9, starNetUserTimeout9, starNetGroupTimeout9, starNetCallsignSwitch9, starNetTXMsgSwitch9 -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - ,starNetLink9 -#endif -); - - if (!starNetCallsign9.IsEmpty() && !starNetCallsign9.IsSameAs(wxT(" "))) { - wxString repeater = callsign; - repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U); - repeater.Append(starNetBand9); - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - m_thread->addStarNet(starNetCallsign9, starNetLogoff9, repeater, starNetInfo9, starNetPermanent9, starNetUserTimeout9, starNetGroupTimeout9, starNetCallsignSwitch9, starNetTXMsgSwitch9, starNetLink9); - wxLogInfo(wxT("StarNet 9 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign9.c_str(), starNetLogoff9.c_str(), repeater.c_str(), starNetInfo9.c_str(), starNetPermanent9.c_str(), starNetUserTimeout9, starNetGroupTimeout9, int(starNetCallsignSwitch9), int(starNetTXMsgSwitch9), starNetLink9.c_str()); -#else - m_thread->addStarNet(starNetCallsign9, starNetLogoff9, repeater, starNetInfo9, starNetPermanent9, starNetUserTimeout9, starNetGroupTimeout9, starNetCallsignSwitch9, starNetTXMsgSwitch9); - wxLogInfo(wxT("StarNet 9 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign9.c_str(), starNetLogoff9.c_str(), repeater.c_str(), starNetInfo9.c_str(), starNetPermanent9.c_str(), starNetUserTimeout9, starNetGroupTimeout9, int(starNetCallsignSwitch9), int(starNetTXMsgSwitch9)); -#endif - } - - wxString starNetBand10, starNetCallsign10, starNetLogoff10, starNetInfo10, starNetPermanent10, starNetLink10; // DEXTRA_LINK || DCS_LINK - unsigned int starNetUserTimeout10, starNetGroupTimeout10; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch10; - bool starNetTXMsgSwitch10; - config.getStarNet10(starNetBand10, starNetCallsign10, starNetLogoff10, starNetInfo10, starNetPermanent10, starNetUserTimeout10, starNetGroupTimeout10, starNetCallsignSwitch10, starNetTXMsgSwitch10 -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - ,starNetLink10 -#endif -); - - if (!starNetCallsign10.IsEmpty() && !starNetCallsign10.IsSameAs(wxT(" "))) { - wxString repeater = callsign; - repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U); - repeater.Append(starNetBand10); - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - m_thread->addStarNet(starNetCallsign10, starNetLogoff10, repeater, starNetInfo10, starNetPermanent10, starNetUserTimeout10, starNetGroupTimeout10, starNetCallsignSwitch10, starNetTXMsgSwitch10, starNetLink10); - wxLogInfo(wxT("StarNet 10 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign10.c_str(), starNetLogoff10.c_str(), repeater.c_str(), starNetInfo10.c_str(), starNetPermanent10.c_str(), starNetUserTimeout10, starNetGroupTimeout10, int(starNetCallsignSwitch10), int(starNetTXMsgSwitch10), starNetLink10.c_str()); -#else - m_thread->addStarNet(starNetCallsign10, starNetLogoff10, repeater, starNetInfo10, starNetPermanent10, starNetUserTimeout10, starNetGroupTimeout10, starNetCallsignSwitch10, starNetTXMsgSwitch10); - wxLogInfo(wxT("StarNet 10 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign10.c_str(), starNetLogoff10.c_str(), repeater.c_str(), starNetInfo10.c_str(), starNetPermanent10.c_str(), starNetUserTimeout10, starNetGroupTimeout10, int(starNetCallsignSwitch10), int(starNetTXMsgSwitch10)); -#endif - } - - wxString starNetBand11, starNetCallsign11, starNetLogoff11, starNetInfo11, starNetPermanent11, starNetLink11; // DEXTRA_LINK || DCS_LINK - unsigned int starNetUserTimeout11, starNetGroupTimeout11; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch11; - bool starNetTXMsgSwitch11; - config.getStarNet11(starNetBand11, starNetCallsign11, starNetLogoff11, starNetInfo11, starNetPermanent11, starNetUserTimeout11, starNetGroupTimeout11, starNetCallsignSwitch11, starNetTXMsgSwitch11 -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - ,starNetLink11 -#endif -); - - if (!starNetCallsign11.IsEmpty() && !starNetCallsign11.IsSameAs(wxT(" "))) { - wxString repeater = callsign; - repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U); - repeater.Append(starNetBand11); - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - m_thread->addStarNet(starNetCallsign11, starNetLogoff11, repeater, starNetInfo11, starNetPermanent11, starNetUserTimeout11, starNetGroupTimeout11, starNetCallsignSwitch11, starNetTXMsgSwitch11, starNetLink11); - wxLogInfo(wxT("StarNet 11 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign11.c_str(), starNetLogoff11.c_str(), repeater.c_str(), starNetInfo11.c_str(), starNetPermanent11.c_str(), starNetUserTimeout11, starNetGroupTimeout11, int(starNetCallsignSwitch11), int(starNetTXMsgSwitch11), starNetLink11.c_str()); -#else - m_thread->addStarNet(starNetCallsign11, starNetLogoff11, repeater, starNetInfo11, starNetPermanent11, starNetUserTimeout11, starNetGroupTimeout11, starNetCallsignSwitch11, starNetTXMsgSwitch11); - wxLogInfo(wxT("StarNet 11 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign11.c_str(), starNetLogoff11.c_str(), repeater.c_str(), starNetInfo11.c_str(), starNetPermanent11.c_str(), starNetUserTimeout11, starNetGroupTimeout11, int(starNetCallsignSwitch11), int(starNetTXMsgSwitch11)); -#endif - } - - wxString starNetBand12, starNetCallsign12, starNetLogoff12, starNetInfo12, starNetPermanent12, starNetLink12; // DEXTRA_LINK || DCS_LINK - unsigned int starNetUserTimeout12, starNetGroupTimeout12; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch12; - bool starNetTXMsgSwitch12; - config.getStarNet12(starNetBand12, starNetCallsign12, starNetLogoff12, starNetInfo12, starNetPermanent12, starNetUserTimeout12, starNetGroupTimeout12, starNetCallsignSwitch12, starNetTXMsgSwitch12 -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - ,starNetLink12 -#endif -); - - if (!starNetCallsign12.IsEmpty() && !starNetCallsign12.IsSameAs(wxT(" "))) { - wxString repeater = callsign; - repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U); - repeater.Append(starNetBand12); - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - m_thread->addStarNet(starNetCallsign12, starNetLogoff12, repeater, starNetInfo12, starNetPermanent12, starNetUserTimeout12, starNetGroupTimeout12, starNetCallsignSwitch12, starNetTXMsgSwitch12, starNetLink12); - wxLogInfo(wxT("StarNet 12 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign12.c_str(), starNetLogoff12.c_str(), repeater.c_str(), starNetInfo12.c_str(), starNetPermanent12.c_str(), starNetUserTimeout12, starNetGroupTimeout12, int(starNetCallsignSwitch12), int(starNetTXMsgSwitch12), starNetLink12.c_str()); -#else - m_thread->addStarNet(starNetCallsign12, starNetLogoff12, repeater, starNetInfo12, starNetPermanent12, starNetUserTimeout12, starNetGroupTimeout12, starNetCallsignSwitch12, starNetTXMsgSwitch12); - wxLogInfo(wxT("StarNet 12 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign12.c_str(), starNetLogoff12.c_str(), repeater.c_str(), starNetInfo12.c_str(), starNetPermanent12.c_str(), starNetUserTimeout12, starNetGroupTimeout12, int(starNetCallsignSwitch12), int(starNetTXMsgSwitch12)); -#endif - } - - wxString starNetBand13, starNetCallsign13, starNetLogoff13, starNetInfo13, starNetPermanent13, starNetLink13; // DEXTRA_LINK || DCS_LINK - unsigned int starNetUserTimeout13, starNetGroupTimeout13; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch13; - bool starNetTXMsgSwitch13; - config.getStarNet13(starNetBand13, starNetCallsign13, starNetLogoff13, starNetInfo13, starNetPermanent13, starNetUserTimeout13, starNetGroupTimeout13, starNetCallsignSwitch13, starNetTXMsgSwitch13 -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - ,starNetLink13 -#endif -); - - if (!starNetCallsign13.IsEmpty() && !starNetCallsign13.IsSameAs(wxT(" "))) { - wxString repeater = callsign; - repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U); - repeater.Append(starNetBand13); - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - m_thread->addStarNet(starNetCallsign13, starNetLogoff13, repeater, starNetInfo13, starNetPermanent13, starNetUserTimeout13, starNetGroupTimeout13, starNetCallsignSwitch13, starNetTXMsgSwitch13, starNetLink13); - wxLogInfo(wxT("StarNet 13 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign13.c_str(), starNetLogoff13.c_str(), repeater.c_str(), starNetInfo13.c_str(), starNetPermanent13.c_str(), starNetUserTimeout13, starNetGroupTimeout13, int(starNetCallsignSwitch13), int(starNetTXMsgSwitch13), starNetLink13.c_str()); -#else - m_thread->addStarNet(starNetCallsign13, starNetLogoff13, repeater, starNetInfo13, starNetPermanent13, starNetUserTimeout13, starNetGroupTimeout13, starNetCallsignSwitch13, starNetTXMsgSwitch13); - wxLogInfo(wxT("StarNet 13 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign13.c_str(), starNetLogoff13.c_str(), repeater.c_str(), starNetInfo13.c_str(), starNetPermanent13.c_str(), starNetUserTimeout13, starNetGroupTimeout13, int(starNetCallsignSwitch13), int(starNetTXMsgSwitch13)); -#endif - } - - wxString starNetBand14, starNetCallsign14, starNetLogoff14, starNetInfo14, starNetPermanent14, starNetLink14; // DEXTRA_LINK || DCS_LINK - unsigned int starNetUserTimeout14, starNetGroupTimeout14; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch14; - bool starNetTXMsgSwitch14; - config.getStarNet14(starNetBand14, starNetCallsign14, starNetLogoff14, starNetInfo14, starNetPermanent14, starNetUserTimeout14, starNetGroupTimeout14, starNetCallsignSwitch14, starNetTXMsgSwitch14 -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - ,starNetLink14 -#endif -); - - if (!starNetCallsign14.IsEmpty() && !starNetCallsign14.IsSameAs(wxT(" "))) { - wxString repeater = callsign; - repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U); - repeater.Append(starNetBand14); - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - m_thread->addStarNet(starNetCallsign14, starNetLogoff14, repeater, starNetInfo14, starNetPermanent14, starNetUserTimeout14, starNetGroupTimeout14, starNetCallsignSwitch14, starNetTXMsgSwitch14, starNetLink14); - wxLogInfo(wxT("StarNet 14 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign14.c_str(), starNetLogoff14.c_str(), repeater.c_str(), starNetInfo14.c_str(), starNetPermanent14.c_str(), starNetUserTimeout14, starNetGroupTimeout14, int(starNetCallsignSwitch14), int(starNetTXMsgSwitch14), starNetLink14.c_str()); -#else - m_thread->addStarNet(starNetCallsign14, starNetLogoff14, repeater, starNetInfo14, starNetPermanent14, starNetUserTimeout14, starNetGroupTimeout14, starNetCallsignSwitch14, starNetTXMsgSwitch14); - wxLogInfo(wxT("StarNet 14 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign14.c_str(), starNetLogoff14.c_str(), repeater.c_str(), starNetInfo14.c_str(), starNetPermanent14.c_str(), starNetUserTimeout14, starNetGroupTimeout14, int(starNetCallsignSwitch14), int(starNetTXMsgSwitch14)); -#endif - } - - wxString starNetBand15, starNetCallsign15, starNetLogoff15, starNetInfo15, starNetPermanent15, starNetLink15; // DEXTRA_LINK || DCS_LINK - unsigned int starNetUserTimeout15, starNetGroupTimeout15; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch15; - bool starNetTXMsgSwitch15; - config.getStarNet15(starNetBand15, starNetCallsign15, starNetLogoff15, starNetInfo15, starNetPermanent15, starNetUserTimeout15, starNetGroupTimeout15, starNetCallsignSwitch15, starNetTXMsgSwitch15 -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - ,starNetLink15 -#endif -); - - if (!starNetCallsign15.IsEmpty() && !starNetCallsign15.IsSameAs(wxT(" "))) { - wxString repeater = callsign; - repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U); - repeater.Append(starNetBand15); - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - m_thread->addStarNet(starNetCallsign15, starNetLogoff15, repeater, starNetInfo15, starNetPermanent15, starNetUserTimeout15, starNetGroupTimeout15, starNetCallsignSwitch15, starNetTXMsgSwitch15, starNetLink15); - wxLogInfo(wxT("StarNet 15 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign15.c_str(), starNetLogoff15.c_str(), repeater.c_str(), starNetInfo15.c_str(), starNetPermanent15.c_str(), starNetUserTimeout15, starNetGroupTimeout15, int(starNetCallsignSwitch15), int(starNetTXMsgSwitch15), starNetLink15.c_str()); -#else - m_thread->addStarNet(starNetCallsign15, starNetLogoff15, repeater, starNetInfo15, starNetPermanent15, starNetUserTimeout15, starNetGroupTimeout15, starNetCallsignSwitch15, starNetTXMsgSwitch15); - wxLogInfo(wxT("StarNet 15 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign15.c_str(), starNetLogoff15.c_str(), repeater.c_str(), starNetInfo15.c_str(), starNetPermanent15.c_str(), starNetUserTimeout15, starNetGroupTimeout15, int(starNetCallsignSwitch15), int(starNetTXMsgSwitch15)); -#endif - } - - bool remoteEnabled; - wxString remotePassword; - unsigned int remotePort; - config.getRemote(remoteEnabled, remotePassword, remotePort); - wxLogInfo(wxT("Remote enabled set to %d, port set to %u"), int(remoteEnabled), remotePort); - m_thread->setRemote(remoteEnabled, remotePassword, remotePort); - - m_thread->setLog(logEnabled); - m_thread->setAddress(address); - m_thread->setCallsign(callsign); - - return true; -} - diff --git a/StarNetServer/StarNetServerAppD.h b/StarNetServer/StarNetServerAppD.h deleted file mode 100644 index 05380bb..0000000 --- a/StarNetServer/StarNetServerAppD.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2010,2011 by Jonathan Naylor G4KLX - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef StarNetServerAppD_H -#define StarNetServerAppD_H - -#include "StarNetServerThread.h" - -#include -#include - -class CStarNetServerAppD { - -public: - CStarNetServerAppD(bool nolog, const wxString& logDir, const wxString& confDir); - ~CStarNetServerAppD(); - - bool init(); - - void run(); - -private: - bool m_nolog; - wxString m_logDir; - wxString m_confDir; - CStarNetServerThread* m_thread; - - bool createThread(); -}; - -#endif diff --git a/StarNetServer/StarNetServerCallsignSet.cpp b/StarNetServer/StarNetServerCallsignSet.cpp deleted file mode 100644 index fdb68f9..0000000 --- a/StarNetServer/StarNetServerCallsignSet.cpp +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (C) 2010,2011 by Jonathan Naylor G4KLX - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include "StarNetServerCallsignSet.h" -#include "DStarDefines.h" -#include - -const unsigned int CALLSIGN_WIDTH = 120U; -const unsigned int ADDRESS_WIDTH = 120U; - -const unsigned int ADDRESS_LENGTH = 15U; - -const unsigned int BORDER_SIZE = 5U; - -CStarNetServerCallsignSet::CStarNetServerCallsignSet(wxWindow* parent, int id, const wxString& title, const wxString& callsign, const wxString& address) : -wxPanel(parent, id), -m_title(title), -m_callsign(NULL), -m_address(NULL) -{ - wxFlexGridSizer* sizer = new wxFlexGridSizer(3); - - wxStaticText* callsignLabel = new wxStaticText(this, -1, _("Callsign")); - sizer->Add(callsignLabel, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE); - - wxString call = callsign; - call.Truncate(LONG_CALLSIGN_LENGTH - 1U); - call.Trim(); - - m_callsign = new CCallsignTextCtrl(this, -1, call, wxDefaultPosition, wxSize(CALLSIGN_WIDTH, -1)); - m_callsign->SetMaxLength(LONG_CALLSIGN_LENGTH); - sizer->Add(m_callsign, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); - - wxStaticText* gLabel = new wxStaticText(this, -1, wxT("G")); - sizer->Add(gLabel, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE); - - wxStaticText* addressLabel = new wxStaticText(this, -1, _("Address")); - sizer->Add(addressLabel, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE); - - m_address = new CAddressTextCtrl(this, -1, address, wxDefaultPosition, wxSize(ADDRESS_WIDTH, -1)); - m_address->SetMaxLength(ADDRESS_LENGTH); - sizer->Add(m_address, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); - - SetAutoLayout(true); - - SetSizer(sizer); -} - - -CStarNetServerCallsignSet::~CStarNetServerCallsignSet() -{ -} - -bool CStarNetServerCallsignSet::Validate() -{ - wxString callsign = getCallsign(); - - if (callsign.IsEmpty()) { - wxMessageDialog dialog(this, _("The Callsign Callsign is not valid"), m_title + _(" Error"), wxICON_ERROR); - dialog.ShowModal(); - return false; - } - - return true; -} - -wxString CStarNetServerCallsignSet::getCallsign() const -{ - wxString callsign = m_callsign->GetValue(); - - callsign.MakeUpper(); - - return callsign; -} - -wxString CStarNetServerCallsignSet::getAddress() const -{ - return m_address->GetValue(); -} diff --git a/StarNetServer/StarNetServerCallsignSet.h b/StarNetServer/StarNetServerCallsignSet.h deleted file mode 100644 index 8b05c7c..0000000 --- a/StarNetServer/StarNetServerCallsignSet.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2010,2011 by Jonathan Naylor G4KLX - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef StarNetServerCallsignSet_H -#define StarNetServerCallsignSet_H - -#include "CallsignTextCtrl.h" -#include "AddressTextCtrl.h" -#include "Defs.h" - -#include - -class CStarNetServerCallsignSet : public wxPanel { -public: - CStarNetServerCallsignSet(wxWindow* parent, int id, const wxString& title, const wxString& callsign, const wxString& address); - virtual ~CStarNetServerCallsignSet(); - - virtual bool Validate(); - - virtual wxString getCallsign() const; - virtual wxString getAddress() const; - -private: - wxString m_title; - CCallsignTextCtrl* m_callsign; - CAddressTextCtrl* m_address; -}; - -#endif diff --git a/StarNetServer/StarNetServerConfig.cpp b/StarNetServer/StarNetServerConfig.cpp deleted file mode 100644 index fd7bbac..0000000 --- a/StarNetServer/StarNetServerConfig.cpp +++ /dev/null @@ -1,2415 +0,0 @@ -/* - * Copyright (C) 2010,2011,2012 by Jonathan Naylor G4KLX - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include "StarNetServerConfig.h" -#include "StarNetServerDefs.h" - -#include - -const wxString KEY_CALLSIGN = wxT("callsign"); -const wxString KEY_ADDRESS = wxT("address"); -const wxString KEY_IRCDDB_HOSTNAME = wxT("ircddbHostname"); -const wxString KEY_IRCDDB_USERNAME = wxT("ircddbUsername"); -const wxString KEY_IRCDDB_PASSWORD = wxT("ircddbPassword"); -const wxString KEY_STARNET_BAND1 = wxT("starNetBand1"); -const wxString KEY_STARNET_CALLSIGN1 = wxT("starNetCallsign1"); -const wxString KEY_STARNET_LOGOFF1 = wxT("starNetLogoff1"); -const wxString KEY_STARNET_INFO1 = wxT("starNetInfo1"); -const wxString KEY_STARNET_PERMANENT1 = wxT("starNetPermanent1"); -const wxString KEY_STARNET_USER_TIMEOUT1 = wxT("starNetUserTimeout1"); -const wxString KEY_STARNET_GROUP_TIMEOUT1 = wxT("starNetGroupTimeout1"); -const wxString KEY_STARNET_CALLSIGN_SWITCH1 = wxT("starNetCallsignSwitch1"); -const wxString KEY_STARNET_TXMSG_SWITCH1 = wxT("starNetTXMsgSwitch1"); -const wxString KEY_STARNET_REFLECTOR1 = wxT("starNetReflector1"); // DEXTRA_LINK -const wxString KEY_STARNET_BAND2 = wxT("starNetBand2"); -const wxString KEY_STARNET_CALLSIGN2 = wxT("starNetCallsign2"); -const wxString KEY_STARNET_LOGOFF2 = wxT("starNetLogoff2"); -const wxString KEY_STARNET_INFO2 = wxT("starNetInfo2"); -const wxString KEY_STARNET_PERMANENT2 = wxT("starNetPermanent2"); -const wxString KEY_STARNET_USER_TIMEOUT2 = wxT("starNetUserTimeout2"); -const wxString KEY_STARNET_GROUP_TIMEOUT2 = wxT("starNetGroupTimeout2"); -const wxString KEY_STARNET_CALLSIGN_SWITCH2 = wxT("starNetCallsignSwitch2"); -const wxString KEY_STARNET_TXMSG_SWITCH2 = wxT("starNetTXMsgSwitch2"); -const wxString KEY_STARNET_REFLECTOR2 = wxT("starNetReflector2"); // DEXTRA_LINK -const wxString KEY_STARNET_BAND3 = wxT("starNetBand3"); -const wxString KEY_STARNET_CALLSIGN3 = wxT("starNetCallsign3"); -const wxString KEY_STARNET_LOGOFF3 = wxT("starNetLogoff3"); -const wxString KEY_STARNET_INFO3 = wxT("starNetInfo3"); -const wxString KEY_STARNET_PERMANENT3 = wxT("starNetPermanent3"); -const wxString KEY_STARNET_USER_TIMEOUT3 = wxT("starNetUserTimeout3"); -const wxString KEY_STARNET_GROUP_TIMEOUT3 = wxT("starNetGroupTimeout3"); -const wxString KEY_STARNET_CALLSIGN_SWITCH3 = wxT("starNetCallsignSwitch3"); -const wxString KEY_STARNET_TXMSG_SWITCH3 = wxT("starNetTXMsgSwitch3"); -const wxString KEY_STARNET_REFLECTOR3 = wxT("starNetReflector3"); // DEXTRA_LINK -const wxString KEY_STARNET_BAND4 = wxT("starNetBand4"); -const wxString KEY_STARNET_CALLSIGN4 = wxT("starNetCallsign4"); -const wxString KEY_STARNET_LOGOFF4 = wxT("starNetLogoff4"); -const wxString KEY_STARNET_INFO4 = wxT("starNetInfo4"); -const wxString KEY_STARNET_PERMANENT4 = wxT("starNetPermanent4"); -const wxString KEY_STARNET_USER_TIMEOUT4 = wxT("starNetUserTimeout4"); -const wxString KEY_STARNET_GROUP_TIMEOUT4 = wxT("starNetGroupTimeout4"); -const wxString KEY_STARNET_CALLSIGN_SWITCH4 = wxT("starNetCallsignSwitch4"); -const wxString KEY_STARNET_TXMSG_SWITCH4 = wxT("starNetTXMsgSwitch4"); -const wxString KEY_STARNET_REFLECTOR4 = wxT("starNetReflector4"); // DEXTRA_LINK -const wxString KEY_STARNET_BAND5 = wxT("starNetBand5"); -const wxString KEY_STARNET_CALLSIGN5 = wxT("starNetCallsign5"); -const wxString KEY_STARNET_LOGOFF5 = wxT("starNetLogoff5"); -const wxString KEY_STARNET_INFO5 = wxT("starNetInfo5"); -const wxString KEY_STARNET_PERMANENT5 = wxT("starNetPermanent5"); -const wxString KEY_STARNET_USER_TIMEOUT5 = wxT("starNetUserTimeout5"); -const wxString KEY_STARNET_GROUP_TIMEOUT5 = wxT("starNetGroupTimeout5"); -const wxString KEY_STARNET_CALLSIGN_SWITCH5 = wxT("starNetCallsignSwitch5"); -const wxString KEY_STARNET_TXMSG_SWITCH5 = wxT("starNetTXMsgSwitch5"); -const wxString KEY_STARNET_REFLECTOR5 = wxT("starNetReflector5"); // DEXTRA_LINK -const wxString KEY_STARNET_BAND6 = wxT("starNetBand6"); -const wxString KEY_STARNET_CALLSIGN6 = wxT("starNetCallsign6"); -const wxString KEY_STARNET_LOGOFF6 = wxT("starNetLogoff6"); -const wxString KEY_STARNET_INFO6 = wxT("starNetInfo6"); -const wxString KEY_STARNET_PERMANENT6 = wxT("starNetPermanent6"); -const wxString KEY_STARNET_USER_TIMEOUT6 = wxT("starNetUserTimeout6"); -const wxString KEY_STARNET_GROUP_TIMEOUT6 = wxT("starNetGroupTimeout6"); -const wxString KEY_STARNET_CALLSIGN_SWITCH6 = wxT("starNetCallsignSwitch6"); -const wxString KEY_STARNET_TXMSG_SWITCH6 = wxT("starNetTXMsgSwitch6"); -const wxString KEY_STARNET_REFLECTOR6 = wxT("starNetReflector6"); // DEXTRA_LINK -const wxString KEY_STARNET_BAND7 = wxT("starNetBand7"); -const wxString KEY_STARNET_CALLSIGN7 = wxT("starNetCallsign7"); -const wxString KEY_STARNET_LOGOFF7 = wxT("starNetLogoff7"); -const wxString KEY_STARNET_INFO7 = wxT("starNetInfo7"); -const wxString KEY_STARNET_PERMANENT7 = wxT("starNetPermanent7"); -const wxString KEY_STARNET_USER_TIMEOUT7 = wxT("starNetUserTimeout7"); -const wxString KEY_STARNET_GROUP_TIMEOUT7 = wxT("starNetGroupTimeout7"); -const wxString KEY_STARNET_CALLSIGN_SWITCH7 = wxT("starNetCallsignSwitch7"); -const wxString KEY_STARNET_TXMSG_SWITCH7 = wxT("starNetTXMsgSwitch7"); -const wxString KEY_STARNET_REFLECTOR7 = wxT("starNetReflector7"); // DEXTRA_LINK -const wxString KEY_STARNET_BAND8 = wxT("starNetBand8"); -const wxString KEY_STARNET_CALLSIGN8 = wxT("starNetCallsign8"); -const wxString KEY_STARNET_LOGOFF8 = wxT("starNetLogoff8"); -const wxString KEY_STARNET_INFO8 = wxT("starNetInfo8"); -const wxString KEY_STARNET_PERMANENT8 = wxT("starNetPermanent8"); -const wxString KEY_STARNET_USER_TIMEOUT8 = wxT("starNetUserTimeout8"); -const wxString KEY_STARNET_GROUP_TIMEOUT8 = wxT("starNetGroupTimeout8"); -const wxString KEY_STARNET_CALLSIGN_SWITCH8 = wxT("starNetCallsignSwitch8"); -const wxString KEY_STARNET_TXMSG_SWITCH8 = wxT("starNetTXMsgSwitch8"); -const wxString KEY_STARNET_REFLECTOR8 = wxT("starNetReflector8"); // DEXTRA_LINK -const wxString KEY_STARNET_BAND9 = wxT("starNetBand9"); -const wxString KEY_STARNET_CALLSIGN9 = wxT("starNetCallsign9"); -const wxString KEY_STARNET_LOGOFF9 = wxT("starNetLogoff9"); -const wxString KEY_STARNET_INFO9 = wxT("starNetInfo9"); -const wxString KEY_STARNET_PERMANENT9 = wxT("starNetPermanent9"); -const wxString KEY_STARNET_USER_TIMEOUT9 = wxT("starNetUserTimeout9"); -const wxString KEY_STARNET_GROUP_TIMEOUT9 = wxT("starNetGroupTimeout9"); -const wxString KEY_STARNET_CALLSIGN_SWITCH9 = wxT("starNetCallsignSwitch9"); -const wxString KEY_STARNET_TXMSG_SWITCH9 = wxT("starNetTXMsgSwitch9"); -const wxString KEY_STARNET_REFLECTOR9 = wxT("starNetReflector9"); // DEXTRA_LINK -const wxString KEY_STARNET_BAND10 = wxT("starNetBand10"); -const wxString KEY_STARNET_CALLSIGN10 = wxT("starNetCallsign10"); -const wxString KEY_STARNET_LOGOFF10 = wxT("starNetLogoff10"); -const wxString KEY_STARNET_INFO10 = wxT("starNetInfo10"); -const wxString KEY_STARNET_PERMANENT10 = wxT("starNetPermanent10"); -const wxString KEY_STARNET_USER_TIMEOUT10 = wxT("starNetUserTimeout10"); -const wxString KEY_STARNET_GROUP_TIMEOUT10 = wxT("starNetGroupTimeout10"); -const wxString KEY_STARNET_CALLSIGN_SWITCH10 = wxT("starNetCallsignSwitch10"); -const wxString KEY_STARNET_TXMSG_SWITCH10 = wxT("starNetTXMsgSwitch10"); -const wxString KEY_STARNET_REFLECTOR10 = wxT("starNetReflector10"); // DEXTRA_LINK -const wxString KEY_STARNET_BAND11 = wxT("starNetBand11"); -const wxString KEY_STARNET_CALLSIGN11 = wxT("starNetCallsign11"); -const wxString KEY_STARNET_LOGOFF11 = wxT("starNetLogoff11"); -const wxString KEY_STARNET_INFO11 = wxT("starNetInfo11"); -const wxString KEY_STARNET_PERMANENT11 = wxT("starNetPermanent11"); -const wxString KEY_STARNET_USER_TIMEOUT11 = wxT("starNetUserTimeout11"); -const wxString KEY_STARNET_GROUP_TIMEOUT11 = wxT("starNetGroupTimeout11"); -const wxString KEY_STARNET_CALLSIGN_SWITCH11 = wxT("starNetCallsignSwitch11"); -const wxString KEY_STARNET_TXMSG_SWITCH11 = wxT("starNetTXMsgSwitch11"); -const wxString KEY_STARNET_REFLECTOR11 = wxT("starNetReflector11"); // DEXTRA_LINK -const wxString KEY_STARNET_BAND12 = wxT("starNetBand12"); -const wxString KEY_STARNET_CALLSIGN12 = wxT("starNetCallsign12"); -const wxString KEY_STARNET_LOGOFF12 = wxT("starNetLogoff12"); -const wxString KEY_STARNET_INFO12 = wxT("starNetInfo12"); -const wxString KEY_STARNET_PERMANENT12 = wxT("starNetPermanent12"); -const wxString KEY_STARNET_USER_TIMEOUT12 = wxT("starNetUserTimeout12"); -const wxString KEY_STARNET_GROUP_TIMEOUT12 = wxT("starNetGroupTimeout12"); -const wxString KEY_STARNET_CALLSIGN_SWITCH12 = wxT("starNetCallsignSwitch12"); -const wxString KEY_STARNET_TXMSG_SWITCH12 = wxT("starNetTXMsgSwitch12"); -const wxString KEY_STARNET_REFLECTOR12 = wxT("starNetReflector12"); // DEXTRA_LINK -const wxString KEY_STARNET_BAND13 = wxT("starNetBand13"); -const wxString KEY_STARNET_CALLSIGN13 = wxT("starNetCallsign13"); -const wxString KEY_STARNET_LOGOFF13 = wxT("starNetLogoff13"); -const wxString KEY_STARNET_INFO13 = wxT("starNetInfo13"); -const wxString KEY_STARNET_PERMANENT13 = wxT("starNetPermanent13"); -const wxString KEY_STARNET_USER_TIMEOUT13 = wxT("starNetUserTimeout13"); -const wxString KEY_STARNET_GROUP_TIMEOUT13 = wxT("starNetGroupTimeout13"); -const wxString KEY_STARNET_CALLSIGN_SWITCH13 = wxT("starNetCallsignSwitch13"); -const wxString KEY_STARNET_TXMSG_SWITCH13 = wxT("starNetTXMsgSwitch13"); -const wxString KEY_STARNET_REFLECTOR13 = wxT("starNetReflector13"); // DEXTRA_LINK -const wxString KEY_STARNET_BAND14 = wxT("starNetBand14"); -const wxString KEY_STARNET_CALLSIGN14 = wxT("starNetCallsign14"); -const wxString KEY_STARNET_LOGOFF14 = wxT("starNetLogoff14"); -const wxString KEY_STARNET_INFO14 = wxT("starNetInfo14"); -const wxString KEY_STARNET_PERMANENT14 = wxT("starNetPermanent14"); -const wxString KEY_STARNET_USER_TIMEOUT14 = wxT("starNetUserTimeout14"); -const wxString KEY_STARNET_GROUP_TIMEOUT14 = wxT("starNetGroupTimeout14"); -const wxString KEY_STARNET_CALLSIGN_SWITCH14 = wxT("starNetCallsignSwitch14"); -const wxString KEY_STARNET_TXMSG_SWITCH14 = wxT("starNetTXMsgSwitch14"); -const wxString KEY_STARNET_REFLECTOR14 = wxT("starNetReflector14"); // DEXTRA_LINK -const wxString KEY_STARNET_BAND15 = wxT("starNetBand15"); -const wxString KEY_STARNET_CALLSIGN15 = wxT("starNetCallsign15"); -const wxString KEY_STARNET_LOGOFF15 = wxT("starNetLogoff15"); -const wxString KEY_STARNET_INFO15 = wxT("starNetInfo15"); -const wxString KEY_STARNET_PERMANENT15 = wxT("starNetPermanent15"); -const wxString KEY_STARNET_USER_TIMEOUT15 = wxT("starNetUserTimeout15"); -const wxString KEY_STARNET_GROUP_TIMEOUT15 = wxT("starNetGroupTimeout15"); -const wxString KEY_STARNET_CALLSIGN_SWITCH15 = wxT("starNetCallsignSwitch15"); -const wxString KEY_STARNET_TXMSG_SWITCH15 = wxT("starNetTXMsgSwitch15"); -const wxString KEY_STARNET_REFLECTOR15 = wxT("starNetReflector15"); // DEXTRA_LINK -const wxString KEY_REMOTE_ENABLED = wxT("remoteEnabled"); -const wxString KEY_REMOTE_PASSWORD = wxT("remotePassword"); -const wxString KEY_REMOTE_PORT = wxT("remotePort"); -const wxString KEY_LOG_ENABLED = wxT("logEnabled"); -const wxString KEY_WINDOW_X = wxT("windowX"); -const wxString KEY_WINDOW_Y = wxT("windowY"); - -const wxString DEFAULT_CALLSIGN = wxEmptyString; -const wxString DEFAULT_ADDRESS = wxEmptyString; -const wxString DEFAULT_IRCDDB_HOSTNAME = wxT("group1-irc.ircddb.net"); -const wxString DEFAULT_IRCDDB_USERNAME = wxEmptyString; -const wxString DEFAULT_IRCDDB_PASSWORD = wxEmptyString; -const wxString DEFAULT_STARNET_BAND = wxEmptyString; -const wxString DEFAULT_STARNET_CALLSIGN = wxEmptyString; -const wxString DEFAULT_STARNET_LOGOFF = wxEmptyString; -const wxString DEFAULT_STARNET_INFO = wxEmptyString; -const wxString DEFAULT_STARNET_PERMANENT = wxEmptyString; -const unsigned int DEFAULT_STARNET_USER_TIMEOUT = 300U; -const unsigned int DEFAULT_STARNET_GROUP_TIMEOUT = 300U; -const STARNET_CALLSIGN_SWITCH DEFAULT_STARNET_CALLSIGN_SWITCH = SCS_GROUP_CALLSIGN; -const bool DEFAULT_STARNET_TXMSG_SWITCH = true; -const wxString DEFAULT_STARNET_REFLECTOR = wxEmptyString; -const bool DEFAULT_REMOTE_ENABLED = false; -const wxString DEFAULT_REMOTE_PASSWORD = wxEmptyString; -const unsigned int DEFAULT_REMOTE_PORT = 0U; -const bool DEFAULT_LOG_ENABLED = false; -const int DEFAULT_WINDOW_X = -1; -const int DEFAULT_WINDOW_Y = -1; - -#if defined(__WINDOWS__) - -CStarNetServerConfig::CStarNetServerConfig(wxConfigBase* config, const wxString& dir) : -m_config(config), -m_fileName(), -m_callsign(DEFAULT_CALLSIGN), -m_address(DEFAULT_ADDRESS), -m_ircddbHostname(DEFAULT_IRCDDB_HOSTNAME), -m_ircddbUsername(DEFAULT_IRCDDB_USERNAME), -m_ircddbPassword(DEFAULT_IRCDDB_PASSWORD), -m_starNet1Band(DEFAULT_STARNET_BAND), -m_starNet1Callsign(DEFAULT_STARNET_CALLSIGN), -m_starNet1Logoff(DEFAULT_STARNET_LOGOFF), -m_starNet1Info(DEFAULT_STARNET_INFO), -m_starNet1Permanent(DEFAULT_STARNET_PERMANENT), -m_starNet1UserTimeout(DEFAULT_STARNET_USER_TIMEOUT), -m_starNet1GroupTimeout(DEFAULT_STARNET_GROUP_TIMEOUT), -m_starNet1CallsignSwitch(DEFAULT_STARNET_CALLSIGN_SWITCH), -m_starNet1TxMsgSwitch(DEFAULT_STARNET_TXMSG_SWITCH), -m_starNet1Reflector(DEFAULT_STARNET_REFLECTOR), -m_starNet2Band(DEFAULT_STARNET_BAND), -m_starNet2Callsign(DEFAULT_STARNET_CALLSIGN), -m_starNet2Logoff(DEFAULT_STARNET_LOGOFF), -m_starNet2Info(DEFAULT_STARNET_INFO), -m_starNet2Permanent(DEFAULT_STARNET_PERMANENT), -m_starNet2UserTimeout(DEFAULT_STARNET_USER_TIMEOUT), -m_starNet2GroupTimeout(DEFAULT_STARNET_GROUP_TIMEOUT), -m_starNet2CallsignSwitch(DEFAULT_STARNET_CALLSIGN_SWITCH), -m_starNet2TxMsgSwitch(DEFAULT_STARNET_TXMSG_SWITCH), -m_starNet2Reflector(DEFAULT_STARNET_REFLECTOR), -m_starNet3Band(DEFAULT_STARNET_BAND), -m_starNet3Callsign(DEFAULT_STARNET_CALLSIGN), -m_starNet3Logoff(DEFAULT_STARNET_LOGOFF), -m_starNet3Info(DEFAULT_STARNET_INFO), -m_starNet3Permanent(DEFAULT_STARNET_PERMANENT), -m_starNet3UserTimeout(DEFAULT_STARNET_USER_TIMEOUT), -m_starNet3GroupTimeout(DEFAULT_STARNET_GROUP_TIMEOUT), -m_starNet3CallsignSwitch(DEFAULT_STARNET_CALLSIGN_SWITCH), -m_starNet3TxMsgSwitch(DEFAULT_STARNET_TXMSG_SWITCH), -m_starNet3Reflector(DEFAULT_STARNET_REFLECTOR), -m_starNet4Band(DEFAULT_STARNET_BAND), -m_starNet4Callsign(DEFAULT_STARNET_CALLSIGN), -m_starNet4Logoff(DEFAULT_STARNET_LOGOFF), -m_starNet4Info(DEFAULT_STARNET_INFO), -m_starNet4Permanent(DEFAULT_STARNET_PERMANENT), -m_starNet4UserTimeout(DEFAULT_STARNET_USER_TIMEOUT), -m_starNet4GroupTimeout(DEFAULT_STARNET_GROUP_TIMEOUT), -m_starNet4CallsignSwitch(DEFAULT_STARNET_CALLSIGN_SWITCH), -m_starNet4TxMsgSwitch(DEFAULT_STARNET_TXMSG_SWITCH), -m_starNet4Reflector(DEFAULT_STARNET_REFLECTOR), -m_starNet5Band(DEFAULT_STARNET_BAND), -m_starNet5Callsign(DEFAULT_STARNET_CALLSIGN), -m_starNet5Logoff(DEFAULT_STARNET_LOGOFF), -m_starNet5Info(DEFAULT_STARNET_INFO), -m_starNet5Permanent(DEFAULT_STARNET_PERMANENT), -m_starNet5UserTimeout(DEFAULT_STARNET_USER_TIMEOUT), -m_starNet5GroupTimeout(DEFAULT_STARNET_GROUP_TIMEOUT), -m_starNet5CallsignSwitch(DEFAULT_STARNET_CALLSIGN_SWITCH), -m_starNet5TxMsgSwitch(DEFAULT_STARNET_TXMSG_SWITCH), -m_starNet5Reflector(DEFAULT_STARNET_REFLECTOR), -m_starNet6Band(DEFAULT_STARNET_BAND), -m_starNet6Callsign(DEFAULT_STARNET_CALLSIGN), -m_starNet6Logoff(DEFAULT_STARNET_LOGOFF), -m_starNet6Info(DEFAULT_STARNET_INFO), -m_starNet6Permanent(DEFAULT_STARNET_PERMANENT), -m_starNet6UserTimeout(DEFAULT_STARNET_USER_TIMEOUT), -m_starNet6GroupTimeout(DEFAULT_STARNET_GROUP_TIMEOUT), -m_starNet6CallsignSwitch(DEFAULT_STARNET_CALLSIGN_SWITCH), -m_starNet6TxMsgSwitch(DEFAULT_STARNET_TXMSG_SWITCH), -m_starNet6Reflector(DEFAULT_STARNET_REFLECTOR), -m_starNet7Band(DEFAULT_STARNET_BAND), -m_starNet7Callsign(DEFAULT_STARNET_CALLSIGN), -m_starNet7Logoff(DEFAULT_STARNET_LOGOFF), -m_starNet7Info(DEFAULT_STARNET_INFO), -m_starNet7Permanent(DEFAULT_STARNET_PERMANENT), -m_starNet7UserTimeout(DEFAULT_STARNET_USER_TIMEOUT), -m_starNet7GroupTimeout(DEFAULT_STARNET_GROUP_TIMEOUT), -m_starNet7CallsignSwitch(DEFAULT_STARNET_CALLSIGN_SWITCH), -m_starNet7TxMsgSwitch(DEFAULT_STARNET_TXMSG_SWITCH), -m_starNet7Reflector(DEFAULT_STARNET_REFLECTOR), -m_starNet8Band(DEFAULT_STARNET_BAND), -m_starNet8Callsign(DEFAULT_STARNET_CALLSIGN), -m_starNet8Logoff(DEFAULT_STARNET_LOGOFF), -m_starNet8Info(DEFAULT_STARNET_INFO), -m_starNet8Permanent(DEFAULT_STARNET_PERMANENT), -m_starNet8UserTimeout(DEFAULT_STARNET_USER_TIMEOUT), -m_starNet8GroupTimeout(DEFAULT_STARNET_GROUP_TIMEOUT), -m_starNet8CallsignSwitch(DEFAULT_STARNET_CALLSIGN_SWITCH), -m_starNet8TxMsgSwitch(DEFAULT_STARNET_TXMSG_SWITCH), -m_starNet8Reflector(DEFAULT_STARNET_REFLECTOR), -m_starNet9Band(DEFAULT_STARNET_BAND), -m_starNet9Callsign(DEFAULT_STARNET_CALLSIGN), -m_starNet9Logoff(DEFAULT_STARNET_LOGOFF), -m_starNet9Info(DEFAULT_STARNET_INFO), -m_starNet9Permanent(DEFAULT_STARNET_PERMANENT), -m_starNet9UserTimeout(DEFAULT_STARNET_USER_TIMEOUT), -m_starNet9GroupTimeout(DEFAULT_STARNET_GROUP_TIMEOUT), -m_starNet9CallsignSwitch(DEFAULT_STARNET_CALLSIGN_SWITCH), -m_starNet9TxMsgSwitch(DEFAULT_STARNET_TXMSG_SWITCH), -m_starNet9Reflector(DEFAULT_STARNET_REFLECTOR), -m_starNet10Band(DEFAULT_STARNET_BAND), -m_starNet10Callsign(DEFAULT_STARNET_CALLSIGN), -m_starNet10Logoff(DEFAULT_STARNET_LOGOFF), -m_starNet10Info(DEFAULT_STARNET_INFO), -m_starNet10Permanent(DEFAULT_STARNET_PERMANENT), -m_starNet10UserTimeout(DEFAULT_STARNET_USER_TIMEOUT), -m_starNet10GroupTimeout(DEFAULT_STARNET_GROUP_TIMEOUT), -m_starNet10CallsignSwitch(DEFAULT_STARNET_CALLSIGN_SWITCH), -m_starNet10TxMsgSwitch(DEFAULT_STARNET_TXMSG_SWITCH), -m_starNet10Reflector(DEFAULT_STARNET_REFLECTOR), -m_starNet11Band(DEFAULT_STARNET_BAND), -m_starNet11Callsign(DEFAULT_STARNET_CALLSIGN), -m_starNet11Logoff(DEFAULT_STARNET_LOGOFF), -m_starNet11Info(DEFAULT_STARNET_INFO), -m_starNet11Permanent(DEFAULT_STARNET_PERMANENT), -m_starNet11UserTimeout(DEFAULT_STARNET_USER_TIMEOUT), -m_starNet11GroupTimeout(DEFAULT_STARNET_GROUP_TIMEOUT), -m_starNet11CallsignSwitch(DEFAULT_STARNET_CALLSIGN_SWITCH), -m_starNet11TxMsgSwitch(DEFAULT_STARNET_TXMSG_SWITCH), -m_starNet11Reflector(DEFAULT_STARNET_REFLECTOR), -m_starNet12Band(DEFAULT_STARNET_BAND), -m_starNet12Callsign(DEFAULT_STARNET_CALLSIGN), -m_starNet12Logoff(DEFAULT_STARNET_LOGOFF), -m_starNet12Info(DEFAULT_STARNET_INFO), -m_starNet12Permanent(DEFAULT_STARNET_PERMANENT), -m_starNet12UserTimeout(DEFAULT_STARNET_USER_TIMEOUT), -m_starNet12GroupTimeout(DEFAULT_STARNET_GROUP_TIMEOUT), -m_starNet12CallsignSwitch(DEFAULT_STARNET_CALLSIGN_SWITCH), -m_starNet12TxMsgSwitch(DEFAULT_STARNET_TXMSG_SWITCH), -m_starNet12Reflector(DEFAULT_STARNET_REFLECTOR), -m_starNet13Band(DEFAULT_STARNET_BAND), -m_starNet13Callsign(DEFAULT_STARNET_CALLSIGN), -m_starNet13Logoff(DEFAULT_STARNET_LOGOFF), -m_starNet13Info(DEFAULT_STARNET_INFO), -m_starNet13Permanent(DEFAULT_STARNET_PERMANENT), -m_starNet13UserTimeout(DEFAULT_STARNET_USER_TIMEOUT), -m_starNet13GroupTimeout(DEFAULT_STARNET_GROUP_TIMEOUT), -m_starNet13CallsignSwitch(DEFAULT_STARNET_CALLSIGN_SWITCH), -m_starNet13TxMsgSwitch(DEFAULT_STARNET_TXMSG_SWITCH), -m_starNet13Reflector(DEFAULT_STARNET_REFLECTOR), -m_starNet14Band(DEFAULT_STARNET_BAND), -m_starNet14Callsign(DEFAULT_STARNET_CALLSIGN), -m_starNet14Logoff(DEFAULT_STARNET_LOGOFF), -m_starNet14Info(DEFAULT_STARNET_INFO), -m_starNet14Permanent(DEFAULT_STARNET_PERMANENT), -m_starNet14UserTimeout(DEFAULT_STARNET_USER_TIMEOUT), -m_starNet14GroupTimeout(DEFAULT_STARNET_GROUP_TIMEOUT), -m_starNet14CallsignSwitch(DEFAULT_STARNET_CALLSIGN_SWITCH), -m_starNet14TxMsgSwitch(DEFAULT_STARNET_TXMSG_SWITCH), -m_starNet14Reflector(DEFAULT_STARNET_REFLECTOR), -m_starNet15Band(DEFAULT_STARNET_BAND), -m_starNet15Callsign(DEFAULT_STARNET_CALLSIGN), -m_starNet15Logoff(DEFAULT_STARNET_LOGOFF), -m_starNet15Info(DEFAULT_STARNET_INFO), -m_starNet15Permanent(DEFAULT_STARNET_PERMANENT), -m_starNet15UserTimeout(DEFAULT_STARNET_USER_TIMEOUT), -m_starNet15GroupTimeout(DEFAULT_STARNET_GROUP_TIMEOUT), -m_starNet15CallsignSwitch(DEFAULT_STARNET_CALLSIGN_SWITCH), -m_starNet15TxMsgSwitch(DEFAULT_STARNET_TXMSG_SWITCH), -m_starNet15Reflector(DEFAULT_STARNET_REFLECTOR), -m_remoteEnabled(DEFAULT_REMOTE_ENABLED), -m_remotePassword(DEFAULT_REMOTE_PASSWORD), -m_remotePort(DEFAULT_REMOTE_PORT), -m_logEnabled(DEFAULT_LOG_ENABLED), -m_x(DEFAULT_WINDOW_X), -m_y(DEFAULT_WINDOW_Y) -{ - wxASSERT(config != NULL); - wxASSERT(!dir.IsEmpty()); - - m_fileName.Assign(dir, CONFIG_FILE_NAME); - - wxTextFile file(m_fileName.GetFullPath()); - - long temp; - - m_config->Read(wxT("/") + KEY_CALLSIGN, &m_callsign, DEFAULT_CALLSIGN); - - m_config->Read(wxT("/") + KEY_ADDRESS, &m_address, DEFAULT_ADDRESS); - - m_config->Read(wxT("/") + KEY_IRCDDB_HOSTNAME, &m_ircddbHostname, DEFAULT_IRCDDB_HOSTNAME); - - m_config->Read(wxT("/") + KEY_IRCDDB_USERNAME, &m_ircddbUsername, DEFAULT_IRCDDB_USERNAME); - - m_config->Read(wxT("/") + KEY_IRCDDB_PASSWORD, &m_ircddbPassword, DEFAULT_IRCDDB_PASSWORD); - - m_config->Read(wxT("/") + KEY_STARNET_BAND1, &m_starNet1Band, DEFAULT_STARNET_BAND); - - m_config->Read(wxT("/") + KEY_STARNET_CALLSIGN1, &m_starNet1Callsign, DEFAULT_STARNET_CALLSIGN); - - m_config->Read(wxT("/") + KEY_STARNET_LOGOFF1, &m_starNet1Logoff, DEFAULT_STARNET_LOGOFF); - - m_config->Read(wxT("/") + KEY_STARNET_INFO1, &m_starNet1Info, DEFAULT_STARNET_INFO); - - m_config->Read(wxT("/") + KEY_STARNET_PERMANENT1, &m_starNet1Permanent, DEFAULT_STARNET_PERMANENT); - - m_config->Read(wxT("/") + KEY_STARNET_USER_TIMEOUT1, &temp, long(DEFAULT_STARNET_USER_TIMEOUT)); - m_starNet1UserTimeout = (unsigned int)temp; - - m_config->Read(wxT("/") + KEY_STARNET_GROUP_TIMEOUT1, &temp, long(DEFAULT_STARNET_GROUP_TIMEOUT)); - m_starNet1GroupTimeout = (unsigned int)temp; - - m_config->Read(wxT("/") + KEY_STARNET_CALLSIGN_SWITCH1, &temp, long(DEFAULT_STARNET_CALLSIGN_SWITCH)); - m_starNet1CallsignSwitch = STARNET_CALLSIGN_SWITCH(temp); - - m_config->Read(wxT("/") + KEY_STARNET_TXMSG_SWITCH1, &m_starNet1TxMsgSwitch, DEFAULT_STARNET_TXMSG_SWITCH); - - m_config->Read(wxT("/") + KEY_STARNET_REFLECTOR1, &m_starNet1Reflector, DEFAULT_STARNET_REFLECTOR); - - m_config->Read(wxT("/") + KEY_STARNET_BAND2, &m_starNet2Band, DEFAULT_STARNET_BAND); - - m_config->Read(wxT("/") + KEY_STARNET_CALLSIGN2, &m_starNet2Callsign, DEFAULT_STARNET_CALLSIGN); - - m_config->Read(wxT("/") + KEY_STARNET_LOGOFF2, &m_starNet2Logoff, DEFAULT_STARNET_LOGOFF); - - m_config->Read(wxT("/") + KEY_STARNET_INFO2, &m_starNet2Info, DEFAULT_STARNET_INFO); - - m_config->Read(wxT("/") + KEY_STARNET_PERMANENT2, &m_starNet2Permanent, DEFAULT_STARNET_PERMANENT); - - m_config->Read(wxT("/") + KEY_STARNET_USER_TIMEOUT2, &temp, long(DEFAULT_STARNET_USER_TIMEOUT)); - m_starNet2UserTimeout = (unsigned int)temp; - - m_config->Read(wxT("/") + KEY_STARNET_GROUP_TIMEOUT2, &temp, long(DEFAULT_STARNET_GROUP_TIMEOUT)); - m_starNet2GroupTimeout = (unsigned int)temp; - - m_config->Read(wxT("/") + KEY_STARNET_CALLSIGN_SWITCH2, &temp, long(DEFAULT_STARNET_CALLSIGN_SWITCH)); - m_starNet2CallsignSwitch = STARNET_CALLSIGN_SWITCH(temp); - - m_config->Read(wxT("/") + KEY_STARNET_TXMSG_SWITCH2, &m_starNet2TxMsgSwitch, DEFAULT_STARNET_TXMSG_SWITCH); - - m_config->Read(wxT("/") + KEY_STARNET_REFLECTOR2, &m_starNet2Reflector, DEFAULT_STARNET_REFLECTOR); - - m_config->Read(wxT("/") + KEY_STARNET_BAND3, &m_starNet3Band, DEFAULT_STARNET_BAND); - - m_config->Read(wxT("/") + KEY_STARNET_CALLSIGN3, &m_starNet3Callsign, DEFAULT_STARNET_CALLSIGN); - - m_config->Read(wxT("/") + KEY_STARNET_LOGOFF3, &m_starNet3Logoff, DEFAULT_STARNET_LOGOFF); - - m_config->Read(wxT("/") + KEY_STARNET_INFO3, &m_starNet3Info, DEFAULT_STARNET_INFO); - - m_config->Read(wxT("/") + KEY_STARNET_PERMANENT3, &m_starNet3Permanent, DEFAULT_STARNET_PERMANENT); - - m_config->Read(wxT("/") + KEY_STARNET_USER_TIMEOUT3, &temp, long(DEFAULT_STARNET_USER_TIMEOUT)); - m_starNet3UserTimeout = (unsigned int)temp; - - m_config->Read(wxT("/") + KEY_STARNET_GROUP_TIMEOUT3, &temp, long(DEFAULT_STARNET_GROUP_TIMEOUT)); - m_starNet3GroupTimeout = (unsigned int)temp; - - m_config->Read(wxT("/") + KEY_STARNET_CALLSIGN_SWITCH3, &temp, long(DEFAULT_STARNET_CALLSIGN_SWITCH)); - m_starNet3CallsignSwitch = STARNET_CALLSIGN_SWITCH(temp); - - m_config->Read(wxT("/") + KEY_STARNET_TXMSG_SWITCH3, &m_starNet3TxMsgSwitch, DEFAULT_STARNET_TXMSG_SWITCH); - - m_config->Read(wxT("/") + KEY_STARNET_REFLECTOR3, &m_starNet3Reflector, DEFAULT_STARNET_REFLECTOR); - - m_config->Read(wxT("/") + KEY_STARNET_BAND4, &m_starNet4Band, DEFAULT_STARNET_BAND); - - m_config->Read(wxT("/") + KEY_STARNET_CALLSIGN4, &m_starNet4Callsign, DEFAULT_STARNET_CALLSIGN); - - m_config->Read(wxT("/") + KEY_STARNET_LOGOFF4, &m_starNet4Logoff, DEFAULT_STARNET_LOGOFF); - - m_config->Read(wxT("/") + KEY_STARNET_INFO4, &m_starNet4Info, DEFAULT_STARNET_INFO); - - m_config->Read(wxT("/") + KEY_STARNET_PERMANENT4, &m_starNet4Permanent, DEFAULT_STARNET_PERMANENT); - - m_config->Read(wxT("/") + KEY_STARNET_USER_TIMEOUT4, &temp, long(DEFAULT_STARNET_USER_TIMEOUT)); - m_starNet4UserTimeout = (unsigned int)temp; - - m_config->Read(wxT("/") + KEY_STARNET_GROUP_TIMEOUT4, &temp, long(DEFAULT_STARNET_GROUP_TIMEOUT)); - m_starNet4GroupTimeout = (unsigned int)temp; - - m_config->Read(wxT("/") + KEY_STARNET_CALLSIGN_SWITCH4, &temp, long(DEFAULT_STARNET_CALLSIGN_SWITCH)); - m_starNet4CallsignSwitch = STARNET_CALLSIGN_SWITCH(temp); - - m_config->Read(wxT("/") + KEY_STARNET_TXMSG_SWITCH4, &m_starNet4TxMsgSwitch, DEFAULT_STARNET_TXMSG_SWITCH); - - m_config->Read(wxT("/") + KEY_STARNET_REFLECTOR4, &m_starNet4Reflector, DEFAULT_STARNET_REFLECTOR); - - m_config->Read(wxT("/") + KEY_STARNET_BAND5, &m_starNet5Band, DEFAULT_STARNET_BAND); - - m_config->Read(wxT("/") + KEY_STARNET_CALLSIGN5, &m_starNet5Callsign, DEFAULT_STARNET_CALLSIGN); - - m_config->Read(wxT("/") + KEY_STARNET_LOGOFF5, &m_starNet5Logoff, DEFAULT_STARNET_LOGOFF); - - m_config->Read(wxT("/") + KEY_STARNET_INFO5, &m_starNet5Info, DEFAULT_STARNET_INFO); - - m_config->Read(wxT("/") + KEY_STARNET_PERMANENT5, &m_starNet5Permanent, DEFAULT_STARNET_PERMANENT); - - m_config->Read(wxT("/") + KEY_STARNET_USER_TIMEOUT5, &temp, long(DEFAULT_STARNET_USER_TIMEOUT)); - m_starNet5UserTimeout = (unsigned int)temp; - - m_config->Read(wxT("/") + KEY_STARNET_GROUP_TIMEOUT5, &temp, long(DEFAULT_STARNET_GROUP_TIMEOUT)); - m_starNet5GroupTimeout = (unsigned int)temp; - - m_config->Read(wxT("/") + KEY_STARNET_CALLSIGN_SWITCH5, &temp, long(DEFAULT_STARNET_CALLSIGN_SWITCH)); - m_starNet5CallsignSwitch = STARNET_CALLSIGN_SWITCH(temp); - - m_config->Read(wxT("/") + KEY_STARNET_TXMSG_SWITCH5, &m_starNet5TxMsgSwitch, DEFAULT_STARNET_TXMSG_SWITCH); - - m_config->Read(wxT("/") + KEY_STARNET_REFLECTOR5, &m_starNet5Reflector, DEFAULT_STARNET_REFLECTOR); - - m_config->Read(wxT("/") + KEY_STARNET_BAND6, &m_starNet6Band, DEFAULT_STARNET_BAND); - - m_config->Read(wxT("/") + KEY_STARNET_CALLSIGN6, &m_starNet6Callsign, DEFAULT_STARNET_CALLSIGN); - - m_config->Read(wxT("/") + KEY_STARNET_LOGOFF6, &m_starNet6Logoff, DEFAULT_STARNET_LOGOFF); - - m_config->Read(wxT("/") + KEY_STARNET_INFO6, &m_starNet6Info, DEFAULT_STARNET_INFO); - - m_config->Read(wxT("/") + KEY_STARNET_PERMANENT6, &m_starNet6Permanent, DEFAULT_STARNET_PERMANENT); - - m_config->Read(wxT("/") + KEY_STARNET_USER_TIMEOUT6, &temp, long(DEFAULT_STARNET_USER_TIMEOUT)); - m_starNet6UserTimeout = (unsigned int)temp; - - m_config->Read(wxT("/") + KEY_STARNET_GROUP_TIMEOUT6, &temp, long(DEFAULT_STARNET_GROUP_TIMEOUT)); - m_starNet6GroupTimeout = (unsigned int)temp; - - m_config->Read(wxT("/") + KEY_STARNET_CALLSIGN_SWITCH6, &temp, long(DEFAULT_STARNET_CALLSIGN_SWITCH)); - m_starNet6CallsignSwitch = STARNET_CALLSIGN_SWITCH(temp); - - m_config->Read(wxT("/") + KEY_STARNET_TXMSG_SWITCH6, &m_starNet6TxMsgSwitch, DEFAULT_STARNET_TXMSG_SWITCH); - - m_config->Read(wxT("/") + KEY_STARNET_REFLECTOR6, &m_starNet6Reflector, DEFAULT_STARNET_REFLECTOR); - - m_config->Read(wxT("/") + KEY_STARNET_BAND7, &m_starNet7Band, DEFAULT_STARNET_BAND); - - m_config->Read(wxT("/") + KEY_STARNET_CALLSIGN7, &m_starNet7Callsign, DEFAULT_STARNET_CALLSIGN); - - m_config->Read(wxT("/") + KEY_STARNET_LOGOFF7, &m_starNet7Logoff, DEFAULT_STARNET_LOGOFF); - - m_config->Read(wxT("/") + KEY_STARNET_INFO7, &m_starNet7Info, DEFAULT_STARNET_INFO); - - m_config->Read(wxT("/") + KEY_STARNET_PERMANENT7, &m_starNet7Permanent, DEFAULT_STARNET_PERMANENT); - - m_config->Read(wxT("/") + KEY_STARNET_USER_TIMEOUT7, &temp, long(DEFAULT_STARNET_USER_TIMEOUT)); - m_starNet7UserTimeout = (unsigned int)temp; - - m_config->Read(wxT("/") + KEY_STARNET_GROUP_TIMEOUT7, &temp, long(DEFAULT_STARNET_GROUP_TIMEOUT)); - m_starNet7GroupTimeout = (unsigned int)temp; - - m_config->Read(wxT("/") + KEY_STARNET_CALLSIGN_SWITCH7, &temp, long(DEFAULT_STARNET_CALLSIGN_SWITCH)); - m_starNet7CallsignSwitch = STARNET_CALLSIGN_SWITCH(temp); - - m_config->Read(wxT("/") + KEY_STARNET_TXMSG_SWITCH7, &m_starNet7TxMsgSwitch, DEFAULT_STARNET_TXMSG_SWITCH); - - m_config->Read(wxT("/") + KEY_STARNET_REFLECTOR7, &m_starNet7Reflector, DEFAULT_STARNET_REFLECTOR); - - m_config->Read(wxT("/") + KEY_STARNET_BAND8, &m_starNet8Band, DEFAULT_STARNET_BAND); - - m_config->Read(wxT("/") + KEY_STARNET_CALLSIGN8, &m_starNet8Callsign, DEFAULT_STARNET_CALLSIGN); - - m_config->Read(wxT("/") + KEY_STARNET_LOGOFF8, &m_starNet8Logoff, DEFAULT_STARNET_LOGOFF); - - m_config->Read(wxT("/") + KEY_STARNET_INFO8, &m_starNet8Info, DEFAULT_STARNET_INFO); - - m_config->Read(wxT("/") + KEY_STARNET_PERMANENT8, &m_starNet8Permanent, DEFAULT_STARNET_PERMANENT); - - m_config->Read(wxT("/") + KEY_STARNET_USER_TIMEOUT8, &temp, long(DEFAULT_STARNET_USER_TIMEOUT)); - m_starNet8UserTimeout = (unsigned int)temp; - - m_config->Read(wxT("/") + KEY_STARNET_GROUP_TIMEOUT8, &temp, long(DEFAULT_STARNET_GROUP_TIMEOUT)); - m_starNet8GroupTimeout = (unsigned int)temp; - - m_config->Read(wxT("/") + KEY_STARNET_CALLSIGN_SWITCH8, &temp, long(DEFAULT_STARNET_CALLSIGN_SWITCH)); - m_starNet8CallsignSwitch = STARNET_CALLSIGN_SWITCH(temp); - - m_config->Read(wxT("/") + KEY_STARNET_TXMSG_SWITCH8, &m_starNet8TxMsgSwitch, DEFAULT_STARNET_TXMSG_SWITCH); - - m_config->Read(wxT("/") + KEY_STARNET_REFLECTOR8, &m_starNet8Reflector, DEFAULT_STARNET_REFLECTOR); - - m_config->Read(wxT("/") + KEY_STARNET_BAND9, &m_starNet9Band, DEFAULT_STARNET_BAND); - - m_config->Read(wxT("/") + KEY_STARNET_CALLSIGN9, &m_starNet9Callsign, DEFAULT_STARNET_CALLSIGN); - - m_config->Read(wxT("/") + KEY_STARNET_LOGOFF9, &m_starNet9Logoff, DEFAULT_STARNET_LOGOFF); - - m_config->Read(wxT("/") + KEY_STARNET_INFO9, &m_starNet9Info, DEFAULT_STARNET_INFO); - - m_config->Read(wxT("/") + KEY_STARNET_PERMANENT9, &m_starNet9Permanent, DEFAULT_STARNET_PERMANENT); - - m_config->Read(wxT("/") + KEY_STARNET_USER_TIMEOUT9, &temp, long(DEFAULT_STARNET_USER_TIMEOUT)); - m_starNet9UserTimeout = (unsigned int)temp; - - m_config->Read(wxT("/") + KEY_STARNET_GROUP_TIMEOUT9, &temp, long(DEFAULT_STARNET_GROUP_TIMEOUT)); - m_starNet9GroupTimeout = (unsigned int)temp; - - m_config->Read(wxT("/") + KEY_STARNET_CALLSIGN_SWITCH9, &temp, long(DEFAULT_STARNET_CALLSIGN_SWITCH)); - m_starNet9CallsignSwitch = STARNET_CALLSIGN_SWITCH(temp); - - m_config->Read(wxT("/") + KEY_STARNET_TXMSG_SWITCH9, &m_starNet9TxMsgSwitch, DEFAULT_STARNET_TXMSG_SWITCH); - - m_config->Read(wxT("/") + KEY_STARNET_REFLECTOR9, &m_starNet9Reflector, DEFAULT_STARNET_REFLECTOR); - - m_config->Read(wxT("/") + KEY_STARNET_BAND10, &m_starNet10Band, DEFAULT_STARNET_BAND); - - m_config->Read(wxT("/") + KEY_STARNET_CALLSIGN10, &m_starNet10Callsign, DEFAULT_STARNET_CALLSIGN); - - m_config->Read(wxT("/") + KEY_STARNET_LOGOFF10, &m_starNet10Logoff, DEFAULT_STARNET_LOGOFF); - - m_config->Read(wxT("/") + KEY_STARNET_INFO10, &m_starNet10Info, DEFAULT_STARNET_INFO); - - m_config->Read(wxT("/") + KEY_STARNET_PERMANENT10, &m_starNet10Permanent, DEFAULT_STARNET_PERMANENT); - - m_config->Read(wxT("/") + KEY_STARNET_USER_TIMEOUT10, &temp, long(DEFAULT_STARNET_USER_TIMEOUT)); - m_starNet10UserTimeout = (unsigned int)temp; - - m_config->Read(wxT("/") + KEY_STARNET_GROUP_TIMEOUT10, &temp, long(DEFAULT_STARNET_GROUP_TIMEOUT)); - m_starNet10GroupTimeout = (unsigned int)temp; - - m_config->Read(wxT("/") + KEY_STARNET_CALLSIGN_SWITCH10, &temp, long(DEFAULT_STARNET_CALLSIGN_SWITCH)); - m_starNet10CallsignSwitch = STARNET_CALLSIGN_SWITCH(temp); - - m_config->Read(wxT("/") + KEY_STARNET_TXMSG_SWITCH10, &m_starNet10TxMsgSwitch, DEFAULT_STARNET_TXMSG_SWITCH); - - m_config->Read(wxT("/") + KEY_STARNET_REFLECTOR10, &m_starNet10Reflector, DEFAULT_STARNET_REFLECTOR); - - m_config->Read(wxT("/") + KEY_STARNET_BAND11, &m_starNet11Band, DEFAULT_STARNET_BAND); - - m_config->Read(wxT("/") + KEY_STARNET_CALLSIGN11, &m_starNet11Callsign, DEFAULT_STARNET_CALLSIGN); - - m_config->Read(wxT("/") + KEY_STARNET_LOGOFF11, &m_starNet11Logoff, DEFAULT_STARNET_LOGOFF); - - m_config->Read(wxT("/") + KEY_STARNET_INFO11, &m_starNet11Info, DEFAULT_STARNET_INFO); - - m_config->Read(wxT("/") + KEY_STARNET_PERMANENT11, &m_starNet11Permanent, DEFAULT_STARNET_PERMANENT); - - m_config->Read(wxT("/") + KEY_STARNET_USER_TIMEOUT11, &temp, long(DEFAULT_STARNET_USER_TIMEOUT)); - m_starNet11UserTimeout = (unsigned int)temp; - - m_config->Read(wxT("/") + KEY_STARNET_GROUP_TIMEOUT11, &temp, long(DEFAULT_STARNET_GROUP_TIMEOUT)); - m_starNet11GroupTimeout = (unsigned int)temp; - - m_config->Read(wxT("/") + KEY_STARNET_CALLSIGN_SWITCH11, &temp, long(DEFAULT_STARNET_CALLSIGN_SWITCH)); - m_starNet11CallsignSwitch = STARNET_CALLSIGN_SWITCH(temp); - - m_config->Read(wxT("/") + KEY_STARNET_TXMSG_SWITCH11, &m_starNet11TxMsgSwitch, DEFAULT_STARNET_TXMSG_SWITCH); - - m_config->Read(wxT("/") + KEY_STARNET_REFLECTOR11, &m_starNet11Reflector, DEFAULT_STARNET_REFLECTOR); - - m_config->Read(wxT("/") + KEY_STARNET_BAND12, &m_starNet12Band, DEFAULT_STARNET_BAND); - - m_config->Read(wxT("/") + KEY_STARNET_CALLSIGN12, &m_starNet12Callsign, DEFAULT_STARNET_CALLSIGN); - - m_config->Read(wxT("/") + KEY_STARNET_LOGOFF12, &m_starNet12Logoff, DEFAULT_STARNET_LOGOFF); - - m_config->Read(wxT("/") + KEY_STARNET_INFO12, &m_starNet12Info, DEFAULT_STARNET_INFO); - - m_config->Read(wxT("/") + KEY_STARNET_PERMANENT12, &m_starNet12Permanent, DEFAULT_STARNET_PERMANENT); - - m_config->Read(wxT("/") + KEY_STARNET_USER_TIMEOUT12, &temp, long(DEFAULT_STARNET_USER_TIMEOUT)); - m_starNet12UserTimeout = (unsigned int)temp; - - m_config->Read(wxT("/") + KEY_STARNET_GROUP_TIMEOUT12, &temp, long(DEFAULT_STARNET_GROUP_TIMEOUT)); - m_starNet12GroupTimeout = (unsigned int)temp; - - m_config->Read(wxT("/") + KEY_STARNET_CALLSIGN_SWITCH12, &temp, long(DEFAULT_STARNET_CALLSIGN_SWITCH)); - m_starNet12CallsignSwitch = STARNET_CALLSIGN_SWITCH(temp); - - m_config->Read(wxT("/") + KEY_STARNET_TXMSG_SWITCH12, &m_starNet12TxMsgSwitch, DEFAULT_STARNET_TXMSG_SWITCH); - - m_config->Read(wxT("/") + KEY_STARNET_REFLECTOR12, &m_starNet12Reflector, DEFAULT_STARNET_REFLECTOR); - - m_config->Read(wxT("/") + KEY_STARNET_BAND13, &m_starNet13Band, DEFAULT_STARNET_BAND); - - m_config->Read(wxT("/") + KEY_STARNET_CALLSIGN13, &m_starNet13Callsign, DEFAULT_STARNET_CALLSIGN); - - m_config->Read(wxT("/") + KEY_STARNET_LOGOFF13, &m_starNet13Logoff, DEFAULT_STARNET_LOGOFF); - - m_config->Read(wxT("/") + KEY_STARNET_INFO13, &m_starNet13Info, DEFAULT_STARNET_INFO); - - m_config->Read(wxT("/") + KEY_STARNET_PERMANENT13, &m_starNet13Permanent, DEFAULT_STARNET_PERMANENT); - - m_config->Read(wxT("/") + KEY_STARNET_USER_TIMEOUT13, &temp, long(DEFAULT_STARNET_USER_TIMEOUT)); - m_starNet13UserTimeout = (unsigned int)temp; - - m_config->Read(wxT("/") + KEY_STARNET_GROUP_TIMEOUT13, &temp, long(DEFAULT_STARNET_GROUP_TIMEOUT)); - m_starNet13GroupTimeout = (unsigned int)temp; - - m_config->Read(wxT("/") + KEY_STARNET_CALLSIGN_SWITCH13, &temp, long(DEFAULT_STARNET_CALLSIGN_SWITCH)); - m_starNet13CallsignSwitch = STARNET_CALLSIGN_SWITCH(temp); - - m_config->Read(wxT("/") + KEY_STARNET_TXMSG_SWITCH13, &m_starNet13TxMsgSwitch, DEFAULT_STARNET_TXMSG_SWITCH); - - m_config->Read(wxT("/") + KEY_STARNET_REFLECTOR13, &m_starNet13Reflector, DEFAULT_STARNET_REFLECTOR); - - m_config->Read(wxT("/") + KEY_STARNET_BAND14, &m_starNet14Band, DEFAULT_STARNET_BAND); - - m_config->Read(wxT("/") + KEY_STARNET_CALLSIGN14, &m_starNet14Callsign, DEFAULT_STARNET_CALLSIGN); - - m_config->Read(wxT("/") + KEY_STARNET_LOGOFF14, &m_starNet14Logoff, DEFAULT_STARNET_LOGOFF); - - m_config->Read(wxT("/") + KEY_STARNET_INFO14, &m_starNet14Info, DEFAULT_STARNET_INFO); - - m_config->Read(wxT("/") + KEY_STARNET_PERMANENT14, &m_starNet14Permanent, DEFAULT_STARNET_PERMANENT); - - m_config->Read(wxT("/") + KEY_STARNET_USER_TIMEOUT14, &temp, long(DEFAULT_STARNET_USER_TIMEOUT)); - m_starNet14UserTimeout = (unsigned int)temp; - - m_config->Read(wxT("/") + KEY_STARNET_GROUP_TIMEOUT14, &temp, long(DEFAULT_STARNET_GROUP_TIMEOUT)); - m_starNet14GroupTimeout = (unsigned int)temp; - - m_config->Read(wxT("/") + KEY_STARNET_CALLSIGN_SWITCH14, &temp, long(DEFAULT_STARNET_CALLSIGN_SWITCH)); - m_starNet14CallsignSwitch = STARNET_CALLSIGN_SWITCH(temp); - - m_config->Read(wxT("/") + KEY_STARNET_TXMSG_SWITCH14, &m_starNet14TxMsgSwitch, DEFAULT_STARNET_TXMSG_SWITCH); - - m_config->Read(wxT("/") + KEY_STARNET_REFLECTOR14, &m_starNet14Reflector, DEFAULT_STARNET_REFLECTOR); - - m_config->Read(wxT("/") + KEY_STARNET_BAND15, &m_starNet15Band, DEFAULT_STARNET_BAND); - - m_config->Read(wxT("/") + KEY_STARNET_CALLSIGN15, &m_starNet15Callsign, DEFAULT_STARNET_CALLSIGN); - - m_config->Read(wxT("/") + KEY_STARNET_LOGOFF15, &m_starNet15Logoff, DEFAULT_STARNET_LOGOFF); - - m_config->Read(wxT("/") + KEY_STARNET_INFO15, &m_starNet15Info, DEFAULT_STARNET_INFO); - - m_config->Read(wxT("/") + KEY_STARNET_PERMANENT15, &m_starNet15Permanent, DEFAULT_STARNET_PERMANENT); - - m_config->Read(wxT("/") + KEY_STARNET_USER_TIMEOUT15, &temp, long(DEFAULT_STARNET_USER_TIMEOUT)); - m_starNet15UserTimeout = (unsigned int)temp; - - m_config->Read(wxT("/") + KEY_STARNET_GROUP_TIMEOUT15, &temp, long(DEFAULT_STARNET_GROUP_TIMEOUT)); - m_starNet15GroupTimeout = (unsigned int)temp; - - m_config->Read(wxT("/") + KEY_STARNET_CALLSIGN_SWITCH15, &temp, long(DEFAULT_STARNET_CALLSIGN_SWITCH)); - m_starNet15CallsignSwitch = STARNET_CALLSIGN_SWITCH(temp); - - m_config->Read(wxT("/") + KEY_STARNET_TXMSG_SWITCH15, &m_starNet15TxMsgSwitch, DEFAULT_STARNET_TXMSG_SWITCH); - - m_config->Read(wxT("/") + KEY_STARNET_REFLECTOR15, &m_starNet15Reflector, DEFAULT_STARNET_REFLECTOR); - - m_config->Read(wxT("/") + KEY_REMOTE_ENABLED, &m_remoteEnabled, DEFAULT_REMOTE_ENABLED); - - m_config->Read(wxT("/") + KEY_REMOTE_PASSWORD, &m_remotePassword, DEFAULT_REMOTE_PASSWORD); - - m_config->Read(wxT("/") + KEY_REMOTE_PORT, &temp, long(DEFAULT_REMOTE_PORT)); - m_remotePort = (unsigned int)temp; - - m_config->Read(wxT("/") + KEY_LOG_ENABLED, &m_logEnabled, DEFAULT_LOG_ENABLED); - - m_config->Read(wxT("/") + KEY_WINDOW_X, &temp, long(DEFAULT_WINDOW_X)); - m_x = int(temp); - - m_config->Read(wxT("/") + KEY_WINDOW_Y, &temp, long(DEFAULT_WINDOW_Y)); - m_y = int(temp); -} - -CStarNetServerConfig::~CStarNetServerConfig() -{ - delete m_config; -} - -#else - -CStarNetServerConfig::CStarNetServerConfig(const wxString& dir) : -m_fileName(), -m_callsign(DEFAULT_CALLSIGN), -m_address(DEFAULT_ADDRESS), -m_ircddbHostname(DEFAULT_IRCDDB_HOSTNAME), -m_ircddbUsername(DEFAULT_IRCDDB_USERNAME), -m_ircddbPassword(DEFAULT_IRCDDB_PASSWORD), -m_starNet1Band(DEFAULT_STARNET_BAND), -m_starNet1Callsign(DEFAULT_STARNET_CALLSIGN), -m_starNet1Logoff(DEFAULT_STARNET_LOGOFF), -m_starNet1Info(DEFAULT_STARNET_INFO), -m_starNet1Permanent(DEFAULT_STARNET_PERMANENT), -m_starNet1UserTimeout(DEFAULT_STARNET_USER_TIMEOUT), -m_starNet1GroupTimeout(DEFAULT_STARNET_GROUP_TIMEOUT), -m_starNet1CallsignSwitch(DEFAULT_STARNET_CALLSIGN_SWITCH), -m_starNet1TxMsgSwitch(DEFAULT_STARNET_TXMSG_SWITCH), -m_starNet1Reflector(DEFAULT_STARNET_REFLECTOR), -m_starNet2Band(DEFAULT_STARNET_BAND), -m_starNet2Callsign(DEFAULT_STARNET_CALLSIGN), -m_starNet2Logoff(DEFAULT_STARNET_LOGOFF), -m_starNet2Info(DEFAULT_STARNET_INFO), -m_starNet2Permanent(DEFAULT_STARNET_PERMANENT), -m_starNet2UserTimeout(DEFAULT_STARNET_USER_TIMEOUT), -m_starNet2GroupTimeout(DEFAULT_STARNET_GROUP_TIMEOUT), -m_starNet2CallsignSwitch(DEFAULT_STARNET_CALLSIGN_SWITCH), -m_starNet2TxMsgSwitch(DEFAULT_STARNET_TXMSG_SWITCH), -m_starNet2Reflector(DEFAULT_STARNET_REFLECTOR), -m_starNet3Band(DEFAULT_STARNET_BAND), -m_starNet3Callsign(DEFAULT_STARNET_CALLSIGN), -m_starNet3Logoff(DEFAULT_STARNET_LOGOFF), -m_starNet3Info(DEFAULT_STARNET_INFO), -m_starNet3Permanent(DEFAULT_STARNET_PERMANENT), -m_starNet3UserTimeout(DEFAULT_STARNET_USER_TIMEOUT), -m_starNet3GroupTimeout(DEFAULT_STARNET_GROUP_TIMEOUT), -m_starNet3CallsignSwitch(DEFAULT_STARNET_CALLSIGN_SWITCH), -m_starNet3TxMsgSwitch(DEFAULT_STARNET_TXMSG_SWITCH), -m_starNet3Reflector(DEFAULT_STARNET_REFLECTOR), -m_starNet4Band(DEFAULT_STARNET_BAND), -m_starNet4Callsign(DEFAULT_STARNET_CALLSIGN), -m_starNet4Logoff(DEFAULT_STARNET_LOGOFF), -m_starNet4Info(DEFAULT_STARNET_INFO), -m_starNet4Permanent(DEFAULT_STARNET_PERMANENT), -m_starNet4UserTimeout(DEFAULT_STARNET_USER_TIMEOUT), -m_starNet4GroupTimeout(DEFAULT_STARNET_GROUP_TIMEOUT), -m_starNet4CallsignSwitch(DEFAULT_STARNET_CALLSIGN_SWITCH), -m_starNet4TxMsgSwitch(DEFAULT_STARNET_TXMSG_SWITCH), -m_starNet4Reflector(DEFAULT_STARNET_REFLECTOR), -m_starNet5Band(DEFAULT_STARNET_BAND), -m_starNet5Callsign(DEFAULT_STARNET_CALLSIGN), -m_starNet5Logoff(DEFAULT_STARNET_LOGOFF), -m_starNet5Info(DEFAULT_STARNET_INFO), -m_starNet5Permanent(DEFAULT_STARNET_PERMANENT), -m_starNet5UserTimeout(DEFAULT_STARNET_USER_TIMEOUT), -m_starNet5GroupTimeout(DEFAULT_STARNET_GROUP_TIMEOUT), -m_starNet5CallsignSwitch(DEFAULT_STARNET_CALLSIGN_SWITCH), -m_starNet5TxMsgSwitch(DEFAULT_STARNET_TXMSG_SWITCH), -m_starNet5Reflector(DEFAULT_STARNET_REFLECTOR), -m_starNet6Band(DEFAULT_STARNET_BAND), -m_starNet6Callsign(DEFAULT_STARNET_CALLSIGN), -m_starNet6Logoff(DEFAULT_STARNET_LOGOFF), -m_starNet6Info(DEFAULT_STARNET_INFO), -m_starNet6Permanent(DEFAULT_STARNET_PERMANENT), -m_starNet6UserTimeout(DEFAULT_STARNET_USER_TIMEOUT), -m_starNet6GroupTimeout(DEFAULT_STARNET_GROUP_TIMEOUT), -m_starNet6CallsignSwitch(DEFAULT_STARNET_CALLSIGN_SWITCH), -m_starNet6TxMsgSwitch(DEFAULT_STARNET_TXMSG_SWITCH), -m_starNet6Reflector(DEFAULT_STARNET_REFLECTOR), -m_starNet7Band(DEFAULT_STARNET_BAND), -m_starNet7Callsign(DEFAULT_STARNET_CALLSIGN), -m_starNet7Logoff(DEFAULT_STARNET_LOGOFF), -m_starNet7Info(DEFAULT_STARNET_INFO), -m_starNet7Permanent(DEFAULT_STARNET_PERMANENT), -m_starNet7UserTimeout(DEFAULT_STARNET_USER_TIMEOUT), -m_starNet7GroupTimeout(DEFAULT_STARNET_GROUP_TIMEOUT), -m_starNet7CallsignSwitch(DEFAULT_STARNET_CALLSIGN_SWITCH), -m_starNet7TxMsgSwitch(DEFAULT_STARNET_TXMSG_SWITCH), -m_starNet7Reflector(DEFAULT_STARNET_REFLECTOR), -m_starNet8Band(DEFAULT_STARNET_BAND), -m_starNet8Callsign(DEFAULT_STARNET_CALLSIGN), -m_starNet8Logoff(DEFAULT_STARNET_LOGOFF), -m_starNet8Info(DEFAULT_STARNET_INFO), -m_starNet8Permanent(DEFAULT_STARNET_PERMANENT), -m_starNet8UserTimeout(DEFAULT_STARNET_USER_TIMEOUT), -m_starNet8GroupTimeout(DEFAULT_STARNET_GROUP_TIMEOUT), -m_starNet8CallsignSwitch(DEFAULT_STARNET_CALLSIGN_SWITCH), -m_starNet8TxMsgSwitch(DEFAULT_STARNET_TXMSG_SWITCH), -m_starNet8Reflector(DEFAULT_STARNET_REFLECTOR), -m_starNet9Band(DEFAULT_STARNET_BAND), -m_starNet9Callsign(DEFAULT_STARNET_CALLSIGN), -m_starNet9Logoff(DEFAULT_STARNET_LOGOFF), -m_starNet9Info(DEFAULT_STARNET_INFO), -m_starNet9Permanent(DEFAULT_STARNET_PERMANENT), -m_starNet9UserTimeout(DEFAULT_STARNET_USER_TIMEOUT), -m_starNet9GroupTimeout(DEFAULT_STARNET_GROUP_TIMEOUT), -m_starNet9CallsignSwitch(DEFAULT_STARNET_CALLSIGN_SWITCH), -m_starNet9TxMsgSwitch(DEFAULT_STARNET_TXMSG_SWITCH), -m_starNet9Reflector(DEFAULT_STARNET_REFLECTOR), -m_starNet10Band(DEFAULT_STARNET_BAND), -m_starNet10Callsign(DEFAULT_STARNET_CALLSIGN), -m_starNet10Logoff(DEFAULT_STARNET_LOGOFF), -m_starNet10Info(DEFAULT_STARNET_INFO), -m_starNet10Permanent(DEFAULT_STARNET_PERMANENT), -m_starNet10UserTimeout(DEFAULT_STARNET_USER_TIMEOUT), -m_starNet10GroupTimeout(DEFAULT_STARNET_GROUP_TIMEOUT), -m_starNet10CallsignSwitch(DEFAULT_STARNET_CALLSIGN_SWITCH), -m_starNet10TxMsgSwitch(DEFAULT_STARNET_TXMSG_SWITCH), -m_starNet10Reflector(DEFAULT_STARNET_REFLECTOR), -m_starNet11Band(DEFAULT_STARNET_BAND), -m_starNet11Callsign(DEFAULT_STARNET_CALLSIGN), -m_starNet11Logoff(DEFAULT_STARNET_LOGOFF), -m_starNet11Info(DEFAULT_STARNET_INFO), -m_starNet11Permanent(DEFAULT_STARNET_PERMANENT), -m_starNet11UserTimeout(DEFAULT_STARNET_USER_TIMEOUT), -m_starNet11GroupTimeout(DEFAULT_STARNET_GROUP_TIMEOUT), -m_starNet11CallsignSwitch(DEFAULT_STARNET_CALLSIGN_SWITCH), -m_starNet11TxMsgSwitch(DEFAULT_STARNET_TXMSG_SWITCH), -m_starNet11Reflector(DEFAULT_STARNET_REFLECTOR), -m_starNet12Band(DEFAULT_STARNET_BAND), -m_starNet12Callsign(DEFAULT_STARNET_CALLSIGN), -m_starNet12Logoff(DEFAULT_STARNET_LOGOFF), -m_starNet12Info(DEFAULT_STARNET_INFO), -m_starNet12Permanent(DEFAULT_STARNET_PERMANENT), -m_starNet12UserTimeout(DEFAULT_STARNET_USER_TIMEOUT), -m_starNet12GroupTimeout(DEFAULT_STARNET_GROUP_TIMEOUT), -m_starNet12CallsignSwitch(DEFAULT_STARNET_CALLSIGN_SWITCH), -m_starNet12TxMsgSwitch(DEFAULT_STARNET_TXMSG_SWITCH), -m_starNet12Reflector(DEFAULT_STARNET_REFLECTOR), -m_starNet13Band(DEFAULT_STARNET_BAND), -m_starNet13Callsign(DEFAULT_STARNET_CALLSIGN), -m_starNet13Logoff(DEFAULT_STARNET_LOGOFF), -m_starNet13Info(DEFAULT_STARNET_INFO), -m_starNet13Permanent(DEFAULT_STARNET_PERMANENT), -m_starNet13UserTimeout(DEFAULT_STARNET_USER_TIMEOUT), -m_starNet13GroupTimeout(DEFAULT_STARNET_GROUP_TIMEOUT), -m_starNet13CallsignSwitch(DEFAULT_STARNET_CALLSIGN_SWITCH), -m_starNet13TxMsgSwitch(DEFAULT_STARNET_TXMSG_SWITCH), -m_starNet13Reflector(DEFAULT_STARNET_REFLECTOR), -m_starNet14Band(DEFAULT_STARNET_BAND), -m_starNet14Callsign(DEFAULT_STARNET_CALLSIGN), -m_starNet14Logoff(DEFAULT_STARNET_LOGOFF), -m_starNet14Info(DEFAULT_STARNET_INFO), -m_starNet14Permanent(DEFAULT_STARNET_PERMANENT), -m_starNet14UserTimeout(DEFAULT_STARNET_USER_TIMEOUT), -m_starNet14GroupTimeout(DEFAULT_STARNET_GROUP_TIMEOUT), -m_starNet14CallsignSwitch(DEFAULT_STARNET_CALLSIGN_SWITCH), -m_starNet14TxMsgSwitch(DEFAULT_STARNET_TXMSG_SWITCH), -m_starNet14Reflector(DEFAULT_STARNET_REFLECTOR), -m_starNet15Band(DEFAULT_STARNET_BAND), -m_starNet15Callsign(DEFAULT_STARNET_CALLSIGN), -m_starNet15Logoff(DEFAULT_STARNET_LOGOFF), -m_starNet15Info(DEFAULT_STARNET_INFO), -m_starNet15Permanent(DEFAULT_STARNET_PERMANENT), -m_starNet15UserTimeout(DEFAULT_STARNET_USER_TIMEOUT), -m_starNet15GroupTimeout(DEFAULT_STARNET_GROUP_TIMEOUT), -m_starNet15CallsignSwitch(DEFAULT_STARNET_CALLSIGN_SWITCH), -m_starNet15TxMsgSwitch(DEFAULT_STARNET_TXMSG_SWITCH), -m_starNet15Reflector(DEFAULT_STARNET_REFLECTOR), -m_remoteEnabled(DEFAULT_REMOTE_ENABLED), -m_remotePassword(DEFAULT_REMOTE_PASSWORD), -m_remotePort(DEFAULT_REMOTE_PORT), -m_logEnabled(DEFAULT_LOG_ENABLED), -m_x(DEFAULT_WINDOW_X), -m_y(DEFAULT_WINDOW_Y) -{ - wxASSERT(!dir.IsEmpty()); - - m_fileName.Assign(dir, CONFIG_FILE_NAME); - - wxTextFile file(m_fileName.GetFullPath()); - - bool exists = file.Exists(); - if (!exists) - return; - - bool ret = file.Open(); - if (!ret) { - wxLogError(wxT("Cannot open the config file - %s"), m_fileName.GetFullPath().c_str()); - return; - } - - long temp1; - unsigned long temp2; - - wxString str = file.GetFirstLine(); - - while (!file.Eof()) { - if (str.GetChar(0U) == wxT('#')) { - str = file.GetNextLine(); - continue; - } - - int n = str.Find(wxT('=')); - if (n == wxNOT_FOUND) { - str = file.GetNextLine(); - continue; - } - - wxString key = str.Left(n); - wxString val = str.Mid(n + 1U); - - if (key.IsSameAs(KEY_CALLSIGN)) { - m_callsign = val; - } else if (key.IsSameAs(KEY_ADDRESS)) { - m_address = val; - } else if (key.IsSameAs(KEY_IRCDDB_HOSTNAME)) { - m_ircddbHostname = val; - } else if (key.IsSameAs(KEY_IRCDDB_USERNAME)) { - m_ircddbUsername = val; - } else if (key.IsSameAs(KEY_IRCDDB_PASSWORD)) { - m_ircddbPassword = val; - } else if (key.IsSameAs(KEY_STARNET_BAND1)) { - m_starNet1Band = val; - } else if (key.IsSameAs(KEY_STARNET_CALLSIGN1)) { - m_starNet1Callsign = val; - } else if (key.IsSameAs(KEY_STARNET_LOGOFF1)) { - m_starNet1Logoff = val; - } else if (key.IsSameAs(KEY_STARNET_INFO1)) { - m_starNet1Info = val; - } else if (key.IsSameAs(KEY_STARNET_PERMANENT1)) { - m_starNet1Permanent = val; - } else if (key.IsSameAs(KEY_STARNET_USER_TIMEOUT1)) { - val.ToULong(&temp2); - m_starNet1UserTimeout = (unsigned int)temp2; - } else if (key.IsSameAs(KEY_STARNET_GROUP_TIMEOUT1)) { - val.ToULong(&temp2); - m_starNet1GroupTimeout = (unsigned int)temp2; - } else if (key.IsSameAs(KEY_STARNET_CALLSIGN_SWITCH1)) { - val.ToLong(&temp1); - m_starNet1CallsignSwitch = STARNET_CALLSIGN_SWITCH(temp1); - } else if (key.IsSameAs(KEY_STARNET_TXMSG_SWITCH1)) { - val.ToLong(&temp1); - m_starNet1TxMsgSwitch = temp1 == 1L; - } else if (key.IsSameAs(KEY_STARNET_REFLECTOR1)) { - m_starNet1Reflector = val; - } else if (key.IsSameAs(KEY_STARNET_BAND2)) { - m_starNet2Band = val; - } else if (key.IsSameAs(KEY_STARNET_CALLSIGN2)) { - m_starNet2Callsign = val; - } else if (key.IsSameAs(KEY_STARNET_LOGOFF2)) { - m_starNet2Logoff = val; - } else if (key.IsSameAs(KEY_STARNET_INFO2)) { - m_starNet2Info = val; - } else if (key.IsSameAs(KEY_STARNET_PERMANENT2)) { - m_starNet2Permanent = val; - } else if (key.IsSameAs(KEY_STARNET_USER_TIMEOUT2)) { - val.ToULong(&temp2); - m_starNet2UserTimeout = (unsigned int)temp2; - } else if (key.IsSameAs(KEY_STARNET_GROUP_TIMEOUT2)) { - val.ToULong(&temp2); - m_starNet2GroupTimeout = (unsigned int)temp2; - } else if (key.IsSameAs(KEY_STARNET_CALLSIGN_SWITCH2)) { - val.ToLong(&temp1); - m_starNet2CallsignSwitch = STARNET_CALLSIGN_SWITCH(temp1); - } else if (key.IsSameAs(KEY_STARNET_TXMSG_SWITCH2)) { - val.ToLong(&temp1); - m_starNet2TxMsgSwitch = temp1 == 1L; - } else if (key.IsSameAs(KEY_STARNET_REFLECTOR2)) { - m_starNet2Reflector = val; - } else if (key.IsSameAs(KEY_STARNET_BAND3)) { - m_starNet3Band = val; - } else if (key.IsSameAs(KEY_STARNET_CALLSIGN3)) { - m_starNet3Callsign = val; - } else if (key.IsSameAs(KEY_STARNET_LOGOFF3)) { - m_starNet3Logoff = val; - } else if (key.IsSameAs(KEY_STARNET_INFO3)) { - m_starNet3Info = val; - } else if (key.IsSameAs(KEY_STARNET_PERMANENT3)) { - m_starNet3Permanent = val; - } else if (key.IsSameAs(KEY_STARNET_USER_TIMEOUT3)) { - val.ToULong(&temp2); - m_starNet3UserTimeout = (unsigned int)temp2; - } else if (key.IsSameAs(KEY_STARNET_GROUP_TIMEOUT3)) { - val.ToULong(&temp2); - m_starNet3GroupTimeout = (unsigned int)temp2; - } else if (key.IsSameAs(KEY_STARNET_CALLSIGN_SWITCH3)) { - val.ToLong(&temp1); - m_starNet3CallsignSwitch = STARNET_CALLSIGN_SWITCH(temp1); - } else if (key.IsSameAs(KEY_STARNET_TXMSG_SWITCH3)) { - val.ToLong(&temp1); - m_starNet3TxMsgSwitch = temp1 == 1L; - } else if (key.IsSameAs(KEY_STARNET_REFLECTOR3)) { - m_starNet3Reflector = val; - } else if (key.IsSameAs(KEY_STARNET_BAND4)) { - m_starNet4Band = val; - } else if (key.IsSameAs(KEY_STARNET_CALLSIGN4)) { - m_starNet4Callsign = val; - } else if (key.IsSameAs(KEY_STARNET_LOGOFF4)) { - m_starNet4Logoff = val; - } else if (key.IsSameAs(KEY_STARNET_INFO4)) { - m_starNet4Info = val; - } else if (key.IsSameAs(KEY_STARNET_PERMANENT4)) { - m_starNet4Permanent = val; - } else if (key.IsSameAs(KEY_STARNET_USER_TIMEOUT4)) { - val.ToULong(&temp2); - m_starNet4UserTimeout = (unsigned int)temp2; - } else if (key.IsSameAs(KEY_STARNET_GROUP_TIMEOUT4)) { - val.ToULong(&temp2); - m_starNet4GroupTimeout = (unsigned int)temp2; - } else if (key.IsSameAs(KEY_STARNET_CALLSIGN_SWITCH4)) { - val.ToLong(&temp1); - m_starNet4CallsignSwitch = STARNET_CALLSIGN_SWITCH(temp1); - } else if (key.IsSameAs(KEY_STARNET_TXMSG_SWITCH4)) { - val.ToLong(&temp1); - m_starNet4TxMsgSwitch = temp1 == 1L; - } else if (key.IsSameAs(KEY_STARNET_REFLECTOR4)) { - m_starNet4Reflector = val; - } else if (key.IsSameAs(KEY_STARNET_BAND5)) { - m_starNet5Band = val; - } else if (key.IsSameAs(KEY_STARNET_CALLSIGN5)) { - m_starNet5Callsign = val; - } else if (key.IsSameAs(KEY_STARNET_LOGOFF5)) { - m_starNet5Logoff = val; - } else if (key.IsSameAs(KEY_STARNET_INFO5)) { - m_starNet5Info = val; - } else if (key.IsSameAs(KEY_STARNET_PERMANENT5)) { - m_starNet5Permanent = val; - } else if (key.IsSameAs(KEY_STARNET_USER_TIMEOUT5)) { - val.ToULong(&temp2); - m_starNet5UserTimeout = (unsigned int)temp2; - } else if (key.IsSameAs(KEY_STARNET_GROUP_TIMEOUT5)) { - val.ToULong(&temp2); - m_starNet5GroupTimeout = (unsigned int)temp2; - } else if (key.IsSameAs(KEY_STARNET_CALLSIGN_SWITCH5)) { - val.ToLong(&temp1); - m_starNet5CallsignSwitch = STARNET_CALLSIGN_SWITCH(temp1); - } else if (key.IsSameAs(KEY_STARNET_TXMSG_SWITCH5)) { - val.ToLong(&temp1); - m_starNet5TxMsgSwitch = temp1 == 1L; - } else if (key.IsSameAs(KEY_STARNET_REFLECTOR5)) { - m_starNet5Reflector = val; - } else if (key.IsSameAs(KEY_STARNET_BAND6)) { - m_starNet6Band = val; - } else if (key.IsSameAs(KEY_STARNET_CALLSIGN6)) { - m_starNet6Callsign = val; - } else if (key.IsSameAs(KEY_STARNET_LOGOFF6)) { - m_starNet6Logoff = val; - } else if (key.IsSameAs(KEY_STARNET_INFO6)) { - m_starNet6Info = val; - } else if (key.IsSameAs(KEY_STARNET_PERMANENT6)) { - m_starNet6Permanent = val; - } else if (key.IsSameAs(KEY_STARNET_USER_TIMEOUT6)) { - val.ToULong(&temp2); - m_starNet6UserTimeout = (unsigned int)temp2; - } else if (key.IsSameAs(KEY_STARNET_GROUP_TIMEOUT6)) { - val.ToULong(&temp2); - m_starNet6GroupTimeout = (unsigned int)temp2; - } else if (key.IsSameAs(KEY_STARNET_CALLSIGN_SWITCH6)) { - val.ToLong(&temp1); - m_starNet6CallsignSwitch = STARNET_CALLSIGN_SWITCH(temp1); - } else if (key.IsSameAs(KEY_STARNET_TXMSG_SWITCH6)) { - val.ToLong(&temp1); - m_starNet6TxMsgSwitch = temp1 == 1L; - } else if (key.IsSameAs(KEY_STARNET_REFLECTOR6)) { - m_starNet6Reflector = val; - } else if (key.IsSameAs(KEY_STARNET_BAND7)) { - m_starNet7Band = val; - } else if (key.IsSameAs(KEY_STARNET_CALLSIGN7)) { - m_starNet7Callsign = val; - } else if (key.IsSameAs(KEY_STARNET_LOGOFF7)) { - m_starNet7Logoff = val; - } else if (key.IsSameAs(KEY_STARNET_INFO7)) { - m_starNet7Info = val; - } else if (key.IsSameAs(KEY_STARNET_PERMANENT7)) { - m_starNet7Permanent = val; - } else if (key.IsSameAs(KEY_STARNET_USER_TIMEOUT7)) { - val.ToULong(&temp2); - m_starNet7UserTimeout = (unsigned int)temp2; - } else if (key.IsSameAs(KEY_STARNET_GROUP_TIMEOUT7)) { - val.ToULong(&temp2); - m_starNet7GroupTimeout = (unsigned int)temp2; - } else if (key.IsSameAs(KEY_STARNET_CALLSIGN_SWITCH7)) { - val.ToLong(&temp1); - m_starNet7CallsignSwitch = STARNET_CALLSIGN_SWITCH(temp1); - } else if (key.IsSameAs(KEY_STARNET_TXMSG_SWITCH7)) { - val.ToLong(&temp1); - m_starNet7TxMsgSwitch = temp1 == 1L; - } else if (key.IsSameAs(KEY_STARNET_REFLECTOR7)) { - m_starNet7Reflector = val; - } else if (key.IsSameAs(KEY_STARNET_BAND8)) { - m_starNet8Band = val; - } else if (key.IsSameAs(KEY_STARNET_CALLSIGN8)) { - m_starNet8Callsign = val; - } else if (key.IsSameAs(KEY_STARNET_LOGOFF8)) { - m_starNet8Logoff = val; - } else if (key.IsSameAs(KEY_STARNET_INFO8)) { - m_starNet8Info = val; - } else if (key.IsSameAs(KEY_STARNET_PERMANENT8)) { - m_starNet8Permanent = val; - } else if (key.IsSameAs(KEY_STARNET_USER_TIMEOUT8)) { - val.ToULong(&temp2); - m_starNet8UserTimeout = (unsigned int)temp2; - } else if (key.IsSameAs(KEY_STARNET_GROUP_TIMEOUT8)) { - val.ToULong(&temp2); - m_starNet8GroupTimeout = (unsigned int)temp2; - } else if (key.IsSameAs(KEY_STARNET_CALLSIGN_SWITCH8)) { - val.ToLong(&temp1); - m_starNet8CallsignSwitch = STARNET_CALLSIGN_SWITCH(temp1); - } else if (key.IsSameAs(KEY_STARNET_TXMSG_SWITCH8)) { - val.ToLong(&temp1); - m_starNet8TxMsgSwitch = temp1 == 1L; - } else if (key.IsSameAs(KEY_STARNET_REFLECTOR8)) { - m_starNet8Reflector = val; - } else if (key.IsSameAs(KEY_STARNET_BAND9)) { - m_starNet9Band = val; - } else if (key.IsSameAs(KEY_STARNET_CALLSIGN9)) { - m_starNet9Callsign = val; - } else if (key.IsSameAs(KEY_STARNET_LOGOFF9)) { - m_starNet9Logoff = val; - } else if (key.IsSameAs(KEY_STARNET_INFO9)) { - m_starNet9Info = val; - } else if (key.IsSameAs(KEY_STARNET_PERMANENT9)) { - m_starNet9Permanent = val; - } else if (key.IsSameAs(KEY_STARNET_USER_TIMEOUT9)) { - val.ToULong(&temp2); - m_starNet9UserTimeout = (unsigned int)temp2; - } else if (key.IsSameAs(KEY_STARNET_GROUP_TIMEOUT9)) { - val.ToULong(&temp2); - m_starNet9GroupTimeout = (unsigned int)temp2; - } else if (key.IsSameAs(KEY_STARNET_CALLSIGN_SWITCH9)) { - val.ToLong(&temp1); - m_starNet9CallsignSwitch = STARNET_CALLSIGN_SWITCH(temp1); - } else if (key.IsSameAs(KEY_STARNET_TXMSG_SWITCH9)) { - val.ToLong(&temp1); - m_starNet9TxMsgSwitch = temp1 == 1L; - } else if (key.IsSameAs(KEY_STARNET_REFLECTOR9)) { - m_starNet9Reflector = val; - } else if (key.IsSameAs(KEY_STARNET_BAND10)) { - m_starNet10Band = val; - } else if (key.IsSameAs(KEY_STARNET_CALLSIGN10)) { - m_starNet10Callsign = val; - } else if (key.IsSameAs(KEY_STARNET_LOGOFF10)) { - m_starNet10Logoff = val; - } else if (key.IsSameAs(KEY_STARNET_INFO10)) { - m_starNet10Info = val; - } else if (key.IsSameAs(KEY_STARNET_PERMANENT10)) { - m_starNet10Permanent = val; - } else if (key.IsSameAs(KEY_STARNET_USER_TIMEOUT10)) { - val.ToULong(&temp2); - m_starNet10UserTimeout = (unsigned int)temp2; - } else if (key.IsSameAs(KEY_STARNET_GROUP_TIMEOUT10)) { - val.ToULong(&temp2); - m_starNet10GroupTimeout = (unsigned int)temp2; - } else if (key.IsSameAs(KEY_STARNET_CALLSIGN_SWITCH10)) { - val.ToLong(&temp1); - m_starNet10CallsignSwitch = STARNET_CALLSIGN_SWITCH(temp1); - } else if (key.IsSameAs(KEY_STARNET_TXMSG_SWITCH10)) { - val.ToLong(&temp1); - m_starNet10TxMsgSwitch = temp1 == 1L; - } else if (key.IsSameAs(KEY_STARNET_REFLECTOR10)) { - m_starNet10Reflector = val; - } else if (key.IsSameAs(KEY_STARNET_BAND11)) { - m_starNet11Band = val; - } else if (key.IsSameAs(KEY_STARNET_CALLSIGN11)) { - m_starNet11Callsign = val; - } else if (key.IsSameAs(KEY_STARNET_LOGOFF11)) { - m_starNet11Logoff = val; - } else if (key.IsSameAs(KEY_STARNET_INFO11)) { - m_starNet11Info = val; - } else if (key.IsSameAs(KEY_STARNET_PERMANENT11)) { - m_starNet11Permanent = val; - } else if (key.IsSameAs(KEY_STARNET_USER_TIMEOUT11)) { - val.ToULong(&temp2); - m_starNet11UserTimeout = (unsigned int)temp2; - } else if (key.IsSameAs(KEY_STARNET_GROUP_TIMEOUT11)) { - val.ToULong(&temp2); - m_starNet11GroupTimeout = (unsigned int)temp2; - } else if (key.IsSameAs(KEY_STARNET_CALLSIGN_SWITCH11)) { - val.ToLong(&temp1); - m_starNet11CallsignSwitch = STARNET_CALLSIGN_SWITCH(temp1); - } else if (key.IsSameAs(KEY_STARNET_TXMSG_SWITCH11)) { - val.ToLong(&temp1); - m_starNet11TxMsgSwitch = temp1 == 1L; - } else if (key.IsSameAs(KEY_STARNET_REFLECTOR11)) { - m_starNet11Reflector = val; - } else if (key.IsSameAs(KEY_STARNET_BAND12)) { - m_starNet12Band = val; - } else if (key.IsSameAs(KEY_STARNET_CALLSIGN12)) { - m_starNet12Callsign = val; - } else if (key.IsSameAs(KEY_STARNET_LOGOFF12)) { - m_starNet12Logoff = val; - } else if (key.IsSameAs(KEY_STARNET_INFO12)) { - m_starNet12Info = val; - } else if (key.IsSameAs(KEY_STARNET_PERMANENT12)) { - m_starNet12Permanent = val; - } else if (key.IsSameAs(KEY_STARNET_USER_TIMEOUT12)) { - val.ToULong(&temp2); - m_starNet12UserTimeout = (unsigned int)temp2; - } else if (key.IsSameAs(KEY_STARNET_GROUP_TIMEOUT12)) { - val.ToULong(&temp2); - m_starNet12GroupTimeout = (unsigned int)temp2; - } else if (key.IsSameAs(KEY_STARNET_CALLSIGN_SWITCH12)) { - val.ToLong(&temp1); - m_starNet12CallsignSwitch = STARNET_CALLSIGN_SWITCH(temp1); - } else if (key.IsSameAs(KEY_STARNET_TXMSG_SWITCH12)) { - val.ToLong(&temp1); - m_starNet12TxMsgSwitch = temp1 == 1L; - } else if (key.IsSameAs(KEY_STARNET_REFLECTOR12)) { - m_starNet12Reflector = val; - } else if (key.IsSameAs(KEY_STARNET_BAND13)) { - m_starNet13Band = val; - } else if (key.IsSameAs(KEY_STARNET_CALLSIGN13)) { - m_starNet13Callsign = val; - } else if (key.IsSameAs(KEY_STARNET_LOGOFF13)) { - m_starNet13Logoff = val; - } else if (key.IsSameAs(KEY_STARNET_INFO13)) { - m_starNet13Info = val; - } else if (key.IsSameAs(KEY_STARNET_PERMANENT13)) { - m_starNet13Permanent = val; - } else if (key.IsSameAs(KEY_STARNET_USER_TIMEOUT13)) { - val.ToULong(&temp2); - m_starNet13UserTimeout = (unsigned int)temp2; - } else if (key.IsSameAs(KEY_STARNET_GROUP_TIMEOUT13)) { - val.ToULong(&temp2); - m_starNet13GroupTimeout = (unsigned int)temp2; - } else if (key.IsSameAs(KEY_STARNET_CALLSIGN_SWITCH13)) { - val.ToLong(&temp1); - m_starNet13CallsignSwitch = STARNET_CALLSIGN_SWITCH(temp1); - } else if (key.IsSameAs(KEY_STARNET_TXMSG_SWITCH13)) { - val.ToLong(&temp1); - m_starNet13TxMsgSwitch = temp1 == 1L; - } else if (key.IsSameAs(KEY_STARNET_REFLECTOR13)) { - m_starNet13Reflector = val; - } else if (key.IsSameAs(KEY_STARNET_BAND14)) { - m_starNet14Band = val; - } else if (key.IsSameAs(KEY_STARNET_CALLSIGN14)) { - m_starNet14Callsign = val; - } else if (key.IsSameAs(KEY_STARNET_LOGOFF14)) { - m_starNet14Logoff = val; - } else if (key.IsSameAs(KEY_STARNET_INFO14)) { - m_starNet14Info = val; - } else if (key.IsSameAs(KEY_STARNET_PERMANENT14)) { - m_starNet14Permanent = val; - } else if (key.IsSameAs(KEY_STARNET_USER_TIMEOUT14)) { - val.ToULong(&temp2); - m_starNet14UserTimeout = (unsigned int)temp2; - } else if (key.IsSameAs(KEY_STARNET_GROUP_TIMEOUT14)) { - val.ToULong(&temp2); - m_starNet14GroupTimeout = (unsigned int)temp2; - } else if (key.IsSameAs(KEY_STARNET_CALLSIGN_SWITCH14)) { - val.ToLong(&temp1); - m_starNet14CallsignSwitch = STARNET_CALLSIGN_SWITCH(temp1); - } else if (key.IsSameAs(KEY_STARNET_TXMSG_SWITCH14)) { - val.ToLong(&temp1); - m_starNet14TxMsgSwitch = temp1 == 1L; - } else if (key.IsSameAs(KEY_STARNET_REFLECTOR14)) { - m_starNet14Reflector = val; - } else if (key.IsSameAs(KEY_STARNET_BAND15)) { - m_starNet15Band = val; - } else if (key.IsSameAs(KEY_STARNET_CALLSIGN15)) { - m_starNet15Callsign = val; - } else if (key.IsSameAs(KEY_STARNET_LOGOFF15)) { - m_starNet15Logoff = val; - } else if (key.IsSameAs(KEY_STARNET_INFO15)) { - m_starNet15Info = val; - } else if (key.IsSameAs(KEY_STARNET_PERMANENT15)) { - m_starNet15Permanent = val; - } else if (key.IsSameAs(KEY_STARNET_USER_TIMEOUT15)) { - val.ToULong(&temp2); - m_starNet15UserTimeout = (unsigned int)temp2; - } else if (key.IsSameAs(KEY_STARNET_GROUP_TIMEOUT15)) { - val.ToULong(&temp2); - m_starNet15GroupTimeout = (unsigned int)temp2; - } else if (key.IsSameAs(KEY_STARNET_CALLSIGN_SWITCH15)) { - val.ToLong(&temp1); - m_starNet15CallsignSwitch = STARNET_CALLSIGN_SWITCH(temp1); - } else if (key.IsSameAs(KEY_STARNET_TXMSG_SWITCH15)) { - val.ToLong(&temp1); - m_starNet15TxMsgSwitch = temp1 == 1L; - } else if (key.IsSameAs(KEY_STARNET_REFLECTOR15)) { - m_starNet15Reflector = val; - } else if (key.IsSameAs(KEY_REMOTE_ENABLED)) { - val.ToLong(&temp1); - m_remoteEnabled = temp1 == 1L; - } else if (key.IsSameAs(KEY_REMOTE_PASSWORD)) { - m_remotePassword = val; - } else if (key.IsSameAs(KEY_REMOTE_PORT)) { - val.ToULong(&temp2); - m_remotePort = (unsigned int)temp2; - } else if (key.IsSameAs(KEY_LOG_ENABLED)) { - val.ToLong(&temp1); - m_logEnabled = temp1 == 1L; - } else if (key.IsSameAs(KEY_WINDOW_X)) { - val.ToLong(&temp1); - m_x = int(temp1); - } else if (key.IsSameAs(KEY_WINDOW_Y)) { - val.ToLong(&temp1); - m_y = int(temp1); - } - - str = file.GetNextLine(); - } - - file.Close(); -} - -CStarNetServerConfig::~CStarNetServerConfig() -{ -} - -#endif - -void CStarNetServerConfig::getGateway(wxString& callsign, wxString& address) const -{ - callsign = m_callsign; - address = m_address; -} - -void CStarNetServerConfig::setGateway(const wxString& callsign, const wxString& address) -{ - m_callsign = callsign; - m_address = address; -} - -void CStarNetServerConfig::getIrcDDB(wxString& hostname, wxString& username, wxString& password) const -{ - hostname = m_ircddbHostname; - username = m_ircddbUsername; - password = m_ircddbPassword; -} - -void CStarNetServerConfig::setIrcDDB(const wxString& hostname, const wxString& username, const wxString& password) -{ - m_ircddbHostname = hostname; - m_ircddbUsername = username; - m_ircddbPassword = password; -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -void CStarNetServerConfig::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 -#else -void CStarNetServerConfig::getStarNet1(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const -#endif -{ - band = m_starNet1Band; - callsign = m_starNet1Callsign; - logoff = m_starNet1Logoff; - info = m_starNet1Info; - permanent = m_starNet1Permanent; - userTimeout = m_starNet1UserTimeout; - groupTimeout = m_starNet1GroupTimeout; - callsignSwitch = m_starNet1CallsignSwitch; - txMsgSwitch = m_starNet1TxMsgSwitch; - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - reflector = m_starNet1Reflector; -#endif -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -void CStarNetServerConfig::setStarNet1(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector) -#else -void CStarNetServerConfig::setStarNet1(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch) -#endif -{ - m_starNet1Band = band; - m_starNet1Callsign = callsign; - m_starNet1Logoff = logoff; - m_starNet1Info = info; - m_starNet1Permanent = permanent; - m_starNet1UserTimeout = userTimeout; - m_starNet1GroupTimeout = groupTimeout; - m_starNet1CallsignSwitch = callsignSwitch; - m_starNet1TxMsgSwitch = txMsgSwitch; - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - m_starNet1Reflector = reflector; -#endif -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -void CStarNetServerConfig::getStarNet2(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 -#else -void CStarNetServerConfig::getStarNet2(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const -#endif -{ - band = m_starNet2Band; - callsign = m_starNet2Callsign; - logoff = m_starNet2Logoff; - info = m_starNet2Info; - permanent = m_starNet2Permanent; - userTimeout = m_starNet2UserTimeout; - groupTimeout = m_starNet2GroupTimeout; - callsignSwitch = m_starNet2CallsignSwitch; - txMsgSwitch = m_starNet2TxMsgSwitch; - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - reflector = m_starNet2Reflector; -#endif -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -void CStarNetServerConfig::setStarNet2(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector) -#else -void CStarNetServerConfig::setStarNet2(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch) -#endif -{ - m_starNet2Band = band; - m_starNet2Callsign = callsign; - m_starNet2Logoff = logoff; - m_starNet2Info = info; - m_starNet2Permanent = permanent; - m_starNet2UserTimeout = userTimeout; - m_starNet2GroupTimeout = groupTimeout; - m_starNet2CallsignSwitch = callsignSwitch; - m_starNet2TxMsgSwitch = txMsgSwitch; - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - m_starNet2Reflector = reflector; -#endif -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -void CStarNetServerConfig::getStarNet3(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 -#else -void CStarNetServerConfig::getStarNet3(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const -#endif -{ - band = m_starNet3Band; - callsign = m_starNet3Callsign; - logoff = m_starNet3Logoff; - info = m_starNet3Info; - permanent = m_starNet3Permanent; - userTimeout = m_starNet3UserTimeout; - groupTimeout = m_starNet3GroupTimeout; - callsignSwitch = m_starNet3CallsignSwitch; - txMsgSwitch = m_starNet3TxMsgSwitch; - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - reflector = m_starNet3Reflector; -#endif -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -void CStarNetServerConfig::setStarNet3(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector) -#else -void CStarNetServerConfig::setStarNet3(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch) -#endif -{ - m_starNet3Band = band; - m_starNet3Callsign = callsign; - m_starNet3Logoff = logoff; - m_starNet3Info = info; - m_starNet3Permanent = permanent; - m_starNet3UserTimeout = userTimeout; - m_starNet3GroupTimeout = groupTimeout; - m_starNet3CallsignSwitch = callsignSwitch; - m_starNet3TxMsgSwitch = txMsgSwitch; - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - m_starNet3Reflector = reflector; -#endif -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -void CStarNetServerConfig::getStarNet4(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 -#else -void CStarNetServerConfig::getStarNet4(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const -#endif -{ - band = m_starNet4Band; - callsign = m_starNet4Callsign; - logoff = m_starNet4Logoff; - info = m_starNet4Info; - permanent = m_starNet4Permanent; - userTimeout = m_starNet4UserTimeout; - groupTimeout = m_starNet4GroupTimeout; - callsignSwitch = m_starNet4CallsignSwitch; - txMsgSwitch = m_starNet4TxMsgSwitch; - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - reflector = m_starNet4Reflector; -#endif -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -void CStarNetServerConfig::setStarNet4(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector) -#else -void CStarNetServerConfig::setStarNet4(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch) -#endif -{ - m_starNet4Band = band; - m_starNet4Callsign = callsign; - m_starNet4Logoff = logoff; - m_starNet4Info = info; - m_starNet4Permanent = permanent; - m_starNet4UserTimeout = userTimeout; - m_starNet4GroupTimeout = groupTimeout; - m_starNet4CallsignSwitch = callsignSwitch; - m_starNet4TxMsgSwitch = txMsgSwitch; - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - m_starNet4Reflector = reflector; -#endif -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -void CStarNetServerConfig::getStarNet5(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 -#else -void CStarNetServerConfig::getStarNet5(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const -#endif -{ - band = m_starNet5Band; - callsign = m_starNet5Callsign; - logoff = m_starNet5Logoff; - info = m_starNet5Info; - permanent = m_starNet5Permanent; - userTimeout = m_starNet5UserTimeout; - groupTimeout = m_starNet5GroupTimeout; - callsignSwitch = m_starNet5CallsignSwitch; - txMsgSwitch = m_starNet5TxMsgSwitch; - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - reflector = m_starNet5Reflector; -#endif -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -void CStarNetServerConfig::setStarNet5(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector) -#else -void CStarNetServerConfig::setStarNet5(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch) -#endif -{ - m_starNet5Band = band; - m_starNet5Callsign = callsign; - m_starNet5Logoff = logoff; - m_starNet5Info = info; - m_starNet5Permanent = permanent; - m_starNet5UserTimeout = userTimeout; - m_starNet5GroupTimeout = groupTimeout; - m_starNet5CallsignSwitch = callsignSwitch; - m_starNet5TxMsgSwitch = txMsgSwitch; - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - m_starNet5Reflector = reflector; -#endif -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -void CStarNetServerConfig::getStarNet6(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 -#else -void CStarNetServerConfig::getStarNet6(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const -#endif -{ - band = m_starNet6Band; - callsign = m_starNet6Callsign; - logoff = m_starNet6Logoff; - info = m_starNet6Info; - permanent = m_starNet6Permanent; - userTimeout = m_starNet6UserTimeout; - groupTimeout = m_starNet6GroupTimeout; - callsignSwitch = m_starNet6CallsignSwitch; - txMsgSwitch = m_starNet6TxMsgSwitch; - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - reflector = m_starNet6Reflector; -#endif -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -void CStarNetServerConfig::setStarNet6(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector) -#else -void CStarNetServerConfig::setStarNet6(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch) -#endif -{ - m_starNet6Band = band; - m_starNet6Callsign = callsign; - m_starNet6Logoff = logoff; - m_starNet6Info = info; - m_starNet6Permanent = permanent; - m_starNet6UserTimeout = userTimeout; - m_starNet6GroupTimeout = groupTimeout; - m_starNet6CallsignSwitch = callsignSwitch; - m_starNet6TxMsgSwitch = txMsgSwitch; - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - m_starNet6Reflector = reflector; -#endif -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -void CStarNetServerConfig::getStarNet7(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 -#else -void CStarNetServerConfig::getStarNet7(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const -#endif -{ - band = m_starNet7Band; - callsign = m_starNet7Callsign; - logoff = m_starNet7Logoff; - info = m_starNet7Info; - permanent = m_starNet7Permanent; - userTimeout = m_starNet7UserTimeout; - groupTimeout = m_starNet7GroupTimeout; - callsignSwitch = m_starNet7CallsignSwitch; - txMsgSwitch = m_starNet7TxMsgSwitch; - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - reflector = m_starNet7Reflector; -#endif -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -void CStarNetServerConfig::setStarNet7(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector) -#else -void CStarNetServerConfig::setStarNet7(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch) -#endif -{ - m_starNet7Band = band; - m_starNet7Callsign = callsign; - m_starNet7Logoff = logoff; - m_starNet7Info = info; - m_starNet7Permanent = permanent; - m_starNet7UserTimeout = userTimeout; - m_starNet7GroupTimeout = groupTimeout; - m_starNet7CallsignSwitch = callsignSwitch; - m_starNet7TxMsgSwitch = txMsgSwitch; - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - m_starNet7Reflector = reflector; -#endif -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -void CStarNetServerConfig::getStarNet8(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 -#else -void CStarNetServerConfig::getStarNet8(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const -#endif -{ - band = m_starNet8Band; - callsign = m_starNet8Callsign; - logoff = m_starNet8Logoff; - info = m_starNet8Info; - permanent = m_starNet8Permanent; - userTimeout = m_starNet8UserTimeout; - groupTimeout = m_starNet8GroupTimeout; - callsignSwitch = m_starNet8CallsignSwitch; - txMsgSwitch = m_starNet8TxMsgSwitch; - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - reflector = m_starNet8Reflector; -#endif -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -void CStarNetServerConfig::setStarNet8(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector) -#else -void CStarNetServerConfig::setStarNet8(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch) -#endif -{ - m_starNet8Band = band; - m_starNet8Callsign = callsign; - m_starNet8Logoff = logoff; - m_starNet8Info = info; - m_starNet8Permanent = permanent; - m_starNet8UserTimeout = userTimeout; - m_starNet8GroupTimeout = groupTimeout; - m_starNet8CallsignSwitch = callsignSwitch; - m_starNet8TxMsgSwitch = txMsgSwitch; - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - m_starNet8Reflector = reflector; -#endif -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -void CStarNetServerConfig::getStarNet9(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 -#else -void CStarNetServerConfig::getStarNet9(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const -#endif -{ - band = m_starNet9Band; - callsign = m_starNet9Callsign; - logoff = m_starNet9Logoff; - info = m_starNet9Info; - permanent = m_starNet9Permanent; - userTimeout = m_starNet9UserTimeout; - groupTimeout = m_starNet9GroupTimeout; - callsignSwitch = m_starNet9CallsignSwitch; - txMsgSwitch = m_starNet9TxMsgSwitch; - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - reflector = m_starNet9Reflector; -#endif -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -void CStarNetServerConfig::setStarNet9(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector) -#else -void CStarNetServerConfig::setStarNet9(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch) -#endif -{ - m_starNet9Band = band; - m_starNet9Callsign = callsign; - m_starNet9Logoff = logoff; - m_starNet9Info = info; - m_starNet9Permanent = permanent; - m_starNet9UserTimeout = userTimeout; - m_starNet9GroupTimeout = groupTimeout; - m_starNet9CallsignSwitch = callsignSwitch; - m_starNet9TxMsgSwitch = txMsgSwitch; - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - m_starNet9Reflector = reflector; -#endif -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -void CStarNetServerConfig::getStarNet10(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 -#else -void CStarNetServerConfig::getStarNet10(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const -#endif -{ - band = m_starNet10Band; - callsign = m_starNet10Callsign; - logoff = m_starNet10Logoff; - info = m_starNet10Info; - permanent = m_starNet10Permanent; - userTimeout = m_starNet10UserTimeout; - groupTimeout = m_starNet10GroupTimeout; - callsignSwitch = m_starNet10CallsignSwitch; - txMsgSwitch = m_starNet10TxMsgSwitch; - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - reflector = m_starNet10Reflector; -#endif -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -void CStarNetServerConfig::setStarNet10(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector) -#else -void CStarNetServerConfig::setStarNet10(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch) -#endif -{ - m_starNet10Band = band; - m_starNet10Callsign = callsign; - m_starNet10Logoff = logoff; - m_starNet10Info = info; - m_starNet10Permanent = permanent; - m_starNet10UserTimeout = userTimeout; - m_starNet10GroupTimeout = groupTimeout; - m_starNet10CallsignSwitch = callsignSwitch; - m_starNet10TxMsgSwitch = txMsgSwitch; - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - m_starNet10Reflector = reflector; -#endif -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -void CStarNetServerConfig::getStarNet11(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 -#else -void CStarNetServerConfig::getStarNet11(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const -#endif -{ - band = m_starNet11Band; - callsign = m_starNet11Callsign; - logoff = m_starNet11Logoff; - info = m_starNet11Info; - permanent = m_starNet11Permanent; - userTimeout = m_starNet11UserTimeout; - groupTimeout = m_starNet11GroupTimeout; - callsignSwitch = m_starNet11CallsignSwitch; - txMsgSwitch = m_starNet11TxMsgSwitch; - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - reflector = m_starNet11Reflector; -#endif -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -void CStarNetServerConfig::setStarNet11(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector) -#else -void CStarNetServerConfig::setStarNet11(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch) -#endif -{ - m_starNet11Band = band; - m_starNet11Callsign = callsign; - m_starNet11Logoff = logoff; - m_starNet11Info = info; - m_starNet11Permanent = permanent; - m_starNet11UserTimeout = userTimeout; - m_starNet11GroupTimeout = groupTimeout; - m_starNet11CallsignSwitch = callsignSwitch; - m_starNet11TxMsgSwitch = txMsgSwitch; - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - m_starNet11Reflector = reflector; -#endif -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -void CStarNetServerConfig::getStarNet12(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 -#else -void CStarNetServerConfig::getStarNet12(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const -#endif -{ - band = m_starNet12Band; - callsign = m_starNet12Callsign; - logoff = m_starNet12Logoff; - info = m_starNet12Info; - permanent = m_starNet12Permanent; - userTimeout = m_starNet12UserTimeout; - groupTimeout = m_starNet12GroupTimeout; - callsignSwitch = m_starNet12CallsignSwitch; - txMsgSwitch = m_starNet12TxMsgSwitch; - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - reflector = m_starNet12Reflector; -#endif -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -void CStarNetServerConfig::setStarNet12(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector) -#else -void CStarNetServerConfig::setStarNet12(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch) -#endif -{ - m_starNet12Band = band; - m_starNet12Callsign = callsign; - m_starNet12Logoff = logoff; - m_starNet12Info = info; - m_starNet12Permanent = permanent; - m_starNet12UserTimeout = userTimeout; - m_starNet12GroupTimeout = groupTimeout; - m_starNet12CallsignSwitch = callsignSwitch; - m_starNet12TxMsgSwitch = txMsgSwitch; - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - m_starNet12Reflector = reflector; -#endif -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -void CStarNetServerConfig::getStarNet13(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 -#else -void CStarNetServerConfig::getStarNet13(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const -#endif -{ - band = m_starNet13Band; - callsign = m_starNet13Callsign; - logoff = m_starNet13Logoff; - info = m_starNet13Info; - permanent = m_starNet13Permanent; - userTimeout = m_starNet13UserTimeout; - groupTimeout = m_starNet13GroupTimeout; - callsignSwitch = m_starNet13CallsignSwitch; - txMsgSwitch = m_starNet13TxMsgSwitch; - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - reflector = m_starNet13Reflector; -#endif -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -void CStarNetServerConfig::setStarNet13(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector) -#else -void CStarNetServerConfig::setStarNet13(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch) -#endif -{ - m_starNet13Band = band; - m_starNet13Callsign = callsign; - m_starNet13Logoff = logoff; - m_starNet13Info = info; - m_starNet13Permanent = permanent; - m_starNet13UserTimeout = userTimeout; - m_starNet13GroupTimeout = groupTimeout; - m_starNet13CallsignSwitch = callsignSwitch; - m_starNet13TxMsgSwitch = txMsgSwitch; - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - m_starNet13Reflector = reflector; -#endif -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -void CStarNetServerConfig::getStarNet14(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 -#else -void CStarNetServerConfig::getStarNet14(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const -#endif -{ - band = m_starNet14Band; - callsign = m_starNet14Callsign; - logoff = m_starNet14Logoff; - info = m_starNet14Info; - permanent = m_starNet14Permanent; - userTimeout = m_starNet14UserTimeout; - groupTimeout = m_starNet14GroupTimeout; - callsignSwitch = m_starNet14CallsignSwitch; - txMsgSwitch = m_starNet14TxMsgSwitch; - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - reflector = m_starNet14Reflector; -#endif -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -void CStarNetServerConfig::setStarNet14(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector) -#else -void CStarNetServerConfig::setStarNet14(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch) -#endif -{ - m_starNet14Band = band; - m_starNet14Callsign = callsign; - m_starNet14Logoff = logoff; - m_starNet14Info = info; - m_starNet14Permanent = permanent; - m_starNet14UserTimeout = userTimeout; - m_starNet14GroupTimeout = groupTimeout; - m_starNet14CallsignSwitch = callsignSwitch; - m_starNet14TxMsgSwitch = txMsgSwitch; - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - m_starNet14Reflector = reflector; -#endif -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -void CStarNetServerConfig::getStarNet15(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 -#else -void CStarNetServerConfig::getStarNet15(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const -#endif -{ - band = m_starNet15Band; - callsign = m_starNet15Callsign; - logoff = m_starNet15Logoff; - info = m_starNet15Info; - permanent = m_starNet15Permanent; - userTimeout = m_starNet15UserTimeout; - groupTimeout = m_starNet15GroupTimeout; - callsignSwitch = m_starNet15CallsignSwitch; - txMsgSwitch = m_starNet15TxMsgSwitch; - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - reflector = m_starNet15Reflector; -#endif -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -void CStarNetServerConfig::setStarNet15(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector) -#else -void CStarNetServerConfig::setStarNet15(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch) -#endif -{ - m_starNet15Band = band; - m_starNet15Callsign = callsign; - m_starNet15Logoff = logoff; - m_starNet15Info = info; - m_starNet15Permanent = permanent; - m_starNet15UserTimeout = userTimeout; - m_starNet15GroupTimeout = groupTimeout; - m_starNet15CallsignSwitch = callsignSwitch; - m_starNet15TxMsgSwitch = txMsgSwitch; - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - m_starNet15Reflector = reflector; -#endif -} - -void CStarNetServerConfig::getRemote(bool& enabled, wxString& password, unsigned int& port) const -{ - enabled = m_remoteEnabled; - password = m_remotePassword; - port = m_remotePort; -} - -void CStarNetServerConfig::setRemote(bool enabled, const wxString& password, unsigned int port) -{ - m_remoteEnabled = enabled; - m_remotePassword = password; - m_remotePort = port; -} - -void CStarNetServerConfig::getMiscellaneous(bool& enabled) const -{ - enabled = m_logEnabled; -} - -void CStarNetServerConfig::setMiscellaneous(bool enabled) -{ - m_logEnabled = enabled; -} - -void CStarNetServerConfig::getPosition(int& x, int& y) const -{ - x = m_x; - y = m_y; -} - -void CStarNetServerConfig::setPosition(int x, int y) -{ - m_x = x; - m_y = y; -} - -bool CStarNetServerConfig::write() -{ -#if defined(__WINDOWS__) - m_config->Write(wxT("/") + KEY_CALLSIGN, m_callsign); - m_config->Write(wxT("/") + KEY_ADDRESS, m_address); - m_config->Write(wxT("/") + KEY_IRCDDB_HOSTNAME, m_ircddbHostname); - m_config->Write(wxT("/") + KEY_IRCDDB_USERNAME, m_ircddbUsername); - m_config->Write(wxT("/") + KEY_IRCDDB_PASSWORD, m_ircddbPassword); - m_config->Write(wxT("/") + KEY_STARNET_BAND1, m_starNet1Band); - m_config->Write(wxT("/") + KEY_STARNET_CALLSIGN1, m_starNet1Callsign); - m_config->Write(wxT("/") + KEY_STARNET_LOGOFF1, m_starNet1Logoff); - m_config->Write(wxT("/") + KEY_STARNET_INFO1, m_starNet1Info); - m_config->Write(wxT("/") + KEY_STARNET_PERMANENT1, m_starNet1Permanent); - m_config->Write(wxT("/") + KEY_STARNET_USER_TIMEOUT1, long(m_starNet1UserTimeout)); - m_config->Write(wxT("/") + KEY_STARNET_GROUP_TIMEOUT1, long(m_starNet1GroupTimeout)); - m_config->Write(wxT("/") + KEY_STARNET_CALLSIGN_SWITCH1, long(m_starNet1CallsignSwitch)); - m_config->Write(wxT("/") + KEY_STARNET_TXMSG_SWITCH1, m_starNet1TxMsgSwitch); - m_config->Write(wxT("/") + KEY_STARNET_REFLECTOR1, m_starNet1Reflector); - m_config->Write(wxT("/") + KEY_STARNET_BAND2, m_starNet2Band); - m_config->Write(wxT("/") + KEY_STARNET_CALLSIGN2, m_starNet2Callsign); - m_config->Write(wxT("/") + KEY_STARNET_LOGOFF2, m_starNet2Logoff); - m_config->Write(wxT("/") + KEY_STARNET_INFO2, m_starNet2Info); - m_config->Write(wxT("/") + KEY_STARNET_PERMANENT2, m_starNet2Permanent); - m_config->Write(wxT("/") + KEY_STARNET_USER_TIMEOUT2, long(m_starNet2UserTimeout)); - m_config->Write(wxT("/") + KEY_STARNET_GROUP_TIMEOUT2, long(m_starNet2GroupTimeout)); - m_config->Write(wxT("/") + KEY_STARNET_CALLSIGN_SWITCH2, long(m_starNet2CallsignSwitch)); - m_config->Write(wxT("/") + KEY_STARNET_TXMSG_SWITCH2, m_starNet2TxMsgSwitch); - m_config->Write(wxT("/") + KEY_STARNET_REFLECTOR2, m_starNet2Reflector); - m_config->Write(wxT("/") + KEY_STARNET_BAND3, m_starNet3Band); - m_config->Write(wxT("/") + KEY_STARNET_CALLSIGN3, m_starNet3Callsign); - m_config->Write(wxT("/") + KEY_STARNET_LOGOFF3, m_starNet3Logoff); - m_config->Write(wxT("/") + KEY_STARNET_INFO3, m_starNet3Info); - m_config->Write(wxT("/") + KEY_STARNET_PERMANENT3, m_starNet3Permanent); - m_config->Write(wxT("/") + KEY_STARNET_USER_TIMEOUT3, long(m_starNet3UserTimeout)); - m_config->Write(wxT("/") + KEY_STARNET_GROUP_TIMEOUT3, long(m_starNet3GroupTimeout)); - m_config->Write(wxT("/") + KEY_STARNET_CALLSIGN_SWITCH3, long(m_starNet3CallsignSwitch)); - m_config->Write(wxT("/") + KEY_STARNET_TXMSG_SWITCH3, m_starNet3TxMsgSwitch); - m_config->Write(wxT("/") + KEY_STARNET_REFLECTOR3, m_starNet3Reflector); - m_config->Write(wxT("/") + KEY_STARNET_BAND4, m_starNet4Band); - m_config->Write(wxT("/") + KEY_STARNET_CALLSIGN4, m_starNet4Callsign); - m_config->Write(wxT("/") + KEY_STARNET_LOGOFF4, m_starNet4Logoff); - m_config->Write(wxT("/") + KEY_STARNET_INFO4, m_starNet4Info); - m_config->Write(wxT("/") + KEY_STARNET_PERMANENT4, m_starNet4Permanent); - m_config->Write(wxT("/") + KEY_STARNET_USER_TIMEOUT4, long(m_starNet4UserTimeout)); - m_config->Write(wxT("/") + KEY_STARNET_GROUP_TIMEOUT4, long(m_starNet4GroupTimeout)); - m_config->Write(wxT("/") + KEY_STARNET_CALLSIGN_SWITCH4, long(m_starNet4CallsignSwitch)); - m_config->Write(wxT("/") + KEY_STARNET_TXMSG_SWITCH4, m_starNet4TxMsgSwitch); - m_config->Write(wxT("/") + KEY_STARNET_REFLECTOR4, m_starNet4Reflector); - m_config->Write(wxT("/") + KEY_STARNET_BAND5, m_starNet5Band); - m_config->Write(wxT("/") + KEY_STARNET_CALLSIGN5, m_starNet5Callsign); - m_config->Write(wxT("/") + KEY_STARNET_LOGOFF5, m_starNet5Logoff); - m_config->Write(wxT("/") + KEY_STARNET_INFO5, m_starNet5Info); - m_config->Write(wxT("/") + KEY_STARNET_PERMANENT5, m_starNet5Permanent); - m_config->Write(wxT("/") + KEY_STARNET_USER_TIMEOUT5, long(m_starNet5UserTimeout)); - m_config->Write(wxT("/") + KEY_STARNET_GROUP_TIMEOUT5, long(m_starNet5GroupTimeout)); - m_config->Write(wxT("/") + KEY_STARNET_CALLSIGN_SWITCH5, long(m_starNet5CallsignSwitch)); - m_config->Write(wxT("/") + KEY_STARNET_TXMSG_SWITCH5, m_starNet5TxMsgSwitch); - m_config->Write(wxT("/") + KEY_STARNET_REFLECTOR5, m_starNet5Reflector); - m_config->Write(wxT("/") + KEY_STARNET_BAND6, m_starNet6Band); - m_config->Write(wxT("/") + KEY_STARNET_CALLSIGN6, m_starNet6Callsign); - m_config->Write(wxT("/") + KEY_STARNET_LOGOFF6, m_starNet6Logoff); - m_config->Write(wxT("/") + KEY_STARNET_INFO6, m_starNet6Info); - m_config->Write(wxT("/") + KEY_STARNET_PERMANENT6, m_starNet6Permanent); - m_config->Write(wxT("/") + KEY_STARNET_USER_TIMEOUT6, long(m_starNet6UserTimeout)); - m_config->Write(wxT("/") + KEY_STARNET_GROUP_TIMEOUT6, long(m_starNet6GroupTimeout)); - m_config->Write(wxT("/") + KEY_STARNET_CALLSIGN_SWITCH6, long(m_starNet6CallsignSwitch)); - m_config->Write(wxT("/") + KEY_STARNET_TXMSG_SWITCH6, m_starNet6TxMsgSwitch); - m_config->Write(wxT("/") + KEY_STARNET_REFLECTOR6, m_starNet6Reflector); - m_config->Write(wxT("/") + KEY_STARNET_BAND7, m_starNet7Band); - m_config->Write(wxT("/") + KEY_STARNET_CALLSIGN7, m_starNet7Callsign); - m_config->Write(wxT("/") + KEY_STARNET_LOGOFF7, m_starNet7Logoff); - m_config->Write(wxT("/") + KEY_STARNET_INFO7, m_starNet7Info); - m_config->Write(wxT("/") + KEY_STARNET_PERMANENT7, m_starNet7Permanent); - m_config->Write(wxT("/") + KEY_STARNET_USER_TIMEOUT7, long(m_starNet7UserTimeout)); - m_config->Write(wxT("/") + KEY_STARNET_GROUP_TIMEOUT7, long(m_starNet7GroupTimeout)); - m_config->Write(wxT("/") + KEY_STARNET_CALLSIGN_SWITCH7, long(m_starNet7CallsignSwitch)); - m_config->Write(wxT("/") + KEY_STARNET_TXMSG_SWITCH7, m_starNet7TxMsgSwitch); - m_config->Write(wxT("/") + KEY_STARNET_REFLECTOR7, m_starNet7Reflector); - m_config->Write(wxT("/") + KEY_STARNET_BAND8, m_starNet8Band); - m_config->Write(wxT("/") + KEY_STARNET_CALLSIGN8, m_starNet8Callsign); - m_config->Write(wxT("/") + KEY_STARNET_LOGOFF8, m_starNet8Logoff); - m_config->Write(wxT("/") + KEY_STARNET_INFO8, m_starNet8Info); - m_config->Write(wxT("/") + KEY_STARNET_PERMANENT8, m_starNet8Permanent); - m_config->Write(wxT("/") + KEY_STARNET_USER_TIMEOUT8, long(m_starNet8UserTimeout)); - m_config->Write(wxT("/") + KEY_STARNET_GROUP_TIMEOUT8, long(m_starNet8GroupTimeout)); - m_config->Write(wxT("/") + KEY_STARNET_CALLSIGN_SWITCH8, long(m_starNet8CallsignSwitch)); - m_config->Write(wxT("/") + KEY_STARNET_TXMSG_SWITCH8, m_starNet8TxMsgSwitch); - m_config->Write(wxT("/") + KEY_STARNET_REFLECTOR8, m_starNet8Reflector); - m_config->Write(wxT("/") + KEY_STARNET_BAND9, m_starNet9Band); - m_config->Write(wxT("/") + KEY_STARNET_CALLSIGN9, m_starNet9Callsign); - m_config->Write(wxT("/") + KEY_STARNET_LOGOFF9, m_starNet9Logoff); - m_config->Write(wxT("/") + KEY_STARNET_INFO9, m_starNet9Info); - m_config->Write(wxT("/") + KEY_STARNET_PERMANENT9, m_starNet9Permanent); - m_config->Write(wxT("/") + KEY_STARNET_USER_TIMEOUT9, long(m_starNet9UserTimeout)); - m_config->Write(wxT("/") + KEY_STARNET_GROUP_TIMEOUT9, long(m_starNet9GroupTimeout)); - m_config->Write(wxT("/") + KEY_STARNET_CALLSIGN_SWITCH9, long(m_starNet9CallsignSwitch)); - m_config->Write(wxT("/") + KEY_STARNET_TXMSG_SWITCH9, m_starNet9TxMsgSwitch); - m_config->Write(wxT("/") + KEY_STARNET_REFLECTOR9, m_starNet9Reflector); - m_config->Write(wxT("/") + KEY_STARNET_BAND10, m_starNet10Band); - m_config->Write(wxT("/") + KEY_STARNET_CALLSIGN10, m_starNet10Callsign); - m_config->Write(wxT("/") + KEY_STARNET_LOGOFF10, m_starNet10Logoff); - m_config->Write(wxT("/") + KEY_STARNET_INFO10, m_starNet10Info); - m_config->Write(wxT("/") + KEY_STARNET_PERMANENT10, m_starNet10Permanent); - m_config->Write(wxT("/") + KEY_STARNET_USER_TIMEOUT10, long(m_starNet10UserTimeout)); - m_config->Write(wxT("/") + KEY_STARNET_GROUP_TIMEOUT10, long(m_starNet10GroupTimeout)); - m_config->Write(wxT("/") + KEY_STARNET_CALLSIGN_SWITCH10, long(m_starNet10CallsignSwitch)); - m_config->Write(wxT("/") + KEY_STARNET_TXMSG_SWITCH10, m_starNet10TxMsgSwitch); - m_config->Write(wxT("/") + KEY_STARNET_REFLECTOR10, m_starNet10Reflector); - m_config->Write(wxT("/") + KEY_STARNET_BAND11, m_starNet11Band); - m_config->Write(wxT("/") + KEY_STARNET_CALLSIGN11, m_starNet11Callsign); - m_config->Write(wxT("/") + KEY_STARNET_LOGOFF11, m_starNet11Logoff); - m_config->Write(wxT("/") + KEY_STARNET_INFO11, m_starNet11Info); - m_config->Write(wxT("/") + KEY_STARNET_PERMANENT11, m_starNet11Permanent); - m_config->Write(wxT("/") + KEY_STARNET_USER_TIMEOUT11, long(m_starNet11UserTimeout)); - m_config->Write(wxT("/") + KEY_STARNET_GROUP_TIMEOUT11, long(m_starNet11GroupTimeout)); - m_config->Write(wxT("/") + KEY_STARNET_CALLSIGN_SWITCH11, long(m_starNet11CallsignSwitch)); - m_config->Write(wxT("/") + KEY_STARNET_TXMSG_SWITCH11, m_starNet11TxMsgSwitch); - m_config->Write(wxT("/") + KEY_STARNET_REFLECTOR11, m_starNet11Reflector); - m_config->Write(wxT("/") + KEY_STARNET_BAND12, m_starNet12Band); - m_config->Write(wxT("/") + KEY_STARNET_CALLSIGN12, m_starNet12Callsign); - m_config->Write(wxT("/") + KEY_STARNET_LOGOFF12, m_starNet12Logoff); - m_config->Write(wxT("/") + KEY_STARNET_INFO12, m_starNet12Info); - m_config->Write(wxT("/") + KEY_STARNET_PERMANENT12, m_starNet12Permanent); - m_config->Write(wxT("/") + KEY_STARNET_USER_TIMEOUT12, long(m_starNet12UserTimeout)); - m_config->Write(wxT("/") + KEY_STARNET_GROUP_TIMEOUT12, long(m_starNet12GroupTimeout)); - m_config->Write(wxT("/") + KEY_STARNET_CALLSIGN_SWITCH12, long(m_starNet12CallsignSwitch)); - m_config->Write(wxT("/") + KEY_STARNET_TXMSG_SWITCH12, m_starNet12TxMsgSwitch); - m_config->Write(wxT("/") + KEY_STARNET_REFLECTOR12, m_starNet12Reflector); - m_config->Write(wxT("/") + KEY_STARNET_BAND13, m_starNet13Band); - m_config->Write(wxT("/") + KEY_STARNET_CALLSIGN13, m_starNet13Callsign); - m_config->Write(wxT("/") + KEY_STARNET_LOGOFF13, m_starNet13Logoff); - m_config->Write(wxT("/") + KEY_STARNET_INFO13, m_starNet13Info); - m_config->Write(wxT("/") + KEY_STARNET_PERMANENT13, m_starNet13Permanent); - m_config->Write(wxT("/") + KEY_STARNET_USER_TIMEOUT13, long(m_starNet13UserTimeout)); - m_config->Write(wxT("/") + KEY_STARNET_GROUP_TIMEOUT13, long(m_starNet13GroupTimeout)); - m_config->Write(wxT("/") + KEY_STARNET_CALLSIGN_SWITCH13, long(m_starNet13CallsignSwitch)); - m_config->Write(wxT("/") + KEY_STARNET_TXMSG_SWITCH13, m_starNet13TxMsgSwitch); - m_config->Write(wxT("/") + KEY_STARNET_REFLECTOR13, m_starNet13Reflector); - m_config->Write(wxT("/") + KEY_STARNET_BAND14, m_starNet14Band); - m_config->Write(wxT("/") + KEY_STARNET_CALLSIGN14, m_starNet14Callsign); - m_config->Write(wxT("/") + KEY_STARNET_LOGOFF14, m_starNet14Logoff); - m_config->Write(wxT("/") + KEY_STARNET_INFO14, m_starNet14Info); - m_config->Write(wxT("/") + KEY_STARNET_PERMANENT14, m_starNet14Permanent); - m_config->Write(wxT("/") + KEY_STARNET_USER_TIMEOUT14, long(m_starNet14UserTimeout)); - m_config->Write(wxT("/") + KEY_STARNET_GROUP_TIMEOUT14, long(m_starNet14GroupTimeout)); - m_config->Write(wxT("/") + KEY_STARNET_CALLSIGN_SWITCH14, long(m_starNet14CallsignSwitch)); - m_config->Write(wxT("/") + KEY_STARNET_TXMSG_SWITCH14, m_starNet14TxMsgSwitch); - m_config->Write(wxT("/") + KEY_STARNET_REFLECTOR14, m_starNet14Reflector); - m_config->Write(wxT("/") + KEY_STARNET_BAND15, m_starNet15Band); - m_config->Write(wxT("/") + KEY_STARNET_CALLSIGN15, m_starNet15Callsign); - m_config->Write(wxT("/") + KEY_STARNET_LOGOFF15, m_starNet15Logoff); - m_config->Write(wxT("/") + KEY_STARNET_INFO15, m_starNet15Info); - m_config->Write(wxT("/") + KEY_STARNET_PERMANENT15, m_starNet15Permanent); - m_config->Write(wxT("/") + KEY_STARNET_USER_TIMEOUT15, long(m_starNet15UserTimeout)); - m_config->Write(wxT("/") + KEY_STARNET_GROUP_TIMEOUT15, long(m_starNet15GroupTimeout)); - m_config->Write(wxT("/") + KEY_STARNET_CALLSIGN_SWITCH15, long(m_starNet15CallsignSwitch)); - m_config->Write(wxT("/") + KEY_STARNET_TXMSG_SWITCH15, m_starNet15TxMsgSwitch); - m_config->Write(wxT("/") + KEY_STARNET_REFLECTOR15, m_starNet15Reflector); - m_config->Write(wxT("/") + KEY_REMOTE_ENABLED, m_remoteEnabled); - m_config->Write(wxT("/") + KEY_REMOTE_PASSWORD, m_remotePassword); - m_config->Write(wxT("/") + KEY_REMOTE_PORT, long(m_remotePort)); - m_config->Write(wxT("/") + KEY_LOG_ENABLED, m_logEnabled); - m_config->Write(wxT("/") + KEY_WINDOW_X, long(m_x)); - m_config->Write(wxT("/") + KEY_WINDOW_Y, long(m_y)); - m_config->Flush(); -#endif - - wxTextFile file(m_fileName.GetFullPath()); - - bool exists = file.Exists(); - if (exists) { - bool ret = file.Open(); - if (!ret) { - wxLogError(wxT("Cannot open the config file - %s"), m_fileName.GetFullPath().c_str()); - return false; - } - - // Remove the existing file entries - file.Clear(); - } else { - bool ret = file.Create(); - if (!ret) { - wxLogError(wxT("Cannot create the config file - %s"), m_fileName.GetFullPath().c_str()); - return false; - } - } - - wxString buffer; - buffer.Printf(wxT("%s=%s"), KEY_CALLSIGN.c_str(), m_callsign.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_ADDRESS.c_str(), m_address.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_IRCDDB_HOSTNAME.c_str(), m_ircddbHostname.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_IRCDDB_USERNAME.c_str(), m_ircddbUsername.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_IRCDDB_PASSWORD.c_str(), m_ircddbPassword.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); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_LOGOFF1.c_str(), m_starNet1Logoff.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_INFO1.c_str(), m_starNet1Info.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_PERMANENT1.c_str(), m_starNet1Permanent.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%u"), KEY_STARNET_USER_TIMEOUT1.c_str(), m_starNet1UserTimeout); file.AddLine(buffer); - buffer.Printf(wxT("%s=%u"), KEY_STARNET_GROUP_TIMEOUT1.c_str(), m_starNet1GroupTimeout); file.AddLine(buffer); - buffer.Printf(wxT("%s=%d"), KEY_STARNET_CALLSIGN_SWITCH1.c_str(), int(m_starNet1CallsignSwitch)); file.AddLine(buffer); - buffer.Printf(wxT("%s=%d"), KEY_STARNET_TXMSG_SWITCH1.c_str(), m_starNet1TxMsgSwitch ? 1 : 0); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_REFLECTOR1.c_str(), m_starNet1Reflector.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_BAND2.c_str(), m_starNet2Band.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_CALLSIGN2.c_str(), m_starNet2Callsign.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_LOGOFF2.c_str(), m_starNet2Logoff.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_INFO2.c_str(), m_starNet2Info.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_PERMANENT2.c_str(), m_starNet2Permanent.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%u"), KEY_STARNET_USER_TIMEOUT2.c_str(), m_starNet2UserTimeout); file.AddLine(buffer); - buffer.Printf(wxT("%s=%u"), KEY_STARNET_GROUP_TIMEOUT2.c_str(), m_starNet2GroupTimeout); file.AddLine(buffer); - buffer.Printf(wxT("%s=%d"), KEY_STARNET_CALLSIGN_SWITCH2.c_str(), int(m_starNet2CallsignSwitch)); file.AddLine(buffer); - buffer.Printf(wxT("%s=%d"), KEY_STARNET_TXMSG_SWITCH2.c_str(), m_starNet2TxMsgSwitch ? 1 : 0); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_REFLECTOR2.c_str(), m_starNet2Reflector.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_BAND3.c_str(), m_starNet3Band.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_CALLSIGN3.c_str(), m_starNet3Callsign.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_LOGOFF3.c_str(), m_starNet3Logoff.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_INFO3.c_str(), m_starNet3Info.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_PERMANENT3.c_str(), m_starNet3Permanent.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%u"), KEY_STARNET_USER_TIMEOUT3.c_str(), m_starNet3UserTimeout); file.AddLine(buffer); - buffer.Printf(wxT("%s=%u"), KEY_STARNET_GROUP_TIMEOUT3.c_str(), m_starNet3GroupTimeout); file.AddLine(buffer); - buffer.Printf(wxT("%s=%d"), KEY_STARNET_CALLSIGN_SWITCH3.c_str(), int(m_starNet3CallsignSwitch)); file.AddLine(buffer); - buffer.Printf(wxT("%s=%d"), KEY_STARNET_TXMSG_SWITCH3.c_str(), m_starNet3TxMsgSwitch ? 1 : 0); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_REFLECTOR3.c_str(), m_starNet3Reflector.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_BAND4.c_str(), m_starNet4Band.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_CALLSIGN4.c_str(), m_starNet4Callsign.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_LOGOFF4.c_str(), m_starNet4Logoff.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_INFO4.c_str(), m_starNet4Info.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_PERMANENT4.c_str(), m_starNet4Permanent.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%u"), KEY_STARNET_USER_TIMEOUT4.c_str(), m_starNet4UserTimeout); file.AddLine(buffer); - buffer.Printf(wxT("%s=%u"), KEY_STARNET_GROUP_TIMEOUT4.c_str(), m_starNet4GroupTimeout); file.AddLine(buffer); - buffer.Printf(wxT("%s=%d"), KEY_STARNET_CALLSIGN_SWITCH4.c_str(), int(m_starNet4CallsignSwitch)); file.AddLine(buffer); - buffer.Printf(wxT("%s=%d"), KEY_STARNET_TXMSG_SWITCH4.c_str(), m_starNet4TxMsgSwitch ? 1 : 0); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_REFLECTOR4.c_str(), m_starNet4Reflector.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_BAND5.c_str(), m_starNet5Band.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_CALLSIGN5.c_str(), m_starNet5Callsign.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_LOGOFF5.c_str(), m_starNet5Logoff.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_INFO5.c_str(), m_starNet5Info.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_PERMANENT5.c_str(), m_starNet5Permanent.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%u"), KEY_STARNET_USER_TIMEOUT5.c_str(), m_starNet5UserTimeout); file.AddLine(buffer); - buffer.Printf(wxT("%s=%u"), KEY_STARNET_GROUP_TIMEOUT5.c_str(), m_starNet5GroupTimeout); file.AddLine(buffer); - buffer.Printf(wxT("%s=%d"), KEY_STARNET_CALLSIGN_SWITCH5.c_str(), int(m_starNet5CallsignSwitch)); file.AddLine(buffer); - buffer.Printf(wxT("%s=%d"), KEY_STARNET_TXMSG_SWITCH5.c_str(), m_starNet5TxMsgSwitch ? 1 : 0); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_REFLECTOR5.c_str(), m_starNet5Reflector.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_BAND6.c_str(), m_starNet6Band.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_CALLSIGN6.c_str(), m_starNet6Callsign.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_LOGOFF6.c_str(), m_starNet6Logoff.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_INFO6.c_str(), m_starNet6Info.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_PERMANENT6.c_str(), m_starNet6Permanent.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%u"), KEY_STARNET_USER_TIMEOUT6.c_str(), m_starNet6UserTimeout); file.AddLine(buffer); - buffer.Printf(wxT("%s=%u"), KEY_STARNET_GROUP_TIMEOUT6.c_str(), m_starNet6GroupTimeout); file.AddLine(buffer); - buffer.Printf(wxT("%s=%d"), KEY_STARNET_CALLSIGN_SWITCH6.c_str(), int(m_starNet6CallsignSwitch)); file.AddLine(buffer); - buffer.Printf(wxT("%s=%d"), KEY_STARNET_TXMSG_SWITCH6.c_str(), m_starNet6TxMsgSwitch ? 1 : 0); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_REFLECTOR6.c_str(), m_starNet6Reflector.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_BAND7.c_str(), m_starNet7Band.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_CALLSIGN7.c_str(), m_starNet7Callsign.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_LOGOFF7.c_str(), m_starNet7Logoff.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_INFO7.c_str(), m_starNet7Info.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_PERMANENT7.c_str(), m_starNet7Permanent.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%u"), KEY_STARNET_USER_TIMEOUT7.c_str(), m_starNet7UserTimeout); file.AddLine(buffer); - buffer.Printf(wxT("%s=%u"), KEY_STARNET_GROUP_TIMEOUT7.c_str(), m_starNet7GroupTimeout); file.AddLine(buffer); - buffer.Printf(wxT("%s=%d"), KEY_STARNET_CALLSIGN_SWITCH7.c_str(), int(m_starNet7CallsignSwitch)); file.AddLine(buffer); - buffer.Printf(wxT("%s=%d"), KEY_STARNET_TXMSG_SWITCH7.c_str(), m_starNet7TxMsgSwitch ? 1 : 0); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_REFLECTOR7.c_str(), m_starNet7Reflector.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_BAND8.c_str(), m_starNet8Band.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_CALLSIGN8.c_str(), m_starNet8Callsign.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_LOGOFF8.c_str(), m_starNet8Logoff.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_INFO8.c_str(), m_starNet8Info.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_PERMANENT8.c_str(), m_starNet8Permanent.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%u"), KEY_STARNET_USER_TIMEOUT8.c_str(), m_starNet8UserTimeout); file.AddLine(buffer); - buffer.Printf(wxT("%s=%u"), KEY_STARNET_GROUP_TIMEOUT8.c_str(), m_starNet8GroupTimeout); file.AddLine(buffer); - buffer.Printf(wxT("%s=%d"), KEY_STARNET_CALLSIGN_SWITCH8.c_str(), int(m_starNet8CallsignSwitch)); file.AddLine(buffer); - buffer.Printf(wxT("%s=%d"), KEY_STARNET_TXMSG_SWITCH8.c_str(), m_starNet8TxMsgSwitch ? 1 : 0); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_REFLECTOR8.c_str(), m_starNet8Reflector.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_BAND9.c_str(), m_starNet9Band.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_CALLSIGN9.c_str(), m_starNet9Callsign.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_LOGOFF9.c_str(), m_starNet9Logoff.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_INFO9.c_str(), m_starNet9Info.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_PERMANENT9.c_str(), m_starNet9Permanent.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%u"), KEY_STARNET_USER_TIMEOUT9.c_str(), m_starNet9UserTimeout); file.AddLine(buffer); - buffer.Printf(wxT("%s=%u"), KEY_STARNET_GROUP_TIMEOUT9.c_str(), m_starNet9GroupTimeout); file.AddLine(buffer); - buffer.Printf(wxT("%s=%d"), KEY_STARNET_CALLSIGN_SWITCH9.c_str(), int(m_starNet9CallsignSwitch)); file.AddLine(buffer); - buffer.Printf(wxT("%s=%d"), KEY_STARNET_TXMSG_SWITCH9.c_str(), m_starNet9TxMsgSwitch ? 1 : 0); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_REFLECTOR9.c_str(), m_starNet9Reflector.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_BAND10.c_str(), m_starNet10Band.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_CALLSIGN10.c_str(), m_starNet10Callsign.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_LOGOFF10.c_str(), m_starNet10Logoff.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_INFO10.c_str(), m_starNet10Info.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_PERMANENT10.c_str(), m_starNet10Permanent.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%u"), KEY_STARNET_USER_TIMEOUT10.c_str(), m_starNet10UserTimeout); file.AddLine(buffer); - buffer.Printf(wxT("%s=%u"), KEY_STARNET_GROUP_TIMEOUT10.c_str(), m_starNet10GroupTimeout); file.AddLine(buffer); - buffer.Printf(wxT("%s=%d"), KEY_STARNET_CALLSIGN_SWITCH10.c_str(), int(m_starNet10CallsignSwitch)); file.AddLine(buffer); - buffer.Printf(wxT("%s=%d"), KEY_STARNET_TXMSG_SWITCH10.c_str(), m_starNet10TxMsgSwitch ? 1 : 0); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_REFLECTOR10.c_str(), m_starNet10Reflector.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_BAND11.c_str(), m_starNet11Band.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_CALLSIGN11.c_str(), m_starNet11Callsign.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_LOGOFF11.c_str(), m_starNet11Logoff.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_INFO11.c_str(), m_starNet11Info.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_PERMANENT11.c_str(), m_starNet11Permanent.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%u"), KEY_STARNET_USER_TIMEOUT11.c_str(), m_starNet11UserTimeout); file.AddLine(buffer); - buffer.Printf(wxT("%s=%u"), KEY_STARNET_GROUP_TIMEOUT11.c_str(), m_starNet11GroupTimeout); file.AddLine(buffer); - buffer.Printf(wxT("%s=%d"), KEY_STARNET_CALLSIGN_SWITCH11.c_str(), int(m_starNet11CallsignSwitch)); file.AddLine(buffer); - buffer.Printf(wxT("%s=%d"), KEY_STARNET_TXMSG_SWITCH11.c_str(), m_starNet11TxMsgSwitch ? 1 : 0); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_REFLECTOR11.c_str(), m_starNet11Reflector.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_BAND12.c_str(), m_starNet12Band.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_CALLSIGN12.c_str(), m_starNet12Callsign.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_LOGOFF12.c_str(), m_starNet12Logoff.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_INFO12.c_str(), m_starNet12Info.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_PERMANENT12.c_str(), m_starNet12Permanent.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%u"), KEY_STARNET_USER_TIMEOUT12.c_str(), m_starNet12UserTimeout); file.AddLine(buffer); - buffer.Printf(wxT("%s=%u"), KEY_STARNET_GROUP_TIMEOUT12.c_str(), m_starNet12GroupTimeout); file.AddLine(buffer); - buffer.Printf(wxT("%s=%d"), KEY_STARNET_CALLSIGN_SWITCH12.c_str(), int(m_starNet12CallsignSwitch)); file.AddLine(buffer); - buffer.Printf(wxT("%s=%d"), KEY_STARNET_TXMSG_SWITCH12.c_str(), m_starNet12TxMsgSwitch ? 1 : 0); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_REFLECTOR12.c_str(), m_starNet12Reflector.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_BAND13.c_str(), m_starNet13Band.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_CALLSIGN13.c_str(), m_starNet13Callsign.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_LOGOFF13.c_str(), m_starNet13Logoff.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_INFO13.c_str(), m_starNet13Info.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_PERMANENT13.c_str(), m_starNet13Permanent.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%u"), KEY_STARNET_USER_TIMEOUT13.c_str(), m_starNet13UserTimeout); file.AddLine(buffer); - buffer.Printf(wxT("%s=%u"), KEY_STARNET_GROUP_TIMEOUT13.c_str(), m_starNet13GroupTimeout); file.AddLine(buffer); - buffer.Printf(wxT("%s=%d"), KEY_STARNET_CALLSIGN_SWITCH13.c_str(), int(m_starNet13CallsignSwitch)); file.AddLine(buffer); - buffer.Printf(wxT("%s=%d"), KEY_STARNET_TXMSG_SWITCH13.c_str(), m_starNet13TxMsgSwitch ? 1 : 0); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_REFLECTOR13.c_str(), m_starNet13Reflector.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_BAND14.c_str(), m_starNet14Band.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_CALLSIGN14.c_str(), m_starNet14Callsign.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_LOGOFF14.c_str(), m_starNet14Logoff.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_INFO14.c_str(), m_starNet14Info.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_PERMANENT14.c_str(), m_starNet14Permanent.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%u"), KEY_STARNET_USER_TIMEOUT14.c_str(), m_starNet14UserTimeout); file.AddLine(buffer); - buffer.Printf(wxT("%s=%u"), KEY_STARNET_GROUP_TIMEOUT14.c_str(), m_starNet14GroupTimeout); file.AddLine(buffer); - buffer.Printf(wxT("%s=%d"), KEY_STARNET_CALLSIGN_SWITCH14.c_str(), int(m_starNet14CallsignSwitch)); file.AddLine(buffer); - buffer.Printf(wxT("%s=%d"), KEY_STARNET_TXMSG_SWITCH14.c_str(), m_starNet14TxMsgSwitch ? 1 : 0); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_REFLECTOR14.c_str(), m_starNet14Reflector.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_BAND15.c_str(), m_starNet15Band.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_CALLSIGN15.c_str(), m_starNet15Callsign.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_LOGOFF15.c_str(), m_starNet15Logoff.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_INFO15.c_str(), m_starNet15Info.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_PERMANENT15.c_str(), m_starNet15Permanent.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%u"), KEY_STARNET_USER_TIMEOUT15.c_str(), m_starNet15UserTimeout); file.AddLine(buffer); - buffer.Printf(wxT("%s=%u"), KEY_STARNET_GROUP_TIMEOUT15.c_str(), m_starNet15GroupTimeout); file.AddLine(buffer); - buffer.Printf(wxT("%s=%d"), KEY_STARNET_CALLSIGN_SWITCH15.c_str(), int(m_starNet15CallsignSwitch)); file.AddLine(buffer); - buffer.Printf(wxT("%s=%d"), KEY_STARNET_TXMSG_SWITCH15.c_str(), m_starNet15TxMsgSwitch ? 1 : 0); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_STARNET_REFLECTOR15.c_str(), m_starNet15Reflector.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%d"), KEY_REMOTE_ENABLED.c_str(), m_remoteEnabled ? 1 : 0); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_REMOTE_PASSWORD.c_str(), m_remotePassword.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%u"), KEY_REMOTE_PORT.c_str(), m_remotePort); file.AddLine(buffer); - buffer.Printf(wxT("%s=%d"), KEY_LOG_ENABLED.c_str(), m_logEnabled ? 1 : 0); file.AddLine(buffer); - buffer.Printf(wxT("%s=%d"), KEY_WINDOW_X.c_str(), m_x); file.AddLine(buffer); - buffer.Printf(wxT("%s=%d"), KEY_WINDOW_Y.c_str(), m_y); file.AddLine(buffer); - - bool ret = file.Write(); - if (!ret) { - file.Close(); - wxLogError(wxT("Cannot write the config file - %s"), m_fileName.GetFullPath().c_str()); - return false; - } - - file.Close(); - - return true; -} diff --git a/StarNetServer/StarNetServerConfig.h b/StarNetServer/StarNetServerConfig.h deleted file mode 100644 index cf6f2a0..0000000 --- a/StarNetServer/StarNetServerConfig.h +++ /dev/null @@ -1,314 +0,0 @@ -/* - * Copyright (C) 2010,2011,2012,2014 by Jonathan Naylor G4KLX - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef StarNetServerConfig_H -#define StarNetServerConfig_H - -#include "Defs.h" - -#include -#include -#include - -class CStarNetServerConfig { -public: -#if defined(__WINDOWS__) - CStarNetServerConfig(wxConfigBase* config, const wxString& dir); -#else - CStarNetServerConfig(const wxString& dir); -#endif - ~CStarNetServerConfig(); - - void getGateway(wxString& callsign, wxString& address) const; - void setGateway(const wxString& callsign, const wxString& address); - - void getIrcDDB(wxString& hostname, wxString& username, wxString& password) const; - void setIrcDDB(const wxString& hostname, const wxString& username, const wxString& password); - -#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; - void setStarNet1(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector); - - void getStarNet2(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; - void setStarNet2(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector); - - void getStarNet3(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; - void setStarNet3(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector); - - void getStarNet4(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; - void setStarNet4(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector); - - void getStarNet5(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; - void setStarNet5(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector); - - void getStarNet6(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; - void setStarNet6(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector); - - void getStarNet7(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; - void setStarNet7(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector); - - void getStarNet8(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; - void setStarNet8(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector); - - void getStarNet9(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; - void setStarNet9(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector); - - void getStarNet10(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; - void setStarNet10(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector); - - void getStarNet11(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; - void setStarNet11(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector); - - void getStarNet12(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; - void setStarNet12(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector); - - void getStarNet13(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; - void setStarNet13(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector); - - void getStarNet14(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; - void setStarNet14(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector); - - void getStarNet15(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; - void setStarNet15(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector); -#else - void getStarNet1(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const; - void setStarNet1(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch); - - void getStarNet2(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const; - void setStarNet2(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch); - - void getStarNet3(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const; - void setStarNet3(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch); - - void getStarNet4(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const; - void setStarNet4(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch); - - void getStarNet5(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const; - void setStarNet5(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch); - - void getStarNet6(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const; - void setStarNet6(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch); - - void getStarNet7(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const; - void setStarNet7(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch); - - void getStarNet8(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const; - void setStarNet8(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch); - - void getStarNet9(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const; - void setStarNet9(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch); - - void getStarNet10(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const; - void setStarNet10(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch); - - void getStarNet11(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const; - void setStarNet11(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch); - - void getStarNet12(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const; - void setStarNet12(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch); - - void getStarNet13(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const; - void setStarNet13(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch); - - void getStarNet14(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const; - void setStarNet14(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch); - - void getStarNet15(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const; - void setStarNet15(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch); -#endif - - void getRemote(bool& enabled, wxString& password, unsigned int& port) const; - void setRemote(bool enabled, const wxString& password, unsigned int port); - - void getMiscellaneous(bool& enabled) const; - void setMiscellaneous(bool enabled); - - void getPosition(int& x, int& y) const; - void setPosition(int x, int y); - - bool write(); - -private: -#if defined(__WINDOWS__) - wxConfigBase* m_config; -#endif - wxFileName m_fileName; - wxString m_callsign; - wxString m_address; - wxString m_ircddbHostname; - wxString m_ircddbUsername; - wxString m_ircddbPassword; - wxString m_starNet1Band; - wxString m_starNet1Callsign; - wxString m_starNet1Logoff; - wxString m_starNet1Info; - wxString m_starNet1Permanent; - unsigned int m_starNet1UserTimeout; - unsigned int m_starNet1GroupTimeout; - STARNET_CALLSIGN_SWITCH m_starNet1CallsignSwitch; - bool m_starNet1TxMsgSwitch; - wxString m_starNet1Reflector; - wxString m_starNet2Band; - wxString m_starNet2Callsign; - wxString m_starNet2Logoff; - wxString m_starNet2Info; - wxString m_starNet2Permanent; - unsigned int m_starNet2UserTimeout; - unsigned int m_starNet2GroupTimeout; - STARNET_CALLSIGN_SWITCH m_starNet2CallsignSwitch; - bool m_starNet2TxMsgSwitch; - wxString m_starNet2Reflector; - wxString m_starNet3Band; - wxString m_starNet3Callsign; - wxString m_starNet3Logoff; - wxString m_starNet3Info; - wxString m_starNet3Permanent; - unsigned int m_starNet3UserTimeout; - unsigned int m_starNet3GroupTimeout; - STARNET_CALLSIGN_SWITCH m_starNet3CallsignSwitch; - bool m_starNet3TxMsgSwitch; - wxString m_starNet3Reflector; - wxString m_starNet4Band; - wxString m_starNet4Callsign; - wxString m_starNet4Logoff; - wxString m_starNet4Info; - wxString m_starNet4Permanent; - unsigned int m_starNet4UserTimeout; - unsigned int m_starNet4GroupTimeout; - STARNET_CALLSIGN_SWITCH m_starNet4CallsignSwitch; - bool m_starNet4TxMsgSwitch; - wxString m_starNet4Reflector; - wxString m_starNet5Band; - wxString m_starNet5Callsign; - wxString m_starNet5Logoff; - wxString m_starNet5Info; - wxString m_starNet5Permanent; - unsigned int m_starNet5UserTimeout; - unsigned int m_starNet5GroupTimeout; - STARNET_CALLSIGN_SWITCH m_starNet5CallsignSwitch; - bool m_starNet5TxMsgSwitch; - wxString m_starNet5Reflector; - wxString m_starNet6Band; - wxString m_starNet6Callsign; - wxString m_starNet6Logoff; - wxString m_starNet6Info; - wxString m_starNet6Permanent; - unsigned int m_starNet6UserTimeout; - unsigned int m_starNet6GroupTimeout; - STARNET_CALLSIGN_SWITCH m_starNet6CallsignSwitch; - bool m_starNet6TxMsgSwitch; - wxString m_starNet6Reflector; - wxString m_starNet7Band; - wxString m_starNet7Callsign; - wxString m_starNet7Logoff; - wxString m_starNet7Info; - wxString m_starNet7Permanent; - unsigned int m_starNet7UserTimeout; - unsigned int m_starNet7GroupTimeout; - STARNET_CALLSIGN_SWITCH m_starNet7CallsignSwitch; - bool m_starNet7TxMsgSwitch; - wxString m_starNet7Reflector; - wxString m_starNet8Band; - wxString m_starNet8Callsign; - wxString m_starNet8Logoff; - wxString m_starNet8Info; - wxString m_starNet8Permanent; - unsigned int m_starNet8UserTimeout; - unsigned int m_starNet8GroupTimeout; - STARNET_CALLSIGN_SWITCH m_starNet8CallsignSwitch; - bool m_starNet8TxMsgSwitch; - wxString m_starNet8Reflector; - wxString m_starNet9Band; - wxString m_starNet9Callsign; - wxString m_starNet9Logoff; - wxString m_starNet9Info; - wxString m_starNet9Permanent; - unsigned int m_starNet9UserTimeout; - unsigned int m_starNet9GroupTimeout; - STARNET_CALLSIGN_SWITCH m_starNet9CallsignSwitch; - bool m_starNet9TxMsgSwitch; - wxString m_starNet9Reflector; - wxString m_starNet10Band; - wxString m_starNet10Callsign; - wxString m_starNet10Logoff; - wxString m_starNet10Info; - wxString m_starNet10Permanent; - unsigned int m_starNet10UserTimeout; - unsigned int m_starNet10GroupTimeout; - STARNET_CALLSIGN_SWITCH m_starNet10CallsignSwitch; - bool m_starNet10TxMsgSwitch; - wxString m_starNet10Reflector; - wxString m_starNet11Band; - wxString m_starNet11Callsign; - wxString m_starNet11Logoff; - wxString m_starNet11Info; - wxString m_starNet11Permanent; - unsigned int m_starNet11UserTimeout; - unsigned int m_starNet11GroupTimeout; - STARNET_CALLSIGN_SWITCH m_starNet11CallsignSwitch; - bool m_starNet11TxMsgSwitch; - wxString m_starNet11Reflector; - wxString m_starNet12Band; - wxString m_starNet12Callsign; - wxString m_starNet12Logoff; - wxString m_starNet12Info; - wxString m_starNet12Permanent; - unsigned int m_starNet12UserTimeout; - unsigned int m_starNet12GroupTimeout; - STARNET_CALLSIGN_SWITCH m_starNet12CallsignSwitch; - bool m_starNet12TxMsgSwitch; - wxString m_starNet12Reflector; - wxString m_starNet13Band; - wxString m_starNet13Callsign; - wxString m_starNet13Logoff; - wxString m_starNet13Info; - wxString m_starNet13Permanent; - unsigned int m_starNet13UserTimeout; - unsigned int m_starNet13GroupTimeout; - STARNET_CALLSIGN_SWITCH m_starNet13CallsignSwitch; - bool m_starNet13TxMsgSwitch; - wxString m_starNet13Reflector; - wxString m_starNet14Band; - wxString m_starNet14Callsign; - wxString m_starNet14Logoff; - wxString m_starNet14Info; - wxString m_starNet14Permanent; - unsigned int m_starNet14UserTimeout; - unsigned int m_starNet14GroupTimeout; - STARNET_CALLSIGN_SWITCH m_starNet14CallsignSwitch; - bool m_starNet14TxMsgSwitch; - wxString m_starNet14Reflector; - wxString m_starNet15Band; - wxString m_starNet15Callsign; - wxString m_starNet15Logoff; - wxString m_starNet15Info; - wxString m_starNet15Permanent; - unsigned int m_starNet15UserTimeout; - unsigned int m_starNet15GroupTimeout; - STARNET_CALLSIGN_SWITCH m_starNet15CallsignSwitch; - bool m_starNet15TxMsgSwitch; - wxString m_starNet15Reflector; - bool m_remoteEnabled; - wxString m_remotePassword; - unsigned int m_remotePort; - bool m_logEnabled; - int m_x; - int m_y; -}; - -#endif diff --git a/StarNetServer/StarNetServerDefs.h b/StarNetServer/StarNetServerDefs.h deleted file mode 100644 index d1f3538..0000000 --- a/StarNetServer/StarNetServerDefs.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2010,2011,2012,2014 by Jonathan Naylor G4KLX - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef StarNetServerDefs_H -#define StarNetServerDefs_H - -#include - -const wxString APPLICATION_NAME = wxT("StarNet Server"); - -const wxString LOG_BASE_NAME = wxT("STARnetServer"); - -const wxString CONFIG_FILE_NAME = wxT("starnetserver"); - -const unsigned int MAX_STARNETS = 15U; -const unsigned int MAX_DEXTRA_LINKS = 15U; -const unsigned int MAX_DCS_LINKS = 15U; -const unsigned int MAX_ROUTES = 0U; - -#endif diff --git a/StarNetServer/StarNetServerFrame.cpp b/StarNetServer/StarNetServerFrame.cpp deleted file mode 100644 index d0cdd82..0000000 --- a/StarNetServer/StarNetServerFrame.cpp +++ /dev/null @@ -1,719 +0,0 @@ -/* - * Copyright (C) 2010-2015,2018 by Jonathan Naylor G4KLX - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include "StarNetServerPreferences.h" -#include "StarNetServerFrame.h" -#include "StarNetServerDefs.h" -#include "StarNetServerApp.h" -#include "LogEvent.h" -#include "Version.h" - -const unsigned int BORDER_SIZE = 5U; - -#if defined(__WINDOWS__) -const unsigned int LOGTEXT_WIDTH = 560U; -#else -const unsigned int LOGTEXT_WIDTH = 700U; -#endif - -#include -#include - -DEFINE_EVENT_TYPE(LOG_EVENT) - -enum { - Menu_Edit_Preferences = 6000, - Menu_View_Updates -}; - -BEGIN_EVENT_TABLE(CStarNetServerFrame, wxFrame) - EVT_MENU(wxID_EXIT, CStarNetServerFrame::onQuit) - EVT_MENU(Menu_Edit_Preferences, CStarNetServerFrame::onPreferences) - EVT_MENU(Menu_View_Updates, CStarNetServerFrame::onUpdates) - EVT_MENU(wxID_ABOUT, CStarNetServerFrame::onAbout) - - EVT_CLOSE(CStarNetServerFrame::onClose) - - EVT_CUSTOM(LOG_EVENT, wxID_ANY, CStarNetServerFrame::onLog) -END_EVENT_TABLE() - -CStarNetServerFrame::CStarNetServerFrame(const wxString& title, const wxPoint& position, bool gui) : -wxFrame(NULL, -1, title, position), -#if defined(__WXDEBUG__) -m_updates(true) -#else -m_updates(gui) -#endif -{ - SetMenuBar(createMenuBar()); - - wxBoxSizer* mainSizer = new wxBoxSizer(wxVERTICAL); - - wxPanel* panel = new wxPanel(this); - - wxBoxSizer* panelSizer = new wxBoxSizer(wxVERTICAL); - - wxStaticBoxSizer* log1Sizer = new wxStaticBoxSizer(new wxStaticBox(panel, -1, _("Log")), wxVERTICAL); - wxBoxSizer* log2Sizer = new wxBoxSizer(wxVERTICAL); - - for (unsigned int i = 0U; i < 20U; i++) { - m_logLine[i] = new wxStaticText(panel, -1, wxEmptyString, wxDefaultPosition, wxSize(LOGTEXT_WIDTH, -1)); - m_logLine[i]->Wrap(LOGTEXT_WIDTH); - log2Sizer->Add(m_logLine[i], 0, wxTOP | wxLEFT | wxRIGHT, BORDER_SIZE); - } - - log1Sizer->Add(log2Sizer); - panelSizer->Add(log1Sizer, 0, wxALL, BORDER_SIZE); - - panel->SetSizer(panelSizer); - panelSizer->SetSizeHints(panel); - - mainSizer->Add(panel); - - SetSizer(mainSizer); - mainSizer->SetSizeHints(this); -} - -CStarNetServerFrame::~CStarNetServerFrame() -{ -} - -wxMenuBar* CStarNetServerFrame::createMenuBar() -{ - wxMenu* fileMenu = new wxMenu(); - fileMenu->Append(wxID_EXIT, _("Exit")); - - wxMenu* editMenu = new wxMenu(); - editMenu->Append(Menu_Edit_Preferences, _("Preferences...")); - - wxMenu* viewMenu = new wxMenu(); - viewMenu->AppendCheckItem(Menu_View_Updates, _("GUI Updates")); - viewMenu->Check(Menu_View_Updates, m_updates); - - wxMenu* helpMenu = new wxMenu(); - helpMenu->Append(wxID_ABOUT, _("About StarNet Server")); - - wxMenuBar* menuBar = new wxMenuBar(); - menuBar->Append(fileMenu, _("File")); - menuBar->Append(editMenu, _("Edit")); - menuBar->Append(viewMenu, _("View")); - menuBar->Append(helpMenu, _("Help")); - - return menuBar; -} - -void CStarNetServerFrame::onQuit(wxCommandEvent&) -{ - Close(false); -} - -void CStarNetServerFrame::onClose(wxCloseEvent&) -{ - int x, y; - GetPosition(&x, &y); - if (x >= 0 && y >= 0) { - ::wxGetApp().setPosition(x, y); - ::wxGetApp().writeConfig(); - } - - Destroy(); -} - -void CStarNetServerFrame::onPreferences(wxCommandEvent&) -{ - wxString callsign, address; - ::wxGetApp().getGateway(callsign, address); - - wxString hostname, username, password; - ::wxGetApp().getIrcDDB(hostname, username, password); - - unsigned int remotePort; - wxString remotePassword; - bool remoteEnabled; - ::wxGetApp().getRemote(remoteEnabled, remotePassword, remotePort); - - bool logEnabled; - ::wxGetApp().getMiscellaneous(logEnabled); - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - wxString starNetBand1, starNetCallsign1, starNetLogoff1, starNetInfo1, starNetLink1, starNetPermanent1; - unsigned int starNetUserTimeout1, starNetGroupTimeout1; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch1; - bool starNetTXMsgSwitch1; - ::wxGetApp().getStarNet1(starNetBand1, starNetCallsign1, starNetLogoff1, starNetInfo1, starNetPermanent1, starNetUserTimeout1, starNetGroupTimeout1, starNetCallsignSwitch1, starNetTXMsgSwitch1, starNetLink1); - - wxString starNetBand2, starNetCallsign2, starNetLogoff2, starNetInfo2, starNetLink2, starNetPermanent2; - unsigned int starNetUserTimeout2, starNetGroupTimeout2; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch2; - bool starNetTXMsgSwitch2; - ::wxGetApp().getStarNet2(starNetBand2, starNetCallsign2, starNetLogoff2, starNetInfo2, starNetPermanent2, starNetUserTimeout2, starNetGroupTimeout2, starNetCallsignSwitch2, starNetTXMsgSwitch2, starNetLink2); - - wxString starNetBand3, starNetCallsign3, starNetLogoff3, starNetInfo3, starNetLink3, starNetPermanent3; - unsigned int starNetUserTimeout3, starNetGroupTimeout3; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch3; - bool starNetTXMsgSwitch3; - ::wxGetApp().getStarNet3(starNetBand3, starNetCallsign3, starNetLogoff3, starNetInfo3, starNetPermanent3, starNetUserTimeout3, starNetGroupTimeout3, starNetCallsignSwitch3, starNetTXMsgSwitch3, starNetLink3); - - wxString starNetBand4, starNetCallsign4, starNetLogoff4, starNetInfo4, starNetLink4, starNetPermanent4; - unsigned int starNetUserTimeout4, starNetGroupTimeout4; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch4; - bool starNetTXMsgSwitch4; - ::wxGetApp().getStarNet4(starNetBand4, starNetCallsign4, starNetLogoff4, starNetInfo4, starNetPermanent4, starNetUserTimeout4, starNetGroupTimeout4, starNetCallsignSwitch4, starNetTXMsgSwitch4, starNetLink4); - - wxString starNetBand5, starNetCallsign5, starNetLogoff5, starNetInfo5, starNetLink5, starNetPermanent5; - unsigned int starNetUserTimeout5, starNetGroupTimeout5; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch5; - bool starNetTXMsgSwitch5; - ::wxGetApp().getStarNet5(starNetBand5, starNetCallsign5, starNetLogoff5, starNetInfo5, starNetPermanent5, starNetUserTimeout5, starNetGroupTimeout5, starNetCallsignSwitch5, starNetTXMsgSwitch5, starNetLink5); - - wxString starNetBand6, starNetCallsign6, starNetLogoff6, starNetInfo6, starNetLink6, starNetPermanent6; - unsigned int starNetUserTimeout6, starNetGroupTimeout6; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch6; - bool starNetTXMsgSwitch6; - ::wxGetApp().getStarNet6(starNetBand6, starNetCallsign6, starNetLogoff6, starNetInfo6, starNetPermanent6, starNetUserTimeout6, starNetGroupTimeout6, starNetCallsignSwitch6, starNetTXMsgSwitch6, starNetLink6); - - wxString starNetBand7, starNetCallsign7, starNetLogoff7, starNetInfo7, starNetLink7, starNetPermanent7; - unsigned int starNetUserTimeout7, starNetGroupTimeout7; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch7; - bool starNetTXMsgSwitch7; - ::wxGetApp().getStarNet7(starNetBand7, starNetCallsign7, starNetLogoff7, starNetInfo7, starNetPermanent7, starNetUserTimeout7, starNetGroupTimeout7, starNetCallsignSwitch7, starNetTXMsgSwitch7, starNetLink7); - - wxString starNetBand8, starNetCallsign8, starNetLogoff8, starNetInfo8, starNetLink8, starNetPermanent8; - unsigned int starNetUserTimeout8, starNetGroupTimeout8; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch8; - bool starNetTXMsgSwitch8; - ::wxGetApp().getStarNet8(starNetBand8, starNetCallsign8, starNetLogoff8, starNetInfo8, starNetPermanent8, starNetUserTimeout8, starNetGroupTimeout8, starNetCallsignSwitch8, starNetTXMsgSwitch8, starNetLink8); - - wxString starNetBand9, starNetCallsign9, starNetLogoff9, starNetInfo9, starNetLink9, starNetPermanent9; - unsigned int starNetUserTimeout9, starNetGroupTimeout9; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch9; - bool starNetTXMsgSwitch9; - ::wxGetApp().getStarNet9(starNetBand9, starNetCallsign9, starNetLogoff9, starNetInfo9, starNetPermanent9, starNetUserTimeout9, starNetGroupTimeout9, starNetCallsignSwitch9, starNetTXMsgSwitch9, starNetLink9); - - wxString starNetBand10, starNetCallsign10, starNetInfo10, starNetLogoff10, starNetLink10, starNetPermanent10; - unsigned int starNetUserTimeout10, starNetGroupTimeout10; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch10; - bool starNetTXMsgSwitch10; - ::wxGetApp().getStarNet10(starNetBand10, starNetCallsign10, starNetLogoff10, starNetInfo10, starNetPermanent10, starNetUserTimeout10, starNetGroupTimeout10, starNetCallsignSwitch10, starNetTXMsgSwitch10, starNetLink10); - - wxString starNetBand11, starNetCallsign11, starNetLogoff11, starNetInfo11, starNetLink11, starNetPermanent11; - unsigned int starNetUserTimeout11, starNetGroupTimeout11; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch11; - bool starNetTXMsgSwitch11; - ::wxGetApp().getStarNet11(starNetBand11, starNetCallsign11, starNetLogoff11, starNetInfo11, starNetPermanent11, starNetUserTimeout11, starNetGroupTimeout11, starNetCallsignSwitch11, starNetTXMsgSwitch11, starNetLink11); - - wxString starNetBand12, starNetCallsign12, starNetLogoff12, starNetInfo12, starNetLink12, starNetPermanent12; - unsigned int starNetUserTimeout12, starNetGroupTimeout12; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch12; - bool starNetTXMsgSwitch12; - ::wxGetApp().getStarNet12(starNetBand12, starNetCallsign12, starNetLogoff12, starNetInfo12, starNetPermanent12, starNetUserTimeout12, starNetGroupTimeout12, starNetCallsignSwitch12, starNetTXMsgSwitch12, starNetLink12); - - wxString starNetBand13, starNetCallsign13, starNetLogoff13, starNetInfo13, starNetLink13, starNetPermanent13; - unsigned int starNetUserTimeout13, starNetGroupTimeout13; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch13; - bool starNetTXMsgSwitch13; - ::wxGetApp().getStarNet13(starNetBand13, starNetCallsign13, starNetLogoff13, starNetInfo13, starNetPermanent13, starNetUserTimeout13, starNetGroupTimeout13, starNetCallsignSwitch13, starNetTXMsgSwitch13, starNetLink13); - - wxString starNetBand14, starNetCallsign14, starNetLogoff14, starNetInfo14, starNetLink14, starNetPermanent14; - unsigned int starNetUserTimeout14, starNetGroupTimeout14; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch14; - bool starNetTXMsgSwitch14; - ::wxGetApp().getStarNet14(starNetBand14, starNetCallsign14, starNetLogoff14, starNetInfo14, starNetPermanent14, starNetUserTimeout14, starNetGroupTimeout14, starNetCallsignSwitch14, starNetTXMsgSwitch14, starNetLink14); - - wxString starNetBand15, starNetCallsign15, starNetLogoff15, starNetInfo15, starNetLink15, starNetPermanent15; - unsigned int starNetUserTimeout15, starNetGroupTimeout15; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch15; - bool starNetTXMsgSwitch15; - ::wxGetApp().getStarNet15(starNetBand15, starNetCallsign15, starNetLogoff15, starNetInfo15, starNetPermanent15, starNetUserTimeout15, starNetGroupTimeout15, starNetCallsignSwitch15, starNetTXMsgSwitch15, starNetLink15); - - CStarNetServerPreferences dialog1(this, -1, callsign, address, - hostname, username, password, logEnabled, - starNetBand1, starNetCallsign1, starNetLogoff1, starNetInfo1, starNetPermanent1, starNetUserTimeout1, starNetGroupTimeout1, starNetCallsignSwitch1, starNetTXMsgSwitch1, starNetLink1, - starNetBand2, starNetCallsign2, starNetLogoff2, starNetInfo2, starNetPermanent2, starNetUserTimeout2, starNetGroupTimeout2, starNetCallsignSwitch2, starNetTXMsgSwitch2, starNetLink2, - starNetBand3, starNetCallsign3, starNetLogoff3, starNetInfo3, starNetPermanent3, starNetUserTimeout3, starNetGroupTimeout3, starNetCallsignSwitch3, starNetTXMsgSwitch3, starNetLink3, - starNetBand4, starNetCallsign4, starNetLogoff4, starNetInfo4, starNetPermanent4, starNetUserTimeout4, starNetGroupTimeout4, starNetCallsignSwitch4, starNetTXMsgSwitch4, starNetLink4, - starNetBand5, starNetCallsign5, starNetLogoff5, starNetInfo5, starNetPermanent5, starNetUserTimeout5, starNetGroupTimeout5, starNetCallsignSwitch5, starNetTXMsgSwitch5, starNetLink5, - starNetBand6, starNetCallsign6, starNetLogoff6, starNetInfo6, starNetPermanent6, starNetUserTimeout6, starNetGroupTimeout6, starNetCallsignSwitch6, starNetTXMsgSwitch6, starNetLink6, - starNetBand7, starNetCallsign7, starNetLogoff7, starNetInfo7, starNetPermanent7, starNetUserTimeout7, starNetGroupTimeout7, starNetCallsignSwitch7, starNetTXMsgSwitch7, starNetLink7, - starNetBand8, starNetCallsign8, starNetLogoff8, starNetInfo8, starNetPermanent8, starNetUserTimeout8, starNetGroupTimeout8, starNetCallsignSwitch8, starNetTXMsgSwitch8, starNetLink8, - starNetBand9, starNetCallsign9, starNetLogoff9, starNetInfo9, starNetPermanent9, starNetUserTimeout9, starNetGroupTimeout9, starNetCallsignSwitch9, starNetTXMsgSwitch9, starNetLink9, - starNetBand10, starNetCallsign10, starNetLogoff10, starNetInfo10, starNetPermanent10, starNetUserTimeout10, starNetGroupTimeout10, starNetCallsignSwitch10, starNetTXMsgSwitch10, starNetLink10, - starNetBand11, starNetCallsign11, starNetLogoff11, starNetInfo11, starNetPermanent11, starNetUserTimeout11, starNetGroupTimeout11, starNetCallsignSwitch11, starNetTXMsgSwitch11, starNetLink11, - starNetBand12, starNetCallsign12, starNetLogoff12, starNetInfo12, starNetPermanent12, starNetUserTimeout12, starNetGroupTimeout12, starNetCallsignSwitch12, starNetTXMsgSwitch12, starNetLink12, - starNetBand13, starNetCallsign13, starNetLogoff13, starNetInfo13, starNetPermanent13, starNetUserTimeout13, starNetGroupTimeout13, starNetCallsignSwitch13, starNetTXMsgSwitch13, starNetLink13, - starNetBand14, starNetCallsign14, starNetLogoff14, starNetInfo14, starNetPermanent14, starNetUserTimeout14, starNetGroupTimeout14, starNetCallsignSwitch14, starNetTXMsgSwitch14, starNetLink14, - starNetBand15, starNetCallsign15, starNetLogoff15, starNetInfo15, starNetPermanent15, starNetUserTimeout15, starNetGroupTimeout15, starNetCallsignSwitch15, starNetTXMsgSwitch15, starNetLink15, - remoteEnabled, remotePassword, remotePort); -#else - wxString starNetBand1, starNetCallsign1, starNetLogoff1, starNetInfo1, starNetPermanent1; - unsigned int starNetUserTimeout1, starNetGroupTimeout1; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch1; - bool starNetTXMsgSwitch1; - ::wxGetApp().getStarNet1(starNetBand1, starNetCallsign1, starNetLogoff1, starNetInfo1, starNetPermanent1, starNetUserTimeout1, starNetGroupTimeout1, starNetCallsignSwitch1, starNetTXMsgSwitch1); - - wxString starNetBand2, starNetCallsign2, starNetLogoff2, starNetInfo2, starNetPermanent2; - unsigned int starNetUserTimeout2, starNetGroupTimeout2; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch2; - bool starNetTXMsgSwitch2; - ::wxGetApp().getStarNet2(starNetBand2, starNetCallsign2, starNetLogoff2, starNetInfo2, starNetPermanent2, starNetUserTimeout2, starNetGroupTimeout2, starNetCallsignSwitch2, starNetTXMsgSwitch2); - - wxString starNetBand3, starNetCallsign3, starNetLogoff3, starNetInfo3, starNetPermanent3; - unsigned int starNetUserTimeout3, starNetGroupTimeout3; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch3; - bool starNetTXMsgSwitch3; - ::wxGetApp().getStarNet3(starNetBand3, starNetCallsign3, starNetLogoff3, starNetInfo3, starNetPermanent3, starNetUserTimeout3, starNetGroupTimeout3, starNetCallsignSwitch3, starNetTXMsgSwitch3); - - wxString starNetBand4, starNetCallsign4, starNetLogoff4, starNetInfo4, starNetPermanent4; - unsigned int starNetUserTimeout4, starNetGroupTimeout4; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch4; - bool starNetTXMsgSwitch4; - ::wxGetApp().getStarNet4(starNetBand4, starNetCallsign4, starNetLogoff4, starNetInfo4, starNetPermanent4, starNetUserTimeout4, starNetGroupTimeout4, starNetCallsignSwitch4, starNetTXMsgSwitch4); - - wxString starNetBand5, starNetCallsign5, starNetLogoff5, starNetInfo5, starNetPermanent5; - unsigned int starNetUserTimeout5, starNetGroupTimeout5; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch5; - bool starNetTXMsgSwitch5; - ::wxGetApp().getStarNet5(starNetBand5, starNetCallsign5, starNetLogoff5, starNetInfo5, starNetPermanent5, starNetUserTimeout5, starNetGroupTimeout5, starNetCallsignSwitch5, starNetTXMsgSwitch5); - - wxString starNetBand6, starNetCallsign6, starNetLogoff6, starNetInfo6, starNetPermanent6; - unsigned int starNetUserTimeout6, starNetGroupTimeout6; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch6; - bool starNetTXMsgSwitch6; - ::wxGetApp().getStarNet6(starNetBand6, starNetCallsign6, starNetLogoff6, starNetInfo6, starNetPermanent6, starNetUserTimeout6, starNetGroupTimeout6, starNetCallsignSwitch6, starNetTXMsgSwitch6); - - wxString starNetBand7, starNetCallsign7, starNetLogoff7, starNetInfo7, starNetPermanent7; - unsigned int starNetUserTimeout7, starNetGroupTimeout7; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch7; - bool starNetTXMsgSwitch7; - ::wxGetApp().getStarNet7(starNetBand7, starNetCallsign7, starNetLogoff7, starNetInfo7, starNetPermanent7, starNetUserTimeout7, starNetGroupTimeout7, starNetCallsignSwitch7, starNetTXMsgSwitch7); - - wxString starNetBand8, starNetCallsign8, starNetLogoff8, starNetInfo8, starNetPermanent8; - unsigned int starNetUserTimeout8, starNetGroupTimeout8; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch8; - bool starNetTXMsgSwitch8; - ::wxGetApp().getStarNet8(starNetBand8, starNetCallsign8, starNetLogoff8, starNetInfo8, starNetPermanent8, starNetUserTimeout8, starNetGroupTimeout8, starNetCallsignSwitch8, starNetTXMsgSwitch8); - - wxString starNetBand9, starNetCallsign9, starNetLogoff9, starNetInfo9, starNetPermanent9; - unsigned int starNetUserTimeout9, starNetGroupTimeout9; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch9; - bool starNetTXMsgSwitch9; - ::wxGetApp().getStarNet9(starNetBand9, starNetCallsign9, starNetLogoff9, starNetInfo9, starNetPermanent9, starNetUserTimeout9, starNetGroupTimeout9, starNetCallsignSwitch9, starNetTXMsgSwitch9); - - wxString starNetBand10, starNetCallsign10, starNetLogoff10, starNetInfo10, starNetPermanent10; - unsigned int starNetUserTimeout10, starNetGroupTimeout10; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch10; - bool starNetTXMsgSwitch10; - ::wxGetApp().getStarNet10(starNetBand10, starNetCallsign10, starNetLogoff10, starNetInfo10, starNetPermanent10, starNetUserTimeout10, starNetGroupTimeout10, starNetCallsignSwitch10, starNetTXMsgSwitch10); - - wxString starNetBand11, starNetCallsign11, starNetLogoff11, starNetInfo11, starNetPermanent11; - unsigned int starNetUserTimeout11, starNetGroupTimeout11; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch11; - bool starNetTXMsgSwitch11; - ::wxGetApp().getStarNet11(starNetBand11, starNetCallsign11, starNetLogoff11, starNetInfo11, starNetPermanent11, starNetUserTimeout11, starNetGroupTimeout11, starNetCallsignSwitch11, starNetTXMsgSwitch11); - - wxString starNetBand12, starNetCallsign12, starNetLogoff12, starNetInfo12, starNetPermanent12; - unsigned int starNetUserTimeout12, starNetGroupTimeout12; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch12; - bool starNetTXMsgSwitch12; - ::wxGetApp().getStarNet12(starNetBand12, starNetCallsign12, starNetLogoff12, starNetInfo12, starNetPermanent12, starNetUserTimeout12, starNetGroupTimeout12, starNetCallsignSwitch12, starNetTXMsgSwitch12); - - wxString starNetBand13, starNetCallsign13, starNetLogoff13, starNetInfo13, starNetPermanent13; - unsigned int starNetUserTimeout13, starNetGroupTimeout13; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch13; - bool starNetTXMsgSwitch13; - ::wxGetApp().getStarNet13(starNetBand13, starNetCallsign13, starNetLogoff13, starNetInfo13, starNetPermanent13, starNetUserTimeout13, starNetGroupTimeout13, starNetCallsignSwitch13, starNetTXMsgSwitch13); - - wxString starNetBand14, starNetCallsign14, starNetLogoff14, starNetInfo14, starNetPermanent14; - unsigned int starNetUserTimeout14, starNetGroupTimeout14; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch14; - bool starNetTXMsgSwitch14; - ::wxGetApp().getStarNet14(starNetBand14, starNetCallsign14, starNetLogoff14, starNetInfo14, starNetPermanent14, starNetUserTimeout14, starNetGroupTimeout14, starNetCallsignSwitch14, starNetTXMsgSwitch14); - - wxString starNetBand15, starNetCallsign15, starNetLogoff15, starNetInfo15, starNetPermanent15; - unsigned int starNetUserTimeout15, starNetGroupTimeout15; - STARNET_CALLSIGN_SWITCH starNetCallsignSwitch15; - bool starNetTXMsgSwitch15; - ::wxGetApp().getStarNet15(starNetBand15, starNetCallsign15, starNetLogoff15, starNetInfo15, starNetPermanent15, starNetUserTimeout15, starNetGroupTimeout15, starNetCallsignSwitch15, starNetTXMsgSwitch15); - - CStarNetServerPreferences dialog1(this, -1, callsign, address, - hostname, username, password, logEnabled, - starNetBand1, starNetCallsign1, starNetLogoff1, starNetInfo1, starNetPermanent1, starNetUserTimeout1, starNetGroupTimeout1, starNetCallsignSwitch1, starNetTXMsgSwitch1, - starNetBand2, starNetCallsign2, starNetLogoff2, starNetInfo2, starNetPermanent2, starNetUserTimeout2, starNetGroupTimeout2, starNetCallsignSwitch2, starNetTXMsgSwitch2, - starNetBand3, starNetCallsign3, starNetLogoff3, starNetInfo3, starNetPermanent3, starNetUserTimeout3, starNetGroupTimeout3, starNetCallsignSwitch3, starNetTXMsgSwitch3, - starNetBand4, starNetCallsign4, starNetLogoff4, starNetInfo4, starNetPermanent4, starNetUserTimeout4, starNetGroupTimeout4, starNetCallsignSwitch4, starNetTXMsgSwitch4, - starNetBand5, starNetCallsign5, starNetLogoff5, starNetInfo5, starNetPermanent5, starNetUserTimeout5, starNetGroupTimeout5, starNetCallsignSwitch5, starNetTXMsgSwitch5, - starNetBand6, starNetCallsign6, starNetLogoff6, starNetInfo6, starNetPermanent6, starNetUserTimeout6, starNetGroupTimeout6, starNetCallsignSwitch6, starNetTXMsgSwitch6, - starNetBand7, starNetCallsign7, starNetLogoff7, starNetInfo7, starNetPermanent7, starNetUserTimeout7, starNetGroupTimeout7, starNetCallsignSwitch7, starNetTXMsgSwitch7, - starNetBand8, starNetCallsign8, starNetLogoff8, starNetInfo8, starNetPermanent8, starNetUserTimeout8, starNetGroupTimeout8, starNetCallsignSwitch8, starNetTXMsgSwitch8, - starNetBand9, starNetCallsign9, starNetLogoff9, starNetInfo9, starNetPermanent9, starNetUserTimeout9, starNetGroupTimeout9, starNetCallsignSwitch9, starNetTXMsgSwitch9, - starNetBand10, starNetCallsign10, starNetLogoff10, starNetInfo10, starNetPermanent10, starNetUserTimeout10, starNetGroupTimeout10, starNetCallsignSwitch10, starNetTXMsgSwitch10, - starNetBand11, starNetCallsign11, starNetLogoff11, starNetInfo11, starNetPermanent11, starNetUserTimeout11, starNetGroupTimeout11, starNetCallsignSwitch11, starNetTXMsgSwitch11, - starNetBand12, starNetCallsign12, starNetLogoff12, starNetInfo12, starNetPermanent12, starNetUserTimeout12, starNetGroupTimeout12, starNetCallsignSwitch12, starNetTXMsgSwitch12, - starNetBand13, starNetCallsign13, starNetLogoff13, starNetInfo13, starNetPermanent13, starNetUserTimeout13, starNetGroupTimeout13, starNetCallsignSwitch13, starNetTXMsgSwitch13, - starNetBand14, starNetCallsign14, starNetLogoff14, starNetInfo14, starNetPermanent14, starNetUserTimeout14, starNetGroupTimeout14, starNetCallsignSwitch14, starNetTXMsgSwitch14, - starNetBand15, starNetCallsign15, starNetLogoff15, starNetInfo15, starNetPermanent15, starNetUserTimeout15, starNetGroupTimeout15, starNetCallsignSwitch15, starNetTXMsgSwitch15, - remoteEnabled, remotePassword, remotePort); -#endif - if (dialog1.ShowModal() != wxID_OK) - return; - - callsign = dialog1.getCallsign(); - address = dialog1.getAddress(); - - hostname = dialog1.getHostname(); - username = dialog1.getUsername(); - password = dialog1.getPassword(); - - starNetBand1 = dialog1.getStarNetBand1(); - starNetCallsign1 = dialog1.getStarNetCallsign1(); - starNetLogoff1 = dialog1.getStarNetLogoff1(); - starNetInfo1 = dialog1.getStarNetInfo1(); - starNetPermanent1 = dialog1.getStarNetPermanent1(); - starNetUserTimeout1 = dialog1.getStarNetUserTimeout1(); - starNetGroupTimeout1 = dialog1.getStarNetGroupTimeout1(); - starNetCallsignSwitch1 = dialog1.getStarNetCallsignSwitch1(); - starNetTXMsgSwitch1 = dialog1.getStarNetTXMsgSwitch1(); -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - starNetLink1 = dialog1.getStarNetLink1(); -#endif - - starNetBand2 = dialog1.getStarNetBand2(); - starNetCallsign2 = dialog1.getStarNetCallsign2(); - starNetLogoff2 = dialog1.getStarNetLogoff2(); - starNetInfo2 = dialog1.getStarNetInfo2(); - starNetPermanent2 = dialog1.getStarNetPermanent2(); - starNetUserTimeout2 = dialog1.getStarNetUserTimeout2(); - starNetGroupTimeout2 = dialog1.getStarNetGroupTimeout2(); - starNetCallsignSwitch2 = dialog1.getStarNetCallsignSwitch2(); - starNetTXMsgSwitch2 = dialog1.getStarNetTXMsgSwitch2(); -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - starNetLink2 = dialog1.getStarNetLink2(); -#endif - - starNetBand3 = dialog1.getStarNetBand3(); - starNetCallsign3 = dialog1.getStarNetCallsign3(); - starNetLogoff3 = dialog1.getStarNetLogoff3(); - starNetInfo3 = dialog1.getStarNetInfo3(); - starNetPermanent3 = dialog1.getStarNetPermanent3(); - starNetUserTimeout3 = dialog1.getStarNetUserTimeout3(); - starNetGroupTimeout3 = dialog1.getStarNetGroupTimeout3(); - starNetCallsignSwitch3 = dialog1.getStarNetCallsignSwitch3(); - starNetTXMsgSwitch3 = dialog1.getStarNetTXMsgSwitch3(); -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - starNetLink3 = dialog1.getStarNetLink3(); -#endif - - starNetBand4 = dialog1.getStarNetBand4(); - starNetCallsign4 = dialog1.getStarNetCallsign4(); - starNetLogoff4 = dialog1.getStarNetLogoff4(); - starNetInfo4 = dialog1.getStarNetInfo4(); - starNetPermanent4 = dialog1.getStarNetPermanent4(); - starNetUserTimeout4 = dialog1.getStarNetUserTimeout4(); - starNetGroupTimeout4 = dialog1.getStarNetGroupTimeout4(); - starNetCallsignSwitch4 = dialog1.getStarNetCallsignSwitch4(); - starNetTXMsgSwitch4 = dialog1.getStarNetTXMsgSwitch4(); -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - starNetLink4 = dialog1.getStarNetLink4(); -#endif - - starNetBand5 = dialog1.getStarNetBand5(); - starNetCallsign5 = dialog1.getStarNetCallsign5(); - starNetLogoff5 = dialog1.getStarNetLogoff5(); - starNetInfo5 = dialog1.getStarNetInfo5(); - starNetPermanent5 = dialog1.getStarNetPermanent5(); - starNetUserTimeout5 = dialog1.getStarNetUserTimeout5(); - starNetGroupTimeout5 = dialog1.getStarNetGroupTimeout5(); - starNetCallsignSwitch5 = dialog1.getStarNetCallsignSwitch5(); - starNetTXMsgSwitch5 = dialog1.getStarNetTXMsgSwitch5(); -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - starNetLink5 = dialog1.getStarNetLink5(); -#endif - - starNetBand6 = dialog1.getStarNetBand6(); - starNetCallsign6 = dialog1.getStarNetCallsign6(); - starNetLogoff6 = dialog1.getStarNetLogoff6(); - starNetInfo6 = dialog1.getStarNetInfo6(); - starNetPermanent6 = dialog1.getStarNetPermanent6(); - starNetUserTimeout6 = dialog1.getStarNetUserTimeout6(); - starNetGroupTimeout6 = dialog1.getStarNetGroupTimeout6(); - starNetCallsignSwitch6 = dialog1.getStarNetCallsignSwitch6(); - starNetTXMsgSwitch6 = dialog1.getStarNetTXMsgSwitch6(); -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - starNetLink6 = dialog1.getStarNetLink6(); -#endif - - starNetBand7 = dialog1.getStarNetBand7(); - starNetCallsign7 = dialog1.getStarNetCallsign7(); - starNetLogoff7 = dialog1.getStarNetLogoff7(); - starNetInfo7 = dialog1.getStarNetInfo7(); - starNetPermanent7 = dialog1.getStarNetPermanent7(); - starNetUserTimeout7 = dialog1.getStarNetUserTimeout7(); - starNetGroupTimeout7 = dialog1.getStarNetGroupTimeout7(); - starNetCallsignSwitch7 = dialog1.getStarNetCallsignSwitch7(); - starNetTXMsgSwitch7 = dialog1.getStarNetTXMsgSwitch7(); -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - starNetLink7 = dialog1.getStarNetLink7(); -#endif - - starNetBand8 = dialog1.getStarNetBand8(); - starNetCallsign8 = dialog1.getStarNetCallsign8(); - starNetLogoff8 = dialog1.getStarNetLogoff8(); - starNetInfo8 = dialog1.getStarNetInfo8(); - starNetPermanent8 = dialog1.getStarNetPermanent8(); - starNetUserTimeout8 = dialog1.getStarNetUserTimeout8(); - starNetGroupTimeout8 = dialog1.getStarNetGroupTimeout8(); - starNetCallsignSwitch8 = dialog1.getStarNetCallsignSwitch8(); - starNetTXMsgSwitch8 = dialog1.getStarNetTXMsgSwitch8(); -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - starNetLink8 = dialog1.getStarNetLink8(); -#endif - - starNetBand9 = dialog1.getStarNetBand9(); - starNetCallsign9 = dialog1.getStarNetCallsign9(); - starNetLogoff9 = dialog1.getStarNetLogoff9(); - starNetInfo9 = dialog1.getStarNetInfo9(); - starNetPermanent9 = dialog1.getStarNetPermanent9(); - starNetUserTimeout9 = dialog1.getStarNetUserTimeout9(); - starNetGroupTimeout9 = dialog1.getStarNetGroupTimeout9(); - starNetCallsignSwitch9 = dialog1.getStarNetCallsignSwitch9(); - starNetTXMsgSwitch9 = dialog1.getStarNetTXMsgSwitch9(); -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - starNetLink9 = dialog1.getStarNetLink9(); -#endif - - starNetBand10 = dialog1.getStarNetBand10(); - starNetCallsign10 = dialog1.getStarNetCallsign10(); - starNetLogoff10 = dialog1.getStarNetLogoff10(); - starNetInfo10 = dialog1.getStarNetInfo10(); - starNetPermanent10 = dialog1.getStarNetPermanent10(); - starNetUserTimeout10 = dialog1.getStarNetUserTimeout10(); - starNetGroupTimeout10 = dialog1.getStarNetGroupTimeout10(); - starNetCallsignSwitch10 = dialog1.getStarNetCallsignSwitch10(); - starNetTXMsgSwitch10 = dialog1.getStarNetTXMsgSwitch10(); -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - starNetLink10 = dialog1.getStarNetLink10(); -#endif - - starNetBand11 = dialog1.getStarNetBand11(); - starNetCallsign11 = dialog1.getStarNetCallsign11(); - starNetLogoff11 = dialog1.getStarNetLogoff11(); - starNetInfo11 = dialog1.getStarNetInfo11(); - starNetPermanent11 = dialog1.getStarNetPermanent11(); - starNetUserTimeout11 = dialog1.getStarNetUserTimeout11(); - starNetGroupTimeout11 = dialog1.getStarNetGroupTimeout11(); - starNetCallsignSwitch11 = dialog1.getStarNetCallsignSwitch11(); - starNetTXMsgSwitch11 = dialog1.getStarNetTXMsgSwitch11(); -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - starNetLink11 = dialog1.getStarNetLink11(); -#endif - - starNetBand12 = dialog1.getStarNetBand12(); - starNetCallsign12 = dialog1.getStarNetCallsign12(); - starNetLogoff12 = dialog1.getStarNetLogoff12(); - starNetInfo12 = dialog1.getStarNetInfo12(); - starNetPermanent12 = dialog1.getStarNetPermanent12(); - starNetUserTimeout12 = dialog1.getStarNetUserTimeout12(); - starNetGroupTimeout12 = dialog1.getStarNetGroupTimeout12(); - starNetCallsignSwitch12 = dialog1.getStarNetCallsignSwitch12(); - starNetTXMsgSwitch12 = dialog1.getStarNetTXMsgSwitch12(); -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - starNetLink12 = dialog1.getStarNetLink12(); -#endif - - starNetBand13 = dialog1.getStarNetBand13(); - starNetCallsign13 = dialog1.getStarNetCallsign13(); - starNetLogoff13 = dialog1.getStarNetLogoff13(); - starNetInfo13 = dialog1.getStarNetInfo13(); - starNetPermanent13 = dialog1.getStarNetPermanent13(); - starNetUserTimeout13 = dialog1.getStarNetUserTimeout13(); - starNetGroupTimeout13 = dialog1.getStarNetGroupTimeout13(); - starNetCallsignSwitch13 = dialog1.getStarNetCallsignSwitch13(); - starNetTXMsgSwitch13 = dialog1.getStarNetTXMsgSwitch13(); -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - starNetLink13 = dialog1.getStarNetLink13(); -#endif - - starNetBand14 = dialog1.getStarNetBand14(); - starNetCallsign14 = dialog1.getStarNetCallsign14(); - starNetLogoff14 = dialog1.getStarNetLogoff14(); - starNetInfo14 = dialog1.getStarNetInfo14(); - starNetPermanent14 = dialog1.getStarNetPermanent14(); - starNetUserTimeout14 = dialog1.getStarNetUserTimeout14(); - starNetGroupTimeout14 = dialog1.getStarNetGroupTimeout14(); - starNetCallsignSwitch14 = dialog1.getStarNetCallsignSwitch14(); - starNetTXMsgSwitch14 = dialog1.getStarNetTXMsgSwitch14(); -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - starNetLink14 = dialog1.getStarNetLink14(); -#endif - - starNetBand15 = dialog1.getStarNetBand15(); - starNetCallsign15 = dialog1.getStarNetCallsign15(); - starNetLogoff15 = dialog1.getStarNetLogoff15(); - starNetInfo15 = dialog1.getStarNetInfo15(); - starNetPermanent15 = dialog1.getStarNetPermanent15(); - starNetUserTimeout15 = dialog1.getStarNetUserTimeout15(); - starNetGroupTimeout15 = dialog1.getStarNetGroupTimeout15(); - starNetCallsignSwitch15 = dialog1.getStarNetCallsignSwitch15(); - starNetTXMsgSwitch15 = dialog1.getStarNetTXMsgSwitch15(); -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - starNetLink15 = dialog1.getStarNetLink15(); -#endif - - remoteEnabled = dialog1.getRemoteEnabled(); - remotePassword = dialog1.getRemotePassword(); - remotePort = dialog1.getRemotePort(); - - logEnabled = dialog1.getLogEnabled(); - - ::wxGetApp().setGateway(callsign, address); - ::wxGetApp().setIrcDDB(hostname, username, password); -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - ::wxGetApp().setStarNet1(starNetBand1, starNetCallsign1, starNetLogoff1, starNetInfo1, starNetPermanent1, starNetUserTimeout1, starNetGroupTimeout1, starNetCallsignSwitch1, starNetTXMsgSwitch1, starNetLink1); - ::wxGetApp().setStarNet2(starNetBand2, starNetCallsign2, starNetLogoff2, starNetInfo2, starNetPermanent2, starNetUserTimeout2, starNetGroupTimeout2, starNetCallsignSwitch2, starNetTXMsgSwitch2, starNetLink2); - ::wxGetApp().setStarNet3(starNetBand3, starNetCallsign3, starNetLogoff3, starNetInfo3, starNetPermanent3, starNetUserTimeout3, starNetGroupTimeout3, starNetCallsignSwitch3, starNetTXMsgSwitch3, starNetLink3); - ::wxGetApp().setStarNet4(starNetBand4, starNetCallsign4, starNetLogoff4, starNetInfo4, starNetPermanent4, starNetUserTimeout4, starNetGroupTimeout4, starNetCallsignSwitch4, starNetTXMsgSwitch4, starNetLink4); - ::wxGetApp().setStarNet5(starNetBand5, starNetCallsign5, starNetLogoff5, starNetInfo5, starNetPermanent5, starNetUserTimeout5, starNetGroupTimeout5, starNetCallsignSwitch5, starNetTXMsgSwitch5, starNetLink5); - ::wxGetApp().setStarNet6(starNetBand6, starNetCallsign6, starNetLogoff6, starNetInfo6, starNetPermanent6, starNetUserTimeout6, starNetGroupTimeout6, starNetCallsignSwitch6, starNetTXMsgSwitch6, starNetLink6); - ::wxGetApp().setStarNet7(starNetBand7, starNetCallsign7, starNetLogoff7, starNetInfo7, starNetPermanent7, starNetUserTimeout7, starNetGroupTimeout7, starNetCallsignSwitch7, starNetTXMsgSwitch7, starNetLink7); - ::wxGetApp().setStarNet8(starNetBand8, starNetCallsign8, starNetLogoff8, starNetInfo8, starNetPermanent8, starNetUserTimeout8, starNetGroupTimeout8, starNetCallsignSwitch8, starNetTXMsgSwitch8, starNetLink8); - ::wxGetApp().setStarNet9(starNetBand9, starNetCallsign9, starNetLogoff9, starNetInfo9, starNetPermanent9, starNetUserTimeout9, starNetGroupTimeout9, starNetCallsignSwitch9, starNetTXMsgSwitch9, starNetLink9); - ::wxGetApp().setStarNet10(starNetBand10, starNetCallsign10, starNetLogoff10, starNetInfo10, starNetPermanent10, starNetUserTimeout10, starNetGroupTimeout10, starNetCallsignSwitch10, starNetTXMsgSwitch10, starNetLink10); - ::wxGetApp().setStarNet11(starNetBand11, starNetCallsign11, starNetLogoff11, starNetInfo11, starNetPermanent11, starNetUserTimeout11, starNetGroupTimeout11, starNetCallsignSwitch11, starNetTXMsgSwitch11, starNetLink11); - ::wxGetApp().setStarNet12(starNetBand12, starNetCallsign12, starNetLogoff12, starNetInfo12, starNetPermanent12, starNetUserTimeout12, starNetGroupTimeout12, starNetCallsignSwitch12, starNetTXMsgSwitch12, starNetLink12); - ::wxGetApp().setStarNet13(starNetBand13, starNetCallsign13, starNetLogoff13, starNetInfo13, starNetPermanent13, starNetUserTimeout13, starNetGroupTimeout13, starNetCallsignSwitch13, starNetTXMsgSwitch13, starNetLink13); - ::wxGetApp().setStarNet14(starNetBand14, starNetCallsign14, starNetLogoff14, starNetInfo14, starNetPermanent14, starNetUserTimeout14, starNetGroupTimeout14, starNetCallsignSwitch14, starNetTXMsgSwitch14, starNetLink14); - ::wxGetApp().setStarNet15(starNetBand15, starNetCallsign15, starNetLogoff15, starNetInfo15, starNetPermanent15, starNetUserTimeout15, starNetGroupTimeout15, starNetCallsignSwitch15, starNetTXMsgSwitch15, starNetLink15); -#else - ::wxGetApp().setStarNet1(starNetBand1, starNetCallsign1, starNetLogoff1, starNetInfo1, starNetPermanent1, starNetUserTimeout1, starNetGroupTimeout1, starNetCallsignSwitch1, starNetTXMsgSwitch1); - ::wxGetApp().setStarNet2(starNetBand2, starNetCallsign2, starNetLogoff2, starNetInfo2, starNetPermanent2, starNetUserTimeout2, starNetGroupTimeout2, starNetCallsignSwitch2, starNetTXMsgSwitch2); - ::wxGetApp().setStarNet3(starNetBand3, starNetCallsign3, starNetLogoff3, starNetInfo3, starNetPermanent3, starNetUserTimeout3, starNetGroupTimeout3, starNetCallsignSwitch3, starNetTXMsgSwitch3); - ::wxGetApp().setStarNet4(starNetBand4, starNetCallsign4, starNetLogoff4, starNetInfo4, starNetPermanent4, starNetUserTimeout4, starNetGroupTimeout4, starNetCallsignSwitch4, starNetTXMsgSwitch4); - ::wxGetApp().setStarNet5(starNetBand5, starNetCallsign5, starNetLogoff5, starNetInfo5, starNetPermanent5, starNetUserTimeout5, starNetGroupTimeout5, starNetCallsignSwitch5, starNetTXMsgSwitch5); - ::wxGetApp().setStarNet6(starNetBand6, starNetCallsign6, starNetLogoff6, starNetInfo6, starNetPermanent6, starNetUserTimeout6, starNetGroupTimeout6, starNetCallsignSwitch6, starNetTXMsgSwitch6); - ::wxGetApp().setStarNet7(starNetBand7, starNetCallsign7, starNetLogoff7, starNetInfo7, starNetPermanent7, starNetUserTimeout7, starNetGroupTimeout7, starNetCallsignSwitch7, starNetTXMsgSwitch7); - ::wxGetApp().setStarNet8(starNetBand8, starNetCallsign8, starNetLogoff8, starNetInfo8, starNetPermanent8, starNetUserTimeout8, starNetGroupTimeout8, starNetCallsignSwitch8, starNetTXMsgSwitch8); - ::wxGetApp().setStarNet9(starNetBand9, starNetCallsign9, starNetLogoff9, starNetInfo9, starNetPermanent9, starNetUserTimeout9, starNetGroupTimeout9, starNetCallsignSwitch9, starNetTXMsgSwitch9); - ::wxGetApp().setStarNet10(starNetBand10, starNetCallsign10, starNetLogoff10, starNetInfo10, starNetPermanent10, starNetUserTimeout10, starNetGroupTimeout10, starNetCallsignSwitch10, starNetTXMsgSwitch10); - ::wxGetApp().setStarNet11(starNetBand11, starNetCallsign11, starNetLogoff11, starNetInfo11, starNetPermanent11, starNetUserTimeout11, starNetGroupTimeout11, starNetCallsignSwitch11, starNetTXMsgSwitch11); - ::wxGetApp().setStarNet12(starNetBand12, starNetCallsign12, starNetLogoff12, starNetInfo12, starNetPermanent12, starNetUserTimeout12, starNetGroupTimeout12, starNetCallsignSwitch12, starNetTXMsgSwitch12); - ::wxGetApp().setStarNet13(starNetBand13, starNetCallsign13, starNetLogoff13, starNetInfo13, starNetPermanent13, starNetUserTimeout13, starNetGroupTimeout13, starNetCallsignSwitch13, starNetTXMsgSwitch13); - ::wxGetApp().setStarNet14(starNetBand14, starNetCallsign14, starNetLogoff14, starNetInfo14, starNetPermanent14, starNetUserTimeout14, starNetGroupTimeout14, starNetCallsignSwitch14, starNetTXMsgSwitch14); - ::wxGetApp().setStarNet15(starNetBand15, starNetCallsign15, starNetLogoff15, starNetInfo15, starNetPermanent15, starNetUserTimeout15, starNetGroupTimeout15, starNetCallsignSwitch15, starNetTXMsgSwitch15); -#endif - ::wxGetApp().setRemote(remoteEnabled, remotePassword, remotePort); - ::wxGetApp().setMiscellaneous(logEnabled); - ::wxGetApp().writeConfig(); - - wxMessageDialog dialog2(this, _("The changes made will not take effect\nuntil the application is restarted"), _("StarNET Server Information"), wxICON_INFORMATION); - dialog2.ShowModal(); -} - -void CStarNetServerFrame::onUpdates(wxCommandEvent& event) -{ - m_updates = event.IsChecked(); -} - -void CStarNetServerFrame::onAbout(wxCommandEvent&) -{ - wxAboutDialogInfo info; - info.AddDeveloper(wxT("Jonathan Naylor, G4KLX")); - info.AddDeveloper(wxT("Michael Dirska, DL1BFF")); - info.SetCopyright(wxT("(C) 2011-2018 using GPL v2 or later")); - info.SetName(APPLICATION_NAME); - info.SetVersion(VERSION); - info.SetDescription(_("This program allows an Internet connected computer \nto become a StarNet Digital Server.")); - - ::wxAboutBox(info); -} - -void CStarNetServerFrame::onLog(wxEvent& event) -{ - CLogEvent& logEvent = dynamic_cast(event); - - wxString text; - - text = m_logLine[1U]->GetLabel(); - m_logLine[0U]->SetLabel(text); - - text = m_logLine[2U]->GetLabel(); - m_logLine[1U]->SetLabel(text); - - text = m_logLine[3U]->GetLabel(); - m_logLine[2U]->SetLabel(text); - - text = m_logLine[4U]->GetLabel(); - m_logLine[3U]->SetLabel(text); - - text = m_logLine[5U]->GetLabel(); - m_logLine[4U]->SetLabel(text); - - text = m_logLine[6U]->GetLabel(); - m_logLine[5U]->SetLabel(text); - - text = m_logLine[7U]->GetLabel(); - m_logLine[6U]->SetLabel(text); - - text = m_logLine[8U]->GetLabel(); - m_logLine[7U]->SetLabel(text); - - text = m_logLine[9U]->GetLabel(); - m_logLine[8U]->SetLabel(text); - - text = m_logLine[10U]->GetLabel(); - m_logLine[9U]->SetLabel(text); - - text = m_logLine[11U]->GetLabel(); - m_logLine[10U]->SetLabel(text); - - text = m_logLine[12U]->GetLabel(); - m_logLine[11U]->SetLabel(text); - - text = m_logLine[13U]->GetLabel(); - m_logLine[12U]->SetLabel(text); - - text = m_logLine[14U]->GetLabel(); - m_logLine[13U]->SetLabel(text); - - text = m_logLine[15U]->GetLabel(); - m_logLine[14U]->SetLabel(text); - - text = m_logLine[16U]->GetLabel(); - m_logLine[15U]->SetLabel(text); - - text = m_logLine[17U]->GetLabel(); - m_logLine[16U]->SetLabel(text); - - text = m_logLine[18U]->GetLabel(); - m_logLine[17U]->SetLabel(text); - - text = m_logLine[19U]->GetLabel(); - m_logLine[18U]->SetLabel(text); - - text = logEvent.getText(); - m_logLine[19U]->SetLabel(text); -} - -void CStarNetServerFrame::showLog(const wxString& text) -{ - if (!m_updates) - return; - - CLogEvent event(text, LOG_EVENT); - - AddPendingEvent(event); -} diff --git a/StarNetServer/StarNetServerFrame.h b/StarNetServer/StarNetServerFrame.h deleted file mode 100644 index 9561190..0000000 --- a/StarNetServer/StarNetServerFrame.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (C) 2010,2011,2012 by Jonathan Naylor G4KLX - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef StarNetServerFrame_H -#define StarNetServerFrame_H - -#include "Defs.h" - -#include -#include - -class CStarNetServerFrame : public wxFrame { -public: - CStarNetServerFrame(const wxString& title, const wxPoint& position, bool gui); - virtual ~CStarNetServerFrame(); - - virtual void onQuit(wxCommandEvent& event); - virtual void onPreferences(wxCommandEvent& event); - virtual void onUpdates(wxCommandEvent& event); - virtual void onAbout(wxCommandEvent& event); - virtual void onClose(wxCloseEvent& event); - virtual void onLog(wxEvent& event); - - virtual void showLog(const wxString& text); - -private: - wxStaticText* m_logLine[20]; - bool m_updates; - - DECLARE_EVENT_TABLE() - - wxMenuBar* createMenuBar(); -}; - -#endif diff --git a/StarNetServer/StarNetServerIrcDDBSet.cpp b/StarNetServer/StarNetServerIrcDDBSet.cpp deleted file mode 100644 index f4f9b25..0000000 --- a/StarNetServer/StarNetServerIrcDDBSet.cpp +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (C) 2010,2012,2013,2014 by Jonathan Naylor G4KLX - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include "StarNetServerIrcDDBSet.h" - -const unsigned int BORDER_SIZE = 5U; -const unsigned int CONTROL_WIDTH1 = 200U; -const unsigned int CONTROL_WIDTH2 = 80U; - -const unsigned int PORT_LENGTH = 5U; - -CStarNetServerIrcDDBSet::CStarNetServerIrcDDBSet(wxWindow* parent, int id, const wxString& title, const wxString& hostname, const wxString& username, const wxString& password) : -wxPanel(parent, id), -m_title(title), -m_hostname(NULL), -m_username(NULL), -m_password(NULL) -{ - wxFlexGridSizer* sizer = new wxFlexGridSizer(2); - - wxStaticText* hostnameLabel = new wxStaticText(this, -1, _("Hostname")); - sizer->Add(hostnameLabel, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); - - m_hostname = new wxChoice(this, -1, wxDefaultPosition, wxSize(CONTROL_WIDTH1, -1)); - m_hostname->Append(wxT("group1-irc.ircddb.net")); - m_hostname->Append(wxT("group2-irc.ircddb.net")); - m_hostname->Append(wxT("irc1.openquad.net")); - m_hostname->Append(wxT("irc2.openquad.net")); - m_hostname->Append(wxT("irc3.openquad.net")); - m_hostname->Append(wxT("irc4.openquad.net")); - m_hostname->Append(wxT("irc5.openquad.net")); - m_hostname->Append(wxT("irc6.openquad.net")); - m_hostname->Append(wxT("server1-ik2xyp.free-dstar.org")); - m_hostname->Append(wxT("ircddb.dstar.su")); - sizer->Add(m_hostname, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); - m_hostname->SetStringSelection(hostname); - - wxStaticText* usernameLabel = new wxStaticText(this, -1, _("Username")); - sizer->Add(usernameLabel, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); - - m_username = new wxTextCtrl(this, -1, username, wxDefaultPosition, wxSize(CONTROL_WIDTH2, -1)); - sizer->Add(m_username, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); - - wxStaticText* passwordLabel = new wxStaticText(this, -1, _("Password")); - sizer->Add(passwordLabel, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); - - m_password = new wxTextCtrl(this, -1, password, wxDefaultPosition, wxSize(CONTROL_WIDTH1, -1), wxTE_PASSWORD); - sizer->Add(m_password, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); - - SetAutoLayout(true); - - SetSizer(sizer); -} - - -CStarNetServerIrcDDBSet::~CStarNetServerIrcDDBSet() -{ -} - -bool CStarNetServerIrcDDBSet::Validate() -{ - bool res = getHostname().IsEmpty(); - if (res) { - wxMessageDialog dialog(this, _("The Hostname may not be empty"), m_title + _(" Error"), wxICON_ERROR); - dialog.ShowModal(); - return false; - } - - res = getUsername().IsEmpty(); - if (res) { - wxMessageDialog dialog(this, _("The Username may not be empty"), m_title + _(" Error"), wxICON_ERROR); - dialog.ShowModal(); - return false; - } - - return true; -} - -wxString CStarNetServerIrcDDBSet::getHostname() const -{ - return m_hostname->GetStringSelection(); -} - -wxString CStarNetServerIrcDDBSet::getUsername() const -{ - return m_username->GetValue(); -} - -wxString CStarNetServerIrcDDBSet::getPassword() const -{ - return m_password->GetValue(); -} diff --git a/StarNetServer/StarNetServerIrcDDBSet.h b/StarNetServer/StarNetServerIrcDDBSet.h deleted file mode 100644 index 8eba83e..0000000 --- a/StarNetServer/StarNetServerIrcDDBSet.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2010,2012,2013 by Jonathan Naylor G4KLX - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef StarNetServerIrcDDBSet_H -#define StarNetServerIrcDDBSet_H - -#include - -class CStarNetServerIrcDDBSet : public wxPanel { -public: - CStarNetServerIrcDDBSet(wxWindow* parent, int id, const wxString& title, const wxString& hostname, const wxString& username, const wxString& password); - virtual ~CStarNetServerIrcDDBSet(); - - virtual bool Validate(); - - virtual wxString getHostname() const; - virtual wxString getUsername() const; - virtual wxString getPassword() const; - -private: - wxString m_title; - wxChoice* m_hostname; - wxTextCtrl* m_username; - wxTextCtrl* m_password; -}; - -#endif diff --git a/StarNetServer/StarNetServerLogRedirect.cpp b/StarNetServer/StarNetServerLogRedirect.cpp deleted file mode 100644 index 800c485..0000000 --- a/StarNetServer/StarNetServerLogRedirect.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (C) 2002,2003,2009-2013,2018 by Jonathan Naylor G4KLX - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include "StarNetServerLogRedirect.h" -#include "StarNetServerApp.h" - -CStarNetServerLogRedirect::CStarNetServerLogRedirect() : -wxLog() -{ -} - -CStarNetServerLogRedirect::~CStarNetServerLogRedirect() -{ -} - -void CStarNetServerLogRedirect::DoLogRecord(wxLogLevel level, const wxString& msg, const wxLogRecordInfo& info) -{ - wxString letter; - - switch (level) { - case wxLOG_FatalError: letter = wxT("F"); break; - case wxLOG_Error: letter = wxT("E"); break; - case wxLOG_Warning: letter = wxT("W"); break; - case wxLOG_Info: letter = wxT("I"); break; - case wxLOG_Message: letter = wxT("M"); break; - case wxLOG_Status: letter = wxT("M"); break; - case wxLOG_Trace: letter = wxT("T"); break; - case wxLOG_Debug: letter = wxT("D"); break; - default: letter = wxT("U"); break; - } - - struct tm* tm = ::gmtime(&info.timestamp); - - wxString message; - message.Printf(wxT("%s: %04d-%02d-%02d %02d:%02d:%02d: %s\n"), letter.c_str(), tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec, msg.c_str()); - - ::wxGetApp().showLog(message); - - if (level == wxLOG_FatalError) - ::abort(); -} diff --git a/StarNetServer/StarNetServerMiscellaneousSet.cpp b/StarNetServer/StarNetServerMiscellaneousSet.cpp deleted file mode 100644 index 8ea7bc5..0000000 --- a/StarNetServer/StarNetServerMiscellaneousSet.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2010,2011 by Jonathan Naylor G4KLX - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include "StarNetServerMiscellaneousSet.h" -#include "DStarDefines.h" - -const unsigned int CONTROL_WIDTH = 130U; - -const unsigned int BORDER_SIZE = 5U; - -CStarNetServerMiscellaneousSet::CStarNetServerMiscellaneousSet(wxWindow* parent, int id, const wxString& title, bool logEnabled) : -wxPanel(parent, id), -m_title(title), -m_logEnabled(NULL) -{ - wxFlexGridSizer* sizer = new wxFlexGridSizer(2); - - wxStaticText* logEnabledLabel = new wxStaticText(this, -1, _("GUI Log")); - sizer->Add(logEnabledLabel, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE); - - m_logEnabled = new wxChoice(this, -1, wxDefaultPosition, wxSize(CONTROL_WIDTH, -1)); - m_logEnabled->Append(_("Disabled")); - m_logEnabled->Append(_("Enabled")); - sizer->Add(m_logEnabled, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); - m_logEnabled->SetSelection(logEnabled ? 1 : 0); - - SetAutoLayout(true); - - SetSizer(sizer); -} - - -CStarNetServerMiscellaneousSet::~CStarNetServerMiscellaneousSet() -{ -} - -bool CStarNetServerMiscellaneousSet::Validate() -{ - return m_logEnabled->GetCurrentSelection() != wxNOT_FOUND; -} - -bool CStarNetServerMiscellaneousSet::getLogEnabled() const -{ - int c = m_logEnabled->GetCurrentSelection(); - if (c == wxNOT_FOUND) - return false; - - return c == 1; -} diff --git a/StarNetServer/StarNetServerMiscellaneousSet.h b/StarNetServer/StarNetServerMiscellaneousSet.h deleted file mode 100644 index ea72977..0000000 --- a/StarNetServer/StarNetServerMiscellaneousSet.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2010,2011 by Jonathan Naylor G4KLX - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef StarNetServerMiscellaneousSet_H -#define StarNetServerMiscellaneousSet_H - -#include "Defs.h" - -#include - -class CStarNetServerMiscellaneousSet : public wxPanel { -public: - CStarNetServerMiscellaneousSet(wxWindow* parent, int id, const wxString& title, bool logEnabled); - virtual ~CStarNetServerMiscellaneousSet(); - - virtual bool Validate(); - - virtual bool getLogEnabled() const; - -private: - wxString m_title; - wxChoice* m_logEnabled; -}; - -#endif diff --git a/StarNetServer/StarNetServerPreferences.cpp b/StarNetServer/StarNetServerPreferences.cpp deleted file mode 100644 index bede7ec..0000000 --- a/StarNetServer/StarNetServerPreferences.cpp +++ /dev/null @@ -1,1091 +0,0 @@ -/* - * Copyright (C) 2010,2011,2012,2013 by Jonathan Naylor G4KLX - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include "StarNetServerPreferences.h" -#include "StarNetServerDefs.h" - -const unsigned int BORDER_SIZE = 5U; - -CStarNetServerPreferences::CStarNetServerPreferences(wxWindow* parent, int id, - const wxString& callsign, const wxString& address, - const wxString& hostname, const wxString& username, - const wxString& password, - bool logEnabled, -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - const wxString& starNetBand1, const wxString& callsign1, const wxString& logoff1, const wxString& info1, const wxString& permanent1, unsigned int userTimeout1, unsigned int groupTimeout1, STARNET_CALLSIGN_SWITCH callsignSwitch1, bool txMsgSwitch1, const wxString& link1, - const wxString& starNetBand2, const wxString& callsign2, const wxString& logoff2, const wxString& info2, const wxString& permanent2, unsigned int userTimeout2, unsigned int groupTimeout2, STARNET_CALLSIGN_SWITCH callsignSwitch2, bool txMsgSwitch2, const wxString& link2, - const wxString& starNetBand3, const wxString& callsign3, const wxString& logoff3, const wxString& info3, const wxString& permanent3, unsigned int userTimeout3, unsigned int groupTimeout3, STARNET_CALLSIGN_SWITCH callsignSwitch3, bool txMsgSwitch3, const wxString& link3, - const wxString& starNetBand4, const wxString& callsign4, const wxString& logoff4, const wxString& info4, const wxString& permanent4, unsigned int userTimeout4, unsigned int groupTimeout4, STARNET_CALLSIGN_SWITCH callsignSwitch4, bool txMsgSwitch4, const wxString& link4, - const wxString& starNetBand5, const wxString& callsign5, const wxString& logoff5, const wxString& info5, const wxString& permanent5, unsigned int userTimeout5, unsigned int groupTimeout5, STARNET_CALLSIGN_SWITCH callsignSwitch5, bool txMsgSwitch5, const wxString& link5, - const wxString& starNetBand6, const wxString& callsign6, const wxString& logoff6, const wxString& info6, const wxString& permanent6, unsigned int userTimeout6, unsigned int groupTimeout6, STARNET_CALLSIGN_SWITCH callsignSwitch6, bool txMsgSwitch6, const wxString& link6, - const wxString& starNetBand7, const wxString& callsign7, const wxString& logoff7, const wxString& info7, const wxString& permanent7, unsigned int userTimeout7, unsigned int groupTimeout7, STARNET_CALLSIGN_SWITCH callsignSwitch7, bool txMsgSwitch7, const wxString& link7, - const wxString& starNetBand8, const wxString& callsign8, const wxString& logoff8, const wxString& info8, const wxString& permanent8, unsigned int userTimeout8, unsigned int groupTimeout8, STARNET_CALLSIGN_SWITCH callsignSwitch8, bool txMsgSwitch8, const wxString& link8, - const wxString& starNetBand9, const wxString& callsign9, const wxString& logoff9, const wxString& info9, const wxString& permanent9, unsigned int userTimeout9, unsigned int groupTimeout9, STARNET_CALLSIGN_SWITCH callsignSwitch9, bool txMsgSwitch9, const wxString& link9, - const wxString& starNetBand10, const wxString& callsign10, const wxString& logoff10, const wxString& info10, const wxString& permanent10, unsigned int userTimeout10, unsigned int groupTimeout10, STARNET_CALLSIGN_SWITCH callsignSwitch10, bool txMsgSwitch10, const wxString& link10, - const wxString& starNetBand11, const wxString& callsign11, const wxString& logoff11, const wxString& info11, const wxString& permanent11, unsigned int userTimeout11, unsigned int groupTimeout11, STARNET_CALLSIGN_SWITCH callsignSwitch11, bool txMsgSwitch11, const wxString& link11, - const wxString& starNetBand12, const wxString& callsign12, const wxString& logoff12, const wxString& info12, const wxString& permanent12, unsigned int userTimeout12, unsigned int groupTimeout12, STARNET_CALLSIGN_SWITCH callsignSwitch12, bool txMsgSwitch12, const wxString& link12, - const wxString& starNetBand13, const wxString& callsign13, const wxString& logoff13, const wxString& info13, const wxString& permanent13, unsigned int userTimeout13, unsigned int groupTimeout13, STARNET_CALLSIGN_SWITCH callsignSwitch13, bool txMsgSwitch13, const wxString& link13, - const wxString& starNetBand14, const wxString& callsign14, const wxString& logoff14, const wxString& info14, const wxString& permanent14, unsigned int userTimeout14, unsigned int groupTimeout14, STARNET_CALLSIGN_SWITCH callsignSwitch14, bool txMsgSwitch14, const wxString& link14, - const wxString& starNetBand15, const wxString& callsign15, const wxString& logoff15, const wxString& info15, const wxString& permanent15, unsigned int userTimeout15, unsigned int groupTimeout15, STARNET_CALLSIGN_SWITCH callsignSwitch15, bool txMsgSwitch15, const wxString& link15, -#else - const wxString& starNetBand1, const wxString& callsign1, const wxString& logoff1, const wxString& info1, const wxString& permanent1, unsigned int userTimeout1, unsigned int groupTimeout1, STARNET_CALLSIGN_SWITCH callsignSwitch1, bool txMsgSwitch1, - const wxString& starNetBand2, const wxString& callsign2, const wxString& logoff2, const wxString& info2, const wxString& permanent2, unsigned int userTimeout2, unsigned int groupTimeout2, STARNET_CALLSIGN_SWITCH callsignSwitch2, bool txMsgSwitch2, - const wxString& starNetBand3, const wxString& callsign3, const wxString& logoff3, const wxString& info3, const wxString& permanent3, unsigned int userTimeout3, unsigned int groupTimeout3, STARNET_CALLSIGN_SWITCH callsignSwitch3, bool txMsgSwitch3, - const wxString& starNetBand4, const wxString& callsign4, const wxString& logoff4, const wxString& info4, const wxString& permanent4, unsigned int userTimeout4, unsigned int groupTimeout4, STARNET_CALLSIGN_SWITCH callsignSwitch4, bool txMsgSwitch4, - const wxString& starNetBand5, const wxString& callsign5, const wxString& logoff5, const wxString& info5, const wxString& permanent5, unsigned int userTimeout5, unsigned int groupTimeout5, STARNET_CALLSIGN_SWITCH callsignSwitch5, bool txMsgSwitch5, - const wxString& starNetBand6, const wxString& callsign6, const wxString& logoff6, const wxString& info6, const wxString& permanent6, unsigned int userTimeout6, unsigned int groupTimeout6, STARNET_CALLSIGN_SWITCH callsignSwitch6, bool txMsgSwitch6, - const wxString& starNetBand7, const wxString& callsign7, const wxString& logoff7, const wxString& info7, const wxString& permanent7, unsigned int userTimeout7, unsigned int groupTimeout7, STARNET_CALLSIGN_SWITCH callsignSwitch7, bool txMsgSwitch7, - const wxString& starNetBand8, const wxString& callsign8, const wxString& logoff8, const wxString& info8, const wxString& permanent8, unsigned int userTimeout8, unsigned int groupTimeout8, STARNET_CALLSIGN_SWITCH callsignSwitch8, bool txMsgSwitch8, - const wxString& starNetBand9, const wxString& callsign9, const wxString& logoff9, const wxString& info9, const wxString& permanent9, unsigned int userTimeout9, unsigned int groupTimeout9, STARNET_CALLSIGN_SWITCH callsignSwitch9, bool txMsgSwitch9, - const wxString& starNetBand10, const wxString& callsign10, const wxString& logoff10, const wxString& info10, const wxString& permanent10, unsigned int userTimeout10, unsigned int groupTimeout10, STARNET_CALLSIGN_SWITCH callsignSwitch10, bool txMsgSwitch10, - const wxString& starNetBand11, const wxString& callsign11, const wxString& logoff11, const wxString& info11, const wxString& permanent11, unsigned int userTimeout11, unsigned int groupTimeout11, STARNET_CALLSIGN_SWITCH callsignSwitch11, bool txMsgSwitch11, - const wxString& starNetBand12, const wxString& callsign12, const wxString& logoff12, const wxString& info12, const wxString& permanent12, unsigned int userTimeout12, unsigned int groupTimeout12, STARNET_CALLSIGN_SWITCH callsignSwitch12, bool txMsgSwitch12, - const wxString& starNetBand13, const wxString& callsign13, const wxString& logoff13, const wxString& info13, const wxString& permanent13, unsigned int userTimeout13, unsigned int groupTimeout13, STARNET_CALLSIGN_SWITCH callsignSwitch13, bool txMsgSwitch13, - const wxString& starNetBand14, const wxString& callsign14, const wxString& logoff14, const wxString& info14, const wxString& permanent14, unsigned int userTimeout14, unsigned int groupTimeout14, STARNET_CALLSIGN_SWITCH callsignSwitch14, bool txMsgSwitch14, - const wxString& starNetBand15, const wxString& callsign15, const wxString& logoff15, const wxString& info15, const wxString& permanent15, unsigned int userTimeout15, unsigned int groupTimeout15, STARNET_CALLSIGN_SWITCH callsignSwitch15, bool txMsgSwitch15, -#endif - bool remoteEnabled, const wxString& remotePassword, unsigned int remotePort) : -wxDialog(parent, id, wxString(_("StarNet Server Preferences"))), -m_callsign(NULL), -m_ircDDB(NULL), -m_starNet1(NULL), -m_starNet2(NULL), -m_starNet3(NULL), -m_starNet4(NULL), -m_starNet5(NULL), -m_starNet6(NULL), -m_starNet7(NULL), -m_starNet8(NULL), -m_starNet9(NULL), -m_starNet10(NULL), -m_starNet11(NULL), -m_starNet12(NULL), -m_starNet13(NULL), -m_starNet14(NULL), -m_starNet15(NULL), -m_remote(NULL), -m_miscellaneous(NULL) -{ - wxBoxSizer* mainSizer = new wxBoxSizer(wxVERTICAL); - - wxNotebook* noteBook = new wxNotebook(this, -1); - - m_callsign = new CStarNetServerCallsignSet(noteBook, -1, APPLICATION_NAME, callsign, address); - noteBook->AddPage(m_callsign, _("Callsign"), true); - - m_ircDDB = new CStarNetServerIrcDDBSet(noteBook, -1, APPLICATION_NAME, hostname, username, password); - noteBook->AddPage(m_ircDDB, wxT("ircDDB"), false); - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - m_starNet1 = new CStarNetSet(noteBook, -1, APPLICATION_NAME, starNetBand1, callsign1, logoff1, info1, permanent1, userTimeout1, groupTimeout1, callsignSwitch1, txMsgSwitch1, link1); - noteBook->AddPage(m_starNet1, wxT("StarNet 1"), false); - - m_starNet2 = new CStarNetSet(noteBook, -1, APPLICATION_NAME, starNetBand2, callsign2, logoff2, info2, permanent2, userTimeout2, groupTimeout2, callsignSwitch2, txMsgSwitch2, link2); - noteBook->AddPage(m_starNet2, wxT("StarNet 2"), false); - - m_starNet3 = new CStarNetSet(noteBook, -1, APPLICATION_NAME, starNetBand3, callsign3, logoff3, info3, permanent3, userTimeout3, groupTimeout3, callsignSwitch3, txMsgSwitch3, link3); - noteBook->AddPage(m_starNet3, wxT("StarNet 3"), false); - - m_starNet4 = new CStarNetSet(noteBook, -1, APPLICATION_NAME, starNetBand4, callsign4, logoff4, info4, permanent4, userTimeout4, groupTimeout4, callsignSwitch4, txMsgSwitch4, link4); - noteBook->AddPage(m_starNet4, wxT("StarNet 4"), false); - - m_starNet5 = new CStarNetSet(noteBook, -1, APPLICATION_NAME, starNetBand5, callsign5, logoff5, info5, permanent5, userTimeout5, groupTimeout5, callsignSwitch5, txMsgSwitch5, link5); - noteBook->AddPage(m_starNet5, wxT("StarNet 5"), false); - - m_starNet6 = new CStarNetSet(noteBook, -1, APPLICATION_NAME, starNetBand6, callsign6, logoff6, info6, permanent6, userTimeout6, groupTimeout6, callsignSwitch6, txMsgSwitch6, link6); - noteBook->AddPage(m_starNet6, wxT("StarNet 6"), false); - - m_starNet7 = new CStarNetSet(noteBook, -1, APPLICATION_NAME, starNetBand7, callsign7, logoff7, info7, permanent7, userTimeout7, groupTimeout7, callsignSwitch7, txMsgSwitch7, link7); - noteBook->AddPage(m_starNet7, wxT("StarNet 7"), false); - - m_starNet8 = new CStarNetSet(noteBook, -1, APPLICATION_NAME, starNetBand8, callsign8, logoff8, info8, permanent8, userTimeout8, groupTimeout8, callsignSwitch8, txMsgSwitch8, link8); - noteBook->AddPage(m_starNet8, wxT("StarNet 8"), false); - - m_starNet9 = new CStarNetSet(noteBook, -1, APPLICATION_NAME, starNetBand9, callsign9, logoff9, info9, permanent9, userTimeout9, groupTimeout9, callsignSwitch9, txMsgSwitch9, link9); - noteBook->AddPage(m_starNet9, wxT("StarNet 9"), false); - - m_starNet10 = new CStarNetSet(noteBook, -1, APPLICATION_NAME, starNetBand10, callsign10, logoff10, info10, permanent10, userTimeout10, groupTimeout10, callsignSwitch10, txMsgSwitch10, link10); - noteBook->AddPage(m_starNet10, wxT("StarNet 10"), false); - - m_starNet11 = new CStarNetSet(noteBook, -1, APPLICATION_NAME, starNetBand11, callsign11, logoff11, info11, permanent11, userTimeout11, groupTimeout11, callsignSwitch11, txMsgSwitch11, link11); - noteBook->AddPage(m_starNet11, wxT("StarNet 11"), false); - - m_starNet12 = new CStarNetSet(noteBook, -1, APPLICATION_NAME, starNetBand12, callsign12, logoff12, info12, permanent12, userTimeout12, groupTimeout12, callsignSwitch12, txMsgSwitch12, link12); - noteBook->AddPage(m_starNet12, wxT("StarNet 12"), false); - - m_starNet13 = new CStarNetSet(noteBook, -1, APPLICATION_NAME, starNetBand13, callsign13, logoff13, info13, permanent13, userTimeout13, groupTimeout13, callsignSwitch13, txMsgSwitch13, link13); - noteBook->AddPage(m_starNet13, wxT("StarNet 13"), false); - - m_starNet14 = new CStarNetSet(noteBook, -1, APPLICATION_NAME, starNetBand14, callsign14, logoff14, info14, permanent14, userTimeout14, groupTimeout14, callsignSwitch14, txMsgSwitch14, link14); - noteBook->AddPage(m_starNet14, wxT("StarNet 14"), false); - - m_starNet15 = new CStarNetSet(noteBook, -1, APPLICATION_NAME, starNetBand15, callsign15, logoff15, info15, permanent15, userTimeout15, groupTimeout15, callsignSwitch15, txMsgSwitch15, link15); - noteBook->AddPage(m_starNet15, wxT("StarNet 15"), false); -#else - m_starNet1 = new CStarNetSet(noteBook, -1, APPLICATION_NAME, starNetBand1, callsign1, logoff1, info1, permanent1, userTimeout1, groupTimeout1, callsignSwitch1, txMsgSwitch1); - noteBook->AddPage(m_starNet1, wxT("StarNet 1"), false); - - m_starNet2 = new CStarNetSet(noteBook, -1, APPLICATION_NAME, starNetBand2, callsign2, logoff2, info2, permanent2, userTimeout2, groupTimeout2, callsignSwitch2, txMsgSwitch2); - noteBook->AddPage(m_starNet2, wxT("StarNet 2"), false); - - m_starNet3 = new CStarNetSet(noteBook, -1, APPLICATION_NAME, starNetBand3, callsign3, logoff3, info3, permanent3, userTimeout3, groupTimeout3, callsignSwitch3, txMsgSwitch3); - noteBook->AddPage(m_starNet3, wxT("StarNet 3"), false); - - m_starNet4 = new CStarNetSet(noteBook, -1, APPLICATION_NAME, starNetBand4, callsign4, logoff4, info4, permanent4, userTimeout4, groupTimeout4, callsignSwitch4, txMsgSwitch4); - noteBook->AddPage(m_starNet4, wxT("StarNet 4"), false); - - m_starNet5 = new CStarNetSet(noteBook, -1, APPLICATION_NAME, starNetBand5, callsign5, logoff5, info5, permanent5, userTimeout5, groupTimeout5, callsignSwitch5, txMsgSwitch5); - noteBook->AddPage(m_starNet5, wxT("StarNet 5"), false); - - m_starNet6 = new CStarNetSet(noteBook, -1, APPLICATION_NAME, starNetBand6, callsign6, logoff6, info6, permanent6, userTimeout6, groupTimeout6, callsignSwitch6, txMsgSwitch6); - noteBook->AddPage(m_starNet6, wxT("StarNet 6"), false); - - m_starNet7 = new CStarNetSet(noteBook, -1, APPLICATION_NAME, starNetBand7, callsign7, logoff7, info7, permanent7, userTimeout7, groupTimeout7, callsignSwitch7, txMsgSwitch7); - noteBook->AddPage(m_starNet7, wxT("StarNet 7"), false); - - m_starNet8 = new CStarNetSet(noteBook, -1, APPLICATION_NAME, starNetBand8, callsign8, logoff8, info8, permanent8, userTimeout8, groupTimeout8, callsignSwitch8, txMsgSwitch8); - noteBook->AddPage(m_starNet8, wxT("StarNet 8"), false); - - m_starNet9 = new CStarNetSet(noteBook, -1, APPLICATION_NAME, starNetBand9, callsign9, logoff9, info9, permanent9, userTimeout9, groupTimeout9, callsignSwitch9, txMsgSwitch9); - noteBook->AddPage(m_starNet9, wxT("StarNet 9"), false); - - m_starNet10 = new CStarNetSet(noteBook, -1, APPLICATION_NAME, starNetBand10, callsign10, logoff10, info10, permanent10, userTimeout10, groupTimeout10, callsignSwitch10, txMsgSwitch10); - noteBook->AddPage(m_starNet10, wxT("StarNet 10"), false); - - m_starNet11 = new CStarNetSet(noteBook, -1, APPLICATION_NAME, starNetBand11, callsign11, logoff11, info11, permanent11, userTimeout11, groupTimeout11, callsignSwitch11, txMsgSwitch11); - noteBook->AddPage(m_starNet11, wxT("StarNet 11"), false); - - m_starNet12 = new CStarNetSet(noteBook, -1, APPLICATION_NAME, starNetBand12, callsign12, logoff12, info12, permanent12, userTimeout12, groupTimeout12, callsignSwitch12, txMsgSwitch12); - noteBook->AddPage(m_starNet12, wxT("StarNet 12"), false); - - m_starNet13 = new CStarNetSet(noteBook, -1, APPLICATION_NAME, starNetBand13, callsign13, logoff13, info13, permanent13, userTimeout13, groupTimeout13, callsignSwitch13, txMsgSwitch13); - noteBook->AddPage(m_starNet13, wxT("StarNet 13"), false); - - m_starNet14 = new CStarNetSet(noteBook, -1, APPLICATION_NAME, starNetBand14, callsign14, logoff14, info14, permanent14, userTimeout14, groupTimeout14, callsignSwitch14, txMsgSwitch14); - noteBook->AddPage(m_starNet14, wxT("StarNet 14"), false); - - m_starNet15 = new CStarNetSet(noteBook, -1, APPLICATION_NAME, starNetBand15, callsign15, logoff15, info15, permanent15, userTimeout15, groupTimeout15, callsignSwitch15, txMsgSwitch15); - noteBook->AddPage(m_starNet15, wxT("StarNet 15"), false); -#endif - - m_remote = new CRemoteSet(noteBook, -1, APPLICATION_NAME, remoteEnabled, remotePassword, remotePort); - noteBook->AddPage(m_remote, wxT("Remote"), false); - - m_miscellaneous = new CStarNetServerMiscellaneousSet(noteBook, -1, APPLICATION_NAME, logEnabled); - noteBook->AddPage(m_miscellaneous, wxT("Misc"), false); - - mainSizer->Add(noteBook, 1, wxALL | wxGROW, BORDER_SIZE); - - mainSizer->Add(CreateButtonSizer(wxOK | wxCANCEL), 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE); - - SetAutoLayout(true); - Layout(); - - mainSizer->Fit(this); - mainSizer->SetSizeHints(this); - - SetSizer(mainSizer); -} - -CStarNetServerPreferences::~CStarNetServerPreferences() -{ -} - -bool CStarNetServerPreferences::Validate() -{ - if (!m_callsign->Validate()) - return false; - - if (!m_ircDDB->Validate()) - return false; - - if (!m_starNet1->Validate()) - return false; - - if (!m_starNet2->Validate()) - return false; - - if (!m_starNet3->Validate()) - return false; - - if (!m_starNet4->Validate()) - return false; - - if (!m_starNet5->Validate()) - return false; - - if (!m_starNet6->Validate()) - return false; - - if (!m_starNet7->Validate()) - return false; - - if (!m_starNet8->Validate()) - return false; - - if (!m_starNet9->Validate()) - return false; - - if (!m_starNet10->Validate()) - return false; - - if (!m_starNet11->Validate()) - return false; - - if (!m_starNet12->Validate()) - return false; - - if (!m_starNet13->Validate()) - return false; - - if (!m_starNet14->Validate()) - return false; - - if (!m_starNet15->Validate()) - return false; - - if (!m_remote->Validate()) - return false; - - return m_miscellaneous->Validate(); -} - -wxString CStarNetServerPreferences::getCallsign() const -{ - return m_callsign->getCallsign(); -} - -wxString CStarNetServerPreferences::getAddress() const -{ - return m_callsign->getAddress(); -} - -wxString CStarNetServerPreferences::getHostname() const -{ - return m_ircDDB->getHostname(); -} - -wxString CStarNetServerPreferences::getUsername() const -{ - return m_ircDDB->getUsername(); -} - -wxString CStarNetServerPreferences::getPassword() const -{ - return m_ircDDB->getPassword(); -} - -bool CStarNetServerPreferences::getLogEnabled() const -{ - return m_miscellaneous->getLogEnabled(); -} - -wxString CStarNetServerPreferences::getStarNetBand1() const -{ - return m_starNet1->getBand(); -} - -wxString CStarNetServerPreferences::getStarNetCallsign1() const -{ - return m_starNet1->getCallsign(); -} - -wxString CStarNetServerPreferences::getStarNetLogoff1() const -{ - return m_starNet1->getLogoff(); -} - -wxString CStarNetServerPreferences::getStarNetInfo1() const -{ - return m_starNet1->getInfo(); -} - -wxString CStarNetServerPreferences::getStarNetPermanent1() const -{ - return m_starNet1->getPermanent(); -} - -unsigned int CStarNetServerPreferences::getStarNetUserTimeout1() const -{ - return m_starNet1->getUserTimeout(); -} - -unsigned int CStarNetServerPreferences::getStarNetGroupTimeout1() const -{ - return m_starNet1->getGroupTimeout(); -} - -STARNET_CALLSIGN_SWITCH CStarNetServerPreferences::getStarNetCallsignSwitch1() const -{ - return m_starNet1->getCallsignSwitch(); -} - -bool CStarNetServerPreferences::getStarNetTXMsgSwitch1() const -{ - return m_starNet1->getTXMsgSwitch(); -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -wxString CStarNetServerPreferences::getStarNetLink1() const -{ - return m_starNet1->getReflector(); -} -#endif - -wxString CStarNetServerPreferences::getStarNetBand2() const -{ - return m_starNet2->getBand(); -} - -wxString CStarNetServerPreferences::getStarNetCallsign2() const -{ - return m_starNet2->getCallsign(); -} - -wxString CStarNetServerPreferences::getStarNetLogoff2() const -{ - return m_starNet2->getLogoff(); -} - -wxString CStarNetServerPreferences::getStarNetInfo2() const -{ - return m_starNet2->getInfo(); -} - -wxString CStarNetServerPreferences::getStarNetPermanent2() const -{ - return m_starNet2->getPermanent(); -} - -unsigned int CStarNetServerPreferences::getStarNetUserTimeout2() const -{ - return m_starNet2->getUserTimeout(); -} - -unsigned int CStarNetServerPreferences::getStarNetGroupTimeout2() const -{ - return m_starNet2->getGroupTimeout(); -} - -STARNET_CALLSIGN_SWITCH CStarNetServerPreferences::getStarNetCallsignSwitch2() const -{ - return m_starNet2->getCallsignSwitch(); -} - -bool CStarNetServerPreferences::getStarNetTXMsgSwitch2() const -{ - return m_starNet2->getTXMsgSwitch(); -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -wxString CStarNetServerPreferences::getStarNetLink2() const -{ - return m_starNet2->getReflector(); -} -#endif - -wxString CStarNetServerPreferences::getStarNetBand3() const -{ - return m_starNet3->getBand(); -} - -wxString CStarNetServerPreferences::getStarNetCallsign3() const -{ - return m_starNet3->getCallsign(); -} - -wxString CStarNetServerPreferences::getStarNetLogoff3() const -{ - return m_starNet3->getLogoff(); -} - -wxString CStarNetServerPreferences::getStarNetInfo3() const -{ - return m_starNet3->getInfo(); -} - -wxString CStarNetServerPreferences::getStarNetPermanent3() const -{ - return m_starNet3->getPermanent(); -} - -unsigned int CStarNetServerPreferences::getStarNetUserTimeout3() const -{ - return m_starNet3->getUserTimeout(); -} - -unsigned int CStarNetServerPreferences::getStarNetGroupTimeout3() const -{ - return m_starNet3->getGroupTimeout(); -} - -STARNET_CALLSIGN_SWITCH CStarNetServerPreferences::getStarNetCallsignSwitch3() const -{ - return m_starNet3->getCallsignSwitch(); -} - -bool CStarNetServerPreferences::getStarNetTXMsgSwitch3() const -{ - return m_starNet3->getTXMsgSwitch(); -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -wxString CStarNetServerPreferences::getStarNetLink3() const -{ - return m_starNet3->getReflector(); -} -#endif - -wxString CStarNetServerPreferences::getStarNetBand4() const -{ - return m_starNet4->getBand(); -} - -wxString CStarNetServerPreferences::getStarNetCallsign4() const -{ - return m_starNet4->getCallsign(); -} - -wxString CStarNetServerPreferences::getStarNetLogoff4() const -{ - return m_starNet4->getLogoff(); -} - -wxString CStarNetServerPreferences::getStarNetInfo4() const -{ - return m_starNet4->getInfo(); -} - -wxString CStarNetServerPreferences::getStarNetPermanent4() const -{ - return m_starNet4->getPermanent(); -} - -unsigned int CStarNetServerPreferences::getStarNetUserTimeout4() const -{ - return m_starNet4->getUserTimeout(); -} - -unsigned int CStarNetServerPreferences::getStarNetGroupTimeout4() const -{ - return m_starNet4->getGroupTimeout(); -} - -STARNET_CALLSIGN_SWITCH CStarNetServerPreferences::getStarNetCallsignSwitch4() const -{ - return m_starNet4->getCallsignSwitch(); -} - -bool CStarNetServerPreferences::getStarNetTXMsgSwitch4() const -{ - return m_starNet4->getTXMsgSwitch(); -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -wxString CStarNetServerPreferences::getStarNetLink4() const -{ - return m_starNet4->getReflector(); -} -#endif - -wxString CStarNetServerPreferences::getStarNetBand5() const -{ - return m_starNet5->getBand(); -} - -wxString CStarNetServerPreferences::getStarNetCallsign5() const -{ - return m_starNet5->getCallsign(); -} - -wxString CStarNetServerPreferences::getStarNetLogoff5() const -{ - return m_starNet5->getLogoff(); -} - -wxString CStarNetServerPreferences::getStarNetInfo5() const -{ - return m_starNet5->getInfo(); -} - -wxString CStarNetServerPreferences::getStarNetPermanent5() const -{ - return m_starNet5->getPermanent(); -} - -unsigned int CStarNetServerPreferences::getStarNetUserTimeout5() const -{ - return m_starNet5->getUserTimeout(); -} - -unsigned int CStarNetServerPreferences::getStarNetGroupTimeout5() const -{ - return m_starNet5->getGroupTimeout(); -} - -STARNET_CALLSIGN_SWITCH CStarNetServerPreferences::getStarNetCallsignSwitch5() const -{ - return m_starNet5->getCallsignSwitch(); -} - -bool CStarNetServerPreferences::getStarNetTXMsgSwitch5() const -{ - return m_starNet5->getTXMsgSwitch(); -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -wxString CStarNetServerPreferences::getStarNetLink5() const -{ - return m_starNet5->getReflector(); -} -#endif - -wxString CStarNetServerPreferences::getStarNetBand6() const -{ - return m_starNet6->getBand(); -} - -wxString CStarNetServerPreferences::getStarNetCallsign6() const -{ - return m_starNet6->getCallsign(); -} - -wxString CStarNetServerPreferences::getStarNetLogoff6() const -{ - return m_starNet6->getLogoff(); -} - -wxString CStarNetServerPreferences::getStarNetInfo6() const -{ - return m_starNet6->getInfo(); -} - -wxString CStarNetServerPreferences::getStarNetPermanent6() const -{ - return m_starNet6->getPermanent(); -} - -unsigned int CStarNetServerPreferences::getStarNetUserTimeout6() const -{ - return m_starNet6->getUserTimeout(); -} - -unsigned int CStarNetServerPreferences::getStarNetGroupTimeout6() const -{ - return m_starNet6->getGroupTimeout(); -} - -STARNET_CALLSIGN_SWITCH CStarNetServerPreferences::getStarNetCallsignSwitch6() const -{ - return m_starNet6->getCallsignSwitch(); -} - -bool CStarNetServerPreferences::getStarNetTXMsgSwitch6() const -{ - return m_starNet6->getTXMsgSwitch(); -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -wxString CStarNetServerPreferences::getStarNetLink6() const -{ - return m_starNet6->getReflector(); -} -#endif - -wxString CStarNetServerPreferences::getStarNetBand7() const -{ - return m_starNet7->getBand(); -} - -wxString CStarNetServerPreferences::getStarNetCallsign7() const -{ - return m_starNet7->getCallsign(); -} - -wxString CStarNetServerPreferences::getStarNetLogoff7() const -{ - return m_starNet7->getLogoff(); -} - -wxString CStarNetServerPreferences::getStarNetInfo7() const -{ - return m_starNet7->getInfo(); -} - -wxString CStarNetServerPreferences::getStarNetPermanent7() const -{ - return m_starNet7->getPermanent(); -} - -unsigned int CStarNetServerPreferences::getStarNetUserTimeout7() const -{ - return m_starNet7->getUserTimeout(); -} - -unsigned int CStarNetServerPreferences::getStarNetGroupTimeout7() const -{ - return m_starNet7->getGroupTimeout(); -} - -STARNET_CALLSIGN_SWITCH CStarNetServerPreferences::getStarNetCallsignSwitch7() const -{ - return m_starNet7->getCallsignSwitch(); -} - -bool CStarNetServerPreferences::getStarNetTXMsgSwitch7() const -{ - return m_starNet7->getTXMsgSwitch(); -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -wxString CStarNetServerPreferences::getStarNetLink7() const -{ - return m_starNet7->getReflector(); -} -#endif - -wxString CStarNetServerPreferences::getStarNetBand8() const -{ - return m_starNet8->getBand(); -} - -wxString CStarNetServerPreferences::getStarNetCallsign8() const -{ - return m_starNet8->getCallsign(); -} - -wxString CStarNetServerPreferences::getStarNetLogoff8() const -{ - return m_starNet8->getLogoff(); -} - -wxString CStarNetServerPreferences::getStarNetInfo8() const -{ - return m_starNet8->getInfo(); -} - -wxString CStarNetServerPreferences::getStarNetPermanent8() const -{ - return m_starNet8->getPermanent(); -} - -unsigned int CStarNetServerPreferences::getStarNetUserTimeout8() const -{ - return m_starNet8->getUserTimeout(); -} - -unsigned int CStarNetServerPreferences::getStarNetGroupTimeout8() const -{ - return m_starNet8->getGroupTimeout(); -} - -STARNET_CALLSIGN_SWITCH CStarNetServerPreferences::getStarNetCallsignSwitch8() const -{ - return m_starNet8->getCallsignSwitch(); -} - -bool CStarNetServerPreferences::getStarNetTXMsgSwitch8() const -{ - return m_starNet8->getTXMsgSwitch(); -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -wxString CStarNetServerPreferences::getStarNetLink8() const -{ - return m_starNet8->getReflector(); -} -#endif - -wxString CStarNetServerPreferences::getStarNetBand9() const -{ - return m_starNet9->getBand(); -} - -wxString CStarNetServerPreferences::getStarNetCallsign9() const -{ - return m_starNet9->getCallsign(); -} - -wxString CStarNetServerPreferences::getStarNetLogoff9() const -{ - return m_starNet9->getLogoff(); -} - -wxString CStarNetServerPreferences::getStarNetInfo9() const -{ - return m_starNet9->getInfo(); -} - -wxString CStarNetServerPreferences::getStarNetPermanent9() const -{ - return m_starNet9->getPermanent(); -} - -unsigned int CStarNetServerPreferences::getStarNetUserTimeout9() const -{ - return m_starNet9->getUserTimeout(); -} - -unsigned int CStarNetServerPreferences::getStarNetGroupTimeout9() const -{ - return m_starNet9->getGroupTimeout(); -} - -STARNET_CALLSIGN_SWITCH CStarNetServerPreferences::getStarNetCallsignSwitch9() const -{ - return m_starNet9->getCallsignSwitch(); -} - -bool CStarNetServerPreferences::getStarNetTXMsgSwitch9() const -{ - return m_starNet9->getTXMsgSwitch(); -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -wxString CStarNetServerPreferences::getStarNetLink9() const -{ - return m_starNet9->getReflector(); -} -#endif - -wxString CStarNetServerPreferences::getStarNetBand10() const -{ - return m_starNet10->getBand(); -} - -wxString CStarNetServerPreferences::getStarNetCallsign10() const -{ - return m_starNet10->getCallsign(); -} - -wxString CStarNetServerPreferences::getStarNetLogoff10() const -{ - return m_starNet10->getLogoff(); -} - -wxString CStarNetServerPreferences::getStarNetInfo10() const -{ - return m_starNet10->getInfo(); -} - -wxString CStarNetServerPreferences::getStarNetPermanent10() const -{ - return m_starNet10->getPermanent(); -} - -unsigned int CStarNetServerPreferences::getStarNetUserTimeout10() const -{ - return m_starNet10->getUserTimeout(); -} - -unsigned int CStarNetServerPreferences::getStarNetGroupTimeout10() const -{ - return m_starNet10->getGroupTimeout(); -} - -STARNET_CALLSIGN_SWITCH CStarNetServerPreferences::getStarNetCallsignSwitch10() const -{ - return m_starNet10->getCallsignSwitch(); -} - -bool CStarNetServerPreferences::getStarNetTXMsgSwitch10() const -{ - return m_starNet10->getTXMsgSwitch(); -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -wxString CStarNetServerPreferences::getStarNetLink10() const -{ - return m_starNet10->getReflector(); -} -#endif - -wxString CStarNetServerPreferences::getStarNetBand11() const -{ - return m_starNet11->getBand(); -} - -wxString CStarNetServerPreferences::getStarNetCallsign11() const -{ - return m_starNet11->getCallsign(); -} - -wxString CStarNetServerPreferences::getStarNetLogoff11() const -{ - return m_starNet11->getLogoff(); -} - -wxString CStarNetServerPreferences::getStarNetInfo11() const -{ - return m_starNet11->getInfo(); -} - -wxString CStarNetServerPreferences::getStarNetPermanent11() const -{ - return m_starNet11->getPermanent(); -} - -unsigned int CStarNetServerPreferences::getStarNetUserTimeout11() const -{ - return m_starNet11->getUserTimeout(); -} - -unsigned int CStarNetServerPreferences::getStarNetGroupTimeout11() const -{ - return m_starNet11->getGroupTimeout(); -} - -STARNET_CALLSIGN_SWITCH CStarNetServerPreferences::getStarNetCallsignSwitch11() const -{ - return m_starNet11->getCallsignSwitch(); -} - -bool CStarNetServerPreferences::getStarNetTXMsgSwitch11() const -{ - return m_starNet11->getTXMsgSwitch(); -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -wxString CStarNetServerPreferences::getStarNetLink11() const -{ - return m_starNet11->getReflector(); -} -#endif - -wxString CStarNetServerPreferences::getStarNetBand12() const -{ - return m_starNet12->getBand(); -} - -wxString CStarNetServerPreferences::getStarNetCallsign12() const -{ - return m_starNet12->getCallsign(); -} - -wxString CStarNetServerPreferences::getStarNetLogoff12() const -{ - return m_starNet12->getLogoff(); -} - -wxString CStarNetServerPreferences::getStarNetInfo12() const -{ - return m_starNet12->getInfo(); -} - -wxString CStarNetServerPreferences::getStarNetPermanent12() const -{ - return m_starNet12->getPermanent(); -} - -unsigned int CStarNetServerPreferences::getStarNetUserTimeout12() const -{ - return m_starNet12->getUserTimeout(); -} - -unsigned int CStarNetServerPreferences::getStarNetGroupTimeout12() const -{ - return m_starNet12->getGroupTimeout(); -} - -STARNET_CALLSIGN_SWITCH CStarNetServerPreferences::getStarNetCallsignSwitch12() const -{ - return m_starNet12->getCallsignSwitch(); -} - -bool CStarNetServerPreferences::getStarNetTXMsgSwitch12() const -{ - return m_starNet12->getTXMsgSwitch(); -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -wxString CStarNetServerPreferences::getStarNetLink12() const -{ - return m_starNet12->getReflector(); -} -#endif - -wxString CStarNetServerPreferences::getStarNetBand13() const -{ - return m_starNet13->getBand(); -} - -wxString CStarNetServerPreferences::getStarNetCallsign13() const -{ - return m_starNet13->getCallsign(); -} - -wxString CStarNetServerPreferences::getStarNetLogoff13() const -{ - return m_starNet13->getLogoff(); -} - -wxString CStarNetServerPreferences::getStarNetInfo13() const -{ - return m_starNet13->getInfo(); -} - -wxString CStarNetServerPreferences::getStarNetPermanent13() const -{ - return m_starNet13->getPermanent(); -} - -unsigned int CStarNetServerPreferences::getStarNetUserTimeout13() const -{ - return m_starNet13->getUserTimeout(); -} - -unsigned int CStarNetServerPreferences::getStarNetGroupTimeout13() const -{ - return m_starNet13->getGroupTimeout(); -} - -STARNET_CALLSIGN_SWITCH CStarNetServerPreferences::getStarNetCallsignSwitch13() const -{ - return m_starNet13->getCallsignSwitch(); -} - -bool CStarNetServerPreferences::getStarNetTXMsgSwitch13() const -{ - return m_starNet13->getTXMsgSwitch(); -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -wxString CStarNetServerPreferences::getStarNetLink13() const -{ - return m_starNet13->getReflector(); -} -#endif - -wxString CStarNetServerPreferences::getStarNetBand14() const -{ - return m_starNet14->getBand(); -} - -wxString CStarNetServerPreferences::getStarNetCallsign14() const -{ - return m_starNet14->getCallsign(); -} - -wxString CStarNetServerPreferences::getStarNetLogoff14() const -{ - return m_starNet14->getLogoff(); -} - -wxString CStarNetServerPreferences::getStarNetInfo14() const -{ - return m_starNet14->getInfo(); -} - -wxString CStarNetServerPreferences::getStarNetPermanent14() const -{ - return m_starNet14->getPermanent(); -} - -unsigned int CStarNetServerPreferences::getStarNetUserTimeout14() const -{ - return m_starNet14->getUserTimeout(); -} - -unsigned int CStarNetServerPreferences::getStarNetGroupTimeout14() const -{ - return m_starNet14->getGroupTimeout(); -} - -STARNET_CALLSIGN_SWITCH CStarNetServerPreferences::getStarNetCallsignSwitch14() const -{ - return m_starNet14->getCallsignSwitch(); -} - -bool CStarNetServerPreferences::getStarNetTXMsgSwitch14() const -{ - return m_starNet14->getTXMsgSwitch(); -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -wxString CStarNetServerPreferences::getStarNetLink14() const -{ - return m_starNet14->getReflector(); -} -#endif - -wxString CStarNetServerPreferences::getStarNetBand15() const -{ - return m_starNet15->getBand(); -} - -wxString CStarNetServerPreferences::getStarNetCallsign15() const -{ - return m_starNet15->getCallsign(); -} - -wxString CStarNetServerPreferences::getStarNetLogoff15() const -{ - return m_starNet15->getLogoff(); -} - -wxString CStarNetServerPreferences::getStarNetInfo15() const -{ - return m_starNet15->getInfo(); -} - -wxString CStarNetServerPreferences::getStarNetPermanent15() const -{ - return m_starNet15->getPermanent(); -} - -unsigned int CStarNetServerPreferences::getStarNetUserTimeout15() const -{ - return m_starNet15->getUserTimeout(); -} - -unsigned int CStarNetServerPreferences::getStarNetGroupTimeout15() const -{ - return m_starNet15->getGroupTimeout(); -} - -STARNET_CALLSIGN_SWITCH CStarNetServerPreferences::getStarNetCallsignSwitch15() const -{ - return m_starNet15->getCallsignSwitch(); -} - -bool CStarNetServerPreferences::getStarNetTXMsgSwitch15() const -{ - return m_starNet15->getTXMsgSwitch(); -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -wxString CStarNetServerPreferences::getStarNetLink15() const -{ - return m_starNet15->getReflector(); -} -#endif - -bool CStarNetServerPreferences::getRemoteEnabled() const -{ - return m_remote->getEnabled(); -} - -wxString CStarNetServerPreferences::getRemotePassword() const -{ - return m_remote->getPassword(); -} - -unsigned int CStarNetServerPreferences::getRemotePort() const -{ - return m_remote->getPort(); -} diff --git a/StarNetServer/StarNetServerPreferences.h b/StarNetServer/StarNetServerPreferences.h deleted file mode 100644 index 7726d9b..0000000 --- a/StarNetServer/StarNetServerPreferences.h +++ /dev/null @@ -1,305 +0,0 @@ -/* - * Copyright (C) 2010,2011,2012,2013 by Jonathan Naylor G4KLX - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef StarNetServerPreferences_H -#define StarNetServerPreferences_H - -#include -#include - -#include "StarNetServerMiscellaneousSet.h" -#include "StarNetServerCallsignSet.h" -#include "StarNetServerIrcDDBSet.h" -#include "StarNetSet.h" -#include "RemoteSet.h" - -class CStarNetServerPreferences : public wxDialog { -public: - CStarNetServerPreferences(wxWindow* parent, int id, - const wxString& callsign, const wxString& address, - const wxString& hostname, const wxString& username, const wxString& password, - bool logEnabled, -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - const wxString& starNetBand1, const wxString& callsign1, const wxString& logoff1, const wxString& info1, const wxString& permanent1, unsigned int userTimeout1, unsigned int groupTimeout1, STARNET_CALLSIGN_SWITCH callsignSwitch1, bool txMsgSwitch1, const wxString& link1, - const wxString& starNetBand2, const wxString& callsign2, const wxString& logoff2, const wxString& info2, const wxString& permanent2, unsigned int userTimeout2, unsigned int groupTimeout2, STARNET_CALLSIGN_SWITCH callsignSwitch2, bool txMsgSwitch2, const wxString& link2, - const wxString& starNetBand3, const wxString& callsign3, const wxString& logoff3, const wxString& info3, const wxString& permanent3, unsigned int userTimeout3, unsigned int groupTimeout3, STARNET_CALLSIGN_SWITCH callsignSwitch3, bool txMsgSwitch3, const wxString& link3, - const wxString& starNetBand4, const wxString& callsign4, const wxString& logoff4, const wxString& info4, const wxString& permanent4, unsigned int userTimeout4, unsigned int groupTimeout4, STARNET_CALLSIGN_SWITCH callsignSwitch4, bool txMsgSwitch4, const wxString& link4, - const wxString& starNetBand5, const wxString& callsign5, const wxString& logoff5, const wxString& info5, const wxString& permanent5, unsigned int userTimeout5, unsigned int groupTimeout5, STARNET_CALLSIGN_SWITCH callsignSwitch5, bool txMsgSwitch5, const wxString& link5, - const wxString& starNetBand6, const wxString& callsign6, const wxString& logoff6, const wxString& info6, const wxString& permanent6, unsigned int userTimeout6, unsigned int groupTimeout6, STARNET_CALLSIGN_SWITCH callsignSwitch6, bool txMsgSwitch6, const wxString& link6, - const wxString& starNetBand7, const wxString& callsign7, const wxString& logoff7, const wxString& info7, const wxString& permanent7, unsigned int userTimeout7, unsigned int groupTimeout7, STARNET_CALLSIGN_SWITCH callsignSwitch7, bool txMsgSwitch7, const wxString& link7, - const wxString& starNetBand8, const wxString& callsign8, const wxString& logoff8, const wxString& info8, const wxString& permanent8, unsigned int userTimeout8, unsigned int groupTimeout8, STARNET_CALLSIGN_SWITCH callsignSwitch8, bool txMsgSwitch8, const wxString& link8, - const wxString& starNetBand9, const wxString& callsign9, const wxString& logoff9, const wxString& info9, const wxString& permanent9, unsigned int userTimeout9, unsigned int groupTimeout9, STARNET_CALLSIGN_SWITCH callsignSwitch9, bool txMsgSwitch9, const wxString& link9, - const wxString& starNetBand10, const wxString& callsign10, const wxString& logoff10, const wxString& info10, const wxString& permanent10, unsigned int userTimeout10, unsigned int groupTimeout10, STARNET_CALLSIGN_SWITCH callsignSwitch10, bool txMsgSwitch10, const wxString& link10, - const wxString& starNetBand11, const wxString& callsign11, const wxString& logoff11, const wxString& info11, const wxString& permanent11, unsigned int userTimeout11, unsigned int groupTimeout11, STARNET_CALLSIGN_SWITCH callsignSwitch11, bool txMsgSwitch11, const wxString& link11, - const wxString& starNetBand12, const wxString& callsign12, const wxString& logoff12, const wxString& info12, const wxString& permanent12, unsigned int userTimeout12, unsigned int groupTimeout12, STARNET_CALLSIGN_SWITCH callsignSwitch12, bool txMsgSwitch12, const wxString& link12, - const wxString& starNetBand13, const wxString& callsign13, const wxString& logoff13, const wxString& info13, const wxString& permanent13, unsigned int userTimeout13, unsigned int groupTimeout13, STARNET_CALLSIGN_SWITCH callsignSwitch13, bool txMsgSwitch13, const wxString& link13, - const wxString& starNetBand14, const wxString& callsign14, const wxString& logoff14, const wxString& info14, const wxString& permanent14, unsigned int userTimeout14, unsigned int groupTimeout14, STARNET_CALLSIGN_SWITCH callsignSwitch14, bool txMsgSwitch14, const wxString& link14, - const wxString& starNetBand15, const wxString& callsign15, const wxString& logoff15, const wxString& info15, const wxString& permanent15, unsigned int userTimeout15, unsigned int groupTimeout15, STARNET_CALLSIGN_SWITCH callsignSwitch15, bool txMsgSwitch15, const wxString& link15, -#else - const wxString& starNetBand1, const wxString& callsign1, const wxString& logoff1, const wxString& info1, const wxString& permanent1, unsigned int userTimeout1, unsigned int groupTimeout1, STARNET_CALLSIGN_SWITCH callsignSwitch1, bool txMsgSwitch1, - const wxString& starNetBand2, const wxString& callsign2, const wxString& logoff2, const wxString& info2, const wxString& permanent2, unsigned int userTimeout2, unsigned int groupTimeout2, STARNET_CALLSIGN_SWITCH callsignSwitch2, bool txMsgSwitch2, - const wxString& starNetBand3, const wxString& callsign3, const wxString& logoff3, const wxString& info3, const wxString& permanent3, unsigned int userTimeout3, unsigned int groupTimeout3, STARNET_CALLSIGN_SWITCH callsignSwitch3, bool txMsgSwitch3, - const wxString& starNetBand4, const wxString& callsign4, const wxString& logoff4, const wxString& info4, const wxString& permanent4, unsigned int userTimeout4, unsigned int groupTimeout4, STARNET_CALLSIGN_SWITCH callsignSwitch4, bool txMsgSwitch4, - const wxString& starNetBand5, const wxString& callsign5, const wxString& logoff5, const wxString& info5, const wxString& permanent5, unsigned int userTimeout5, unsigned int groupTimeout5, STARNET_CALLSIGN_SWITCH callsignSwitch5, bool txMsgSwitch5, - const wxString& starNetBand6, const wxString& callsign6, const wxString& logoff6, const wxString& info6, const wxString& permanent6, unsigned int userTimeout6, unsigned int groupTimeout6, STARNET_CALLSIGN_SWITCH callsignSwitch6, bool txMsgSwitch6, - const wxString& starNetBand7, const wxString& callsign7, const wxString& logoff7, const wxString& info7, const wxString& permanent7, unsigned int userTimeout7, unsigned int groupTimeout7, STARNET_CALLSIGN_SWITCH callsignSwitch7, bool txMsgSwitch7, - const wxString& starNetBand8, const wxString& callsign8, const wxString& logoff8, const wxString& info8, const wxString& permanent8, unsigned int userTimeout8, unsigned int groupTimeout8, STARNET_CALLSIGN_SWITCH callsignSwitch8, bool txMsgSwitch8, - const wxString& starNetBand9, const wxString& callsign9, const wxString& logoff9, const wxString& info9, const wxString& permanent9, unsigned int userTimeout9, unsigned int groupTimeout9, STARNET_CALLSIGN_SWITCH callsignSwitch9, bool txMsgSwitch9, - const wxString& starNetBand10, const wxString& callsign10, const wxString& logoff10, const wxString& info10, const wxString& permanent10, unsigned int userTimeout10, unsigned int groupTimeout10, STARNET_CALLSIGN_SWITCH callsignSwitch10, bool txMsgSwitch10, - const wxString& starNetBand11, const wxString& callsign11, const wxString& logoff11, const wxString& info11, const wxString& permanent11, unsigned int userTimeout11, unsigned int groupTimeout11, STARNET_CALLSIGN_SWITCH callsignSwitch11, bool txMsgSwitch11, - const wxString& starNetBand12, const wxString& callsign12, const wxString& logoff12, const wxString& info12, const wxString& permanent12, unsigned int userTimeout12, unsigned int groupTimeout12, STARNET_CALLSIGN_SWITCH callsignSwitch12, bool txMsgSwitch12, - const wxString& starNetBand13, const wxString& callsign13, const wxString& logoff13, const wxString& info13, const wxString& permanent13, unsigned int userTimeout13, unsigned int groupTimeout13, STARNET_CALLSIGN_SWITCH callsignSwitch13, bool txMsgSwitch13, - const wxString& starNetBand14, const wxString& callsign14, const wxString& logoff14, const wxString& info14, const wxString& permanent14, unsigned int userTimeout14, unsigned int groupTimeout14, STARNET_CALLSIGN_SWITCH callsignSwitch14, bool txMsgSwitch14, - const wxString& starNetBand15, const wxString& callsign15, const wxString& logoff15, const wxString& info15, const wxString& permanent15, unsigned int userTimeout15, unsigned int groupTimeout15, STARNET_CALLSIGN_SWITCH callsignSwitch15, bool txMsgSwitch15, -#endif - bool remoteEnabled, const wxString& remotePassword, unsigned int remotePort); - virtual ~CStarNetServerPreferences(); - - virtual bool Validate(); - - virtual wxString getCallsign() const; - virtual wxString getAddress() const; - - virtual wxString getHostname() const; - virtual wxString getUsername() const; - virtual wxString getPassword() const; - - virtual bool getLogEnabled() const; - - virtual wxString getStarNetBand1() const; - virtual wxString getStarNetCallsign1() const; - virtual wxString getStarNetLogoff1() const; - virtual wxString getStarNetInfo1() const; - virtual wxString getStarNetPermanent1() const; - virtual unsigned int getStarNetUserTimeout1() const; - virtual unsigned int getStarNetGroupTimeout1() const; - virtual STARNET_CALLSIGN_SWITCH getStarNetCallsignSwitch1() const; - virtual bool getStarNetTXMsgSwitch1() const; -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - virtual wxString getStarNetLink1() const; -#endif - - virtual wxString getStarNetBand2() const; - virtual wxString getStarNetCallsign2() const; - virtual wxString getStarNetLogoff2() const; - virtual wxString getStarNetInfo2() const; - virtual wxString getStarNetPermanent2() const; - virtual unsigned int getStarNetUserTimeout2() const; - virtual unsigned int getStarNetGroupTimeout2() const; - virtual STARNET_CALLSIGN_SWITCH getStarNetCallsignSwitch2() const; - virtual bool getStarNetTXMsgSwitch2() const; -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - virtual wxString getStarNetLink2() const; -#endif - - virtual wxString getStarNetBand3() const; - virtual wxString getStarNetCallsign3() const; - virtual wxString getStarNetLogoff3() const; - virtual wxString getStarNetInfo3() const; - virtual wxString getStarNetPermanent3() const; - virtual unsigned int getStarNetUserTimeout3() const; - virtual unsigned int getStarNetGroupTimeout3() const; - virtual STARNET_CALLSIGN_SWITCH getStarNetCallsignSwitch3() const; - virtual bool getStarNetTXMsgSwitch3() const; -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - virtual wxString getStarNetLink3() const; -#endif - - virtual wxString getStarNetBand4() const; - virtual wxString getStarNetCallsign4() const; - virtual wxString getStarNetLogoff4() const; - virtual wxString getStarNetInfo4() const; - virtual wxString getStarNetPermanent4() const; - virtual unsigned int getStarNetUserTimeout4() const; - virtual unsigned int getStarNetGroupTimeout4() const; - virtual STARNET_CALLSIGN_SWITCH getStarNetCallsignSwitch4() const; - virtual bool getStarNetTXMsgSwitch4() const; -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - virtual wxString getStarNetLink4() const; -#endif - - virtual wxString getStarNetBand5() const; - virtual wxString getStarNetCallsign5() const; - virtual wxString getStarNetLogoff5() const; - virtual wxString getStarNetInfo5() const; - virtual wxString getStarNetPermanent5() const; - virtual unsigned int getStarNetUserTimeout5() const; - virtual unsigned int getStarNetGroupTimeout5() const; - virtual STARNET_CALLSIGN_SWITCH getStarNetCallsignSwitch5() const; - virtual bool getStarNetTXMsgSwitch5() const; -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - virtual wxString getStarNetLink5() const; -#endif - - virtual wxString getStarNetBand6() const; - virtual wxString getStarNetCallsign6() const; - virtual wxString getStarNetLogoff6() const; - virtual wxString getStarNetInfo6() const; - virtual wxString getStarNetPermanent6() const; - virtual unsigned int getStarNetUserTimeout6() const; - virtual unsigned int getStarNetGroupTimeout6() const; - virtual STARNET_CALLSIGN_SWITCH getStarNetCallsignSwitch6() const; - virtual bool getStarNetTXMsgSwitch6() const; -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - virtual wxString getStarNetLink6() const; -#endif - - virtual wxString getStarNetBand7() const; - virtual wxString getStarNetCallsign7() const; - virtual wxString getStarNetLogoff7() const; - virtual wxString getStarNetInfo7() const; - virtual wxString getStarNetPermanent7() const; - virtual unsigned int getStarNetUserTimeout7() const; - virtual unsigned int getStarNetGroupTimeout7() const; - virtual STARNET_CALLSIGN_SWITCH getStarNetCallsignSwitch7() const; - virtual bool getStarNetTXMsgSwitch7() const; -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - virtual wxString getStarNetLink7() const; -#endif - - virtual wxString getStarNetBand8() const; - virtual wxString getStarNetCallsign8() const; - virtual wxString getStarNetLogoff8() const; - virtual wxString getStarNetInfo8() const; - virtual wxString getStarNetPermanent8() const; - virtual unsigned int getStarNetUserTimeout8() const; - virtual unsigned int getStarNetGroupTimeout8() const; - virtual STARNET_CALLSIGN_SWITCH getStarNetCallsignSwitch8() const; - virtual bool getStarNetTXMsgSwitch8() const; -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - virtual wxString getStarNetLink8() const; -#endif - - virtual wxString getStarNetBand9() const; - virtual wxString getStarNetCallsign9() const; - virtual wxString getStarNetLogoff9() const; - virtual wxString getStarNetInfo9() const; - virtual wxString getStarNetPermanent9() const; - virtual unsigned int getStarNetUserTimeout9() const; - virtual unsigned int getStarNetGroupTimeout9() const; - virtual STARNET_CALLSIGN_SWITCH getStarNetCallsignSwitch9() const; - virtual bool getStarNetTXMsgSwitch9() const; -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - virtual wxString getStarNetLink9() const; -#endif - - virtual wxString getStarNetBand10() const; - virtual wxString getStarNetCallsign10() const; - virtual wxString getStarNetLogoff10() const; - virtual wxString getStarNetInfo10() const; - virtual wxString getStarNetPermanent10() const; - virtual unsigned int getStarNetUserTimeout10() const; - virtual unsigned int getStarNetGroupTimeout10() const; - virtual STARNET_CALLSIGN_SWITCH getStarNetCallsignSwitch10() const; - virtual bool getStarNetTXMsgSwitch10() const; -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - virtual wxString getStarNetLink10() const; -#endif - - virtual wxString getStarNetBand11() const; - virtual wxString getStarNetCallsign11() const; - virtual wxString getStarNetLogoff11() const; - virtual wxString getStarNetInfo11() const; - virtual wxString getStarNetPermanent11() const; - virtual unsigned int getStarNetUserTimeout11() const; - virtual unsigned int getStarNetGroupTimeout11() const; - virtual STARNET_CALLSIGN_SWITCH getStarNetCallsignSwitch11() const; - virtual bool getStarNetTXMsgSwitch11() const; -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - virtual wxString getStarNetLink11() const; -#endif - - virtual wxString getStarNetBand12() const; - virtual wxString getStarNetCallsign12() const; - virtual wxString getStarNetLogoff12() const; - virtual wxString getStarNetInfo12() const; - virtual wxString getStarNetPermanent12() const; - virtual unsigned int getStarNetUserTimeout12() const; - virtual unsigned int getStarNetGroupTimeout12() const; - virtual STARNET_CALLSIGN_SWITCH getStarNetCallsignSwitch12() const; - virtual bool getStarNetTXMsgSwitch12() const; -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - virtual wxString getStarNetLink12() const; -#endif - - virtual wxString getStarNetBand13() const; - virtual wxString getStarNetCallsign13() const; - virtual wxString getStarNetLogoff13() const; - virtual wxString getStarNetInfo13() const; - virtual wxString getStarNetPermanent13() const; - virtual unsigned int getStarNetUserTimeout13() const; - virtual unsigned int getStarNetGroupTimeout13() const; - virtual STARNET_CALLSIGN_SWITCH getStarNetCallsignSwitch13() const; - virtual bool getStarNetTXMsgSwitch13() const; -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - virtual wxString getStarNetLink13() const; -#endif - - virtual wxString getStarNetBand14() const; - virtual wxString getStarNetCallsign14() const; - virtual wxString getStarNetLogoff14() const; - virtual wxString getStarNetInfo14() const; - virtual wxString getStarNetPermanent14() const; - virtual unsigned int getStarNetUserTimeout14() const; - virtual unsigned int getStarNetGroupTimeout14() const; - virtual STARNET_CALLSIGN_SWITCH getStarNetCallsignSwitch14() const; - virtual bool getStarNetTXMsgSwitch14() const; -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - virtual wxString getStarNetLink14() const; -#endif - - virtual wxString getStarNetBand15() const; - virtual wxString getStarNetCallsign15() const; - virtual wxString getStarNetLogoff15() const; - virtual wxString getStarNetInfo15() const; - virtual wxString getStarNetPermanent15() const; - virtual unsigned int getStarNetUserTimeout15() const; - virtual unsigned int getStarNetGroupTimeout15() const; - virtual STARNET_CALLSIGN_SWITCH getStarNetCallsignSwitch15() const; - virtual bool getStarNetTXMsgSwitch15() const; -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - virtual wxString getStarNetLink15() const; -#endif - - virtual bool getRemoteEnabled() const; - virtual wxString getRemotePassword() const; - virtual unsigned int getRemotePort() const; - -private: - CStarNetServerCallsignSet* m_callsign; - CStarNetServerIrcDDBSet* m_ircDDB; - CStarNetSet* m_starNet1; - CStarNetSet* m_starNet2; - CStarNetSet* m_starNet3; - CStarNetSet* m_starNet4; - CStarNetSet* m_starNet5; - CStarNetSet* m_starNet6; - CStarNetSet* m_starNet7; - CStarNetSet* m_starNet8; - CStarNetSet* m_starNet9; - CStarNetSet* m_starNet10; - CStarNetSet* m_starNet11; - CStarNetSet* m_starNet12; - CStarNetSet* m_starNet13; - CStarNetSet* m_starNet14; - CStarNetSet* m_starNet15; - CRemoteSet* m_remote; - CStarNetServerMiscellaneousSet* m_miscellaneous; -}; - -#endif diff --git a/StarNetServer/StarNetServerThread.cpp b/StarNetServer/StarNetServerThread.cpp deleted file mode 100644 index 2b86002..0000000 --- a/StarNetServer/StarNetServerThread.cpp +++ /dev/null @@ -1,627 +0,0 @@ -/* - * Copyright (C) 2010-2014 by Jonathan Naylor G4KLX - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include "StarNetServerThread.h" -#include "StarNetServerDefs.h" -#include "StarNetHandler.h" -#include "DExtraHandler.h" // DEXTRA LINK -#include "DCSHandler.h" // DCS LINK -#include "HeaderData.h" -#include "G2Handler.h" -#include "AMBEData.h" -#include "HostFile.h" // DEXTRA_LINK || DCS_LINK -#include "Utils.h" - -#include -#include - -const unsigned int REMOTE_DUMMY_PORT = 65015U; - -CStarNetServerThread::CStarNetServerThread(bool nolog, const wxString& logDir) : -m_nolog(nolog), -m_logDir(logDir), -m_killed(false), -m_stopped(true), -m_callsign(), -m_address(), -#if defined(DEXTRA_LINK) -m_dextraPool(NULL), -#endif -#if defined(DCS_LINK) -m_dcsPool(NULL), -#endif -m_g2Handler(NULL), -m_irc(NULL), -m_cache(), -m_logEnabled(false), -m_statusTimer(1000U, 1U), // 1 second -m_lastStatus(IS_DISCONNECTED), -m_remoteEnabled(false), -m_remotePassword(), -m_remotePort(0U), -m_remote(NULL) -{ - CHeaderData::initialise(); - CG2Handler::initialise(MAX_ROUTES); - CStarNetHandler::initialise(MAX_STARNETS); -#if defined(DEXTRA_LINK) - CDExtraHandler::initialise(MAX_DEXTRA_LINKS); -#endif -#if defined(DCS_LINK) - CDCSHandler::initialise(MAX_DCS_LINKS); -#endif -} - -CStarNetServerThread::~CStarNetServerThread() -{ - CHeaderData::finalise(); - CG2Handler::finalise(); - CStarNetHandler::finalise(); -#if defined(DEXTRA_LINK) - CDExtraHandler::finalise(); -#endif -#if defined(DCS_LINK) - CDCSHandler::finalise(); -#endif -} - -void CStarNetServerThread::run() -{ - // Truncate the old StarNet.log file - wxFileName fileName(m_logDir, STARNET_BASE_NAME, wxT("log")); - wxLogMessage(wxT("Truncating %s"), fileName.GetFullPath().c_str()); - - wxFFile file; - bool ret = file.Open(fileName.GetFullPath(), wxT("wt")); - if (ret) - file.Close(); - -#if defined(DEXTRA_LINK) - m_dextraPool = new CDExtraProtocolHandlerPool(MAX_DEXTRA_LINKS, DEXTRA_PORT, m_address); - ret = m_dextraPool->open(); - if (!ret) { - wxLogError(wxT("Could not open the DExtra protocol pool")); - delete m_dextraPool; - m_dextraPool = NULL; - } -#endif - -#if defined(DCS_LINK) - m_dcsPool = new CDCSProtocolHandlerPool(MAX_DCS_LINKS, DCS_PORT, m_address); - ret = m_dcsPool->open(); - if (!ret) { - wxLogError(wxT("Could not open the DCS protocol pool")); - delete m_dcsPool; - m_dcsPool = NULL; - } -#endif - - m_g2Handler = new CG2ProtocolHandler(G2_DV_PORT, m_address); - ret = m_g2Handler->open(); - if (!ret) { - wxLogError(wxT("Could not open the G2 protocol handler")); - delete m_g2Handler; - m_g2Handler = NULL; - } - - // Wait here until we have the essentials to run -#if defined(DEXTRA_LINK) - while (!m_killed && (m_g2Handler == NULL || m_dextraPool == NULL || m_irc == NULL || m_callsign.IsEmpty())) - ::wxMilliSleep(500UL); // 1/2 sec -#elif defined(DCS_LINK) - while (!m_killed && (m_g2Handler == NULL || m_dcsPool == NULL || m_irc == NULL || m_callsign.IsEmpty())) - ::wxMilliSleep(500UL); // 1/2 sec -#else - while (!m_killed && (m_g2Handler == NULL || m_irc == NULL || m_callsign.IsEmpty())) - ::wxMilliSleep(500UL); // 1/2 sec -#endif - - if (m_killed) - return; - - m_stopped = false; - - wxLogMessage(wxT("Starting the StarNet Server thread")); - - CHeaderLogger* headerLogger = NULL; - if (m_logEnabled) { - headerLogger = new CHeaderLogger(m_logDir); - ret = headerLogger->open(); - if (!ret) { - delete headerLogger; - headerLogger = NULL; - } - } - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - loadReflectors(); -#endif - - CG2Handler::setG2ProtocolHandler(m_g2Handler); - CG2Handler::setHeaderLogger(headerLogger); - -#if defined(DEXTRA_LINK) - CDExtraHandler::setCallsign(m_callsign); - CDExtraHandler::setDExtraProtocolHandlerPool(m_dextraPool); - CDExtraHandler::setHeaderLogger(headerLogger); -#endif -#if defined(DCS_LINK) - CDCSHandler::setDCSProtocolHandlerPool(m_dcsPool); - CDCSHandler::setHeaderLogger(headerLogger); - CDCSHandler::setGatewayType(GT_STARNET); -#endif - - CStarNetHandler::setCache(&m_cache); - CStarNetHandler::setGateway(m_callsign); - CStarNetHandler::setG2Handler(m_g2Handler); - CStarNetHandler::setIRC(m_irc); - CStarNetHandler::setLogging(m_logEnabled, m_logDir); -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - CStarNetHandler::link(); -#endif - - if (m_remoteEnabled && !m_remotePassword.IsEmpty() && m_remotePort > 0U) { - m_remote = new CRemoteHandler(m_remotePassword, m_remotePort); - bool res = m_remote->open(); - if (!res) { - delete m_remote; - m_remote = NULL; - } - } - - wxStopWatch stopWatch; - stopWatch.Start(); - - m_statusTimer.start(); - - try { - while (!m_killed) { - processIrcDDB(); - processG2(); -#if defined(DEXTRA_LINK) - processDExtra(); -#endif -#if defined(DCS_LINK) - processDCS(); -#endif - if (m_remote != NULL) - m_remote->process(); - - unsigned long ms = stopWatch.Time(); - stopWatch.Start(); - - m_statusTimer.clock(ms); - - CG2Handler::clock(ms); - CStarNetHandler::clock(ms); -#if defined(DEXTRA_LINK) - CDExtraHandler::clock(ms); -#endif -#if defined(DCS_LINK) - CDCSHandler::clock(ms); -#endif - - ::wxMilliSleep(TIME_PER_TIC_MS); - } - } - catch (std::exception& e) { - wxString message(e.what(), wxConvLocal); - wxLogError(wxT("Exception raised - \"%s\""), message.c_str()); - } - catch (...) { - wxLogError(wxT("Unknown exception raised")); - } - - wxLogMessage(wxT("Stopping the StarNet Server thread")); - -#if defined(DEXTRA_LINK) - // Unlink from all reflectors - CDExtraHandler::unlink(); - - m_dextraPool->close(); - delete m_dextraPool; -#endif - -#if defined(DCS_LINK) - // Unlink from all reflectors - CDCSHandler::unlink(); - - m_dcsPool->close(); - delete m_dcsPool; -#endif - - m_g2Handler->close(); - delete m_g2Handler; - - m_irc->close(); - delete m_irc; - - if (m_remote != NULL) { - m_remote->close(); - delete m_remote; - } - - if (headerLogger != NULL) { - headerLogger->close(); - delete headerLogger; - } -} - -void CStarNetServerThread::kill() -{ - m_killed = true; -} - -void CStarNetServerThread::setCallsign(const wxString& callsign) -{ - if (!m_stopped) - return; - - m_callsign = callsign; -} - -void CStarNetServerThread::setAddress(const wxString& address) -{ - m_address = address; -} - -#if defined(DEXTRA_LINK) || defined(DCS_LINK) -void CStarNetServerThread::addStarNet(const wxString& callsign, const wxString& logoff, const wxString& repeater, const wxString& infoText, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector) -{ - CStarNetHandler::add(callsign, logoff, repeater, infoText, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector); -} -#else -void CStarNetServerThread::addStarNet(const wxString& callsign, const wxString& logoff, const wxString& repeater, const wxString& infoText, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch) -{ - CStarNetHandler::add(callsign, logoff, repeater, infoText, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch); -} -#endif - -void CStarNetServerThread::setIRC(CIRCDDB* irc) -{ - wxASSERT(irc != NULL); - - m_irc = irc; -} - -void CStarNetServerThread::setLog(bool enabled) -{ - m_logEnabled = enabled; -} - -void CStarNetServerThread::setRemote(bool enabled, const wxString& password, unsigned int port) -{ - if (enabled) { - m_remoteEnabled = true; - m_remotePassword = password; - m_remotePort = port; - } else { - m_remoteEnabled = false; - m_remotePassword = password; - m_remotePort = REMOTE_DUMMY_PORT; - } -} - -void CStarNetServerThread::processIrcDDB() -{ - // Once per second - if (m_statusTimer.hasExpired()) { - int status = m_irc->getConnectionState(); - switch (status) { - case 0: - case 10: - if (m_lastStatus != IS_DISCONNECTED) { - wxLogInfo(wxT("Disconnected from ircDDB")); - m_lastStatus = IS_DISCONNECTED; - } - break; - case 7: - if (m_lastStatus != IS_CONNECTED) { - wxLogInfo(wxT("Connected to ircDDB")); - m_lastStatus = IS_CONNECTED; - } - break; - default: - if (m_lastStatus != IS_CONNECTING) { - wxLogInfo(wxT("Connecting to ircDDB")); - m_lastStatus = IS_CONNECTING; - } - break; - } - - m_statusTimer.start(); - } - - // Process all incoming ircDDB messages, updating the caches - for (;;) { - IRCDDB_RESPONSE_TYPE type = m_irc->getMessageType(); - - switch (type) { - case IDRT_NONE: - return; - - case IDRT_USER: { - wxString user, repeater, gateway, address, timestamp; - bool res = m_irc->receiveUser(user, repeater, gateway, address, timestamp); - if (!res) - break; - - if (!address.IsEmpty()) { - wxLogMessage(wxT("USER: %s %s %s %s"), user.c_str(), repeater.c_str(), gateway.c_str(), address.c_str()); - m_cache.updateUser(user, repeater, gateway, address, timestamp, DP_DEXTRA, false, false); - } else { - wxLogMessage(wxT("USER: %s NOT FOUND"), user.c_str()); - } - } - break; - - case IDRT_REPEATER: { - wxString repeater, gateway, address; - bool res = m_irc->receiveRepeater(repeater, gateway, address); - if (!res) - break; - - if (!address.IsEmpty()) { - wxLogMessage(wxT("REPEATER: %s %s %s"), repeater.c_str(), gateway.c_str(), address.c_str()); - m_cache.updateRepeater(repeater, gateway, address, DP_DEXTRA, false, false); - } else { - wxLogMessage(wxT("REPEATER: %s NOT FOUND"), repeater.c_str()); - } - } - break; - - case IDRT_GATEWAY: { - wxString gateway, address; - bool res = m_irc->receiveGateway(gateway, address); - if (!res) - break; - -#if defined(DEXTRA_LINK) - CDExtraHandler::gatewayUpdate(gateway, address); -#endif -#if defined(DCS_LINK) - CDCSHandler::gatewayUpdate(gateway, address); -#endif - - if (!address.IsEmpty()) { - wxLogMessage(wxT("GATEWAY: %s %s"), gateway.c_str(), address.c_str()); - m_cache.updateGateway(gateway, address, DP_DEXTRA, false, false); - } else { - wxLogMessage(wxT("GATEWAY: %s NOT FOUND"), gateway.c_str()); - } - } - break; - } - } -} - -#if defined(DEXTRA_LINK) -void CStarNetServerThread::processDExtra() -{ - for (;;) { - DEXTRA_TYPE type = m_dextraPool->read(); - - switch (type) { - case DE_NONE: - return; - - case DE_POLL: { - CPollData* poll = m_dextraPool->readPoll(); - if (poll != NULL) { - CDExtraHandler::process(*poll); - delete poll; - } - } - break; - - case DE_CONNECT: { - CConnectData* connect = m_dextraPool->readConnect(); - if (connect != NULL) { - CDExtraHandler::process(*connect); - delete connect; - } - } - break; - - case DE_HEADER: { - CHeaderData* header = m_dextraPool->readHeader(); - if (header != NULL) { - // wxLogMessage(wxT("DExtra header - My: %s/%s Your: %s Rpt1: %s Rpt2: %s"), header->getMyCall1().c_str(), header->getMyCall2().c_str(), header->getYourCall().c_str(), header->getRptCall1().c_str(), header->getRptCall2().c_str()); - CDExtraHandler::process(*header); - delete header; - } - } - break; - - case DE_AMBE: { - CAMBEData* data = m_dextraPool->readAMBE(); - if (data != NULL) { - CDExtraHandler::process(*data); - delete data; - } - } - break; - } - } -} -#endif - -#if defined(DCS_LINK) -void CStarNetServerThread::processDCS() -{ - for (;;) { - DCS_TYPE type = m_dcsPool->read(); - - switch (type) { - case DC_NONE: - return; - - case DC_POLL: { - CPollData* poll = m_dcsPool->readPoll(); - if (poll != NULL) { - CDCSHandler::process(*poll); - delete poll; - } - } - break; - - case DC_CONNECT: { - CConnectData* connect = m_dcsPool->readConnect(); - if (connect != NULL) { - CDCSHandler::process(*connect); - delete connect; - } - } - break; - - case DC_DATA: { - CAMBEData* data = m_dcsPool->readData(); - if (data != NULL) { - // wxLogMessage(wxT("DCS header - My: %s/%s Your: %s Rpt1: %s Rpt2: %s"), header->getMyCall1().c_str(), header->getMyCall2().c_str(), header->getYourCall().c_str(), header->getRptCall1().c_str(), header->getRptCall2().c_str()); - CDCSHandler::process(*data); - delete data; - } - } - break; - } - } -} -#endif - -void CStarNetServerThread::processG2() -{ - for (;;) { - G2_TYPE type = m_g2Handler->read(); - - switch (type) { - case GT_NONE: - return; - - case GT_HEADER: { - CHeaderData* header = m_g2Handler->readHeader(); - if (header != NULL) { - // wxLogMessage(wxT("G2 header - My: %s/%s Your: %s Rpt1: %s Rpt2: %s Flags: %02X %02X %02X"), header->getMyCall1().c_str(), header->getMyCall2().c_str(), header->getYourCall().c_str(), header->getRptCall1().c_str(), header->getRptCall2().c_str(), header->getFlag1(), header->getFlag2(), header->getFlag3()); - CG2Handler::process(*header); - delete header; - } - } - break; - - case GT_AMBE: { - CAMBEData* data = m_g2Handler->readAMBE(); - if (data != NULL) { - CG2Handler::process(*data); - delete data; - } - } - break; - } - } -} - -#if defined(DEXTRA_LINK) -void CStarNetServerThread::loadReflectors() -{ - wxFileName fileName(wxFileName::GetHomeDir(), DEXTRA_HOSTS_FILE_NAME); - - if (!fileName.IsFileReadable()) { - wxLogMessage(wxT("File %s not readable"), fileName.GetFullPath().c_str()); -#if defined(__WINDOWS__) - fileName.Assign(::wxGetCwd(), DEXTRA_HOSTS_FILE_NAME); -#else - fileName.Assign(wxT(DATA_DIR), DEXTRA_HOSTS_FILE_NAME); -#endif - if (!fileName.IsFileReadable()) - wxLogMessage(wxT("File %s not readable"), fileName.GetFullPath().c_str()); - } - - unsigned int count = 0U; - - CHostFile hostFile(fileName.GetFullPath(), true); - for (unsigned int i = 0U; i < hostFile.getCount(); i++) { - wxString reflector = hostFile.getName(i); - in_addr address = CUDPReaderWriter::lookup(hostFile.getAddress(i)); - bool lock = hostFile.getLock(i); - - if (address.s_addr != INADDR_NONE) { - unsigned char* ucp = (unsigned char*)&address; - - wxString addrText; - addrText.Printf(wxT("%u.%u.%u.%u"), ucp[0U] & 0xFFU, ucp[1U] & 0xFFU, ucp[2U] & 0xFFU, ucp[3U] & 0xFFU); - - if (lock) - wxLogMessage(wxT("Locking %s to %s"), reflector.c_str(), addrText.c_str()); - - reflector.Append(wxT(" ")); - reflector.Truncate(LONG_CALLSIGN_LENGTH - 1U); - reflector.Append(wxT("G")); - m_cache.updateGateway(reflector, addrText, DP_DEXTRA, lock, true); - - count++; - } - } - - wxLogMessage(wxT("Loaded %u of %u DExtra reflectors"), count, hostFile.getCount()); -} -#endif - -#if defined(DCS_LINK) -void CStarNetServerThread::loadReflectors() -{ - wxFileName fileName(wxFileName::GetHomeDir(), DCS_HOSTS_FILE_NAME); - - if (!fileName.IsFileReadable()) { - wxLogMessage(wxT("File %s not readable"), fileName.GetFullPath().c_str()); -#if defined(__WINDOWS__) - fileName.Assign(::wxGetCwd(), DCS_HOSTS_FILE_NAME); -#else - fileName.Assign(wxT(DATA_DIR), DCS_HOSTS_FILE_NAME); -#endif - if (!fileName.IsFileReadable()) - wxLogMessage(wxT("File %s not readable"), fileName.GetFullPath().c_str()); - } - - unsigned int count = 0U; - - CHostFile hostFile(fileName.GetFullPath(), true); - for (unsigned int i = 0U; i < hostFile.getCount(); i++) { - wxString reflector = hostFile.getName(i); - in_addr address = CUDPReaderWriter::lookup(hostFile.getAddress(i)); - bool lock = hostFile.getLock(i); - - if (address.s_addr != INADDR_NONE) { - unsigned char* ucp = (unsigned char*)&address; - - wxString addrText; - addrText.Printf(wxT("%u.%u.%u.%u"), ucp[0U] & 0xFFU, ucp[1U] & 0xFFU, ucp[2U] & 0xFFU, ucp[3U] & 0xFFU); - - if (lock) - wxLogMessage(wxT("Locking %s to %s"), reflector.c_str(), addrText.c_str()); - - reflector.Append(wxT(" ")); - reflector.Truncate(LONG_CALLSIGN_LENGTH - 1U); - reflector.Append(wxT("G")); - m_cache.updateGateway(reflector, addrText, DP_DCS, lock, true); - - count++; - } - } - - wxLogMessage(wxT("Loaded %u of %u DCS reflectors"), count, hostFile.getCount()); -} -#endif diff --git a/StarNetServer/StarNetServerThread.h b/StarNetServer/StarNetServerThread.h deleted file mode 100644 index aac957a..0000000 --- a/StarNetServer/StarNetServerThread.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (C) 2010,2011,2012,2013 by Jonathan Naylor G4KLX - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef StarNetServerThread_H -#define StarNetServerThread_H - -#include "DExtraProtocolHandlerPool.h" // DEXTRA_LINK -#include "DCSProtocolHandlerPool.h" // DCS_LINK -#include "G2ProtocolHandler.h" -#include "RemoteHandler.h" -#include "CacheManager.h" -#include "IRCDDB.h" -#include "Timer.h" -#include "Defs.h" - -#include - -class CStarNetServerThread { -public: - CStarNetServerThread(bool nolog, const wxString& logDir); - virtual ~CStarNetServerThread(); - - virtual void setCallsign(const wxString& callsign); - virtual void setAddress(const wxString& address); -#if defined(DEXTRA_LINK) || defined(DCS_LINK) - virtual void addStarNet(const wxString& callsign, const wxString& logoff, const wxString& repeater, const wxString& infoText, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector); -#else - virtual void addStarNet(const wxString& callsign, const wxString& logoff, const wxString& repeater, const wxString& infoText, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch); -#endif - virtual void setRemote(bool enabled, const wxString& password, unsigned int port); - virtual void setIRC(CIRCDDB* irc); - virtual void setLog(bool enabled); - - virtual void run(); - virtual void kill(); - -private: - bool m_nolog; - wxString m_logDir; - bool m_killed; - bool m_stopped; - wxString m_callsign; - wxString m_address; -#if defined(DEXTRA_LINK) - CDExtraProtocolHandlerPool* m_dextraPool; -#endif -#if defined(DCS_LINK) - CDCSProtocolHandlerPool* m_dcsPool; -#endif - CG2ProtocolHandler* m_g2Handler; - CIRCDDB* m_irc; - CCacheManager m_cache; - bool m_logEnabled; - CTimer m_statusTimer; - IRCDDB_STATUS m_lastStatus; - bool m_remoteEnabled; - wxString m_remotePassword; - unsigned int m_remotePort; - CRemoteHandler* m_remote; - - void processIrcDDB(); - void processG2(); -#if defined(DEXTRA_LINK) - void processDExtra(); - void loadReflectors(); -#endif -#if defined(DCS_LINK) - void processDCS(); - void loadReflectors(); -#endif -}; - -#endif diff --git a/StarNetServer/StarNetServerThreadHelper.cpp b/StarNetServer/StarNetServerThreadHelper.cpp deleted file mode 100644 index e6bb482..0000000 --- a/StarNetServer/StarNetServerThreadHelper.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2012 by Jonathan Naylor G4KLX - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include "StarNetServerThreadHelper.h" - -CStarNetServerThreadHelper::CStarNetServerThreadHelper(CStarNetServerThread* thread) : -wxThread(wxTHREAD_JOINABLE), -m_thread(thread) -{ - wxASSERT(thread != NULL); -} - -CStarNetServerThreadHelper::~CStarNetServerThreadHelper() -{ - delete m_thread; -} - -void CStarNetServerThreadHelper::start() -{ - Create(); - - SetPriority(100U); - - Run(); -} - -void* CStarNetServerThreadHelper::Entry() -{ - wxASSERT(m_thread != NULL); - - m_thread->run(); - - return NULL; -} - -void CStarNetServerThreadHelper::kill() -{ - wxASSERT(m_thread != NULL); - - m_thread->kill(); - - Wait(); -} diff --git a/ircDDBGateway/IRCDDBGatewayApp.cpp b/ircDDBGateway/IRCDDBGatewayApp.cpp index 930b1d5..78243c0 100644 --- a/ircDDBGateway/IRCDDBGatewayApp.cpp +++ b/ircDDBGateway/IRCDDBGatewayApp.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2015,2018,2020 by Jonathan Naylor G4KLX + * Copyright (C) 2010-2015,2018,2020,2023 by Jonathan Naylor G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -23,6 +23,7 @@ #include "IRCDDBGatewayThread.h" #include "IRCDDBGatewayDefs.h" #include "IRCDDBGatewayApp.h" +#include "MQTTConnection.h" #include "CallsignList.h" #include "APRSWriter.h" #include "Version.h" @@ -47,6 +48,9 @@ const wxChar* CONFDIR_OPTION = wxT("confdir"); const wxString LOG_BASE_NAME = wxT("ircddbgateway"); +// In MQTTLog.cpp +extern CMQTTConnection* m_mqtt; + CIRCDDBGatewayApp::CIRCDDBGatewayApp() : wxApp(), m_name(), @@ -74,6 +78,28 @@ bool CIRCDDBGatewayApp::OnInit() if (!wxApp::OnInit()) return false; +#if defined(__WINDOWS__) + if (m_confDir.IsEmpty()) + m_confDir = ::wxGetHomeDir(); + + m_config = new CIRCDDBGatewayConfig(new wxConfig(APPLICATION_NAME), m_confDir, CONFIG_FILE_NAME, m_name); +#else + if (m_confDir.IsEmpty()) + m_confDir = wxT(CONF_DIR); + + m_config = new CIRCDDBGatewayConfig(m_confDir, CONFIG_FILE_NAME, m_name); +#endif + + std::string mqttAddress; + unsigned short mqttPort; + unsigned int mqttKeepalive; + m_config->getMQTT(mqttAddress, mqttPort, mqttKeepalive); + std::vector> subscriptions; + m_mqtt = new CMQTTConnection(mqttAddress, mqttPort, "ircddb-gateway", subscriptions, mqttKeepalive);m_conf.getMQTTKeepalive()); + bool ret = m_mqtt->open(); + if (!ret) + return false; + if (!m_nolog) { wxString logBaseName = LOG_BASE_NAME; if (!m_name.IsEmpty()) { @@ -89,7 +115,7 @@ bool CIRCDDBGatewayApp::OnInit() m_logDir = wxT(LOG_DIR); #endif - wxLog* log = new CLogger(m_logDir, logBaseName); + wxLog* log = new CLogger; wxLog::SetActiveTarget(log); if (m_debug) { @@ -118,24 +144,12 @@ bool CIRCDDBGatewayApp::OnInit() m_checker = new wxSingleInstanceChecker(appName); #endif - bool ret = m_checker->IsAnotherRunning(); + ret = m_checker->IsAnotherRunning(); if (ret) { wxLogError(wxT("Another copy of the ircDDB Gateway is running, exiting")); return false; } -#if defined(__WINDOWS__) - if (m_confDir.IsEmpty()) - m_confDir = ::wxGetHomeDir(); - - m_config = new CIRCDDBGatewayConfig(new wxConfig(APPLICATION_NAME), m_confDir, CONFIG_FILE_NAME, m_name); -#else - if (m_confDir.IsEmpty()) - m_confDir = wxT(CONF_DIR); - - m_config = new CIRCDDBGatewayConfig(m_confDir, CONFIG_FILE_NAME, m_name); -#endif - wxString frameName = APPLICATION_NAME + wxT(" - "); if (!m_name.IsEmpty()) { frameName.Append(m_name); @@ -268,15 +282,13 @@ void CIRCDDBGatewayApp::createThread() thread->setGateway(gatewayType, gatewayCallsign, gatewayAddress); - wxString aprsAddress; - unsigned int aprsPort; bool aprsEnabled; - m_config->getDPRS(aprsEnabled, aprsAddress, aprsPort); - wxLogInfo(wxT("APRS enabled: %d, host: %s:%u"), int(aprsEnabled), aprsAddress.c_str(), aprsPort); + m_config->getDPRS(aprsEnabled); + wxLogInfo(wxT("APRS enabled: %d"), int(aprsEnabled)); CAPRSWriter* aprs = NULL; - if (aprsEnabled && !aprsAddress.IsEmpty() && aprsPort != 0U) { - aprs = new CAPRSWriter(aprsAddress, aprsPort, gatewayCallsign); + if (aprsEnabled) { + aprs = new CAPRSWriter(gatewayCallsign); bool res = aprs->open(); if (!res) diff --git a/ircDDBGateway/IRCDDBGatewayAppD.cpp b/ircDDBGateway/IRCDDBGatewayAppD.cpp index 4a3c900..e990ad0 100644 --- a/ircDDBGateway/IRCDDBGatewayAppD.cpp +++ b/ircDDBGateway/IRCDDBGatewayAppD.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2013,2015,2018,2020 by Jonathan Naylor G4KLX + * Copyright (C) 2010-2013,2015,2018,2020,2023 by Jonathan Naylor G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,6 +22,7 @@ #include "IRCDDBGatewayConfig.h" #include "IRCDDBGatewayAppD.h" #include "IRCDDBGatewayDefs.h" +#include "MQTTConnection.h" #include "CallsignList.h" #include "APRSWriter.h" #include "Version.h" @@ -55,6 +56,9 @@ const wxString LOG_BASE_NAME = wxT("ircDDBGateway"); static CIRCDDBGatewayAppD* m_gateway = NULL; +// In MQTTLog.cpp +extern CMQTTConnection* m_mqtt; + static void handler(int signum) { m_gateway->kill(); @@ -185,6 +189,18 @@ CIRCDDBGatewayAppD::~CIRCDDBGatewayAppD() bool CIRCDDBGatewayAppD::init() { + CIRCDDBGatewayConfig config(m_confDir, CONFIG_FILE_NAME, m_name); + + wxString mqttAddress; + unsigned short mqttPort; + unsigned int mqttKeepalive; + config.getMQTT(mqttAddress, mqttPort, mqttKeepalive); + std::vector> subscriptions; + m_mqtt = new CMQTTConnection(mqttAddress, mqttPort, "ircddb-gateway", subscriptions, mqttKeepalive); + bool ret = m_mqtt->open(); + if (!ret) + return false; + if (m_foreground) { initLogging(new CConsoleLogger()); } else if (!m_nolog) { @@ -197,7 +213,7 @@ bool CIRCDDBGatewayAppD::init() if (m_logDir.IsEmpty()) m_logDir = wxT(LOG_DIR); - initLogging(new CLogger(m_logDir, logBaseName)); + initLogging(new CLogger); } else { new wxLogNull; } @@ -210,7 +226,7 @@ bool CIRCDDBGatewayAppD::init() appName.Replace(wxT(" "), wxT("_")); m_checker = new wxSingleInstanceChecker(appName, wxT("/tmp")); - bool ret = m_checker->IsAnotherRunning(); + ret = m_checker->IsAnotherRunning(); if (ret) { wxLogError(wxT("Another copy of the ircDDB Gateway is running, exiting")); return false; @@ -232,13 +248,13 @@ void CIRCDDBGatewayAppD::initLogging(wxLog *logger) { wxLog::SetActiveTarget(logger); - if (m_debug) { - wxLog::SetVerbose(true); - wxLog::SetLogLevel(wxLOG_Debug); - } else { - wxLog::SetVerbose(false); - wxLog::SetLogLevel(wxLOG_Message); - } + if (m_debug) { + wxLog::SetVerbose(true); + wxLog::SetLogLevel(wxLOG_Debug); + } else { + wxLog::SetVerbose(false); + wxLog::SetLogLevel(wxLOG_Message); + } } void CIRCDDBGatewayAppD::run() @@ -275,15 +291,13 @@ bool CIRCDDBGatewayAppD::createThread() m_thread->setGateway(gatewayType, gatewayCallsign, gatewayAddress); - wxString aprsAddress; - unsigned int aprsPort; bool aprsEnabled; - config.getDPRS(aprsEnabled, aprsAddress, aprsPort); - wxLogInfo(wxT("APRS enabled: %d, host: %s:%u"), int(aprsEnabled), aprsAddress.c_str(), aprsPort); + config.getDPRS(aprsEnabled); + wxLogInfo(wxT("APRS enabled: %d"), int(aprsEnabled)); CAPRSWriter* aprs = NULL; - if (aprsEnabled && !aprsAddress.IsEmpty() && aprsPort != 0U) { - aprs = new CAPRSWriter(aprsAddress, aprsPort, gatewayCallsign); + if (aprsEnabled) { + aprs = new CAPRSWriter(gatewayCallsign); bool res = aprs->open(); if (!res) diff --git a/ircDDBGateway/IRCDDBGatewayThread.cpp b/ircDDBGateway/IRCDDBGatewayThread.cpp index d18b003..b715924 100644 --- a/ircDDBGateway/IRCDDBGatewayThread.cpp +++ b/ircDDBGateway/IRCDDBGatewayThread.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2015,2018,2020 by Jonathan Naylor G4KLX + * Copyright (C) 2010-2015,2018,2020,2023 by Jonathan Naylor G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,6 +21,7 @@ #include "RepeaterHandler.h" #include "StarNetHandler.h" #include "CallsignServer.h" +#include "MQTTConnection.h" #include "DExtraHandler.h" #include "DPlusHandler.h" #include "HeaderLogger.h" @@ -35,10 +36,13 @@ #include "PollData.h" #include "AMBEData.h" #include "HostFile.h" +#include "Version.h" #include "CCSData.h" +#include "MQTTLog.h" #include "DDData.h" #include "Utils.h" #include "Defs.h" +#include "../GitVersion.h" #include #include @@ -53,6 +57,9 @@ #include #endif +// In MQTTLog.cpp +extern CMQTTConnection* m_mqtt; + const wxString LOOPBACK_ADDRESS = wxT("127.0.0.1"); const unsigned int REMOTE_DUMMY_PORT = 65016U; @@ -236,7 +243,10 @@ void CIRCDDBGatewayThread::run() m_stopped = false; - wxLogMessage(wxT("Starting the ircDDB Gateway thread")); + wxLogInfo(wxT("ircDDBGateway-%s is starting"), VERSION); + wxLogInfo(wxT("Built %s %s (GitID #%.7s)"), __TIME__, __DATE__, gitversion); + + writeJSONStatus("ircDDBGateway is starting"); CHeaderLogger* headerLogger = NULL; if (m_logEnabled) { @@ -427,7 +437,8 @@ void CIRCDDBGatewayThread::run() wxLogError(wxT("Unknown exception raised in the main thread")); } - wxLogMessage(wxT("Stopping the ircDDB Gateway thread")); + wxLogInfo(wxT("ircDDBGateway is stopping")); + writeJSONStatus("ircDDBGateway is stopping"); // Unlink from all reflectors CDExtraHandler::unlink(); @@ -1416,3 +1427,14 @@ void CIRCDDBGatewayThread::readStatusFile(const wxString& filename, unsigned int var = text; } } + +void CIRCDDBGatewayThread::writeJSONStatus(const std::string& status) +{ + nlohmann::json json; + + json["timestamp"] = CUtils::createTimestamp(); + json["message"] = status; + + WriteJSON("status", json); +} + diff --git a/ircDDBGateway/IRCDDBGatewayThread.h b/ircDDBGateway/IRCDDBGatewayThread.h index f89361b..5ab7c87 100644 --- a/ircDDBGateway/IRCDDBGatewayThread.h +++ b/ircDDBGateway/IRCDDBGatewayThread.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2013,2015 by Jonathan Naylor G4KLX + * Copyright (C) 2010-2013,2015,2023 by Jonathan Naylor G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -155,6 +155,8 @@ private: void readStatusFiles(); void readStatusFile(const wxString& filename, unsigned int n, wxString& var); + + void writeJSONStatus(const std::string& status); }; #endif diff --git a/ircDDBGateway/schema.json b/ircDDBGateway/schema.json new file mode 100644 index 0000000..ba508e4 --- /dev/null +++ b/ircDDBGateway/schema.json @@ -0,0 +1,29 @@ +{ + "$defs": { + "timestamp": {"type": "string"}, + "reflector": {"type": "string"}, + "action": {"type": "string", "enum": ["linking", "unlinked", "failed", "relinking"]}, + "protocol": {"type": "string", "enum": ["d-plus", "dextra", "dcs"]}, + "direction": {"type": "string", "enum": ["in", "out"]}, + "reason": {"type": "string", "enum": ["user", "timer", "remote", "startup"]} + }, + + "status": { + "type": "object", + "timestamp": {"$ref": "#/$defs/timestamp"}, + "message": {"type": "string"}, + "required": ["timestamp", "message"] + }, + + "link": { + "type": "object", + "timestamp": {"$ref": "#/$defs/timestamp"}, + "action": {"$ref": "#/$defs/action"}, + "reason": {"$ref": "#/$defs/reason"}, + "reflector": {"$ref": "#/defs/reflector"}, + "direction": {"$ref": "#/defs/direction"}, + "protocol": {"$ref": "#/defs/protocol"}, + "required": ["timestamp", "action"] + } +} +