equal
deleted
inserted
replaced
239 tmp.removeFirst(); |
239 tmp.removeFirst(); |
240 emit chatStringFromNet(tmp); |
240 emit chatStringFromNet(tmp); |
241 return; |
241 return; |
242 } |
242 } |
243 |
243 |
244 if (lst[0] == "ADDTEAM") { |
244 if (lst[0] == "ADD_TEAM") { |
245 if(lst.size() < 22) |
245 if(lst.size() != 21) |
246 { |
246 { |
247 qWarning("Net: Too short ADDTEAM message"); |
247 qWarning("Net: Bad ADDTEAM message"); |
248 return; |
248 return; |
249 } |
249 } |
250 QStringList tmp = lst; |
250 QStringList tmp = lst; |
251 tmp.removeFirst(); |
251 tmp.removeFirst(); |
252 emit AddNetTeam(tmp); |
252 emit AddNetTeam(tmp); |
257 if(lst.size() < 3) |
257 if(lst.size() < 3) |
258 { |
258 { |
259 qWarning("Net: Bad REMOVETEAM message"); |
259 qWarning("Net: Bad REMOVETEAM message"); |
260 return; |
260 return; |
261 } |
261 } |
262 m_pTeamSelWidget->removeNetTeam(HWTeam(lst[1], lst[2].toUInt())); |
262 m_pTeamSelWidget->removeNetTeam(HWTeam(lst[1])); |
263 return; |
263 return; |
264 } |
264 } |
265 |
265 |
266 if(lst[0]=="JOINED") { |
266 if(lst[0]=="JOINED") { |
267 if(lst.size() < 2) |
267 if(lst.size() < 2) |
282 emit nickAdded(lst[i]); |
282 emit nickAdded(lst[i]); |
283 } |
283 } |
284 return; |
284 return; |
285 } |
285 } |
286 |
286 |
287 if(lst[0]=="LEFT") { |
287 if(lst[0] == "LEFT") { |
288 if(lst.size() < 2) |
288 if(lst.size() < 2) |
289 { |
289 { |
290 qWarning("Net: Bad LEFT message"); |
290 qWarning("Net: Bad LEFT message"); |
291 return; |
291 return; |
292 } |
292 } |
293 emit nickRemoved(lst[1]); |
293 emit nickRemoved(lst[1]); |
294 return; |
294 return; |
295 } |
295 } |
296 |
296 |
297 if (lst[0] == "RUNGAME") { |
297 if (lst[0] == "RUNGAME") { |
298 RunGame(); |
298 RunGame(); |
299 return; |
299 return; |
300 } |
300 } |
301 |
301 |
302 |
302 |
303 if(lst[0]=="TEAM_ACCEPTED") { |
303 if (lst[0] == "TEAM_ACCEPTED") { |
304 if(lst.size() < 3) |
304 if (lst.size() != 2) |
305 { |
305 { |
306 qWarning("Net: Bad TEAM_ACCEPTED message"); |
306 qWarning("Net: Bad TEAM_ACCEPTED message"); |
307 return; |
307 return; |
308 } |
308 } |
309 m_pTeamSelWidget->changeTeamStatus(lst[1]); |
309 m_pTeamSelWidget->changeTeamStatus(lst[1]); |
310 return; |
310 return; |
311 } |
311 } |
312 |
312 |
313 if (lst[0] == "CONFIG_PARAM") { |
313 if (lst[0] == "CONFIG_PARAM") { |
314 if(lst.size() < 3) |
314 if(lst.size() < 3) |
315 { |
315 { |
316 qWarning("Net: Bad CONFIG_PARAM message"); |
316 qWarning("Net: Bad CONFIG_PARAM message"); |
343 if (lst[1] == "AMMO") { |
343 if (lst[1] == "AMMO") { |
344 if(lst.size() < 4) return; |
344 if(lst.size() < 4) return; |
345 emit ammoChanged(lst[3], lst[2]); |
345 emit ammoChanged(lst[3], lst[2]); |
346 return; |
346 return; |
347 } |
347 } |
348 QStringList hhTmpList = lst[1].split('+'); |
348 QStringList hhTmpList = lst[1].split('+');// deprecated stuff |
349 if (hhTmpList[0] == "TEAM_COLOR") { |
349 if (hhTmpList[0] == "TEAM_COLOR") { |
350 HWTeam tmptm(hhTmpList[1]); |
350 HWTeam tmptm(hhTmpList[1]); |
351 tmptm.teamColor = QColor(lst[2]); |
351 tmptm.teamColor = QColor(lst[2]); |
352 emit teamColorChanged(tmptm); |
352 emit teamColorChanged(tmptm); |
353 return; |
353 return; |
361 qWarning() << "Net: Unknown 'CONFIG_PARAM' message:" << lst; |
361 qWarning() << "Net: Unknown 'CONFIG_PARAM' message:" << lst; |
362 return; |
362 return; |
363 } |
363 } |
364 |
364 |
365 |
365 |
366 // should be kinda game states, which don't allow "GAMEMSG:" at configure step, |
|
367 // "CONNECTED" at round phase, etc. |
|
368 if (lst[0] == "GAMEMSG") { |
366 if (lst[0] == "GAMEMSG") { |
369 if(lst.size() < 2) |
367 if(lst.size() < 2) |
370 { |
368 { |
371 qWarning("Net: Bad GAMEMSG message"); |
369 qWarning("Net: Bad GAMEMSG message"); |
372 return; |
370 return; |