some debug messages removed
authordisplacer
Tue, 20 Feb 2007 22:34:42 +0000
changeset 468 8403d6884707
parent 467 20d36f976b25
child 469 ec37579483b4
some debug messages removed oldlocalcfg signal connect removed
QTfrontend/game.cpp
QTfrontend/netconnectedclient.cpp
QTfrontend/netserver.cpp
QTfrontend/netudpserver.cpp
QTfrontend/netudpwidget.cpp
QTfrontend/newnetclient.cpp
QTfrontend/team.cpp
--- a/QTfrontend/game.cpp	Tue Feb 20 21:33:49 2007 +0000
+++ b/QTfrontend/game.cpp	Tue Feb 20 22:34:42 2007 +0000
@@ -25,7 +25,6 @@
 #include <QTextStream>
 #include <QUuid>
 #include <QTextStream>
-#include <QDebug>
 
 #include "game.h"
 #include "hwconsts.h"
@@ -70,18 +69,13 @@
 			gt = "TL";
 	}
 	HWProto::addStringToBuffer(buf, gt);
-	qDebug() << "game type" << gt;
 	HWProto::addStringListToBuffer(buf, gamecfg->getFullConfig());
-	qDebug() << "config" << gamecfg->getFullConfig();
 
 	if (m_pTeamSelWidget)
 	{
-		qDebug() << "adding teams from teamselwidget...";
 		QList<HWTeam> teams = m_pTeamSelWidget->getPlayingTeams();
 		for(QList<HWTeam>::iterator it = teams.begin(); it != teams.end(); ++it)
 		{
-			qDebug() << "a team...";
-			//(*it).numHedgehogs = 4;
 			HWProto::addStringListToBuffer(buf,
 				(*it).TeamGameConfig(gamecfg->getInitHealth()));
 		}
@@ -127,7 +121,6 @@
 			break;
 		}
 		case 'C': {
-			qDebug("ASK Config");
 			switch (gameType) {
 				case gtLocal: {
 				 	SendConfig();
@@ -152,7 +145,7 @@
 		case 'K': {
 			ulong kb = msg.mid(2).toULong();
 			if (kb==1) {
-			  qWarning("%s\n", KBMessages[kb - 1].toLocal8Bit().constData());
+			  qWarning("%s", KBMessages[kb - 1].toLocal8Bit().constData());
 			  return;
 			}
 			if (kb && kb <= KBmsgsCount)
--- a/QTfrontend/netconnectedclient.cpp	Tue Feb 20 21:33:49 2007 +0000
+++ b/QTfrontend/netconnectedclient.cpp	Tue Feb 20 22:34:42 2007 +0000
@@ -23,8 +23,6 @@
 #include <QTcpSocket>
 #include <QStringList>
 
-#include <QDebug>
-
 extern char delimeter;
 
 HWConnectedClient::HWConnectedClient(HWNetServer* hwserver, QTcpSocket* client) :
@@ -70,7 +68,6 @@
     }
 
     client_nick=lst[1];
-    qDebug() << "send connected";
     RawSendNet(QString("CONNECTED"));
     if(m_hwserver->isChiefClient(this)) {
       RawSendNet(QString("CONFIGASKED"));
@@ -84,10 +81,8 @@
       }
       // send config
       QMap<QString, QStringList> conf=m_hwserver->getGameCfg();
-      qDebug() << "Config:";
       for(QMap<QString, QStringList>::iterator it=conf.begin(); it!=conf.end(); ++it) {
 	RawSendNet(QString("CONFIG_PARAM")+delimeter+it.key()+delimeter+it.value().join(QString(delimeter)));
-	qDebug() << QString("CONFIG_PARAM")+delimeter+it.key()+delimeter+it.value().join(QString(delimeter));
       }
     }
     m_hwserver->sendNicks(this);
@@ -120,7 +115,6 @@
   if(lst[0]=="CONFIG_PARAM") {
     if(!m_hwserver->isChiefClient(this) || lst.size()<3) return; // error or permission denied :)
     else m_hwserver->m_gameCfg[lst[1]]=lst.mid(2);
-    qDebug() << msg;
   }
 
   if(lst[0]=="ADDTEAM:") {
@@ -136,7 +130,6 @@
     if (maxAdd<=0) return; // reject command
     int toAdd=maxAdd<4 ? maxAdd : 4;
     m_hwserver->hhnum+=toAdd;
-    qDebug() << "added " << toAdd << " hedgehogs";
     // hedgehogs num config
     QString hhnumCfg=QString("CONFIG_PARAM%1HHNUM+%2+%3%1%4").arg(delimeter).arg(lst[0])\
       .arg(netTeamID)\
@@ -146,7 +139,6 @@
     QString colorCfg=QString("CONFIG_PARAM%1TEAM_COLOR+%2+%3%1%4").arg(delimeter).arg(lst[0])\
       .arg(netTeamID)\
       .arg(lst.takeAt(2));
-    qDebug() << "color config:" << colorCfg;
 
     m_hwserver->m_gameCfg[colorCfg.split(delimeter)[1]]=colorCfg.split(delimeter).mid(2);
     m_hwserver->m_gameCfg[hhnumCfg.split(delimeter)[1]]=hhnumCfg.split(delimeter).mid(2);
@@ -166,7 +158,6 @@
       QStringList hhTmpList=it.key().split('+');
       if(hhTmpList[0] == "HHNUM") {
 	if(hhTmpList[1]==lst[1]) {
-	  qDebug() << "removed " << it.value()[0].toUInt() << " hedgehogs";
 	  m_hwserver->hhnum-=it.value()[0].toUInt();
 	  break;
 	}
@@ -175,7 +166,6 @@
 
     unsigned int netID=removeTeam(lst[1]);
     m_hwserver->sendOthers(this, QString("REMOVETEAM:")+delimeter+lst[1]+delimeter+QString::number(netID));
-    qDebug() << QString("REMOVETEAM:")+delimeter+lst[1]+delimeter+QString::number(netID);
     return;
   }
 
--- a/QTfrontend/netserver.cpp	Tue Feb 20 21:33:49 2007 +0000
+++ b/QTfrontend/netserver.cpp	Tue Feb 20 22:34:42 2007 +0000
@@ -25,8 +25,6 @@
 
 #include <algorithm>
 
-#include <QDebug>
-
 const quint16 HWNetServer::ds_port=46631;
 
 extern char delimeter;
@@ -116,7 +114,6 @@
 void HWNetServer::sendNicks(HWConnectedClient* cl) const
 {
   for(QList<HWConnectedClient*>::const_iterator it=connclients.begin(); it!=connclients.end(); ++it) {
-      qDebug() << "sendNicks: " << (*it)->client_nick;
       cl->RawSendNet(QString("JOINED")+delimeter+(*it)->client_nick);
   }
 }
@@ -158,7 +155,6 @@
     if(!(*it)->isReady()) continue;
     msg+=(*it)->getHedgehogsDescription()+delimeter;
   }
-  qDebug() << msg;
   return msg;
 }
 
--- a/QTfrontend/netudpserver.cpp	Tue Feb 20 21:33:49 2007 +0000
+++ b/QTfrontend/netudpserver.cpp	Tue Feb 20 22:34:42 2007 +0000
@@ -2,8 +2,6 @@
 
 #include "netudpserver.h"
 
-#include <QDebug>
-
 HWNetUdpServer::HWNetUdpServer(QObject* parent) :
   QObject(parent)
 {
@@ -24,7 +22,6 @@
     pUdpSocket->readDatagram(datagram.data(), datagram.size(), &clientAddr, &clientPort);
     if(QString("%1").arg(datagram.data())==QString("hedgewars client")) {
       // send answer to client
-      qDebug() << "received UDP query from " << clientAddr << ":" << clientPort;
       pUdpSocket->writeDatagram("hedgewars server", clientAddr, clientPort);
     }
   }
--- a/QTfrontend/netudpwidget.cpp	Tue Feb 20 21:33:49 2007 +0000
+++ b/QTfrontend/netudpwidget.cpp	Tue Feb 20 22:34:42 2007 +0000
@@ -3,8 +3,6 @@
 
 #include "netudpwidget.h"
 
-#include <QDebug>
-
 HWNetUdpWidget::HWNetUdpWidget(QWidget* parent) :
   QWidget(parent), mainLayout(this)
 {
@@ -33,7 +31,6 @@
     quint16 clientPort;
     pUdpSocket->readDatagram(datagram.data(), datagram.size(), &clientAddr, &clientPort);
     if(QString("%1").arg(datagram.data())==QString("hedgewars server")) {
-      qDebug() << "detected server at " << clientAddr << ":" << clientPort;
       serversList->addItem(clientAddr.toString());
     }
   }
--- a/QTfrontend/newnetclient.cpp	Tue Feb 20 21:33:49 2007 +0000
+++ b/QTfrontend/newnetclient.cpp	Tue Feb 20 22:34:42 2007 +0000
@@ -17,7 +17,6 @@
  */
 
 #include <QMessageBox>
-#include <QDebug>
 
 #include "newnetclient.h"
 #include "proto.h"
@@ -44,7 +43,6 @@
 
 void HWNewNet::Connect(const QString & hostName, quint16 port, const QString & nick)
 {
-  qDebug() << hostName << ":" << port;
   NetSocket.connectToHost(hostName, port);
   mynick = nick;
 }
@@ -186,14 +184,12 @@
 
   if(lst[0]=="JOINED") {
     if(lst.size()<2) return;
-    qDebug() << "JOINED" << lst[1];
     emit nickAdded(lst[1]);
     return;
   }
 
   if(lst[0]=="LEFT") {
     if(lst.size()<2) return;
-    qDebug() << "LEFT" << lst[1];
     emit nickRemoved(lst[1]);
     return;
   }
@@ -212,7 +208,6 @@
   if (lst[0] == "CONFIGURED") {
     lst.pop_front();
     if(lst.size()<5) return;
-    qDebug() << lst;
     emit seedChanged(lst[0]);
     emit mapChanged(lst[1]);
     emit themeChanged(lst[2]);
@@ -223,7 +218,6 @@
   }
 
   if(lst[0]=="TEAM_ACCEPTED") {
-    qDebug() << "accepted " << lst[2].toUInt() << " team";
     m_networkToLocalteams.insert(lst[2].toUInt(), lst[1]);
     m_pTeamSelWidget->changeTeamStatus(lst[1]);
     return;
@@ -273,7 +267,6 @@
 	  emit hhnumChanged(tmptm);
 	  return;
   	}
-  	qDebug() << "unknow config param: " << lst[1];
     return;
   }
 
