# HG changeset patch
# User unc0rr
# Date 1448098833 -10800
# Node ID c6c6a4b32ceabbfe497d6ff3f015a3729b36e271
# Parent  25e0f427f57ef619df7edd0a086d05ab8025a4ea
Handle ROOM UPD

diff -r 25e0f427f57e -r c6c6a4b32cea qmlFrontend/hwengine.cpp
--- a/qmlFrontend/hwengine.cpp	Sat Nov 21 10:04:20 2015 +0300
+++ b/qmlFrontend/hwengine.cpp	Sat Nov 21 12:40:33 2015 +0300
@@ -205,6 +205,8 @@
         break;
     }
     case MSG_UPDATEROOM: {
+        QStringList l = QString::fromUtf8(msg).split('\n');
+        emit roomUpdated(l[0], 0, l[2], l[3].toInt(), l[4].toInt(), l[5], l[6], l[7], l[8], l[9]);
         break;
     }
     case MSG_REMOVEROOM: {
diff -r 25e0f427f57e -r c6c6a4b32cea qmlFrontend/hwengine.h
--- a/qmlFrontend/hwengine.h	Sat Nov 21 10:04:20 2015 +0300
+++ b/qmlFrontend/hwengine.h	Sat Nov 21 12:40:33 2015 +0300
@@ -64,6 +64,16 @@
                    , const QString & script
                    , const QString & scheme
                    , const QString & weapons);
+    void roomUpdated(const QString & name
+                   , quint32 flags
+                   , const QString & newName
+                   , int players
+                   , int teams
+                   , const QString & host
+                   , const QString & map
+                   , const QString & script
+                   , const QString & scheme
+                   , const QString & weapons);
     void roomRemoved(const QString & name);
 
 public slots:
diff -r 25e0f427f57e -r c6c6a4b32cea qmlFrontend/qml/qmlFrontend/LobbyPage.qml
--- a/qmlFrontend/qml/qmlFrontend/LobbyPage.qml	Sat Nov 21 10:04:20 2015 +0300
+++ b/qmlFrontend/qml/qmlFrontend/LobbyPage.qml	Sat Nov 21 12:40:33 2015 +0300
@@ -65,6 +65,23 @@
                                , "scheme": scheme
                                , "weapons": weapons
                            })
+            onRoomUpdated: {
+                var i = roomsListModel.count - 1;
+                while ((i >= 0) && (roomsListModel.get(i).name !== name)) --i
+
+                if(i >= 0) {
+                    roomsListModel.set(i, {
+                                           "name" : newName
+                                           , "players": players
+                                           , "teams": teams
+                                           , "host": host
+                                           , "map": map
+                                           , "script": script
+                                           , "scheme": scheme
+                                           , "weapons": weapons
+                                       })
+                }
+            }
             onRoomRemoved: {
                 var i = roomsListModel.count - 1;
                 while ((i >= 0) && (roomsListModel.get(i).name !== name)) --i
@@ -77,7 +94,7 @@
     Chat {
         id: lobbyChat;
         x: 0;
-        y: 100;
+        y: 300;
         width: parent.width;
         height: parent.height - y;
     }