| 211 | } |
| 212 | |
| 213 | void NetworkGame::slotRecv() |
| 214 | { |
| 215 | QByteArray arry = m_tcpSocket->readAll(); |
| 216 | |
| 217 | // 悔棋命令:0xFE 标记 |
| 218 | if (static_cast<unsigned char>(arry[0]) == 0xFE) { |
| 219 | ChessBoard::back(); |
| 220 | update(); |
| 221 | return; |
| 222 | } |
| 223 | |
| 224 | int nCheckedID = arry[0]; |
| 225 | int nRow = arry[1]; |
| 226 | int nCol = arry[2]; |
| 227 | |
| 228 | //qDebug()<<nCheckedID<<" "<<nRow<<" "<<nCol<<" "; |
| 229 | ChessBoard::clickPieces(nCheckedID, nRow, nCol); |
| 230 | update(); // Force repaint so the last-move trail & text stay in sync on both peers |
| 231 | } |
| 232 | |
| 233 | void NetworkGame::back() |
| 234 | { |
nothing calls this directly
no outgoing calls
no test coverage detected