Exemple #1
0
        public override List <RoomData> Search(string query, Session session, int Limit)
        {
            List <RoomData> rooms = new List <RoomData>();

            switch (base.QueryId)
            {
            case "my":
            {
                foreach (var room in RoomDatabase.UserRooms(session.Player.Id))
                {
                    if (rooms.Count >= Limit)
                    {
                        break;
                    }

                    if (!room.Name.ToLower().Contains(query))
                    {
                        continue;
                    }

                    rooms.Add(room);
                }
                break;
            }
            }
            return(rooms);
        }
Exemple #2
0
        public void Handle(Session session, ClientPacket message)
        {
            List <RoomData> rooms = new List <RoomData>();

            RoomDatabase.UserRooms(session.Player.Id).ForEach(roomData =>
            {
                //todo: check if room is promoted
                rooms.Add(roomData);
            });

            session.Send(new PromoteOwnRoomsListComposer(rooms));
        }
        public void Handle(Session session, ClientPacket message)
        {
            List <RoomData> rooms = new List <RoomData>();

            RoomDatabase.UserRooms(session.Player.Id).ForEach(roomData =>
            {
                if (roomData.Group == null)
                {
                    rooms.Add(roomData);
                }
            });

            session.Send(new GroupBuyRoomsComposer(rooms.ToList()));
        }