mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 15:25:35 +08:00
Ref T623, ignore/unignore dot command
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user