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;) Q_UNUSED(originator;)
if (commandLine.isEmpty()) { return false; } 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); CSimpleCommandParser parser(cmds);
parser.parse(commandLine); parser.parse(commandLine);
if (!parser.isKnownCommand()) { return false; } 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"); CLogMessage(this).validationError(u"Network needs to be connected");
return false; return false;

View File

@@ -207,7 +207,7 @@ namespace BlackCore
//! \addtogroup swiftdotcommands //! \addtogroup swiftdotcommands
//! @{ //! @{
//! <pre> //! <pre>
//! .m .msg message text //! .m .msg .chat message text
//! .altos .altoffset altitude offset for testing //! .altos .altoffset altitude offset for testing
//! .reinit .reinitialize re-initialize all aircraft //! .reinit .reinitialize re-initialize all aircraft
//! .watchdog on|off watchdog on/off //! .watchdog on|off watchdog on/off
@@ -221,7 +221,7 @@ namespace BlackCore
static void registerHelp() static void registerHelp()
{ {
if (BlackMisc::CSimpleCommandParser::registered("BlackCore::CContextNetwork")) { return; } 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 message text", "send text message"});
BlackMisc::CSimpleCommandParser::registerCommand({".m callsign 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)"}); BlackMisc::CSimpleCommandParser::registerCommand({".altos callsign|? offsetvalue", "set altitude offset value (testing)"});

View File

@@ -1485,7 +1485,7 @@ namespace BlackCore
{ {
case vatServerErrorCsInUs: CLogMessage(self).error(u"The requested callsign is already taken"); emit self->terminate(); break; case vatServerErrorCsInUs: CLogMessage(self).error(u"The requested callsign is already taken"); emit self->terminate(); break;
case vatServerErrorCallsignInvalid: CLogMessage(self).error(u"The requested callsign is not valid"); emit self->terminate(); break; case vatServerErrorCallsignInvalid: CLogMessage(self).error(u"The requested callsign is not valid"); emit self->terminate(); break;
case vatServerErrorCidInvalid: CLogMessage(self).error(u"Wrong user ID or password"); emit self->terminate(); break; case vatServerErrorCidInvalid: CLogMessage(self).error(u"Wrong user ID or password, inactive account"); emit self->terminate(); break;
case vatServerErrorRevision: CLogMessage(self).error(u"This server does not support our protocol version"); emit self->terminate(); break; case vatServerErrorRevision: CLogMessage(self).error(u"This server does not support our protocol version"); emit self->terminate(); break;
case vatServerErrorLevel: CLogMessage(self).error(u"You are not authorized to use the requested pilot rating"); emit self->terminate(); break; case vatServerErrorLevel: CLogMessage(self).error(u"You are not authorized to use the requested pilot rating"); emit self->terminate(); break;
case vatServerErrorServFull: CLogMessage(self).error(u"The server is full"); emit self->terminate(); break; case vatServerErrorServFull: CLogMessage(self).error(u"The server is full"); emit self->terminate(); break;