public void Handle(GameClient session, ClientMessage message)
        {
            Room room = session.GetHabbo().GetRoomSession().GetRoom();

            if (room != null)
            {
                FlatCat flatCat = Skylight.GetGame().GetNavigatorManager().GetFlatCat(room.RoomData.Category);
                if (flatCat != null && flatCat.CanTrade)
                {
                    int          virtualId = message.PopWiredInt32();
                    RoomUnitUser user      = room.RoomUserManager.GetUserByVirtualID(virtualId);
                    if (user != null && user.Session.GetHabbo().GetUserSettings().AcceptTrading)
                    {
                        room.StartTrade(session.GetHabbo().GetRoomSession().GetRoomUser(), user);
                    }
                }
                else
                {
                    session.SendNotif("Trading is disabled in this room!");
                }
            }
        }
Beispiel #2
0
        public void Handle(GameClient Session, ClientMessage Event)
        {
            Room @class = GoldTree.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (@class != null && @class.CheckRights(Session, true))
            {
                Event.PopWiredInt32();
                string text  = GoldTree.FilterString(Event.PopFixedString());
                string text2 = GoldTree.FilterString(Event.PopFixedString());
                if (text2.Length > 255)
                {
                    text2 = text2.Substring(0, 255);
                }
                int           num           = Event.PopWiredInt32();
                string        text3         = GoldTree.FilterString(Event.PopFixedString());
                int           num2          = Event.PopWiredInt32();
                int           num3          = Event.PopWiredInt32();
                int           num4          = Event.PopWiredInt32();
                List <string> list          = new List <string>();
                StringBuilder stringBuilder = new StringBuilder();
                for (int i = 0; i < num4; i++)
                {
                    if (i > 0)
                    {
                        stringBuilder.Append(",");
                    }
                    string text4 = GoldTree.FilterString(Event.PopFixedString().ToLower());
                    if (text4 == ChatCommandHandler.smethod_4(text4))
                    {
                        list.Add(text4);
                        stringBuilder.Append(text4);
                    }
                }
                if (stringBuilder.Length > 100)
                {
                    stringBuilder.Clear();
                    stringBuilder.Append("");
                }
                int    num5 = 0;
                int    num6 = 0;
                int    num7 = 0;
                int    num8 = 0;
                string a    = Event.PlainReadBytes(1)[0].ToString();
                Event.AdvancePointer(1);
                string a2 = Event.PlainReadBytes(1)[0].ToString();
                Event.AdvancePointer(1);
                string a3 = Event.PlainReadBytes(1)[0].ToString();
                Event.AdvancePointer(1);
                string a4 = Event.PlainReadBytes(1)[0].ToString();
                Event.AdvancePointer(1);
                int num9  = Event.PopWiredInt32();
                int num10 = Event.PopWiredInt32();
                if (!(text != ChatCommandHandler.smethod_4(text)) && !(text2 != ChatCommandHandler.smethod_4(text2)) && text.Length >= 1 && (num9 >= -2 && num9 <= 1 && num10 >= -2 && num10 <= 1))
                {
                    @class.Wallthick  = num9;
                    @class.Floorthick = num10;
                    if (num >= 0 && num <= 2 && (num2 == 10 || num2 == 15 || num2 == 20 || num2 == 25 || num2 == 30 || num2 == 35 || num2 == 40 || num2 == 45 || num2 == 50 || num2 == 55 || num2 == 60 || num2 == 65 || num2 == 70 || num2 == 75 || num2 == 80 || num2 == 85 || num2 == 90 || num2 == 95 || num2 == 100))
                    {
                        FlatCat class2 = GoldTree.GetGame().GetNavigator().method_2(num3);
                        if (class2 != null)
                        {
                            if ((long)class2.MinRank > (long)((ulong)Session.GetHabbo().Rank))
                            {
                                Session.SendNotification("You are not allowed to use this category. Your room has been moved to no category instead.");
                                num3 = 0;
                            }
                            if (num4 <= 2)
                            {
                                if (a == "65")
                                {
                                    num5            = 1;
                                    @class.AllowPet = true;
                                }
                                else
                                {
                                    @class.AllowPet = false;
                                }
                                if (a2 == "65")
                                {
                                    num6 = 1;
                                    @class.AllowPetsEating = true;
                                }
                                else
                                {
                                    @class.AllowPetsEating = false;
                                }
                                if (a3 == "65")
                                {
                                    num7 = 1;
                                    @class.AllowWalkthrough = true;
                                }
                                else
                                {
                                    @class.AllowWalkthrough = false;
                                }
                                @class.method_22();
                                if (a4 == "65")
                                {
                                    num8            = 1;
                                    @class.Hidewall = true;
                                }
                                else
                                {
                                    @class.Hidewall = false;
                                }
                                @class.Name        = text;
                                @class.State       = num;
                                @class.Description = text2;
                                @class.Category    = num3;
                                if (text3 != "")
                                {
                                    @class.Password = text3;
                                }
                                @class.Tags     = list;
                                @class.UsersMax = num2;
                                string text5 = "open";
                                if (@class.State == 1)
                                {
                                    text5 = "locked";
                                }
                                else
                                {
                                    if (@class.State > 1)
                                    {
                                        text5 = "password";
                                    }
                                }
                                using (DatabaseClient class3 = GoldTree.GetDatabase().GetClient())
                                {
                                    class3.AddParamWithValue("caption", @class.Name);
                                    class3.AddParamWithValue("description", @class.Description);
                                    class3.AddParamWithValue("password", @class.Password);
                                    class3.AddParamWithValue("tags", stringBuilder.ToString());
                                    class3.ExecuteQuery(string.Concat(new object[]
                                    {
                                        "UPDATE rooms SET caption = @caption, description = @description, password = @password, category = '",
                                        num3,
                                        "', state = '",
                                        text5,
                                        "', tags = @tags, users_max = '",
                                        num2,
                                        "', allow_pets = '",
                                        num5,
                                        "', allow_pets_eat = '",
                                        num6,
                                        "', allow_walkthrough = '",
                                        num7,
                                        "', allow_hidewall = '",
                                        num8,
                                        "', wallthick = '",
                                        num9,
                                        "', floorthick = '",
                                        num10,
                                        "'  WHERE Id = '",
                                        @class.Id,
                                        "' LIMIT 1;"
                                    }));
                                }
                                ServerMessage Message = new ServerMessage(467u);
                                Message.AppendUInt(@class.Id);
                                Session.SendMessage(Message);
                                ServerMessage Message2 = new ServerMessage(456u);
                                Message2.AppendUInt(@class.Id);
                                Session.SendMessage(Message2);
                                ServerMessage Message3 = new ServerMessage(472u);
                                Message3.AppendBoolean(@class.Hidewall);
                                Message3.AppendInt32(@class.Wallthick);
                                Message3.AppendInt32(@class.Floorthick);
                                @class.SendMessage(Message3, null);
                                ServerMessage Message4 = new ServerMessage(473u);
                                Message4.AppendBoolean(true);
                                Message4.AppendBoolean(true);
                                @class.SendMessage(Message4, null);
                                RoomData      class27_ = @class.RoomData;
                                ServerMessage Message5 = new ServerMessage(454u);
                                Message5.AppendBoolean(false);
                                class27_.method_3(Message5, false, false);
                                Session.SendMessage(Message5);
                            }
                        }
                    }
                }
            }
        }
