equal
deleted
inserted
replaced
210 { |
210 { |
211 qWarning("Net server: Bad 'REMOVETEAM' message"); |
211 qWarning("Net server: Bad 'REMOVETEAM' message"); |
212 return; |
212 return; |
213 } |
213 } |
214 |
214 |
215 for(QMap<QString, QStringList>::iterator it=m_hwserver->m_gameCfg.begin(); it!=m_hwserver->m_gameCfg.end(); ++it) |
215 for(QMap<QString, QStringList>::iterator it=m_hwserver->m_gameCfg.begin(); it!=m_hwserver->m_gameCfg.end(); ++it) |
216 { |
216 { |
217 QStringList hhTmpList=it.key().split('+'); |
217 QStringList hhTmpList=it.key().split('+'); |
218 if(hhTmpList[0] == "HHNUM") |
218 if(hhTmpList[0] == "HHNUM") |
219 { |
219 { |
220 if(hhTmpList[1]==lst[1]) |
220 if(hhTmpList[1]==lst[1]) |
221 { |
221 { |
222 m_hwserver->hhnum-=it.value()[0].toUInt(); |
222 m_hwserver->hhnum-=it.value()[0].toUInt(); |
223 m_hwserver->m_gameCfg.remove(it.key()); |
223 m_hwserver->m_gameCfg.remove(it.key()); |
224 qDebug() << "REMOVETEAM hhnum = " << m_hwserver->hhnum; |
224 |
225 break; |
225 for(QList<QStringList>::iterator it=m_teamsCfg.begin(); it!=m_teamsCfg.end(); ++it) |
226 } |
226 if((*it)[0] == lst[1]) |
227 } |
227 m_teamsCfg.erase(it); |
228 } |
228 |
|
229 qDebug() << "REMOVETEAM hhnum = " << m_hwserver->hhnum; |
|
230 break; |
|
231 } |
|
232 } |
|
233 } |
229 |
234 |
230 unsigned int netID=removeTeam(lst[1]); |
235 unsigned int netID=removeTeam(lst[1]); |
231 m_hwserver->sendOthers(this, QString("REMOVETEAM:")+delimeter+lst[1]+delimeter+QString::number(netID)); |
236 m_hwserver->sendOthers(this, QString("REMOVETEAM:")+delimeter+lst[1]+delimeter+QString::number(netID)); |
232 return; |
237 return; |
233 } |
238 } |
235 m_hwserver->sendOthers(this, lst.join(QString(delimeter))); |
240 m_hwserver->sendOthers(this, lst.join(QString(delimeter))); |
236 } |
241 } |
237 |
242 |
238 unsigned int HWConnectedClient::netIDbyTeamName(const QString& tname) |
243 unsigned int HWConnectedClient::netIDbyTeamName(const QString& tname) |
239 { |
244 { |
240 qDebug() << "Check exist" << tname; |
|
241 |
|
242 for(QList<QStringList>::iterator it=m_teamsCfg.begin(); it!=m_teamsCfg.end(); ++it) |
245 for(QList<QStringList>::iterator it=m_teamsCfg.begin(); it!=m_teamsCfg.end(); ++it) |
243 if((*it)[0]==tname) |
246 if((*it)[0]==tname) |
244 return (*it)[1].toUInt(); |
247 return (*it)[1].toUInt(); |
245 |
248 |
246 return 0; |
249 return 0; |