Example #1
0
        /// <summary>
        /// 17 - "@Q"
        /// </summary>
        public void SRCHF()
        {
            string Criteria = Request.Content.Split('%')[1]; // Get plain criteria

            roomInformation[] Rooms = ObjectTree.Game.Rooms.getUserFlatsSearchResult(Criteria);
            if (Rooms.Length > 0)        // Rooms found!
            {
                Response.Initialize(55); // "@w"
                foreach (roomInformation Room in Rooms)
                {
                    roomCategoryInformation pCategory = ObjectTree.Game.Rooms.getRoomCategory(Room.categoryID);
                    if (pCategory != null && pCategory.userRoleHasAccess(Session.User.Role))
                    {
                        if (!(Room.showOwner ||
                              Room.ownerID == Session.User.ID ||
                              Session.User.hasFuseRight("fuse_see_all_roomowners")))
                        {
                            Room.Owner = "-"; // Can't see owner name
                        }
                        Response.Append(Room.ToUserFlatString());
                    }
                }
            }
            else
            {
                Response.Initialize(58); // "@z"
            }
            sendResponse();
        }
Example #2
0
        /// <summary>
        /// 17 - "@Q"
        /// </summary>
        public void SRCHF()
        {
            string Criteria = Request.Content.Split('%')[1]; // Get plain criteria

            roomInformation[] Rooms = Engine.Game.Rooms.getUserFlatsSearchResult(Criteria);
            if (Rooms.Length > 0)        // Rooms found!
            {
                Response.Initialize(55); // "@w"
                foreach (roomInformation Room in Rooms)
                {
                    roomCategoryInformation pCategory = Engine.Game.Rooms.getRoomCategory(Room.categoryID);
                    if (pCategory != null && pCategory.userRoleHasAccess(Session.User.Role))
                    {
                        if (!Room.showOwner)
                        {
                            if (Room.ownerID != Session.User.ID && !Session.User.hasFuseRight("fuse_see_all_roomowners"))
                            {
                                if (Room.Owner == Criteria) // Was searching for room owners
                                {
                                    continue;               // Can't view this room at all
                                }
                                else
                                {
                                    Room.Owner = "-";
                                }
                            }
                        }

                        Response.Append(Room.ToUserFlatString());
                    }
                }
            }
            else
            {
                Response.Initialize(58); // "@z"
            }
            sendResponse();
        }
Example #3
0
        /// <summary>
        /// 150 - "BV"
        /// </summary>
        public void NAVIGATE()
        {
            int categoryID = Request.getWiredParameters()[1];

            Response.Initialize(220); // "C\"
            roomCategoryInformation pCategory = Engine.Game.Rooms.getRoomCategory(categoryID);

            if (pCategory != null && pCategory.userRoleHasAccess(Session.User.Role)) // Valid category
            {
                bool hideFull = wireEncoding.decodeBoolean(Request.Content.Substring(0, 1));

                #region Build category info
                Response.appendWired(hideFull);
                Response.appendWired(pCategory.ID);
                if (pCategory.forPublicSpaces)
                {
                    Response.appendWired(false); // Public spaces
                }
                else
                {
                    Response.appendWired(2); // User flats
                }
                Response.appendClosedValue(pCategory.Name);
                Response.appendWired(pCategory.currentVisitors);
                Response.appendWired(pCategory.maxVisitors);
                Response.appendWired(pCategory.parentID);

                List <roomInformation> Rooms = Engine.Game.Rooms.getCategoryRooms(categoryID, !pCategory.forPublicSpaces);
                if (!pCategory.forPublicSpaces) // User flats
                {
                    Response.appendWired(Rooms.Count);
                }
                #endregion

                #region Build rooms info
                foreach (roomInformation lRoom in Rooms)
                {
                    if (!hideFull || lRoom.currentVisitors <= lRoom.maxVisitors)
                    {
                        Response.Append(lRoom.ToString(Session.User));
                    }
                }
                #endregion

                #region Build subcategory info
                foreach (roomCategoryInformation lSubcategory in Engine.Game.Rooms.getChildRoomCategories(pCategory.ID))
                {
                    if (lSubcategory.userRoleHasAccess(Session.User.Role) && (!hideFull || lSubcategory.currentVisitors < lSubcategory.maxVisitors)) // User has access to this room category and requests to see this category
                    {
                        Response.appendWired(lSubcategory.ID);
                        Response.appendWired(false);
                        Response.appendClosedValue(lSubcategory.Name);
                        Response.appendWired(lSubcategory.currentVisitors);
                        Response.appendWired(lSubcategory.maxVisitors);
                        Response.appendWired(pCategory.ID);
                    }
                }
                #endregion
            }

            sendResponse();
        }