isChiefClient is now correct :)
authordisplacer
Sun, 14 Jan 2007 18:45:13 +0000
changeset 332 10080f681118
parent 331 6bfc326e4976
child 333 770743a946b1
isChiefClient is now correct :)
QTfrontend/netserver.cpp
QTfrontend/newnetclient.cpp
--- a/QTfrontend/netserver.cpp	Sun Jan 14 18:32:44 2007 +0000
+++ b/QTfrontend/netserver.cpp	Sun Jan 14 18:45:13 2007 +0000
@@ -76,9 +76,11 @@
 bool HWNetServer::isChiefClient(HWConnectedClient* cl) const
 {
   for(QList<HWConnectedClient*>::const_iterator it=connclients.begin(); it!=connclients.end(); ++it) {
-    if((*it)->getClientNick()!="" && *it==cl)  return true;
+    // watch for first fully connected client (with confirmed nick) and test it for chief
+    if((*it)->getClientNick()=="") continue;
+    if(*it==cl) return true;
+    else return false;
   }
-  return false;
 }
 
 bool HWNetServer::haveNick(const QString& nick) const
--- a/QTfrontend/newnetclient.cpp	Sun Jan 14 18:32:44 2007 +0000
+++ b/QTfrontend/newnetclient.cpp	Sun Jan 14 18:45:13 2007 +0000
@@ -168,27 +168,27 @@
 
   if (lst[0] == "CONFIG_PARAM") {
   	if (lst[1] == "SEED") {
-      emit seedChanged(lst[2]);
+	  emit seedChanged(lst[2]);
 	  return;
   	}
   	if (lst[1] == "MAP") {
-      emit mapChanged(lst[2]);
+	  emit mapChanged(lst[2]);
 	  return;
   	}
   	if (lst[1] == "THEME") {
-      emit themeChanged(lst[2]);
+	  emit themeChanged(lst[2]);
 	  return;
   	}
   	if (lst[1] == "HEALTH") {
-      emit initHealthChanged(lst[2].toUInt());
+	  emit initHealthChanged(lst[2].toUInt());
 	  return;
   	}
   	if (lst[1] == "TURNTIME") {
-      emit turnTimeChanged(lst[2].toUInt());
+	  emit turnTimeChanged(lst[2].toUInt());
 	  return;
   	}
   	if (lst[1] == "FORTSMODE") {
-      emit fortsModeChanged(lst[2].toInt() != 0);
+	  emit fortsModeChanged(lst[2].toInt() != 0);
 	  return;
   	}
   	qDebug() << "unknow config param: " << lst[1];