Пример #1
0
        public ServerMessage method_12(GameClient Session, int int_0)
        {
            Func <RoomData, bool> func  = null;
            Func <Room, bool>     func2 = null;

            Navigator.Class219 @class = new Navigator.Class219();
            @class.int_0 = int_0;
            ServerMessage Message = new ServerMessage(451u);

            if (@class.int_0 >= -1)
            {
                Message.AppendInt32(@class.int_0);
                Message.AppendInt32(1);
            }
            else
            {
                if (@class.int_0 == -2)
                {
                    Message.AppendInt32(0);
                    Message.AppendInt32(2);
                }
                else
                {
                    if (@class.int_0 == -3)
                    {
                        Message.AppendInt32(0);
                        Message.AppendInt32(5);
                    }
                    else
                    {
                        if (@class.int_0 == -4)
                        {
                            Message.AppendInt32(0);
                            Message.AppendInt32(3);
                        }
                        else
                        {
                            if (@class.int_0 == -5)
                            {
                                Message.AppendInt32(0);
                                Message.AppendInt32(4);
                            }
                        }
                    }
                }
            }
            Message.AppendStringWithBreak("");
            List <RoomData> list = new List <RoomData>();

            switch (@class.int_0)
            {
            case -5:
            case -4:
                break;

            case -3:
                goto IL_3A2;

            case -2:
                goto IL_3E5;

            case -1:
                goto IL_47E;

            default:
            {
                Dictionary <Room, int> dictionary = GoldTree.GetGame().GetRoomManager().method_21();
                IEnumerable <RoomData> arg_11F_0  = GoldTree.GetGame().GetRoomManager().list_3;
                if (func == null)
                {
                    func = new Func <RoomData, bool>(@class.method_0);
                }
                IEnumerable <RoomData> enumerable = arg_11F_0.Where(func);
                IEnumerable <Room>     arg_13E_0  = dictionary.Keys;
                if (func2 == null)
                {
                    func2 = new Func <Room, bool>(@class.method_1);
                }
                IEnumerable <Room> arg_160_0 = arg_13E_0.Where(func2);
                if (Navigator.func_2 == null)
                {
                    Navigator.func_2 = new Func <Room, int>(Navigator.smethod_3);
                }
                IOrderedEnumerable <Room> orderedEnumerable = arg_160_0.OrderByDescending(Navigator.func_2);
                new List <RoomData>();
                int num = 0;
                foreach (Room current in orderedEnumerable)
                {
                    if (num > 40)
                    {
                        break;
                    }
                    list.Add(current.Class27_0);
                    num++;
                }
                using (IEnumerator <RoomData> enumerator2 = enumerable.GetEnumerator())
                {
                    while (enumerator2.MoveNext())
                    {
                        RoomData current2 = enumerator2.Current;
                        if (num > 40)
                        {
                            break;
                        }
                        if (list.Contains(current2))
                        {
                            list.Remove(current2);
                        }
                        list.Add(current2);
                        num++;
                    }
                    goto IL_508;
                }
            }
            }
            List <string>          list2       = new List <string>();
            Dictionary <int, Room> dictionary2 = new Dictionary <int, Room>();
            Hashtable hashtable = Session.GetHabbo().GetMessenger().method_26().Clone() as Hashtable;
            Dictionary <RoomData, int> dictionary3 = new Dictionary <RoomData, int>();

            foreach (MessengerBuddy class2 in hashtable.Values)
            {
                if (class2.Boolean_0 && class2.Boolean_1)
                {
                    GameClient class3 = GoldTree.GetGame().GetClientManager().method_2(class2.UInt32_0);
                    if (class3 != null && class3.GetHabbo() != null && class3.GetHabbo().CurrentRoom != null)
                    {
                        RoomData class27_ = class3.GetHabbo().CurrentRoom.Class27_0;
                        if (!dictionary3.ContainsKey(class27_))
                        {
                            dictionary3.Add(class27_, class27_.UsersNow);
                        }
                    }
                }
            }
            IEnumerable <RoomData> arg_344_0 = dictionary3.Keys;

            if (Navigator.func_0 == null)
            {
                Navigator.func_0 = new Func <RoomData, int>(Navigator.smethod_1);
            }
            IOrderedEnumerable <RoomData> orderedEnumerable2 = arg_344_0.OrderByDescending(Navigator.func_0);

            list2.Clear();
            dictionary2.Clear();
            hashtable.Clear();
            dictionary3.Clear();
            using (IEnumerator <RoomData> enumerator2 = orderedEnumerable2.GetEnumerator())
            {
                while (enumerator2.MoveNext())
                {
                    RoomData current3 = enumerator2.Current;
                    list.Add(current3);
                }
                goto IL_508;
            }
IL_3A2:
            using (List <RoomData> .Enumerator enumerator4 = Session.GetHabbo().list_6.GetEnumerator())
            {
                while (enumerator4.MoveNext())
                {
                    RoomData current3 = enumerator4.Current;
                    list.Add(current3);
                }
                goto IL_508;
            }
IL_3E5:
            DataTable dataTable;

            using (DatabaseClient class4 = GoldTree.GetDatabase().GetClient())
            {
                dataTable = class4.ReadDataTable("SELECT * FROM rooms WHERE score > 0 AND roomtype = 'private' ORDER BY score DESC LIMIT 40");
            }
            IEnumerator enumerator3 = dataTable.Rows.GetEnumerator();

            try
            {
                while (enumerator3.MoveNext())
                {
                    DataRow dataRow = (DataRow)enumerator3.Current;
                    list.Add(GoldTree.GetGame().GetRoomManager().method_17((uint)dataRow["Id"], dataRow));
                }
                goto IL_508;
            }
            finally
            {
                IDisposable disposable = enumerator3 as IDisposable;
                if (disposable != null)
                {
                    disposable.Dispose();
                }
            }
IL_47E:
            Dictionary <Room, int> dictionary4 = GoldTree.GetGame().GetRoomManager().method_21();
            IEnumerable <Room> arg_4B3_0       = dictionary4.Keys;

            if (Navigator.func_1 == null)
            {
                Navigator.func_1 = new Func <Room, int>(Navigator.smethod_2);
            }
            IOrderedEnumerable <Room> orderedEnumerable3 = arg_4B3_0.OrderByDescending(Navigator.func_1);
            int num2 = 0;

            foreach (Room current4 in orderedEnumerable3)
            {
                if (num2 >= 40)
                {
                    break;
                }
                num2++;
                list.Add(current4.Class27_0);
            }
IL_508:
            Message.AppendInt32(list.Count);
            foreach (RoomData current5 in list)
            {
                current5.method_3(Message, false, false);
            }
            Random random = new Random();

            Message.AppendStringWithBreak("");
            this.dictionary_1.ElementAt(random.Next(0, this.dictionary_1.Count)).Value.method_0(Message);
            return(Message);
        }
