This commit is contained in:
Max-Wilhelm Bruker
2009-12-01 10:43:46 +01:00
parent e51aa20420
commit 207d10d3e2
9 changed files with 73 additions and 70 deletions

View File

@@ -73,18 +73,15 @@ void ServerSocketInterface::readClient()
qDebug() << data;
xmlReader->addData(data);
if (topLevelItem)
topLevelItem->read(xmlReader);
else
while (!xmlReader->atEnd()) {
xmlReader->readNext();
if (xmlReader->isStartElement() && (xmlReader->name().toString() == "cockatrice_client_stream")) {
topLevelItem = new TopLevelProtocolItem;
connect(topLevelItem, SIGNAL(protocolItemReceived(ProtocolItem *)), this, SLOT(processProtocolItem(ProtocolItem *)));
topLevelItem->read(xmlReader);
}
while (!xmlReader->atEnd()) {
xmlReader->readNext();
if (topLevelItem)
topLevelItem->readElement(xmlReader);
else if (xmlReader->isStartElement() && (xmlReader->name().toString() == "cockatrice_client_stream")) {
topLevelItem = new TopLevelProtocolItem;
connect(topLevelItem, SIGNAL(protocolItemReceived(ProtocolItem *)), this, SLOT(processProtocolItem(ProtocolItem *)));
}
}
}
void ServerSocketInterface::catchSocketError(QAbstractSocket::SocketError socketError)