MCPcopy Create free account
hub / github.com/XMuli/ChineseChess / slotRecv

Method slotRecv

NetworkGame.cpp:213–231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

211}
212
213void 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
233void NetworkGame::back()
234{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected