Ref T601, added chat command

This commit is contained in:
Klaus Basan
2019-04-12 14:29:56 +02:00
parent bfed07fbc7
commit dd1aec056f
3 changed files with 6 additions and 6 deletions

View File

@@ -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;

View File

@@ -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)"});