mirror of
https://github.com/overte-org/overte.git
synced 2025-04-24 05:53:29 +02:00
include the number of keys with data-server get
This commit is contained in:
parent
fb39ad0a55
commit
d37ae7da1b
1 changed files with 4 additions and 1 deletions
|
@ -68,7 +68,7 @@ void DataServerClient::getValuesForKeysAndUUID(const QStringList& keys, const QU
|
|||
}
|
||||
|
||||
void DataServerClient::getValuesForKeysAndUserString(const QStringList& keys, const QString& userString) {
|
||||
if (!userString.isEmpty()) {
|
||||
if (!userString.isEmpty() && keys.size() <= UCHAR_MAX) {
|
||||
unsigned char* getPacket = new unsigned char[MAX_PACKET_SIZE];
|
||||
|
||||
// setup the header for this packet
|
||||
|
@ -79,6 +79,9 @@ void DataServerClient::getValuesForKeysAndUserString(const QStringList& keys, co
|
|||
numPacketBytes += userString.toLocal8Bit().size();
|
||||
getPacket[numPacketBytes++] = '\0';
|
||||
|
||||
// pack one byte to designate the number of keys
|
||||
getPacket[numPacketBytes++] = keys.size();
|
||||
|
||||
for (int i = 0; i < keys.size(); ++i) {
|
||||
// pack the keys, null terminated
|
||||
strcpy((char*) getPacket + numPacketBytes, keys[i].toLocal8Bit().constData());
|
||||
|
|
Loading…
Reference in a new issue