QTfrontend/game.cpp
changeset 157 8e3e11bb0a5f
parent 149 aae256899c49
child 172 5294ada3910b
equal deleted inserted replaced
156:3d6e89bba384 157:8e3e11bb0a5f
    71 	}
    71 	}
    72 }
    72 }
    73 
    73 
    74 void HWGame::ClientDisconnect()
    74 void HWGame::ClientDisconnect()
    75 {
    75 {
    76 	SaveDemo(cfgdir->absolutePath() + "/Demos/demo.hwd_1");
    76 	SaveDemo(cfgdir->absolutePath() + "/Demos/LastRound.hwd_1");
    77     IPCSocket->deleteLater();
    77     IPCSocket->deleteLater();
    78 	IPCSocket = 0;
    78 	IPCSocket = 0;
    79 	deleteLater();
    79 	deleteLater();
    80 }
    80 }
    81 
    81 
   275 	hdNum[teamname]=numHedgedogs;
   275 	hdNum[teamname]=numHedgedogs;
   276 }
   276 }
   277 
   277 
   278 void HWGame::SaveDemo(const QString & filename)
   278 void HWGame::SaveDemo(const QString & filename)
   279 {
   279 {
       
   280 	demo->replace(QByteArray("\x02TL"), QByteArray("\x02TD"));
       
   281 	demo->replace(QByteArray("\x02TN"), QByteArray("\x02TD"));
       
   282 
   280 	QFile demofile(filename);
   283 	QFile demofile(filename);
   281 	if (!demofile.open(QIODevice::WriteOnly))
   284 	if (!demofile.open(QIODevice::WriteOnly))
   282 	{
   285 	{
   283 		QMessageBox::critical(0,
   286 		QMessageBox::critical(0,
   284 				tr("Error"),
   287 				tr("Error"),