mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 02:45:33 +08:00
[FSD] wallop message sending incomplete fixed
This commit is contained in:
committed by
Mat Sutcliffe
parent
2a34786039
commit
b9ea40e8d1
@@ -402,7 +402,7 @@ namespace BlackCore
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString msg(parser.remainingStringAfter(2));
|
const QString msg(parser.partAndRemainingStringAfter(2));
|
||||||
tm.setMessage(msg);
|
tm.setMessage(msg);
|
||||||
if (tm.isEmpty())
|
if (tm.isEmpty())
|
||||||
{
|
{
|
||||||
@@ -490,7 +490,12 @@ namespace BlackCore
|
|||||||
if (parser.countParts() < 2) { return false; }
|
if (parser.countParts() < 2) { return false; }
|
||||||
if (!m_fsdClient) { return false; }
|
if (!m_fsdClient) { return false; }
|
||||||
if (!this->isConnected()) { return false; }
|
if (!this->isConnected()) { return false; }
|
||||||
const QString wallopMsg = parser.part(1).simplified().trimmed();
|
const QString wallopMsg = parser.partAndRemainingStringAfter(1);
|
||||||
|
if (wallopMsg.isEmpty())
|
||||||
|
{
|
||||||
|
CLogMessage(this).validationError(u"No wallop message body");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
m_fsdClient->sendTextMessage(TextMessageGroups::AllSups, wallopMsg);
|
m_fsdClient->sendTextMessage(TextMessageGroups::AllSups, wallopMsg);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ namespace BlackMisc
|
|||||||
return m_splitParts.at(index);
|
return m_splitParts.at(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString CSimpleCommandParser::remainingStringAfter(int index) const
|
QString CSimpleCommandParser::partAndRemainingStringAfter(int index) const
|
||||||
{
|
{
|
||||||
if (index < 0) { return m_cleanedLine; }
|
if (index < 0) { return m_cleanedLine; }
|
||||||
const QString p = this->part(index);
|
const QString p = this->part(index);
|
||||||
|
|||||||
@@ -45,8 +45,9 @@ namespace BlackMisc
|
|||||||
//! Get part, 0 is command itself
|
//! Get part, 0 is command itself
|
||||||
const QString &part(int index) const;
|
const QString &part(int index) const;
|
||||||
|
|
||||||
//! Remaining part after
|
//! Part and remaing string after
|
||||||
QString remainingStringAfter(int index) const;
|
//! \remark trimmed and simlified
|
||||||
|
QString partAndRemainingStringAfter(int index) const;
|
||||||
|
|
||||||
//! Count parts
|
//! Count parts
|
||||||
int countParts() const;
|
int countParts() const;
|
||||||
|
|||||||
Reference in New Issue
Block a user