Refactor server services to share more code
This commit is contained in:
parent
37c0c5d17b
commit
5cd7c782ce
9 changed files with 280 additions and 85 deletions
|
|
@ -33,7 +33,6 @@ void TcpClient::processIncomeingJson(const QByteArray& jsonbytes)
|
|||
QString type = json["MessageType"].toString();
|
||||
if(type == "ItemUpdate")
|
||||
{
|
||||
std::cout<<"Got item json:\n"<<QString::fromLatin1(jsonbytes).toStdString();
|
||||
QJsonArray data = json["Data"].toArray();
|
||||
std::vector<std::shared_ptr<Item>> items;
|
||||
for(QJsonValueRef itemjson : data)
|
||||
|
|
@ -42,6 +41,7 @@ void TcpClient::processIncomeingJson(const QByteArray& jsonbytes)
|
|||
std::shared_ptr<Item> item = Item::loadItem(jsonobject);
|
||||
if(item)
|
||||
{
|
||||
qDebug()<<"Client got item"<<item->getName();
|
||||
item->setLoaded(false);
|
||||
items.push_back(item);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue