#include "gameclient.h" GameClient::GameClient() : TcpClientEquipment() { } bool GameClient::setValue(int iValue) { QByteArray buffer; buffer.resize(0); buffer[0]=static_cast(iValue%0xff); buffer[1]=static_cast(iValue>>8); return this->sendMsg(buffer); } bool GameClient::IsReady() { return IsReady(); } void GameClient::sendReady() { sendMsg(readyCheckString); } void GameClient::sendStart() { sendMsg(gameStartString); } void GameClient::sendStop() { sendMsg(gameStopString); } void GameClient::sendLevelHard() { sendMsg(gameLevelHard); } void GameClient::sendLevelMiddle() { sendMsg(gameLevelMiddle); } void GameClient::sendLevelEasy() { sendMsg(gameLevelEasy); } void GameClient::sendScore(int iValue) { sendMsg(gameScore+"|"+QString::number(iValue)); } void GameClient::onDataReceived() { QByteArray revBuffer=this->mClient->readAll(); QString strTempBuffer=QString(revBuffer); if(strTempBuffer.contains("|")) { QStringList list=strTempBuffer.split('|'); for (int i=0;i