Add a few debug message which show the problem with total hedgehogs number counting
authorunc0rr
Sun, 13 Jul 2008 11:39:02 +0000
changeset 1078 8f891269392f
parent 1077 c527b316a295
child 1079 2a4a8a5ca392
Add a few debug message which show the problem with total hedgehogs number counting
QTfrontend/frameTeam.cpp
QTfrontend/netconnectedclient.cpp
--- a/QTfrontend/frameTeam.cpp	Sun Jul 13 11:37:48 2008 +0000
+++ b/QTfrontend/frameTeam.cpp	Sun Jul 13 11:39:02 2008 +0000
@@ -16,13 +16,14 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  */
 
+#include <QResizeEvent>
+#include <QCoreApplication>
+#include <QDebug>
+
 #include "frameTeam.h"
 #include "teamselhelper.h"
 #include "hwconsts.h"
 
-#include <QResizeEvent>
-#include <QCoreApplication>
-
 FrameTeams::FrameTeams(QWidget* parent) :
   QWidget(parent), maxHedgehogsPerGame(18), overallHedgehogs(0), mainLayout(this), nonInteractive(false)
 {
@@ -106,6 +107,7 @@
 
 QWidget* FrameTeams::getTeamWidget(HWTeam team)
 {
+//qDebug() << "FrameTeams::getTeamWidget getNetID() = " << team.getNetID();
   tmapTeamToWidget::iterator it=teamToWidget.find(team);
   QWidget* ret = it!=teamToWidget.end() ? it.value() : 0;
   return ret;
--- a/QTfrontend/netconnectedclient.cpp	Sun Jul 13 11:37:48 2008 +0000
+++ b/QTfrontend/netconnectedclient.cpp	Sun Jul 13 11:39:02 2008 +0000
@@ -129,6 +129,7 @@
     int oldTeamHHNum = it==m_hwserver->m_gameCfg.end() ? 0 : it.value()[0].toUInt();
     int newTeamHHNum = lst[3].toUInt();
     m_hwserver->hhnum+=newTeamHHNum-oldTeamHHNum;
+qDebug() << "HHNUM hhnum = " << m_hwserver->hhnum;
     // create CONFIG_PARAM to save HHNUM at server from lst
     lst=QStringList("CONFIG_PARAM") << confstr << lst[3];
     m_hwserver->sendOthers(this, lst.join(QString(delimeter)));
@@ -170,6 +171,7 @@
     }
     int toAdd=maxAdd<4 ? maxAdd : 4;
     m_hwserver->hhnum+=toAdd;
+qDebug() << "to add = " << toAdd << "m_hwserver->hhnum = " << m_hwserver->hhnum;
     // hedgehogs num config
     QString hhnumCfg=QString("CONFIG_PARAM%1HHNUM+%2+%3%1%4").arg(delimeter).arg(lst[0])\
       .arg(netTeamID)\
@@ -195,7 +197,7 @@
     if(lst.size() < 2)
     {
       qWarning("Net server: Bad 'REMOVETEAM' message");
-	  return;
+      return;
     }
 
     for(QMap<QString, QStringList>::iterator it=m_hwserver->m_gameCfg.begin(); it!=m_hwserver->m_gameCfg.end(); ++it)
@@ -206,6 +208,7 @@
         if(hhTmpList[1]==lst[1])
         {
 		  m_hwserver->hhnum-=it.value()[0].toUInt();
+qDebug() << "REMOVETEAM hhnum = " << m_hwserver->hhnum;
 		  break;
         }
       }