Пример #2
0
 public ServerMessage method_12(GameClient Session, int int_0)
 {
     Func<RoomData, bool> func = null;
     Func<Room, bool> func2 = null;
     Navigator.Class219 @class = new Navigator.Class219();
     @class.int_0 = int_0;
     ServerMessage Message = new ServerMessage(451u);
     if (@class.int_0 >= -1)
     {
         Message.AppendInt32(@class.int_0);
         Message.AppendInt32(1);
     }
     else
     {
         if (@class.int_0 == -2)
         {
             Message.AppendInt32(0);
             Message.AppendInt32(2);
         }
         else
         {
             if (@class.int_0 == -3)
             {
                 Message.AppendInt32(0);
                 Message.AppendInt32(5);
             }
             else
             {
                 if (@class.int_0 == -4)
                 {
                     Message.AppendInt32(0);
                     Message.AppendInt32(3);
                 }
                 else
                 {
                     if (@class.int_0 == -5)
                     {
                         Message.AppendInt32(0);
                         Message.AppendInt32(4);
                     }
                 }
             }
         }
     }
     Message.AppendStringWithBreak("");
     List<RoomData> list = new List<RoomData>();
     switch (@class.int_0)
     {
     case -5:
     case -4:
         break;
     case -3:
         goto IL_3A2;
     case -2:
         goto IL_3E5;
     case -1:
         goto IL_47E;
     default:
     {
         Dictionary<Room, int> dictionary = GoldTree.GetGame().GetRoomManager().method_21();
         IEnumerable<RoomData> arg_11F_0 = GoldTree.GetGame().GetRoomManager().list_3;
         if (func == null)
         {
             func = new Func<RoomData, bool>(@class.method_0);
         }
         IEnumerable<RoomData> enumerable = arg_11F_0.Where(func);
         IEnumerable<Room> arg_13E_0 = dictionary.Keys;
         if (func2 == null)
         {
             func2 = new Func<Room, bool>(@class.method_1);
         }
         IEnumerable<Room> arg_160_0 = arg_13E_0.Where(func2);
         if (Navigator.func_2 == null)
         {
             Navigator.func_2 = new Func<Room, int>(Navigator.smethod_3);
         }
         IOrderedEnumerable<Room> orderedEnumerable = arg_160_0.OrderByDescending(Navigator.func_2);
         new List<RoomData>();
         int num = 0;
         foreach (Room current in orderedEnumerable)
         {
             if (num > 40)
             {
                 break;
             }
             list.Add(current.Class27_0);
             num++;
         }
         using (IEnumerator<RoomData> enumerator2 = enumerable.GetEnumerator())
         {
             while (enumerator2.MoveNext())
             {
                 RoomData current2 = enumerator2.Current;
                 if (num > 40)
                 {
                     break;
                 }
                 if (list.Contains(current2))
                 {
                     list.Remove(current2);
                 }
                 list.Add(current2);
                 num++;
             }
             goto IL_508;
         }
     }
     }
     List<string> list2 = new List<string>();
     Dictionary<int, Room> dictionary2 = new Dictionary<int, Room>();
     Hashtable hashtable = Session.GetHabbo().GetMessenger().method_26().Clone() as Hashtable;
     Dictionary<RoomData, int> dictionary3 = new Dictionary<RoomData, int>();
     foreach (MessengerBuddy class2 in hashtable.Values)
     {
         if (class2.Boolean_0 && class2.Boolean_1)
         {
             GameClient class3 = GoldTree.GetGame().GetClientManager().method_2(class2.UInt32_0);
             if (class3 != null && class3.GetHabbo() != null && class3.GetHabbo().CurrentRoom != null)
             {
                 RoomData class27_ = class3.GetHabbo().CurrentRoom.Class27_0;
                 if (!dictionary3.ContainsKey(class27_))
                 {
                     dictionary3.Add(class27_, class27_.UsersNow);
                 }
             }
         }
     }
     IEnumerable<RoomData> arg_344_0 = dictionary3.Keys;
     if (Navigator.func_0 == null)
     {
         Navigator.func_0 = new Func<RoomData, int>(Navigator.smethod_1);
     }
     IOrderedEnumerable<RoomData> orderedEnumerable2 = arg_344_0.OrderByDescending(Navigator.func_0);
     list2.Clear();
     dictionary2.Clear();
     hashtable.Clear();
     dictionary3.Clear();
     using (IEnumerator<RoomData> enumerator2 = orderedEnumerable2.GetEnumerator())
     {
         while (enumerator2.MoveNext())
         {
             RoomData current3 = enumerator2.Current;
             list.Add(current3);
         }
         goto IL_508;
     }
     IL_3A2:
     using (List<RoomData>.Enumerator enumerator4 = Session.GetHabbo().list_6.GetEnumerator())
     {
         while (enumerator4.MoveNext())
         {
             RoomData current3 = enumerator4.Current;
             list.Add(current3);
         }
         goto IL_508;
     }
     IL_3E5:
     DataTable dataTable;
     using (DatabaseClient class4 = GoldTree.GetDatabase().GetClient())
     {
         dataTable = class4.ReadDataTable("SELECT * FROM rooms WHERE score > 0 AND roomtype = 'private' ORDER BY score DESC LIMIT 40");
     }
     IEnumerator enumerator3 = dataTable.Rows.GetEnumerator();
     try
     {
         while (enumerator3.MoveNext())
         {
             DataRow dataRow = (DataRow)enumerator3.Current;
             list.Add(GoldTree.GetGame().GetRoomManager().method_17((uint)dataRow["Id"], dataRow));
         }
         goto IL_508;
     }
     finally
     {
         IDisposable disposable = enumerator3 as IDisposable;
         if (disposable != null)
         {
             disposable.Dispose();
         }
     }
     IL_47E:
     Dictionary<Room, int> dictionary4 = GoldTree.GetGame().GetRoomManager().method_21();
     IEnumerable<Room> arg_4B3_0 = dictionary4.Keys;
     if (Navigator.func_1 == null)
     {
         Navigator.func_1 = new Func<Room, int>(Navigator.smethod_2);
     }
     IOrderedEnumerable<Room> orderedEnumerable3 = arg_4B3_0.OrderByDescending(Navigator.func_1);
     int num2 = 0;
     foreach (Room current4 in orderedEnumerable3)
     {
         if (num2 >= 40)
         {
             break;
         }
         num2++;
         list.Add(current4.Class27_0);
     }
     IL_508:
     Message.AppendInt32(list.Count);
     foreach (RoomData current5 in list)
     {
         current5.method_3(Message, false, false);
     }
     Random random = new Random();
     Message.AppendStringWithBreak("");
     this.dictionary_1.ElementAt(random.Next(0, this.dictionary_1.Count)).Value.method_0(Message);
     return Message;
 }