mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-15 09:15:34 +08:00
Avoid colons in VATLIB packets https://discordapp.com/channels/539048679160676382/567983892791951374/585899398387728395
This commit is contained in:
committed by
Mat Sutcliffe
parent
3510e20290
commit
c9846f45ee
@@ -303,7 +303,11 @@ namespace BlackCore
|
|||||||
QByteArray CNetworkVatlib::toFSDnoColon(const QString &qstr) const
|
QByteArray CNetworkVatlib::toFSDnoColon(const QString &qstr) const
|
||||||
{
|
{
|
||||||
if (!qstr.contains(':')) { return toFSD(qstr); }
|
if (!qstr.contains(':')) { return toFSD(qstr); }
|
||||||
BLACK_VERIFY_X(false, Q_FUNC_INFO, "Illegal char :");
|
if (CBuildConfig::isLocalDeveloperDebugBuild())
|
||||||
|
{
|
||||||
|
// so we can investigate
|
||||||
|
BLACK_VERIFY_X(false, Q_FUNC_INFO, "Illegal char :");
|
||||||
|
}
|
||||||
QString copy(qstr);
|
QString copy(qstr);
|
||||||
return toFSD(copy.remove(':'));
|
return toFSD(copy.remove(':'));
|
||||||
}
|
}
|
||||||
@@ -719,7 +723,7 @@ namespace BlackCore
|
|||||||
|
|
||||||
void CNetworkVatlib::replyToNameQuery(const CCallsign &callsign) // private
|
void CNetworkVatlib::replyToNameQuery(const CCallsign &callsign) // private
|
||||||
{
|
{
|
||||||
QStringList response { m_server.getUser().getRealNameAndHomeBase(), "" };
|
QStringList response { removeColon(m_server.getUser().getRealNameAndHomeBase()), "" };
|
||||||
Vat_SendClientQueryResponse(m_net.data(), vatClientQueryName, toFSD(callsign), toFSD(response)(), response.size());
|
Vat_SendClientQueryResponse(m_net.data(), vatClientQueryName, toFSD(callsign), toFSD(response)(), response.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1340,6 +1344,10 @@ namespace BlackCore
|
|||||||
{
|
{
|
||||||
QPointer<CNetworkVatlib> self(cbvar_cast(cbvar));
|
QPointer<CNetworkVatlib> self(cbvar_cast(cbvar));
|
||||||
const CCallsign callsign(self->fromFSD(callsignString));
|
const CCallsign callsign(self->fromFSD(callsignString));
|
||||||
|
const bool valid = !callsign.isEmpty();
|
||||||
|
BLACK_AUDIT_X(valid, Q_FUNC_INFO, "No callsign");
|
||||||
|
if (!valid) { return; }
|
||||||
|
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case vatClientQueryFreq:
|
case vatClientQueryFreq:
|
||||||
|
|||||||
Reference in New Issue
Block a user