QTfrontend/game.cpp
branch0.9.15
changeset 4746 3ae448aebe7e
parent 4494 9585435e20f7
child 4849 e7b1f0aaf36f
equal deleted inserted replaced
4744:ecc2c757d0df 4746:3ae448aebe7e
    54         case gtDemo: break;
    54         case gtDemo: break;
    55         case gtNet:
    55         case gtNet:
    56             emit HaveRecord(true, demo);
    56             emit HaveRecord(true, demo);
    57             break;
    57             break;
    58         default:
    58         default:
    59             if (gameState == gsInterrupted) emit HaveRecord(false, demo);
    59             if (gameState == gsInterrupted || gameState == gsHalted) emit HaveRecord(false, demo);
    60             else if (gameState == gsFinished) emit HaveRecord(true, demo);
    60             else if (gameState == gsFinished) emit HaveRecord(true, demo);
    61     }
    61     }
    62     SetGameState(gsStopped);
    62     SetGameState(gsStopped);
    63 }
    63 }
    64 
    64 
   227         }
   227         }
   228         case 'q': {
   228         case 'q': {
   229             SetGameState(gsFinished);
   229             SetGameState(gsFinished);
   230             break;
   230             break;
   231         }
   231         }
       
   232         case 'H': {
       
   233             SetGameState(gsHalted);
       
   234             break;
       
   235         }
   232         case 's': {
   236         case 's': {
   233             int size = msg.size();
   237             int size = msg.size();
   234             QString msgbody = QString::fromUtf8(msg.mid(2).left(size - 4));
   238             QString msgbody = QString::fromUtf8(msg.mid(2).left(size - 4));
   235             emit SendChat(msgbody);
   239             emit SendChat(msgbody);
   236             // FIXME: /me command doesn't work here
   240             // FIXME: /me command doesn't work here
   248         default: {
   252         default: {
   249             if (gameType == gtNet && !netSuspend)
   253             if (gameType == gtNet && !netSuspend)
   250             {
   254             {
   251                 emit SendNet(msg);
   255                 emit SendNet(msg);
   252             }
   256             }
   253         if (msg.at(1) != 's')
   257             if (msg.at(1) != 's')
   254             demo.append(msg);
   258                 demo.append(msg);
   255         }
   259         }
   256     }
   260     }
   257 }
   261 }
   258 
   262 
   259 void HWGame::FromNet(const QByteArray & msg)
   263 void HWGame::FromNet(const QByteArray & msg)