mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 19:35:32 +08:00
Ref T601, added chat command
This commit is contained in:
@@ -280,13 +280,13 @@ namespace BlackCore
|
||||
{
|
||||
Q_UNUSED(originator;)
|
||||
if (commandLine.isEmpty()) { return false; }
|
||||
static const QStringList cmds({ ".msg", ".m", ".altos", ".altoffset", ".wallop", ".watchdog", ".reinit", ".reinitialize" });
|
||||
static const QStringList cmds({ ".msg", ".m", ".chat", ".altos", ".altoffset", ".wallop", ".watchdog", ".reinit", ".reinitialize" });
|
||||
CSimpleCommandParser parser(cmds);
|
||||
parser.parse(commandLine);
|
||||
if (!parser.isKnownCommand()) { return false; }
|
||||
if (parser.matchesCommand(".msg", ".m"))
|
||||
if (parser.matchesCommand(".msg", ".m", ".chat"))
|
||||
{
|
||||
if (!this->getIContextNetwork()->isConnected())
|
||||
if (!this->getIContextNetwork() || !this->getIContextNetwork()->isConnected())
|
||||
{
|
||||
CLogMessage(this).validationError(u"Network needs to be connected");
|
||||
return false;
|
||||
|
||||
@@ -207,7 +207,7 @@ namespace BlackCore
|
||||
//! \addtogroup swiftdotcommands
|
||||
//! @{
|
||||
//! <pre>
|
||||
//! .m .msg message text
|
||||
//! .m .msg .chat message text
|
||||
//! .altos .altoffset altitude offset for testing
|
||||
//! .reinit .reinitialize re-initialize all aircraft
|
||||
//! .watchdog on|off watchdog on/off
|
||||
@@ -221,7 +221,7 @@ namespace BlackCore
|
||||
static void registerHelp()
|
||||
{
|
||||
if (BlackMisc::CSimpleCommandParser::registered("BlackCore::CContextNetwork")) { return; }
|
||||
BlackMisc::CSimpleCommandParser::registerCommand({".m", "alias: .msg"});
|
||||
BlackMisc::CSimpleCommandParser::registerCommand({".m", "alias: .msg, .chat"});
|
||||
BlackMisc::CSimpleCommandParser::registerCommand({".m message text", "send text message"});
|
||||
BlackMisc::CSimpleCommandParser::registerCommand({".m callsign message text", "send text message"});
|
||||
BlackMisc::CSimpleCommandParser::registerCommand({".altos callsign|? offsetvalue", "set altitude offset value (testing)"});
|
||||
|
||||
Reference in New Issue
Block a user