Send appropriate messages to server on control menu actions
authorunc0rr
Fri, 24 Oct 2008 17:34:20 +0000
changeset 1410 eece43296890
parent 1409 d1cbe4a57ebf
child 1411 df78c9571bc7
Send appropriate messages to server on control menu actions
QTfrontend/hwform.cpp
QTfrontend/newnetclient.cpp
QTfrontend/newnetclient.h
--- a/QTfrontend/hwform.cpp	Fri Oct 24 17:30:30 2008 +0000
+++ b/QTfrontend/hwform.cpp	Fri Oct 24 17:34:20 2008 +0000
@@ -737,6 +737,13 @@
 	ui.pageNetGame->BtnMaster->setVisible(true);
 	ui.pageNetGame->restrictJoins->setChecked(false);
 	ui.pageNetGame->restrictTeamAdds->setChecked(false);
+	
+	if (hwnet)
+	{
+		connect(ui.pageNetGame->startGame, SIGNAL(triggered(bool)), hwnet, SLOT(startGame()));
+		connect(ui.pageNetGame->restrictJoins, SIGNAL(triggered(bool)), hwnet, SLOT(toggleRestrictJoins()));
+		connect(ui.pageNetGame->restrictTeamAdds, SIGNAL(triggered(bool)), hwnet, SLOT(toggleRestrictTeamAdds()));
+	}
 }
 
 void HWForm::NetGameSlave()
--- a/QTfrontend/newnetclient.cpp	Fri Oct 24 17:30:30 2008 +0000
+++ b/QTfrontend/newnetclient.cpp	Fri Oct 24 17:34:20 2008 +0000
@@ -548,3 +548,18 @@
 {
 	RawSendNet(QString("KICK%1%2").arg(delimeter).arg(nick));
 }
+
+void HWNewNet::startGame()
+{
+	RawSendNet(QString("START_GAME"));
+}
+
+void HWNewNet::toggleRestrictJoins()
+{
+	RawSendNet(QString("TOGGLE_RESTRICT_JOINS"));
+}
+
+void HWNewNet::toggleRestrictTeamAdds()
+{
+	RawSendNet(QString("TOGGLE_RESTRICT_TEAMS"));
+}
--- a/QTfrontend/newnetclient.h	Fri Oct 24 17:30:30 2008 +0000
+++ b/QTfrontend/newnetclient.h	Fri Oct 24 17:34:20 2008 +0000
@@ -133,6 +133,9 @@
   void askRoomsList();
   void gameFinished();
   void kickPlayer(const QString &);
+  void startGame();
+  void toggleRestrictJoins();
+  void toggleRestrictTeamAdds();
 
  private slots:
   void ClientRead();