QTfrontend/netserver.cpp
changeset 383 09a8795105a4
parent 382 e7220e48ead1
child 388 dcf5335940bd
--- a/QTfrontend/netserver.cpp	Sat Feb 03 21:40:50 2007 +0000
+++ b/QTfrontend/netserver.cpp	Sun Feb 04 14:35:28 2007 +0000
@@ -44,6 +44,10 @@
 
 void HWNetServer::StopServer()
 {
+  QList<HWConnectedClient*>::iterator it;
+  for(it=connclients.begin(); it!=connclients.end(); ++it) {
+    ClientDisconnect(*it);
+  }
   IPCServer->close();
 }
 
@@ -59,8 +63,9 @@
 void HWNetServer::ClientDisconnect(HWConnectedClient* client)
 {
   QList<HWConnectedClient*>::iterator it=std::find(connclients.begin(), connclients.end(), client);
+  if(it==connclients.end()) return;
   for(QList<QStringList>::iterator tmIt=(*it)->m_teamsCfg.begin(); tmIt!=(*it)->m_teamsCfg.end(); ++tmIt) {
-    sendOthers(*it, QString("REMOVETEAM:")+delimeter+*(tmIt->begin()));
+    sendOthers(*it, QString("REMOVETEAM:")+delimeter+*(tmIt->begin()) + delimeter + *(tmIt->begin()+1));
   }
   connclients.erase(it);
   //teamChanged();