mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 15:45:46 +08:00
Sending wallop message
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", ".altos", ".altoffset", ".watchdog", ".reinit", ".reinitialize" });
|
||||
static const QStringList cmds({ ".msg", ".m", ".altos", ".altoffset", ".wallop", ".watchdog", ".reinit", ".reinitialize" });
|
||||
CSimpleCommandParser parser(cmds);
|
||||
parser.parse(commandLine);
|
||||
if (!parser.isKnownCommand()) { return false; }
|
||||
@@ -401,6 +401,15 @@ namespace BlackCore
|
||||
CLogMessage(this).info("Re-init %1 aircraft") << count;
|
||||
}
|
||||
}
|
||||
else if (parser.matchesCommand(".wallop"))
|
||||
{
|
||||
if (parser.countParts() < 2) { return false; }
|
||||
if (!m_network) { return false; }
|
||||
if (!this->isConnected()) { return false; }
|
||||
const QString wallopMsg = simplifyAccents(parser.part(1).simplified().trimmed());
|
||||
m_network->sendWallopMessage(wallopMsg);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -209,6 +209,7 @@ namespace BlackCore
|
||||
//! .altos .altoffset altitude offset for testing
|
||||
//! .reinit .reinitialize re-initialize all aircraft
|
||||
//! .watchdog on|off watchdog on/off
|
||||
//! .wallop message send wallop message
|
||||
//! </pre>
|
||||
//! @}
|
||||
//! \copydoc IContextNetwork::parseCommandLine
|
||||
@@ -223,6 +224,7 @@ namespace BlackCore
|
||||
BlackMisc::CSimpleCommandParser::registerCommand({".m callsign message text", "send text message"});
|
||||
BlackMisc::CSimpleCommandParser::registerCommand({".altos callsign offsetvalue", "set altitude offset value (testing)"});
|
||||
BlackMisc::CSimpleCommandParser::registerCommand({".watchdog on|off", "enable/disable network watchdog (testing)"});
|
||||
BlackMisc::CSimpleCommandParser::registerCommand({".wallop message", "send a wallop message"});
|
||||
BlackMisc::CSimpleCommandParser::registerCommand({".reinit", "re-initialize all aircraft"});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user