Ref T623, ignore/unignore dot command

This commit is contained in:
Klaus Basan
2019-04-26 02:15:03 +02:00
parent bbd6811c8d
commit 57c6d8ac77
3 changed files with 22 additions and 2 deletions

View File

@@ -280,7 +280,7 @@ namespace BlackCore
{
Q_UNUSED(originator;)
if (commandLine.isEmpty()) { return false; }
static const QStringList cmds({ ".msg", ".m", ".chat", ".altos", ".altoffset", ".wallop", ".watchdog", ".reinit", ".reinitialize" });
static const QStringList cmds({ ".msg", ".m", ".chat", ".altos", ".altoffset", ".wallop", ".watchdog", ".reinit", ".reinitialize", ".enable", ".disable", ".ignore", ".unignore" });
CSimpleCommandParser parser(cmds);
parser.parse(commandLine);
if (!parser.isKnownCommand()) { return false; }
@@ -419,6 +419,22 @@ namespace BlackCore
m_network->sendWallopMessage(wallopMsg);
return true;
}
else if (parser.matchesCommand(".enable", ".unignore"))
{
if (parser.countParts() < 2) { return false; }
if (!m_network) { return false; }
if (!this->isConnected()) { return false; }
const CCallsign cs(parser.part(1));
if (cs.isValid()) { this->updateAircraftEnabled(cs, true); }
}
else if (parser.matchesCommand(".disable", ".ignore"))
{
if (parser.countParts() < 2) { return false; }
if (!m_network) { return false; }
if (!this->isConnected()) { return false; }
const CCallsign cs(parser.part(1));
if (cs.isValid()) { this->updateAircraftEnabled(cs, false); }
}
return false;
}