Beispiel #3
0
        public void Handle(GameClient session, ClientMessage message)
        {
            string view  = message.PopFixedString();
            string query = message.PopFixedString();

            ServerMessage message_ = BasicUtilies.GetRevisionServerMessage(Revision.PRODUCTION_201601012205_226667486);

            message_.Init(r63cOutgoing.NewNavigatorSearchResults);
            message_.AppendString(view);
            message_.AppendString(query);
            if (view == "official_view")
            {
                IEnumerable <PublicItem> items       = Skylight.GetGame().GetNavigatorManager().GetPublicRoomItems().Where(i => i.Type != PublicItemType.CATEGORY && this.doFilter(query, i));
                IEnumerable <PublicItem> categorys   = Skylight.GetGame().GetNavigatorManager().GetPublicRoomItems().Where(i => i.Type == PublicItemType.CATEGORY && items.Any(p => p.ParentCategoryID == i.ID));
                IEnumerable <PublicItem> publicRooms = items.Where(i => i.ParentCategoryID == 0);

                if (publicRooms.Count() > 0)
                {
                    message_.AppendInt32(categorys.Count() + 1); //count
                    message_.AppendString("official-root");
                    message_.AppendString("");                   //text
                    message_.AppendInt32(0);                     //action allowed
                    message_.AppendBoolean(false);               //closed
                    message_.AppendInt32(0);                     //display mode

                    message_.AppendInt32(publicRooms.Count());
                    foreach (PublicItem item in publicRooms)
                    {
                        item.RoomData.Serialize(message_, false);
                    }
                }
                else
                {
                    message_.AppendInt32(categorys.Count());
                }

                foreach (PublicItem item in categorys)
                {
                    message_.AppendString("");
                    message_.AppendString(item.Caption);
                    message_.AppendInt32(0);
                    message_.AppendBoolean(string.IsNullOrEmpty(query));
                    message_.AppendInt32(0);

                    IEnumerable <PublicItem> rooms = items.Where(i => i.ParentCategoryID == item.ID);
                    message_.AppendInt32(rooms.Count()); //count
                    foreach (PublicItem room in rooms)
                    {
                        room.RoomData.Serialize(message_, false);
                    }
                }
            }
            else if (view == "hotel_view")
            {
                IEnumerable <Room> rooms        = Skylight.GetGame().GetRoomManager().LoadedRooms.Values.Where(i => this.doFilter(query, i.RoomData));
                IEnumerable <Room> popularRooms = rooms.OrderByDescending(r => r.RoomData.UsersNow).Take(50);

                HashSet <int> categorys = new HashSet <int>();
                foreach (int c in rooms.Select(r => r.RoomData.Category))
                {
                    categorys.Add(c);
                }

                if (!string.IsNullOrEmpty(query))
                {
                    DataTable results = null;
                    using (DatabaseClient dbClient = Skylight.GetDatabaseManager().GetClient())
                    {
                        dbClient.AddParamWithValue("query", "%" + query.Replace("%", "\\%") + "%");
                        results = dbClient.ReadDataTable("SELECT r.* FROM rooms r LEFT JOIN users u ON r.ownerid = u.id WHERE r.type = 'private' AND (r.name LIKE @query OR u.username LIKE @query) ORDER BY r.users_now LIMIT 50");
                    }

                    if (results != null && results.Rows.Count > 0)
                    {
                        message_.AppendInt32(categorys.Count + (popularRooms.Count() > 0 ? 2 : 1));
                        message_.AppendString("");
                        message_.AppendString("Text Search"); //text
                        message_.AppendInt32(0);              //action allowed
                        message_.AppendBoolean(false);        //closed
                        message_.AppendInt32(0);              //display mode

                        message_.AppendInt32(results.Rows.Count);
                        foreach (DataRow dataRow in results.Rows)
                        {
                            Skylight.GetGame().GetRoomManager().TryGetAndLoadRoomData((uint)dataRow["id"], dataRow).Serialize(message_, false);
                        }
                    }
                    else
                    {
                        message_.AppendInt32(categorys.Count + (popularRooms.Count() > 0 ? 1 : 0));
                    }
                }
                else
                {
                    message_.AppendInt32(categorys.Count + (popularRooms.Count() > 0 ? 1 : 0));
                }

                if (popularRooms.Count() > 0)
                {
                    message_.AppendString("popular");
                    message_.AppendString("");     //text
                    message_.AppendInt32(0);       //action allowed
                    message_.AppendBoolean(false); //closed
                    message_.AppendInt32(0);       //display mode

                    message_.AppendInt32(popularRooms.Count());
                    foreach (Room room in popularRooms)
                    {
                        room.RoomData.Serialize(message_, false);
                    }
                }

                foreach (int c in categorys)
                {
                    FlatCat flatCat = Skylight.GetGame().GetNavigatorManager().GetFlatCat(c);

                    message_.AppendString("");
                    message_.AppendString(flatCat.Caption);
                    message_.AppendInt32(0);
                    message_.AppendBoolean(string.IsNullOrEmpty(query));
                    message_.AppendInt32(0);

                    IEnumerable <Room> categoryRooms = rooms.Where(r => r.RoomData.Category == c).OrderByDescending(r => r.RoomData.UsersNow).Take(50);
                    message_.AppendInt32(categoryRooms.Count());
                    foreach (Room room in categoryRooms)
                    {
                        room.RoomData.Serialize(message_, false);
                    }
                }
            }
            else if (view == "myworld_view")
            {
                IEnumerable <RoomData> rooms = session.GetHabbo().UserRooms.Select(i => Skylight.GetGame().GetRoomManager().TryGetAndLoadRoomData(i)).Where(r => this.doFilter(query, r));

                message_.AppendInt32(1);       //count
                message_.AppendString("my");
                message_.AppendString("");     //text
                message_.AppendInt32(0);       //action allowed
                message_.AppendBoolean(false); //closed
                message_.AppendInt32(0);       //display mode

                message_.AppendInt32(rooms.Count());
                foreach (RoomData room in rooms)
                {
                    room.Serialize(message_, false);
                }
            }
            else
            {
                message_.AppendInt32(0); //count
            }
            session.SendMessage(message_);
        }
        public void Handle(GameClient session, ClientMessage message)
        {
            bool hideFull   = message.PopWiredBoolean();
            int  caterogyId = message.PopWiredInt32();

            if (caterogyId == GetRoomsMessageEvent.PRIVATE_ROOMS) //private rooms
            {
                ServerMessage Message = BasicUtilies.GetRevisionServerMessage(Revision.R26_20080915_0408_7984_61ccb5f8b8797a3aba62c1fa2ca80169);
                Message.Init(r26Outgoing.SendRooms);
                Message.AppendBoolean(hideFull);
                Message.AppendInt32(caterogyId);
                Message.AppendInt32(GetRoomsMessageEvent.PRIVATE); //type
                Message.AppendString("Guestrooms");                //caption
                Message.AppendInt32(0);                            //unknown
                Message.AppendInt32(10000);                        //unknown
                Message.AppendInt32(GetRoomsMessageEvent.NONE);    //parent id
                Message.AppendInt32(0);                            //rooms count

                foreach (FlatCat flatCat in Skylight.GetGame().GetNavigatorManager().GetFlatCats())
                {
                    int usersNow = 0;
                    int usersMax = 0;
                    foreach (RoomData room in Skylight.GetGame().GetRoomManager().GetLoadedRooms().Where(r => r.RoomData.Type == "private" && r.RoomData.UsersNow > 0 && r.RoomData.Category == flatCat.Id).OrderByDescending(r => r.RoomData.UsersNow).Take(50).Select(r => r.RoomData).ToList())
                    {
                        usersNow += room.UsersNow;
                        usersMax += room.UsersMax;
                    }

                    Message.AppendInt32(Skylight.GetGame().GetNavigatorManager().GetOldSchoolCategoryThingy2()[new KeyValuePair <int, bool>(flatCat.Id, true)]); //id
                    Message.AppendBoolean(false);                                                                                                                //is room
                    Message.AppendString(flatCat.Caption);
                    Message.AppendInt32(usersNow);                                                                                                               //users now
                    Message.AppendInt32(usersMax);                                                                                                               //users max
                    Message.AppendInt32(GetRoomsMessageEvent.PRIVATE_ROOMS);                                                                                     //parent id
                }

                session.SendMessage(Message);
            }
            else if (caterogyId == GetRoomsMessageEvent.PUBLIC_ROOMS) //public rooms
            {
                ServerMessage Message = BasicUtilies.GetRevisionServerMessage(Revision.R26_20080915_0408_7984_61ccb5f8b8797a3aba62c1fa2ca80169);
                Message.Init(r26Outgoing.SendRooms);
                Message.AppendBoolean(hideFull);
                Message.AppendInt32(caterogyId);
                Message.AppendInt32(GetRoomsMessageEvent.PUBLIC); //type
                Message.AppendString("Publics");                  //caption
                Message.AppendInt32(0);                           //unknown
                Message.AppendInt32(10000);                       //unknown
                Message.AppendInt32(GetRoomsMessageEvent.NONE);   //parent id

                foreach (PublicItem category in Skylight.GetGame().GetNavigatorManager().GetPublicRoomItems().Where(i => i.Type == PublicItemType.CATEGORY && i.ParentCategoryID == 0))
                {
                    int usersNow = 0;
                    int usersMax = 0;
                    foreach (PublicItem item in Skylight.GetGame().GetNavigatorManager().GetPublicRoomItems().Where(i => i.ParentCategoryID == category.ID))
                    {
                        usersNow += item.RoomData.UsersNow;
                        usersMax += item.RoomData.UsersMax;
                    }

                    Message.AppendInt32(Skylight.GetGame().GetNavigatorManager().GetOldSchoolCategoryThingy2()[new KeyValuePair <int, bool>(category.ID, false)]); //id
                    Message.AppendBoolean(false);                                                                                                                  //is room
                    Message.AppendString(category.Caption);                                                                                                        //name
                    Message.AppendInt32(usersNow);                                                                                                                 //users now
                    Message.AppendInt32(usersMax);                                                                                                                 //users max
                    Message.AppendInt32(GetRoomsMessageEvent.PUBLIC_ROOMS);                                                                                        //parent id
                }

                foreach (PublicItem item in Skylight.GetGame().GetNavigatorManager().GetPublicRoomItems().Where(i => i.Type != PublicItemType.CATEGORY && i.ParentCategoryID == 0))
                {
                    Message.AppendUInt(item.RoomData.ID);            //id
                    Message.AppendBoolean(true);                     //is room
                    Message.AppendString(item.RoomData.Name);        //name
                    Message.AppendInt32(item.RoomData.UsersNow);     //visitors now
                    Message.AppendInt32(item.RoomData.UsersMax);     //visitors max
                    Message.AppendInt32(caterogyId);                 //category inside
                    Message.AppendString(item.RoomData.Description); //desc
                    Message.AppendUInt(item.RoomData.ID);            //id
                    Message.AppendBoolean(false);                    //unknwon
                    Message.AppendString(item.RoomData.PublicCCTs);  //ccts
                    Message.AppendBoolean(false);                    //unknwon
                    Message.AppendBoolean(true);                     //unknwon
                }

                session.SendMessage(Message);
            }
            else //private room category
            {
                object category;
                Skylight.GetGame().GetNavigatorManager().GetOldSchoolCategoryThingy().TryGetValue(caterogyId, out category);

                if (category is FlatCat)
                {
                    FlatCat flatCat = (FlatCat)category;

                    ServerMessage Message = BasicUtilies.GetRevisionServerMessage(Revision.R26_20080915_0408_7984_61ccb5f8b8797a3aba62c1fa2ca80169);
                    Message.Init(r26Outgoing.SendRooms);
                    Message.AppendBoolean(hideFull);
                    Message.AppendInt32(caterogyId);
                    Message.AppendInt32(GetRoomsMessageEvent.PRIVATE);       //type
                    Message.AppendString(flatCat.Caption);
                    Message.AppendInt32(0);                                  //unknown
                    Message.AppendInt32(10000);                              //unknown
                    Message.AppendInt32(GetRoomsMessageEvent.PRIVATE_ROOMS); //parent id

                    List <Room> rooms = Skylight.GetGame().GetRoomManager().GetLoadedRooms().Where(r => !r.RoomData.IsPublicRoom && r.RoomData.Category == flatCat.Id).Take(50).ToList();

                    Message.AppendInt32(rooms.Count);
                    foreach (Room room in rooms)
                    {
                        Message.AppendUInt(room.RoomData.ID);                                                                   //id
                        Message.AppendString(room.RoomData.Name);                                                               //name
                        Message.AppendString(Skylight.GetGame().GetGameClientManager().GetUsernameByID(room.RoomData.OwnerID)); //owner
                        Message.AppendString(room.RoomData.State == RoomStateType.OPEN ? "open" : room.RoomData.State == RoomStateType.LOCKED ? "closed" : "password");
                        Message.AppendInt32(room.RoomData.UsersNow);                                                            //visitors now
                        Message.AppendInt32(room.RoomData.UsersMax);                                                            //visitors max
                        Message.AppendString(room.RoomData.Description);                                                        //desc
                    }

                    session.SendMessage(Message);
                }
                else if (category is PublicItem)
                {
                    PublicItem item = (PublicItem)category;

                    if (item.Type == PublicItemType.CATEGORY)
                    {
                        ServerMessage Message = BasicUtilies.GetRevisionServerMessage(Revision.R26_20080915_0408_7984_61ccb5f8b8797a3aba62c1fa2ca80169);
                        Message.Init(r26Outgoing.SendRooms);
                        Message.AppendBoolean(hideFull);
                        Message.AppendInt32(caterogyId);
                        Message.AppendInt32(GetRoomsMessageEvent.PUBLIC);       //type
                        Message.AppendString(item.Caption);                     //caption
                        Message.AppendInt32(0);                                 //unknown
                        Message.AppendInt32(10000);                             //unknown
                        Message.AppendInt32(GetRoomsMessageEvent.PUBLIC_ROOMS); //parent id

                        foreach (PublicItem item_ in Skylight.GetGame().GetNavigatorManager().GetPublicRoomItems().Where(i => i.Type != PublicItemType.CATEGORY && i.ParentCategoryID == item.ID))
                        {
                            Message.AppendUInt(item_.RoomData.ID);            //id
                            Message.AppendBoolean(true);                      //is room
                            Message.AppendString(item_.RoomData.Name);        //name
                            Message.AppendInt32(item_.RoomData.UsersNow);     //visitors now
                            Message.AppendInt32(item_.RoomData.UsersMax);     //visitors max
                            Message.AppendInt32(caterogyId);                  //category inside
                            Message.AppendString(item_.RoomData.Description); //desc
                            Message.AppendUInt(item_.RoomData.ID);            //id
                            Message.AppendBoolean(false);                     //unknwon
                            Message.AppendString(item_.RoomData.PublicCCTs);  //ccts
                            Message.AppendBoolean(false);                     //unknwon
                            Message.AppendBoolean(true);                      //unknwon
                        }

                        session.SendMessage(Message);
                    }
                }
            }
        }
        public void Handle(GameClient Session, ClientMessage Event)
        {
            Room     room     = Session.GetHabbo().CurrentRoom;
            RoomData roomData = room.RoomData;

            if ((room != null) && room.CheckRights(Session, true))
            {
                int           num     = Event.PopWiredInt32();
                string        str     = Essential.FilterString(Event.PopFixedString());
                string        str2    = Essential.FilterString(Event.PopFixedString());
                int           num2    = Event.PopWiredInt32();
                string        str3    = Essential.FilterString(Event.PopFixedString());
                int           num3    = Event.PopWiredInt32();
                int           id      = Event.PopWiredInt32();
                int           num5    = Event.PopWiredInt32();
                List <string> tags    = new List <string>();
                StringBuilder builder = new StringBuilder();
                for (int i = 0; i < num5; i++)
                {
                    if (i > 0)
                    {
                        builder.Append(",");
                    }
                    string item = Essential.FilterString(Event.PopFixedString().ToLower());
                    tags.Add(item);
                    builder.Append(item);
                }
                int  num7  = Event.PopWiredInt32();
                bool k     = Event.PopWiredBoolean();
                bool flag2 = Event.PopWiredBoolean();
                bool flag3 = Event.PopWiredBoolean();
                bool flag4 = Event.PopWiredBoolean();
                int  num8  = Event.PopWiredInt32();
                int  num9  = Event.PopWiredInt32();
                if ((num8 < -2) || (num8 > 1))
                {
                    num8 = 0;
                }
                if ((num9 < -2) || (num9 > 1))
                {
                    num9 = 0;
                }
                if (((str.Length >= 1) && ((num2 >= 0) && (num2 <= 2))) && ((num3 >= 10) && (num3 <= 500)))
                {
                    FlatCat flatCat = Essential.GetGame().GetNavigator().GetFlatCat(id);
                    if (flatCat != null)
                    {
                        if (flatCat.MinRank > Session.GetHabbo().Rank)
                        {
                            Session.SendNotification("Du hast nicht die dafür vorgegebene Rechte!");
                            id = 0;
                        }
                        room.AllowPet                  = k;
                        room.AllowPetsEating           = flag2;
                        room.AllowWalkthrough          = flag3;
                        room.Hidewall                  = flag4;
                        room.RoomData.AllowPet         = k;
                        room.RoomData.AllowPetsEating  = flag2;
                        room.RoomData.AllowWalkthrough = flag3;
                        room.RoomData.Hidewall         = flag4;
                        room.Name                 = str;
                        room.State                = num2;
                        room.Description          = str2;
                        room.Category             = id;
                        room.Password             = str3;
                        room.RoomData.Name        = str;
                        room.RoomData.State       = num2;
                        room.RoomData.Description = str2;
                        room.RoomData.Category    = id;
                        room.RoomData.Password    = str3;
                        room.Tags.Clear();
                        room.Tags.AddRange(tags);
                        room.UsersMax = num3;
                        room.RoomData.Tags.Clear();
                        room.RoomData.Tags.AddRange(tags);
                        room.RoomData.UsersMax   = num3;
                        room.Wallthick           = num8;
                        room.Floorthick          = num9;
                        room.RoomData.Wallthick  = num8;
                        room.RoomData.Floorthick = num9;
                        string str5 = "open";
                        if (room.State == 1)
                        {
                            str5 = "locked";
                        }
                        else if (room.State > 1)
                        {
                            str5 = "password";
                        }
                        using (DatabaseClient adapter = Essential.GetDatabase().GetClient())
                        {
                            adapter.AddParamWithValue("caption", room.Name);
                            adapter.AddParamWithValue("description", room.Description);
                            adapter.AddParamWithValue("password", room.Password);
                            adapter.AddParamWithValue("tags", builder.ToString());
                            adapter.ExecuteQuery(string.Concat(new object[] {
                                "UPDATE rooms SET caption = @caption, description = @description, password = @password, category = '", id, "', state = '", str5, "', tags = @tags, users_max = '", num3, "', allow_pets = '", (k ? 1 : 0), "', allow_pets_eat = '", (flag2 ? 1 : 0), "', allow_walkthrough = '", (flag3 ? 1 : 0), "', allow_hidewall = '", (room.Hidewall ? 1 : 0), "', floorthick = '", room.Floorthick,
                                "', wallthick = '", room.Wallthick, "' WHERE id = ", room.Id
                            }));
                        }

                        ServerMessage UpdateRoomOne = new ServerMessage(Outgoing.UpdateRoomOne);
                        UpdateRoomOne.AppendInt32(room.Id);
                        Session.SendMessage(UpdateRoomOne);

                        ServerMessage WallAndFloor = new ServerMessage(Outgoing.ConfigureWallandFloor);
                        WallAndFloor.AppendBoolean(room.Hidewall);
                        WallAndFloor.AppendInt32(room.Wallthick);
                        WallAndFloor.AppendInt32(room.Floorthick);
                        Session.GetHabbo().CurrentRoom.SendMessage(WallAndFloor, null);

                        RoomData data2 = room.RoomData;

                        ServerMessage RoomDataa = new ServerMessage(Outgoing.RoomData);
                        RoomDataa.AppendBoolean(false);
                        RoomDataa.AppendInt32(room.Id);
                        RoomDataa.AppendString(room.Name);
                        RoomDataa.AppendBoolean(true);
                        RoomDataa.AppendInt32(room.OwnerId);
                        RoomDataa.AppendString(room.Owner);
                        RoomDataa.AppendInt32(room.State);
                        RoomDataa.AppendInt32(room.UsersNow);
                        RoomDataa.AppendInt32(room.UsersMax);
                        RoomDataa.AppendString(room.Description);
                        RoomDataa.AppendInt32(0);
                        RoomDataa.AppendInt32((room.Category == 0x34) ? 2 : 0);
                        RoomDataa.AppendInt32(room.Score);
                        RoomDataa.AppendInt32(0);
                        RoomDataa.AppendInt32(room.Category);

                        if (room.RoomData.GuildId == 0)
                        {
                            RoomDataa.AppendInt32(0);
                            RoomDataa.AppendInt32(0);
                        }
                        else
                        {
                            GroupsManager guild = Groups.GetGroupById(room.RoomData.GuildId);
                            RoomDataa.AppendInt32(guild.Id);
                            RoomDataa.AppendString(guild.Name);
                            RoomDataa.AppendString(guild.Badge);
                        }

                        RoomDataa.AppendString("");
                        RoomDataa.AppendInt32(room.Tags.Count);

                        foreach (string str6 in room.Tags)
                        {
                            RoomDataa.AppendString(str6);
                        }

                        RoomDataa.AppendInt32(0);
                        RoomDataa.AppendInt32(0);
                        RoomDataa.AppendInt32(0);
                        RoomDataa.AppendBoolean(true);
                        RoomDataa.AppendBoolean(true);
                        RoomDataa.AppendInt32(0);
                        RoomDataa.AppendInt32(0);
                        RoomDataa.AppendBoolean(false);
                        RoomDataa.AppendBoolean(false);
                        RoomDataa.AppendBoolean(false);

                        RoomDataa.AppendInt32(0);
                        RoomDataa.AppendInt32(0);
                        RoomDataa.AppendInt32(0);
                        RoomDataa.AppendBoolean(false);
                        RoomDataa.AppendBoolean(true);
                        Session.GetHabbo().CurrentRoom.SendMessage(RoomDataa, null);
                    }
                }
            }
        }