mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-09 01:23:57 -07:00
fix compiling on arch
This commit is contained in:
parent
ba786a0289
commit
3cf3fa789d
7 changed files with 108 additions and 56 deletions
|
|
@ -242,11 +242,15 @@ void IslInterface::readClient()
|
|||
return;
|
||||
|
||||
IslMessage newMessage;
|
||||
newMessage.ParseFromArray(inputBuffer.data(), messageLength);
|
||||
bool ok = newMessage.ParseFromArray(inputBuffer.data(), messageLength);
|
||||
inputBuffer.remove(0, messageLength);
|
||||
messageInProgress = false;
|
||||
|
||||
processMessage(newMessage);
|
||||
if (ok) {
|
||||
processMessage(newMessage);
|
||||
} else {
|
||||
qDebug() << "[ISL] parsing error!";
|
||||
}
|
||||
} while (!inputBuffer.isEmpty());
|
||||
}
|
||||
|
||||
|
|
@ -270,7 +274,10 @@ void IslInterface::transmitMessage(const IslMessage &item)
|
|||
unsigned int size = static_cast<unsigned int>(item.ByteSize());
|
||||
#endif
|
||||
buf.resize(size + 4);
|
||||
item.SerializeToArray(buf.data() + 4, size);
|
||||
if (!item.SerializeToArray(buf.data() + 4, size)) {
|
||||
qDebug() << "[ISL] transmit error!";
|
||||
return;
|
||||
}
|
||||
buf.data()[3] = (unsigned char)size;
|
||||
buf.data()[2] = (unsigned char)(size >> 8);
|
||||
buf.data()[1] = (unsigned char)(size >> 16);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue