mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 02:03:11 +02:00
use a proper string list in DataServer for values
This commit is contained in:
parent
910b97de21
commit
2294b3a2cd
1 changed files with 5 additions and 9 deletions
|
@ -152,7 +152,7 @@ void DataServer::readPendingDatagrams() {
|
||||||
sendPacketStream << keyListString;
|
sendPacketStream << keyListString;
|
||||||
|
|
||||||
QStringList keyList = keyListString.split(MULTI_KEY_VALUE_SEPARATOR);
|
QStringList keyList = keyListString.split(MULTI_KEY_VALUE_SEPARATOR);
|
||||||
QString valueList;
|
QStringList valueList;
|
||||||
|
|
||||||
foreach (const QString& dataKey, keyList) {
|
foreach (const QString& dataKey, keyList) {
|
||||||
qDebug("Sending command to redis: GET uuid:%s:%s",
|
qDebug("Sending command to redis: GET uuid:%s:%s",
|
||||||
|
@ -164,21 +164,17 @@ void DataServer::readPendingDatagrams() {
|
||||||
|
|
||||||
if (reply->len) {
|
if (reply->len) {
|
||||||
// copy the value that redis returned
|
// copy the value that redis returned
|
||||||
valueList.append(reply->str);
|
valueList << reply->str;
|
||||||
} else {
|
} else {
|
||||||
// didn't find a value - insert a space
|
// didn't find a value - insert a space
|
||||||
valueList.append(' ');
|
valueList << QChar(' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
// add the multi-value separator
|
|
||||||
valueList.append(MULTI_KEY_VALUE_SEPARATOR);
|
|
||||||
|
|
||||||
freeReplyObject(reply);
|
freeReplyObject(reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
// null terminate the packet we're sending back (erases the trailing separator)
|
// append the value QStringList using the right separator
|
||||||
valueList[valueList.size() - 1] = '\0';
|
sendPacketStream << valueList.join(MULTI_KEY_VALUE_SEPARATOR);
|
||||||
sendPacketStream << valueList;
|
|
||||||
} else {
|
} else {
|
||||||
// user was asking for their UUID
|
// user was asking for their UUID
|
||||||
sendPacketStream << userString;
|
sendPacketStream << userString;
|
||||||
|
|
Loading…
Reference in a new issue