Remove Quadnet specific messages

develop^2
Geoffrey Merck 5 years ago
parent 1ee39161ed
commit 8001a7b2ba

@ -974,8 +974,6 @@ void CGroupHandler::updateReflectorInfo()
info.resize(20, '_'); info.resize(20, '_');
CUtils::ReplaceChar(info, ' ', '_'); CUtils::ReplaceChar(info, ' ', '_');
parms.push_back(info); parms.push_back(info);
m_irc->sendSGSInfo(subcommand, parms);
} }
void CGroupHandler::logUser(LOGUSER lu, const std::string channel, const std::string user) void CGroupHandler::logUser(LOGUSER lu, const std::string channel, const std::string user)
@ -988,7 +986,6 @@ void CGroupHandler::logUser(LOGUSER lu, const std::string channel, const std::st
std::vector<std::string> parms; std::vector<std::string> parms;
parms.push_back(chn); parms.push_back(chn);
parms.push_back(usr); parms.push_back(usr);
m_irc->sendSGSInfo(cmd, parms);
} }
void CGroupHandler::sendToRepeaters(CHeaderData& header) const void CGroupHandler::sendToRepeaters(CHeaderData& header) const

@ -111,9 +111,6 @@ public:
// Send query for a user, a false return implies a network error // Send query for a user, a false return implies a network error
virtual bool findUser(const std::string& userCallsign) = 0; virtual bool findUser(const std::string& userCallsign) = 0;
// Support for the Smart Group Server
virtual void sendSGSInfo(const std::string subcommand, const std::vector<std::string> parms) = 0;
// The following functions are for processing received messages // The following functions are for processing received messages
// Get the waiting message type // Get the waiting message type

