equal
deleted
inserted
replaced
59 |
59 |
60 void HWNewNet::CreateRoom(const QString & room) |
60 void HWNewNet::CreateRoom(const QString & room) |
61 { |
61 { |
62 if(netClientState != 2) |
62 if(netClientState != 2) |
63 { |
63 { |
64 qDebug("Illegal try to create room!"); |
64 qWarning("Illegal try to create room!"); |
65 return; |
65 return; |
66 } |
66 } |
67 |
67 |
68 RawSendNet(QString("CREATE%1%2").arg(delimeter).arg(room)); |
68 RawSendNet(QString("CREATE%1%2").arg(delimeter).arg(room)); |
69 isChief = true; |
69 isChief = true; |
71 |
71 |
72 void HWNewNet::JoinRoom(const QString & room) |
72 void HWNewNet::JoinRoom(const QString & room) |
73 { |
73 { |
74 if(netClientState != 2) |
74 if(netClientState != 2) |
75 { |
75 { |
76 qDebug("Illegal try to join room!"); |
76 qWarning("Illegal try to join room!"); |
77 return; |
77 return; |
78 } |
78 } |
79 |
79 |
80 loginStep++; |
80 loginStep++; |
81 |
81 |
240 tmp.removeFirst(); |
240 tmp.removeFirst(); |
241 emit chatStringFromNet(tmp); |
241 emit chatStringFromNet(tmp); |
242 return; |
242 return; |
243 } |
243 } |
244 |
244 |
245 if (lst[0] == "ADDTEAM:") { |
245 if (lst[0] == "ADDTEAM") { |
246 if(lst.size() < 22) |
246 if(lst.size() < 22) |
247 { |
247 { |
248 qWarning("Net: Too short ADDTEAM message"); |
248 qWarning("Net: Too short ADDTEAM message"); |
249 return; |
249 return; |
250 } |
250 } |
251 QStringList tmp = lst; |
251 QStringList tmp = lst; |
252 tmp.removeFirst(); |
252 tmp.removeFirst(); |
253 emit AddNetTeam(tmp); |
253 emit AddNetTeam(tmp); |
254 return; |
254 return; |
255 } |
255 } |
256 |
256 |
257 if (lst[0] == "REMOVETEAM:") { |
257 if (lst[0] == "REMOVETEAM") { |
258 if(lst.size() < 3) |
258 if(lst.size() < 3) |
259 { |
259 { |
260 qWarning("Net: Bad REMOVETEAM message"); |
260 qWarning("Net: Bad REMOVETEAM message"); |
261 return; |
261 return; |
262 } |
262 } |
408 emit AskForRunGame(); |
408 emit AskForRunGame(); |
409 } |
409 } |
410 |
410 |
411 void HWNewNet::onHedgehogsNumChanged(const HWTeam& team) |
411 void HWNewNet::onHedgehogsNumChanged(const HWTeam& team) |
412 { |
412 { |
413 RawSendNet(QString("HHNUM%1%2%1%3%1%4").arg(delimeter).arg(team.TeamName)\ |
413 RawSendNet(QString("HHNUM%1%2%1%3%1%4").arg(delimeter).arg(team.TeamName) |
414 .arg(team.getNetID() ? team.getNetID() : m_networkToLocalteams.key(team.TeamName))\ |
414 .arg(team.getNetID() ? team.getNetID() : m_networkToLocalteams.key(team.TeamName)) |
415 .arg(team.numHedgehogs)); |
415 .arg(team.numHedgehogs)); |
416 } |
416 } |
417 |
417 |
418 void HWNewNet::onTeamColorChanged(const HWTeam& team) |
418 void HWNewNet::onTeamColorChanged(const HWTeam& team) |
419 { |
419 { |
420 RawSendNet(QString("CONFIG_PARAM%1TEAM_COLOR+%2+%3%1%4").arg(delimeter).arg(team.TeamName)\ |
420 RawSendNet(QString("CONFIG_PARAM%1TEAM_COLOR+%2+%3%1%4").arg(delimeter).arg(team.TeamName) |
421 .arg(team.getNetID() ? team.getNetID() : m_networkToLocalteams.key(team.TeamName))\ |
421 .arg(team.getNetID() ? team.getNetID() : m_networkToLocalteams.key(team.TeamName)) |
422 .arg(team.teamColor.name())); |
422 .arg(team.teamColor.name())); |
423 } |
423 } |
424 |
424 |
425 void HWNewNet::onSeedChanged(const QString & seed) |
425 void HWNewNet::onSeedChanged(const QString & seed) |
426 { |
426 { |
427 if (isChief) RawSendNet(QString("CONFIG_PARAM%1SEED%1%2").arg(delimeter).arg(seed)); |
427 if (isChief) RawSendNet(QString("CONFIG_PARAM%1SEED%1%2").arg(delimeter).arg(seed)); |
467 |
467 |
468 void HWNewNet::askRoomsList() |
468 void HWNewNet::askRoomsList() |
469 { |
469 { |
470 if(netClientState != 2) |
470 if(netClientState != 2) |
471 { |
471 { |
472 qDebug("Illegal try to get rooms list!"); |
472 qWarning("Illegal try to get rooms list!"); |
473 return; |
473 return; |
474 } |
474 } |
475 RawSendNet(QString("LIST")); |
475 RawSendNet(QString("LIST")); |
476 } |
476 } |