[FS9] Add missing null termination when serializing QStrings

The produced QByteArray was missing the null terminating character,
since QByteArray::append() only added up to and not including '\0'.
This was also the reason why sometimes planes did not change their
aircraft models properly.
This commit is contained in:
Roland Winklmeier
2016-11-06 00:32:17 +01:00
committed by Klaus Basan
parent ea561cf723
commit a13f7eb1d4
2 changed files with 1 additions and 4 deletions

View File

@@ -316,9 +316,6 @@ namespace BlackSimPlugin
MultiPlayerPacketParser::writeSize(message, mpChangePlayerPlane.size());
message = MultiPlayerPacketParser::writeMessage(message, mpChangePlayerPlane);
CLogMessage(this).debug() << m_callsign << " connected to session.";
// Send it several times, since one got missed several times.
sendMessage(message);
sendMessage(message);
sendMessage(message);
m_timerId = startTimer(m_updateInterval.value(CTimeUnit::ms()));

View File

@@ -29,7 +29,7 @@ namespace BlackSimPlugin
QByteArray writeValue(QByteArray data, const QString &value)
{
data.append(qPrintable(value));
data.append(qPrintable(value), value.size() + 1);
return data;
}