equal
deleted
inserted
replaced
86 qWarning("Illegal try to create room!"); |
86 qWarning("Illegal try to create room!"); |
87 return; |
87 return; |
88 } |
88 } |
89 |
89 |
90 RawSendNet(QString("CREATE_ROOM%1%2").arg(delimeter).arg(room)); |
90 RawSendNet(QString("CREATE_ROOM%1%2").arg(delimeter).arg(room)); |
91 m_pGameCFGWidget->setEnabled(true); |
|
92 m_pTeamSelWidget->setInteractivity(true); |
|
93 isChief = true; |
91 isChief = true; |
94 } |
92 } |
95 |
93 |
96 void HWNewNet::JoinRoom(const QString & room) |
94 void HWNewNet::JoinRoom(const QString & room) |
97 { |
95 { |
99 { |
97 { |
100 qWarning("Illegal try to join room!"); |
98 qWarning("Illegal try to join room!"); |
101 return; |
99 return; |
102 } |
100 } |
103 |
101 |
104 loginStep++; |
|
105 |
|
106 RawSendNet(QString("JOIN_ROOM%1%2").arg(delimeter).arg(room)); |
102 RawSendNet(QString("JOIN_ROOM%1%2").arg(delimeter).arg(room)); |
107 m_pGameCFGWidget->setEnabled(false); |
|
108 m_pTeamSelWidget->setInteractivity(false); |
|
109 isChief = false; |
103 isChief = false; |
110 } |
104 } |
111 |
105 |
112 void HWNewNet::AddTeam(const HWTeam & team) |
106 void HWNewNet::AddTeam(const HWTeam & team) |
113 { |
107 { |
446 return; |
440 return; |
447 } |
441 } |
448 |
442 |
449 if (lst[0] == "RUN_GAME") { |
443 if (lst[0] == "RUN_GAME") { |
450 netClientState = 5; |
444 netClientState = 5; |
451 RunGame(); |
445 emit AskForRunGame(); |
452 return; |
446 return; |
453 } |
447 } |
454 |
448 |
455 if (lst[0] == "ASKPASSWORD") { |
449 if (lst[0] == "ASKPASSWORD") { |
456 int passLength = config->value("net/passwordlength", 0).toInt(); |
450 int passLength = config->value("net/passwordlength", 0).toInt(); |
556 } |
550 } |
557 bool b = lst[1] != "0"; |
551 bool b = lst[1] != "0"; |
558 m_pGameCFGWidget->setEnabled(b); |
552 m_pGameCFGWidget->setEnabled(b); |
559 m_pTeamSelWidget->setInteractivity(b); |
553 m_pTeamSelWidget->setInteractivity(b); |
560 isChief = b; |
554 isChief = b; |
|
555 emit roomMaster(isChief); |
561 |
556 |
562 return; |
557 return; |
563 } |
558 } |
564 |
559 |
565 qWarning() << "Net: Unknown message:" << lst; |
560 qWarning() << "Net: Unknown message:" << lst; |
566 } |
|
567 |
|
568 void HWNewNet::RunGame() |
|
569 { |
|
570 emit AskForRunGame(); |
|
571 } |
561 } |
572 |
562 |
573 void HWNewNet::onHedgehogsNumChanged(const HWTeam& team) |
563 void HWNewNet::onHedgehogsNumChanged(const HWTeam& team) |
574 { |
564 { |
575 if (isChief) |
565 if (isChief) |