Support 'registered only' room flag in frontend
authorunc0rr
Fri, 22 Feb 2013 23:59:52 +0400
changeset 8559 29e420194558
parent 8556 6f4c2711baa6
child 8562 d9d1cb650ff8
Support 'registered only' room flag in frontend
QTfrontend/hwform.cpp
QTfrontend/net/newnetclient.cpp
QTfrontend/net/newnetclient.h
QTfrontend/ui/page/pagenetgame.cpp
QTfrontend/ui/page/pagenetgame.h
--- a/QTfrontend/hwform.cpp	Fri Feb 22 14:42:57 2013 -0500
+++ b/QTfrontend/hwform.cpp	Fri Feb 22 23:59:52 2013 +0400
@@ -1730,6 +1730,7 @@
     ui.pageNetGame->setMasterMode(true);
     ui.pageNetGame->restrictJoins->setChecked(false);
     ui.pageNetGame->restrictTeamAdds->setChecked(false);
+    ui.pageNetGame->restrictUnregistered->setChecked(false);
     ui.pageNetGame->pGameCFG->GameSchemes->setModel(ammoSchemeModel);
     ui.pageNetGame->pGameCFG->setMaster(true);
     ui.pageNetGame->pNetTeamsWidget->setInteractivity(true);
@@ -1742,6 +1743,7 @@
         ui.pageNetGame->leRoomName->disconnect(hwnet);
         ui.pageNetGame->restrictJoins->disconnect(hwnet);
         ui.pageNetGame->restrictTeamAdds->disconnect(hwnet);
+        ui.pageNetGame->restrictUnregistered->disconnect(hwnet);
         ui.pageNetGame->disconnect(hwnet, SLOT(updateRoomName(const QString&)));
 
         ui.pageNetGame->setRoomName(hwnet->getRoom());
@@ -1750,6 +1752,7 @@
         connect(ui.pageNetGame, SIGNAL(askForUpdateRoomName(const QString &)), hwnet, SLOT(updateRoomName(const QString &)));
         connect(ui.pageNetGame->restrictJoins, SIGNAL(triggered()), hwnet, SLOT(toggleRestrictJoins()));
         connect(ui.pageNetGame->restrictTeamAdds, SIGNAL(triggered()), hwnet, SLOT(toggleRestrictTeamAdds()));
+        connect(ui.pageNetGame->restrictUnregistered, SIGNAL(triggered()), hwnet, SLOT(toggleRegisteredOnly()));
         connect(ui.pageNetGame->pGameCFG->GameSchemes->model(),
                 SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)),
                 ui.pageNetGame->pGameCFG,
--- a/QTfrontend/net/newnetclient.cpp	Fri Feb 22 14:42:57 2013 -0500
+++ b/QTfrontend/net/newnetclient.cpp	Fri Feb 22 23:59:52 2013 +0400
@@ -982,6 +982,11 @@
     RawSendNet(QString("TOGGLE_RESTRICT_TEAMS"));
 }
 
+void HWNewNet::toggleRegisteredOnly()
+{
+    RawSendNet(QString("TOGGLE_REGISTERED_ONLY"));
+}
+
 void HWNewNet::clearAccountsCache()
 {
     RawSendNet(QString("CLEAR_ACCOUNTS_CACHE"));
--- a/QTfrontend/net/newnetclient.h	Fri Feb 22 14:42:57 2013 -0500
+++ b/QTfrontend/net/newnetclient.h	Fri Feb 22 23:59:52 2013 +0400
@@ -163,6 +163,7 @@
         void startGame();
         void toggleRestrictJoins();
         void toggleRestrictTeamAdds();
+        void toggleRegisteredOnly();
         void partRoom();
         void clearAccountsCache();
         void getBanList();
--- a/QTfrontend/ui/page/pagenetgame.cpp	Fri Feb 22 14:42:57 2013 -0500
+++ b/QTfrontend/ui/page/pagenetgame.cpp	Fri Feb 22 23:59:52 2013 +0400
@@ -170,8 +170,11 @@
     restrictJoins->setCheckable(true);
     restrictTeamAdds = new QAction(QAction::tr("Restrict Team Additions"), menu);
     restrictTeamAdds->setCheckable(true);
+    restrictUnregistered = new QAction(QAction::tr("Restrict Unregistered Players Join"), menu);
+    restrictUnregistered->setCheckable(true);
     menu->addAction(restrictJoins);
     menu->addAction(restrictTeamAdds);
+    menu->addAction(restrictUnregistered);
 
     BtnMaster->setMenu(menu);
 
--- a/QTfrontend/ui/page/pagenetgame.h	Fri Feb 22 14:42:57 2013 -0500
+++ b/QTfrontend/ui/page/pagenetgame.h	Fri Feb 22 23:59:52 2013 +0400
@@ -49,6 +49,7 @@
 
         QAction * restrictJoins;
         QAction * restrictTeamAdds;
+        QAction * restrictUnregistered;
 
         HWChatWidget* chatWidget;