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

View file

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

View file

@ -279,9 +279,8 @@ int CYSFGateway::run()
std::string fileName = m_conf.getYSFNetworkHosts();
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();
createWiresX(&rptNetwork);

View file

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

View file

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

View file

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