equal
deleted
inserted
replaced
198 |
198 |
199 void HWGame::onClientRead() |
199 void HWGame::onClientRead() |
200 { |
200 { |
201 quint8 msglen; |
201 quint8 msglen; |
202 quint32 bufsize; |
202 quint32 bufsize; |
203 while (((bufsize = readbuffer.size()) > 0) && |
203 while (!readbuffer.isEmpty() && ((bufsize = readbuffer.size()) > 0) && |
204 ((msglen = readbuffer.data()[0]) < bufsize)) |
204 ((msglen = readbuffer.data()[0]) < bufsize)) |
205 { |
205 { |
206 QByteArray msg = readbuffer.left(msglen + 1); |
206 QByteArray msg = readbuffer.left(msglen + 1); |
207 readbuffer.remove(0, msglen + 1); |
207 readbuffer.remove(0, msglen + 1); |
208 ParseMessage(msg); |
208 ParseMessage(msg); |