@ -550,22 +550,6 @@ bool IRCDDBApp::findRepeater(const std::string& rptrCall)
return true; return true;
} }
void IRCDDBApp::sendSGSInfo(const std::string &subcommand, const std::vector<std::string> &pars)
{
IRCMessageQueue *q = getSendQ();
std::string srv(d->currentServer);
if (srv.size() && d->state>=6 && q) {
std::string command("SGS ");
command.append(subcommand);
for (auto it=pars.begin(); it!=pars.end(); it++) {
command.push_back(' ');
command.append(*it);
}
IRCMessage *m = new IRCMessage(srv, command);
q->putMessage(m);
}
}
bool IRCDDBApp::sendHeard(const std::string& myCall, const std::string& myCallExt, const std::string& yourCall, const std::string& rpt1, const std::string& rpt2, unsigned char flag1, bool IRCDDBApp::sendHeard(const std::string& myCall, const std::string& myCallExt, const std::string& yourCall, const std::string& rpt1, const std::string& rpt2, unsigned char flag1,
unsigned char flag2, unsigned char flag3, const std::string& destination, const std::string& tx_msg, const std::string& tx_stats) unsigned char flag2, unsigned char flag3, const std::string& destination, const std::string& tx_msg, const std::string& tx_stats)
{ {

@ -70,8 +70,6 @@ public:
bool sendHeard(const std::string& myCall, const std::string& myCallExt, const std::string& yourCall, const std::string& rpt1, const std::string& rpt2, unsigned char flag1, bool sendHeard(const std::string& myCall, const std::string& myCallExt, const std::string& yourCall, const std::string& rpt1, const std::string& rpt2, unsigned char flag1,
unsigned char flag2, unsigned char flag3, const std::string& destination, const std::string& tx_msg, const std::string& tx_stats); unsigned char flag2, unsigned char flag3, const std::string& destination, const std::string& tx_msg, const std::string& tx_stats);
void sendSGSInfo(const std::string &subcommand, const std::vector<std::string> &pars);
int getConnectionState(); int getConnectionState();
void rptrQRG(const std::string& callsign, double txFrequency, double duplexShift, double range, double agl); void rptrQRG(const std::string& callsign, double txFrequency, double duplexShift, double range, double agl);

@ -30,9 +30,8 @@ struct CIRCDDBClientPrivate
IRCDDBApp *app; IRCDDBApp *app;
}; };
CIRCDDBClient::CIRCDDBClient(const std::string& hostName, unsigned int port, const std::string& callsign, const std::string& password, const std::string& versionInfo, const std::string& localAddr, bool isQuadNet ) : CIRCDDBClient::CIRCDDBClient(const std::string& hostName, unsigned int port, const std::string& callsign, const std::string& password, const std::string& versionInfo, const std::string& localAddr) :
d(new CIRCDDBClientPrivate), d(new CIRCDDBClientPrivate)
m_isQuadNet(isQuadNet)
{ {
std::string update_channel("#dstar"); std::string update_channel("#dstar");
d->app = new IRCDDBApp(update_channel); d->app = new IRCDDBApp(update_channel);
@ -114,17 +113,6 @@ bool CIRCDDBClient::sendHeard( const std::string& myCall, const std::string& myC
return d->app->sendHeard(myCall, myCallExt, yourCall, rpt1, rpt2, flag1, flag2, flag3, std::string(" "), std::string(""), std::string("")); return d->app->sendHeard(myCall, myCallExt, yourCall, rpt1, rpt2, flag1, flag2, flag3, std::string(" "), std::string(""), std::string(""));
} }
void CIRCDDBClient::sendSGSInfo(const std::string subcommand, const std::vector<std::string> parms)
{
printf("CIRCDDBClient::sendSGSInfo subcommand %s parms", subcommand.c_str());
for(unsigned int i=0; i < parms.size();i++)
printf(" %s", parms[i].c_str());
printf("\n");
if(m_isQuadNet) {
d->app->sendSGSInfo(subcommand, parms);
}
}
// Send heard data, a false return implies a network error // Send heard data, a false return implies a network error
bool CIRCDDBClient::sendHeardWithTXMsg(const std::string& myCall, const std::string& myCallExt, const std::string& yourCall, const std::string& rpt1, bool CIRCDDBClient::sendHeardWithTXMsg(const std::string& myCall, const std::string& myCallExt, const std::string& yourCall, const std::string& rpt1,

@ -33,7 +33,7 @@ struct CIRCDDBPrivate;
class CIRCDDBClient : public CIRCDDB{ class CIRCDDBClient : public CIRCDDB{
public: public:
CIRCDDBClient(const std::string& hostName, unsigned int port, const std::string& callsign, const std::string& password, const std::string& versionInfo, CIRCDDBClient(const std::string& hostName, unsigned int port, const std::string& callsign, const std::string& password, const std::string& versionInfo,
const std::string& localAddr = std::string(""), bool isQuadNet = false); const std::string& localAddr = std::string(""));
~CIRCDDBClient(); ~CIRCDDBClient();
// A false return implies a network error, or unable to log in // A false return implies a network error, or unable to log in
@ -106,9 +106,6 @@ public:
// Send query for a user, a false return implies a network error // Send query for a user, a false return implies a network error
bool findUser(const std::string& userCallsign); bool findUser(const std::string& userCallsign);
// Support for the Smart Group Server
void sendSGSInfo(const std::string subcommand, const std::vector<std::string> parms);
// The following functions are for processing received messages // The following functions are for processing received messages
// Get the waiting message type // Get the waiting message type
@ -132,7 +129,6 @@ public:
private: private:
struct CIRCDDBClientPrivate * const d; struct CIRCDDBClientPrivate * const d;
bool m_isQuadNet;
}; };

@ -137,13 +137,6 @@ bool CIRCDDBMultiClient::sendHeardWithTXStats(const std::string & myCall, const
return result; return result;
} }
void CIRCDDBMultiClient::sendSGSInfo(const std::string subcommand, const std::vector<std::string> parms)
{
for (unsigned int i = 0; i < m_clients.size(); i++) {
m_clients[i]->sendSGSInfo(subcommand, parms);
}
}
bool CIRCDDBMultiClient::findGateway(const std::string & gatewayCallsign) bool CIRCDDBMultiClient::findGateway(const std::string & gatewayCallsign)
{ {
pushQuery(IDRT_GATEWAY, gatewayCallsign, new CIRCDDBMultiClientQuery("", "", gatewayCallsign, "", "", IDRT_GATEWAY)); pushQuery(IDRT_GATEWAY, gatewayCallsign, new CIRCDDBMultiClientQuery("", "", gatewayCallsign, "", "", IDRT_GATEWAY));

@ -154,7 +154,6 @@ public:
virtual bool receiveGateway(std::string & gatewayCallsign, std::string & address); virtual bool receiveGateway(std::string & gatewayCallsign, std::string & address);
virtual bool receiveUser(std::string & userCallsign, std::string & repeaterCallsign, std::string & gatewayCallsign, std::string & address); virtual bool receiveUser(std::string & userCallsign, std::string & repeaterCallsign, std::string & gatewayCallsign, std::string & address);
virtual bool receiveUser(std::string & userCallsign, std::string & repeaterCallsign, std::string & gatewayCallsign, std::string & address, std::string & timeStamp); virtual bool receiveUser(std::string & userCallsign, std::string & repeaterCallsign, std::string & gatewayCallsign, std::string & address, std::string & timeStamp);
virtual void sendSGSInfo(const std::string subcommand, const std::vector<std::string> parms);
virtual void close(); virtual void close();
// //

@ -109,10 +109,9 @@ bool CSGSXLApp::createThread()
CIRCDDB_Array clients; CIRCDDB_Array clients;
for(unsigned int i=0; i < config.getIrcDDBCount(); i++) { for(unsigned int i=0; i < config.getIrcDDBCount(); i++) {
std::string hostname, username, password; std::string hostname, username, password;
bool isQuadNet; config.getIrcDDB(i, hostname, username, password);
config.getIrcDDB(i, hostname, username, password, isQuadNet); std::cout << "ircDDB " << i + 1 << " set to " << hostname << " username set to " << username << std::endl;
std::cout << "ircDDB " << i + 1 << " set to " << hostname << " username set to " << username << " QuadNet " << isQuadNet << std::endl; CIRCDDB *ircDDB = new CIRCDDBClient(hostname, 9007U, username, password, std::string("linux_SmartGroupServerXL-") + VERSION, address);
CIRCDDB *ircDDB = new CIRCDDBClient(hostname, 9007U, username, password, std::string("linux_SmartGroupServerXL-") + VERSION, address, isQuadNet);
clients.push_back(ircDDB); clients.push_back(ircDDB);
} }

@ -85,7 +85,6 @@ CSGSXLConfig::CSGSXLConfig(const std::string &pathname)
continue; continue;
} }
ircddb->isQuadNet = ircddb->hostname.find("openquad.net") != std::string::npos;
this->m_ircDDB.push_back(ircddb); this->m_ircDDB.push_back(ircddb);
std::cout << "IRCDDB: host=" << ircddb->hostname << " user=" << ircddb->username << " password=" << ircddb->password << "\n"; std::cout << "IRCDDB: host=" << ircddb->hostname << " user=" << ircddb->username << " password=" << ircddb->password << "\n";
} }
@ -95,7 +94,6 @@ CSGSXLConfig::CSGSXLConfig(const std::string &pathname)
ircddb->hostname = "rr.openquad.net"; ircddb->hostname = "rr.openquad.net";
ircddb->password = ""; ircddb->password = "";
ircddb->username = m_callsign; ircddb->username = m_callsign;
ircddb->isQuadNet = true;
this->m_ircDDB.push_back(ircddb); this->m_ircDDB.push_back(ircddb);
std::cout << "No ircDDB networks configure'd, defaulting to IRCDDB: host=" << ircddb->hostname << " user=" << ircddb->username << " password=" << ircddb->password << "\n"; std::cout << "No ircDDB networks configure'd, defaulting to IRCDDB: host=" << ircddb->hostname << " user=" << ircddb->username << " password=" << ircddb->password << "\n";
} }
@ -362,12 +360,11 @@ void CSGSXLConfig::getGateway(std::string& callsign, std::string& address) const
address = m_address; address = m_address;
} }
void CSGSXLConfig::getIrcDDB(unsigned int ircddb, std::string& hostname, std::string& username, std::string& password, bool &isQuadNet) const void CSGSXLConfig::getIrcDDB(unsigned int ircddb, std::string& hostname, std::string& username, std::string& password) const
{ {
hostname = m_ircDDB[ircddb]->hostname; hostname = m_ircDDB[ircddb]->hostname;
username = m_ircDDB[ircddb]->username; username = m_ircDDB[ircddb]->username;
password = m_ircDDB[ircddb]->password; password = m_ircDDB[ircddb]->password;
isQuadNet = m_ircDDB[ircddb]->isQuadNet;
} }
void CSGSXLConfig::getGroup(unsigned int mod, std::string& band, std::string& callsign, std::string& logoff, std::string& info, std::string& permanent, unsigned int& userTimeout, CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, std::string& reflector) const void CSGSXLConfig::getGroup(unsigned int mod, std::string& band, std::string& callsign, std::string& logoff, std::string& info, std::string& permanent, unsigned int& userTimeout, CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, std::string& reflector) const

@ -40,7 +40,6 @@ struct SircDDB {
std::string hostname; std::string hostname;
std::string username; std::string username;
std::string password; std::string password;
bool isQuadNet;
}; };
class CSGSXLConfig { class CSGSXLConfig {
@ -50,7 +49,7 @@ public:
void getGateway(std::string &callsign, std::string &address) const; void getGateway(std::string &callsign, std::string &address) const;
void getIrcDDB(unsigned int ircddb, std::string &hostname, std::string &username, std::string &password, bool &isQuadNet) const; void getIrcDDB(unsigned int ircddb, std::string &hostname, std::string &username, std::string &password) const;
void getGroup(unsigned int mod, std::string &band, std::string &callsign, std::string &logoff, std::string &info, std::string &permanent, unsigned int &userTimeout, CALLSIGN_SWITCH &callsignSwitch, bool &txMsgSwitch, std::string &reflector) const; void getGroup(unsigned int mod, std::string &band, std::string &callsign, std::string &logoff, std::string &info, std::string &permanent, unsigned int &userTimeout, CALLSIGN_SWITCH &callsignSwitch, bool &txMsgSwitch, std::string &reflector) const;

Loading…
Cancel
Save

Powered by TurnKey Linux.