@@ -285,9 +278,6 @@
     emit FromNet(em);
     return;
   }
-
-  qDebug() << "unknown net command: " << msg;
-
 }
 
 
@@ -307,7 +297,6 @@
   connect(game, SIGNAL(GameStateChanged(GameState)), this, SIGNAL(GameStateChanged(GameState)));
   connect(game, SIGNAL(SendNet(const QByteArray &)), this, SLOT(SendNet(const QByteArray &)));
   connect(this, SIGNAL(FromNet(const QByteArray &)), game, SLOT(FromNet(const QByteArray &)));
-  connect(this, SIGNAL(LocalCFG(const QString &)), game, SLOT(LocalCFG(const QString &)));
   connect(game, SIGNAL(ErrorMessage(const QString &)), this, SLOT(ShowErrorMessage(const QString &)), Qt::QueuedConnection);
   game->StartNet();
 }
@@ -328,7 +317,6 @@
 
 void HWNewNet::onTeamColorChanged(const HWTeam& team)
 {
-  qDebug() << team.getNetID() << ":" << team.teamColor.name();
   RawSendNet(QString("CONFIG_PARAM%1TEAM_COLOR+%2+%3%1%4").arg(delimeter).arg(team.TeamName)\
 	     .arg(team.getNetID() ? team.getNetID() : m_networkToLocalteams.key(team.TeamName))\
 	     .arg(team.teamColor.name()));
--- a/QTfrontend/team.cpp	Tue Feb 20 21:33:49 2007 +0000
+++ b/QTfrontend/team.cpp	Tue Feb 20 22:34:42 2007 +0000
@@ -27,7 +27,6 @@
 #include "hwconsts.h"
 
 #include <QStringList>
-#include <QDebug>
 
 HWTeam::HWTeam(const QString & teamname, unsigned int netID) :
   difficulty(0),