QTfrontend/netserver.cpp
changeset 347 6521e1b2cd40
parent 339 7535ab6c3820
child 349 5b37d6a39829
--- a/QTfrontend/netserver.cpp	Tue Jan 16 22:13:58 2007 +0000
+++ b/QTfrontend/netserver.cpp	Wed Jan 17 19:56:51 2007 +0000
@@ -33,7 +33,7 @@
 void HWNetServer::StartServer()
 {
   IPCServer = new QTcpServer(this);
-  if (!IPCServer->listen(QHostAddress::LocalHost, ds_port)) {
+  if (!IPCServer->listen(QHostAddress::Any, ds_port)) {
     QMessageBox::critical(0, tr("Error"),
 			  tr("Unable to start the server: %1.")
 			  .arg(IPCServer->errorString()));
@@ -242,9 +242,24 @@
     return;
   }
 
+  if(lst[0]=="REMOVETEAM:") {
+    if(lst.size()<2) return;
+    removeTeam(lst[1]);
+  }
+
   m_hwserver->sendOthers(this, msg);
 }
 
+void HWConnectedClient::removeTeam(const QString& tname)
+{
+  for(QList<QStringList>::iterator it=m_teamsCfg.begin(); it!=m_teamsCfg.end(); ++it) {
+    if((*it)[0]==tname) {
+      m_teamsCfg.erase(it);
+      break;
+    }
+  }
+}
+
 QList<QStringList> HWConnectedClient::getTeamNames() const
 {
   return m_teamsCfg;