recognize client-flags h and u, ROOM_CONTROL_ACCESS will be ignored from here on
authorsheepluva
Sun, 09 Sep 2012 20:58:45 +0200
changeset 7684 db140521d102
parent 7683 993337e5021f
child 7685 250e677e64de
recognize client-flags h and u, ROOM_CONTROL_ACCESS will be ignored from here on
QTfrontend/net/newnetclient.cpp
QTfrontend/net/newnetclient.h
--- a/QTfrontend/net/newnetclient.cpp	Sun Sep 09 20:11:07 2012 +0200
+++ b/QTfrontend/net/newnetclient.cpp	Sun Sep 09 20:58:45 2012 +0200
@@ -366,6 +366,7 @@
 
             switch(c)
             {
+                // flag indicating if a player is ready to start a game
                 case 'r':
                         foreach (const QString & nick, nicks)
                         {
@@ -378,6 +379,26 @@
                         }
                         break;
 
+                // flag indicating if a player is a registered user
+                case 'u':
+                        emit setRegisteredStatus(nicks, setFlag);
+                        break;
+
+                // flag indicating if a player is the host/master of the room
+                case 'h':
+                        foreach (const QString & nick, nicks)
+                        {
+                            if (nick == mynick)
+                            {
+                                isChief = setFlag;
+                                emit roomMaster(isChief);
+                            }
+
+                            emit setRoomMasterStatus(nick, setFlag);
+                        }
+                        break;
+
+                // flag indicating if a player is admin (if so -> worship them!)
                 case 'a':
                         foreach (const QString & nick, nicks)
                         {
@@ -685,6 +706,7 @@
             return;
         }
 
+        // obsolete
         if (lst[0] == "ROOM_CONTROL_ACCESS")
         {
             if (lst.size() < 2)
@@ -692,8 +714,6 @@
                 qWarning("Net: Bad ROOM_CONTROL_ACCESS message");
                 return;
             }
-            isChief = (lst[1] != "0");
-            emit roomMaster(isChief);
             return;
         }
     }
--- a/QTfrontend/net/newnetclient.h	Sun Sep 09 20:11:07 2012 +0200
+++ b/QTfrontend/net/newnetclient.h	Sun Sep 09 20:58:45 2012 +0200
@@ -139,7 +139,9 @@
 
         void setReadyStatus(const QString & nick, bool isReady);
         void setMyReadyStatus(bool isReady);
-        void setAdminStatus(const QString & nick, bool isReady);
+        void setAdminStatus(const QString & nick, bool isAdmin);
+        void setRoomMasterStatus(const QString & nick, bool isAdmin);
+        void setRegisteredStatus(const QStringList & nicks, bool isRegistered);
 
     public slots:
         void ToggleReady();