Remove config opton / code for making hostfiles UPPER case

This commit is contained in:
Andrew Taylor 2025-06-15 16:32:44 +01:00
parent 450fd77a09
commit 9df9a1aa16
6 changed files with 3 additions and 27 deletions

View file

@ -48,7 +48,6 @@ m_rptAddress(),
m_rptPort(0U), m_rptPort(0U),
m_myAddress(), m_myAddress(),
m_myPort(0U), m_myPort(0U),
m_wiresXMakeUpper(true),
m_wiresXCommandPassthrough(false), m_wiresXCommandPassthrough(false),
m_debug(false), m_debug(false),
m_daemon(false), m_daemon(false),
@ -190,8 +189,6 @@ bool CConf::read()
m_myAddress = value; m_myAddress = value;
else if (::strcmp(key, "LocalPort") == 0) else if (::strcmp(key, "LocalPort") == 0)
m_myPort = (unsigned short)::atoi(value); m_myPort = (unsigned short)::atoi(value);
else if (::strcmp(key, "WiresXMakeUpper") == 0)
m_wiresXMakeUpper = ::atoi(value) == 1;
else if (::strcmp(key, "WiresXCommandPassthrough") == 0) else if (::strcmp(key, "WiresXCommandPassthrough") == 0)
m_wiresXCommandPassthrough = ::atoi(value) == 1; m_wiresXCommandPassthrough = ::atoi(value) == 1;
else if (::strcmp(key, "Debug") == 0) else if (::strcmp(key, "Debug") == 0)
@ -339,11 +336,6 @@ unsigned short CConf::getMyPort() const
return m_myPort; return m_myPort;
} }
bool CConf::getWiresXMakeUpper() const
{
return m_wiresXMakeUpper;
}
bool CConf::getWiresXCommandPassthrough() const bool CConf::getWiresXCommandPassthrough() const
{ {
return m_wiresXCommandPassthrough; return m_wiresXCommandPassthrough;

View file

@ -37,7 +37,6 @@ public:
unsigned short getRptPort() const; unsigned short getRptPort() const;
std::string getMyAddress() const; std::string getMyAddress() const;
unsigned short getMyPort() const; unsigned short getMyPort() const;
bool getWiresXMakeUpper() const;
bool getWiresXCommandPassthrough() const; bool getWiresXCommandPassthrough() const;
bool getDebug() const; bool getDebug() const;
bool getDaemon() const; bool getDaemon() const;
@ -112,7 +111,6 @@ private:
unsigned short m_rptPort; unsigned short m_rptPort;
std::string m_myAddress; std::string m_myAddress;
unsigned short m_myPort; unsigned short m_myPort;
bool m_wiresXMakeUpper;
bool m_wiresXCommandPassthrough; bool m_wiresXCommandPassthrough;
bool m_debug; bool m_debug;
bool m_daemon; bool m_daemon;

View file

@ -279,9 +279,8 @@ int CYSFGateway::run()
std::string fileName = m_conf.getYSFNetworkHosts(); std::string fileName = m_conf.getYSFNetworkHosts();
unsigned int reloadTime = m_conf.getYSFNetworkReloadTime(); unsigned int reloadTime = m_conf.getYSFNetworkReloadTime();
bool wiresXMakeUpper = m_conf.getWiresXMakeUpper();
m_reflectors = new CYSFReflectors(fileName, reloadTime, wiresXMakeUpper); m_reflectors = new CYSFReflectors(fileName, reloadTime);
m_reflectors->reload(); m_reflectors->reload();
createWiresX(&rptNetwork); createWiresX(&rptNetwork);

View file

@ -7,7 +7,6 @@ RptAddress=127.0.0.1
RptPort=3200 RptPort=3200
LocalAddress=127.0.0.1 LocalAddress=127.0.0.1
LocalPort=4200 LocalPort=4200
WiresXMakeUpper=1
WiresXCommandPassthrough=0 WiresXCommandPassthrough=0
Debug=0 Debug=0
Daemon=0 Daemon=0

View file

@ -26,7 +26,7 @@
#include <cstring> #include <cstring>
#include <cctype> #include <cctype>
CYSFReflectors::CYSFReflectors(const std::string& hostsFile, unsigned int reloadTime, bool makeUpper) : CYSFReflectors::CYSFReflectors(const std::string& hostsFile, unsigned int reloadTime) :
m_hostsFile(hostsFile), m_hostsFile(hostsFile),
m_parrotAddress(), m_parrotAddress(),
m_parrotPort(0U), m_parrotPort(0U),
@ -40,7 +40,6 @@ m_fcsRooms(),
m_newReflectors(), m_newReflectors(),
m_currReflectors(), m_currReflectors(),
m_search(), m_search(),
m_makeUpper(makeUpper),
m_timer(1000U, reloadTime * 60U) m_timer(1000U, reloadTime * 60U)
{ {
if (reloadTime > 0U) if (reloadTime > 0U)
@ -284,13 +283,6 @@ bool CYSFReflectors::load()
if (size == 0U) if (size == 0U)
return false; return false;
if (m_makeUpper) {
for (std::vector<CYSFReflector*>::iterator it = m_newReflectors.begin(); it != m_newReflectors.end(); ++it) {
std::transform((*it)->m_name.begin(), (*it)->m_name.end(), (*it)->m_name.begin(), ::toupper);
std::transform((*it)->m_desc.begin(), (*it)->m_desc.end(), (*it)->m_desc.begin(), ::toupper);
}
}
std::sort(m_newReflectors.begin(), m_newReflectors.end(), refComparison); std::sort(m_newReflectors.begin(), m_newReflectors.end(), refComparison);
return true; return true;
@ -324,9 +316,6 @@ bool CYSFReflectors::findById(unsigned int id) const
CYSFReflector* CYSFReflectors::findByName(const std::string& name) CYSFReflector* CYSFReflectors::findByName(const std::string& name)
{ {
std::string fullName = name; std::string fullName = name;
if (m_makeUpper) {
std::transform(fullName.begin(), fullName.end(), fullName.begin(), ::toupper);
}
fullName.resize(16U, ' '); fullName.resize(16U, ' ');
for (std::vector<CYSFReflector*>::const_iterator it = m_currReflectors.cbegin(); it != m_currReflectors.cend(); ++it) { for (std::vector<CYSFReflector*>::const_iterator it = m_currReflectors.cbegin(); it != m_currReflectors.cend(); ++it) {

View file

@ -56,7 +56,7 @@ public:
class CYSFReflectors { class CYSFReflectors {
public: public:
CYSFReflectors(const std::string& hostsFile, unsigned int reloadTime, bool makeUpper); CYSFReflectors(const std::string& hostsFile, unsigned int reloadTime);
~CYSFReflectors(); ~CYSFReflectors();
void setParrot(const std::string& address, unsigned short port); void setParrot(const std::string& address, unsigned short port);
@ -92,7 +92,6 @@ private:
std::vector<CYSFReflector*> m_newReflectors; std::vector<CYSFReflector*> m_newReflectors;
std::vector<CYSFReflector*> m_currReflectors; std::vector<CYSFReflector*> m_currReflectors;
std::vector<CYSFReflector*> m_search; std::vector<CYSFReflector*> m_search;
bool m_makeUpper;
CTimer m_timer; CTimer m_timer;
bool findById(unsigned int id) const; bool findById(unsigned int id) const;