mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 05:26:45 +08:00
[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:
committed by
Klaus Basan
parent
ea561cf723
commit
a13f7eb1d4
@@ -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()));
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user