public void Handle(GameClient Session, ClientMessage Event)
 {
     DataTable dataTable_ = Session.GetHabbo().dataTable_0;
     if (dataTable_ != null)
     {
         ServerMessage Message = new ServerMessage(915u);
         Message.AppendInt32(dataTable_.Rows.Count);
         foreach (DataRow dataRow in dataTable_.Rows)
         {
             GroupsManager @class = Groups.smethod_2((int)dataRow["groupid"]);
             Message.AppendInt32(@class.int_0);
             Message.AppendStringWithBreak(@class.string_0);
             Message.AppendStringWithBreak(@class.string_2);
             if (Session.GetHabbo().int_0 == @class.int_0) // is favorite group?
             {
                 Message.AppendBoolean(true);
             }
             else
             {
                 Message.AppendBoolean(false);
             }
         }
         Session.SendMessage(Message);
     }
 }
 public void Handle(GameClient Session, ClientMessage Event)
 {
     Room class14_ = Session.GetHabbo().CurrentRoom;
     if (class14_ != null)
     {
         Event.PopWiredUInt();
         string string_ = Event.PopFixedString();
         RoomUser @class = class14_.method_56(string_);
         if (@class != null && @class.GetClient().GetHabbo().Rank <= 2u)
         {
             uint uint_ = @class.GetClient().GetHabbo().Id;
             if (!Session.GetHabbo().list_2.Contains(uint_))
             {
                 Session.GetHabbo().list_2.Add(uint_);
                 using (DatabaseClient class2 = GoldTree.GetDatabase().GetClient())
                 {
                     class2.ExecuteQuery(string.Concat(new object[]
                     {
                         "INSERT INTO user_ignores(user_id, ignore_id) VALUES (",
                         Session.GetHabbo().Id,
                         ", ",
                         uint_,
                         ");"
                     }));
                 }
                 ServerMessage Message = new ServerMessage(419u);
                 Message.AppendInt32(1);
                 Session.SendMessage(Message);
             }
         }
     }
 }
 public void Handle(GameClient Session, ClientMessage Event)
 {
     ServerMessage Message = new ServerMessage(443u);
     Message.AppendInt32(Session.GetHabbo().AchievementScore);
     Message.AppendStringWithBreak("");
     Session.SendMessage(Message);
 }
 public void Handle(GameClient Session, ClientMessage Event)
 {
     string text = Event.PopFixedString();
     ServerMessage Message = new ServerMessage(7u);
     Message.AppendStringWithBreak(text.ToLower());
     if (Session.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_vip"))
     {
         double num = (double)Session.GetHabbo().GetSubscriptionManager().method_1("habbo_vip").Int32_0;
         double num2 = num - GoldTree.GetUnixTimestamp();
         int num3 = (int)Math.Ceiling(num2 / 86400.0);
         int num4 = num3 / 31;
         if (num4 >= 1)
         {
             num4--;
         }
         Message.AppendInt32(num3 - num4 * 31);
         Message.AppendBoolean(true);
         Message.AppendInt32(num4);
         Message.AppendBoolean(true);
         Message.AppendBoolean(true);
         Message.AppendBoolean(Session.GetHabbo().Vip);
         Message.AppendInt32(0);
         Message.AppendInt32(0);
     }
     else
     {
         if (Session.GetHabbo().GetSubscriptionManager().HasSubscription(text))
         {
             double num = (double)Session.GetHabbo().GetSubscriptionManager().method_1(text).Int32_0;
             double num2 = num - GoldTree.GetUnixTimestamp();
             int num3 = (int)Math.Ceiling(num2 / 86400.0);
             int num4 = num3 / 31;
             if (num4 >= 1)
             {
                 num4--;
             }
             Message.AppendInt32(num3 - num4 * 31);
             Message.AppendBoolean(true);
             Message.AppendInt32(num4);
             if (Session.GetHabbo().Rank >= 2u)
             {
                 Message.AppendInt32(1);
                 Message.AppendInt32(1);
                 Message.AppendInt32(2);
             }
             else
             {
                 Message.AppendInt32(1);
             }
         }
         else
         {
             for (int i = 0; i < 3; i++)
             {
                 Message.AppendInt32(0);
             }
         }
     }
     Session.SendMessage(Message);
 }
 public void Handle(GameClient Session, ClientMessage Event)
 {
     if (Session != null && Session.GetHabbo() != null)
     {
         Room @class = GoldTree.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
         if (@class != null)
         {
             RoomUser class2 = @class.GetRoomUserByHabbo(Event.PopWiredUInt());
             if (class2 != null && !class2.IsBot && class2.GetClient() != null)
             {
                 ServerMessage Message = new ServerMessage(228u);
                 Message.AppendUInt(class2.GetClient().GetHabbo().Id);
                 Message.AppendInt32(class2.GetClient().GetHabbo().method_22().Int32_1);
                 using (TimedLock.Lock(class2.GetClient().GetHabbo().method_22().List_0))
                 {
                     foreach (Badge current in class2.GetClient().GetHabbo().method_22().List_0)
                     {
                         if (current.Slot > 0)
                         {
                             Message.AppendInt32(current.Slot);
                             Message.AppendStringWithBreak(current.Code);
                         }
                     }
                 }
                 Session.SendMessage(Message);
             }
         }
     }
 }
 public void Handle(GameClient Session, ClientMessage Event)
 {
     ServerMessage Message = new ServerMessage(611u);
     Message.AppendBoolean(true);
     Message.AppendInt32(2);
     Session.SendMessage(Message);
 }
 public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
 {
     if (bool_0)
     {
         ServerMessage Message = new ServerMessage(650u);
         Message.AppendInt32(0);
         Message.AppendInt32(5);
         Message.AppendInt32(0);
         Message.AppendInt32(RoomItem_0.GetBaseItem().Sprite);
         Message.AppendUInt(RoomItem_0.uint_0);
         Message.AppendStringWithBreak("");
         Message.AppendString("I");
         if (RoomItem_0.string_3.Length > 0)
         {
             Message.AppendString(RoomItem_0.string_3);
         }
         else
         {
             Message.AppendString("RB");
         }
         Message.AppendStringWithBreak("HRAH");
         Session.SendMessage(Message);
         RoomItem_0.ReqUpdate(1);
     }
 }
 public void Handle(GameClient Session, ClientMessage Event)
 {
     Room @class = GoldTree.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
     if (@class != null && Session.GetHabbo().int_21 > 0)
     {
         RoomUser class2 = @class.GetRoomUserByHabbo(Event.PopWiredUInt());
         if (class2 != null && class2.GetClient().GetHabbo().Id != Session.GetHabbo().Id && !class2.IsBot)
         {
             Session.GetHabbo().int_21--;
             Session.GetHabbo().RespectGiven++;
             class2.GetClient().GetHabbo().Respect++;
             using (DatabaseClient class3 = GoldTree.GetDatabase().GetClient())
             {
                 class3.ExecuteQuery("UPDATE user_stats SET Respect = respect + 1 WHERE Id = '" + class2.GetClient().GetHabbo().Id + "' LIMIT 1");
                 class3.ExecuteQuery("UPDATE user_stats SET RespectGiven = RespectGiven + 1 WHERE Id = '" + Session.GetHabbo().Id + "' LIMIT 1");
                 class3.ExecuteQuery("UPDATE user_stats SET dailyrespectpoints = dailyrespectpoints - 1 WHERE Id = '" + Session.GetHabbo().Id + "' LIMIT 1");
             }
             ServerMessage Message = new ServerMessage(440u);
             Message.AppendUInt(class2.GetClient().GetHabbo().Id);
             Message.AppendInt32(class2.GetClient().GetHabbo().Respect);
             @class.SendMessage(Message, null);
             Session.GetHabbo().CheckRespectGivedAchievements();
             class2.GetClient().GetHabbo().CheckRespectReceivedAchievements();
             if (Session.GetHabbo().CurrentQuestId == 5u)
             {
                 GoldTree.GetGame().GetQuestManager().ProgressUserQuest(5u, Session);
             }
         }
     }
 }
 public void Handle(GameClient Session, ClientMessage Event)
 {
     ServerMessage Message = new ServerMessage(620u);
     Message.AppendInt32(1);
     Message.AppendInt32(1);
     Message.AppendInt32(10);
     for (int i = 187; i < 191; i++)
     {
         Message.AppendInt32(i);
     }
     Message.AppendInt32(7);
     Message.AppendInt32(0);
     Message.AppendInt32(1);
     Message.AppendInt32(2);
     Message.AppendInt32(3);
     Message.AppendInt32(4);
     Message.AppendInt32(5);
     Message.AppendInt32(6);
     Message.AppendInt32(11);
     Message.AppendInt32(0);
     Message.AppendInt32(1);
     Message.AppendInt32(2);
     Message.AppendInt32(3);
     Message.AppendInt32(4);
     Message.AppendInt32(5);
     Message.AppendInt32(6);
     Message.AppendInt32(7);
     Message.AppendInt32(8);
     Message.AppendInt32(9);
     Message.AppendInt32(10);
     Message.AppendInt32(1);
     Session.SendMessage(Message);
 }
 public void Handle(GameClient Session, ClientMessage Event)
 {
     Room @class = GoldTree.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
     if (@class != null && @class.CheckRights(Session, true))
     {
         ServerMessage Message = new ServerMessage(465u);
         Message.AppendUInt(@class.Id);
         Message.AppendStringWithBreak(@class.Name);
         Message.AppendStringWithBreak(@class.Description);
         Message.AppendInt32(@class.State);
         Message.AppendInt32(@class.Category);
         Message.AppendInt32(@class.UsersMax);
         Message.AppendInt32(100);
         Message.AppendInt32(@class.Tags.Count);
         foreach (string current in @class.Tags)
         {
             Message.AppendStringWithBreak(current);
         }
         Message.AppendInt32(@class.UsersWithRights.Count);
         foreach (uint current2 in @class.UsersWithRights)
         {
             Message.AppendUInt(current2);
             Message.AppendStringWithBreak(GoldTree.GetGame().GetClientManager().GetNameById(current2));
         }
         Message.AppendInt32(@class.UsersWithRights.Count);
         Message.AppendBoolean(@class.AllowPet);
         Message.AppendBoolean(@class.AllowPetsEating);
         Message.AppendBoolean(@class.AllowWalkthrough);
         Message.AppendBoolean(@class.Hidewall);
         Message.AppendInt32(@class.Wallthick);
         Message.AppendInt32(@class.Floorthick);
         Session.SendMessage(Message);
     }
 }
 public void Handle(GameClient Session, ClientMessage Event)
 {
     Room @class = GoldTree.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
     if (@class != null && !Session.GetHabbo().list_4.Contains(@class.Id) && [email protected](Session, true))
     {
         switch (Event.PopWiredInt32())
         {
         case -1:
             @class.Score--;
             break;
         case 0:
             return;
         case 1:
             @class.Score++;
             break;
         default:
             return;
         }
         using (DatabaseClient class2 = GoldTree.GetDatabase().GetClient())
         {
             class2.ExecuteQuery(string.Concat(new object[]
             {
                 "UPDATE rooms SET score = '",
                 @class.Score,
                 "' WHERE Id = '",
                 @class.Id,
                 "' LIMIT 1"
             }));
         }
         Session.GetHabbo().list_4.Add(@class.Id);
         ServerMessage Message = new ServerMessage(345u);
         Message.AppendInt32(@class.Score);
         Session.SendMessage(Message);
     }
 }
 public void method_10(string string_0, string string_1)
 {
     ServerMessage Message = new ServerMessage(161u);
     Message.AppendStringWithBreak(string_0);
     Message.AppendStringWithBreak(string_1);
     this.GetConnection().SendMessage(Message);
 }
 public void Handle(GameClient Session, ClientMessage Event)
 {
     uint num = Event.PopWiredUInt();
     RoomData @class = GoldTree.GetGame().GetRoomManager().method_12(num);
     if (@class == null || Session.GetHabbo().list_1.Count >= 30 || Session.GetHabbo().list_1.Contains(num) || @class.Type == "public")
     {
         ServerMessage Message = new ServerMessage(33u);
         Message.AppendInt32(-9001);
         Session.SendMessage(Message);
     }
     else
     {
         ServerMessage Message2 = new ServerMessage(459u);
         Message2.AppendUInt(num);
         Message2.AppendBoolean(true);
         Session.SendMessage(Message2);
         Session.GetHabbo().list_1.Add(num);
         using (DatabaseClient class2 = GoldTree.GetDatabase().GetClient())
         {
             class2.ExecuteQuery(string.Concat(new object[]
             {
                 "INSERT INTO user_favorites (user_id,room_id) VALUES ('",
                 Session.GetHabbo().Id,
                 "','",
                 num,
                 "')"
             }));
         }
     }
 }
 public void Handle(GameClient Session, ClientMessage Event)
 {
     Room class14_ = Session.GetHabbo().CurrentRoom;
     if (class14_ != null)
     {
         Event.PopWiredUInt();
         string string_ = Event.PopFixedString();
         RoomUser @class = class14_.method_56(string_);
         if (@class != null)
         {
             uint uint_ = @class.GetClient().GetHabbo().Id;
             if (Session.GetHabbo().list_2.Contains(uint_))
             {
                 Session.GetHabbo().list_2.Remove(uint_);
                 using (DatabaseClient class2 = GoldTree.GetDatabase().GetClient())
                 {
                     class2.ExecuteQuery(string.Concat(new object[]
                     {
                         "DELETE FROM user_ignores WHERE user_id = ",
                         Session.GetHabbo().Id,
                         " AND ignore_id = ",
                         uint_,
                         " LIMIT 1;"
                     }));
                 }
                 ServerMessage Message = new ServerMessage(419u);
                 Message.AppendInt32(3);
                 Session.SendMessage(Message);
             }
         }
     }
 }
 public void Handle(GameClient Session, ClientMessage Event)
 {
     Room room = GoldTree.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
     if (room != null)
     {
         RoomUser roomUserByHabbo = room.GetRoomUserByHabbo(Session.GetHabbo().Id);
         if (roomUserByHabbo != null)
         {
             roomUserByHabbo.Unidle();
             int num = Event.PopWiredInt32();
             if (num < 0 || num > 4 || (!Session.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_club") && num > 1))
             {
                 num = 0;
             }
             if (num > 0 && roomUserByHabbo.CarryItemID > 0)
             {
                 roomUserByHabbo.CarryItem(0);
             }
             roomUserByHabbo.DanceId = num;
             ServerMessage serverMessage = new ServerMessage(480u);
             serverMessage.AppendInt32(roomUserByHabbo.VirtualId);
             serverMessage.AppendInt32(num);
             room.SendMessage(serverMessage, null);
             if (Session.GetHabbo().CurrentQuestId > 0 && GoldTree.GetGame().GetQuestManager().GetQuestAction(Session.GetHabbo().CurrentQuestId) == "DANCE")
             {
                 GoldTree.GetGame().GetQuestManager().ProgressUserQuest(Session.GetHabbo().CurrentQuestId, Session);
             }
         }
     }
 }
 public override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRights)
 {
     if (UserHasRights && Session != null)
     {
         Item.method_9();
         ServerMessage Message = new ServerMessage(652u);
         Message.AppendInt32(0);
         Message.AppendInt32(5);
         if (Item.string_5.Length > 0)
         {
             Message.AppendString(Item.string_5);
         }
         else
         {
             Message.AppendInt32(0);
         }
         Message.AppendInt32(Item.GetBaseItem().Sprite);
         Message.AppendUInt(Item.uint_0);
         Message.AppendStringWithBreak("");
         Message.AppendString("J");
         if (Item.string_3.Length > 0)
         {
             Message.AppendString(Item.string_3);
         }
         else
         {
             Message.AppendString("HHH");
         }
         Session.SendMessage(Message);
     }
 }
 public void Handle(GameClient Session, ClientMessage Event)
 {
     uint num = Event.PopWiredUInt();
     Event.PopFixedString();
     Event.PopWiredInt32();
     RoomData @class = GoldTree.GetGame().GetRoomManager().method_12(num);
     if (@class != null)
     {
         if (@class.Type == "private")
         {
             ServerMessage Message = new ServerMessage(286u);
             Message.AppendBoolean(@class.IsPublicRoom);
             Message.AppendUInt(num);
             Session.SendMessage(Message);
         }
         else
         {
             ServerMessage Message2 = new ServerMessage(453u);
             Message2.AppendUInt(@class.Id);
             Message2.AppendStringWithBreak(@class.CCTs);
             Message2.AppendUInt(@class.Id);
             Session.SendMessage(Message2);
         }
     }
 }
        public void Handle(GameClient Session, ClientMessage Event)
        {
            int num = Event.PopWiredInt32();
            ServerMessage Message = new ServerMessage(300u);
            Message.AppendInt32(num);
            if (num > 0)
            {
                for (int i = 0; i < num; i++)
                {
                    int num2 = Event.PopWiredInt32();
                    if (num2 > 0)
                    {
                        /*Soundtrack @class = GoldTree.GetGame().GetItemManager().method_4(num2);
                        Message.AppendInt32(@class.Id);
                        Message.AppendStringWithBreak(@class.Name);
                        Message.AppendStringWithBreak(@class.Track);
                        Message.AppendInt32(@class.Length);
                        Message.AppendStringWithBreak(@class.Author);*/

                        Message.AppendInt32(SongManager.GetSong(num2).Id);
                        Message.AppendStringWithBreak(SongManager.GetSong(num2).Name);
                        Message.AppendStringWithBreak(SongManager.GetSong(num2).Track);
                        Message.AppendInt32(SongManager.GetSong(num2).Length);
                        Message.AppendStringWithBreak(SongManager.GetSong(num2).Author);
                    }
                }
            }
            Session.SendMessage(Message);
        }
 public void Handle(GameClient Session, ClientMessage Event)
 {
     ServerMessage Message = new ServerMessage(308u);
     Message.AppendInt32(Session.GetHabbo().Volume);
     Message.AppendBoolean(false);
     Session.SendMessage(Message);
 }
        public void Handle(GameClient Session, ClientMessage Event)
        {
            if (Session.GetHabbo() == null)
            {
                Session.method_6(Event.PopFixedString());
                if (Session.GetHabbo() != null && Session.GetHabbo().list_2 != null && Session.GetHabbo().list_2.Count > 0)
                {
                    using (DatabaseClient @class = GoldTree.GetDatabase().GetClient())
                    {
                        try
                        {
                            ServerMessage Message = new ServerMessage(420u);
                            Message.AppendInt32(Session.GetHabbo().list_2.Count);
                            foreach (uint current in Session.GetHabbo().list_2)
                            {
                                string string_ = @class.ReadString("SELECT username FROM users WHERE Id = " + current + " LIMIT 1;");
                                Message.AppendStringWithBreak(string_);
                            }
                            Session.SendMessage(Message);
                        }
                        catch
                        {
                            Console.ForegroundColor = ConsoleColor.Red;
                            Logging.WriteLine("Login error: User is ignoring a user that no longer exists");
                            Console.ForegroundColor = ConsoleColor.Gray;
                        }

                    }
                }
            }
        }
 public void Handle(GameClient Session, ClientMessage Event)
 {
     uint num = Event.PopWiredUInt();
     Room room = GoldTree.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
     if (room != null)
     {
         RoomUser roomUserByHabbo = room.GetRoomUserByHabbo(num);
         if (room != null && room.CheckRights(Session, true) && roomUserByHabbo != null && !roomUserByHabbo.IsBot && !room.UsersWithRights.Contains(num))
         {
             room.UsersWithRights.Add(num);
             using (DatabaseClient client = GoldTree.GetDatabase().GetClient())
             {
                 client.ExecuteQuery(string.Concat(new object[]
                 {
                     "INSERT INTO room_rights (room_id,user_id) VALUES (",
                     room.Id,
                     ",",
                     num,
                     ")"
                 }));
             }
             ServerMessage serverMessage = new ServerMessage(510u);
             serverMessage.AppendUInt(room.Id);
             serverMessage.AppendUInt(num);
             serverMessage.AppendStringWithBreak(roomUserByHabbo.GetClient().GetHabbo().Username);
             Session.SendMessage(serverMessage);
             roomUserByHabbo.AddStatus("flatctrl", "");
             roomUserByHabbo.UpdateNeeded = true;
             roomUserByHabbo.GetClient().SendMessage(new ServerMessage(42u));
         }
     }
 }
 public void Handle(GameClient Session, ClientMessage Event)
 {
     uint num = Event.PopWiredUInt();
     string text = GoldTree.FilterString(Event.PopFixedString());
     if (Session != null && Session.GetHabbo() != null && Session.GetHabbo().GetMessenger() != null)
     {
         if (num == 0u && Session.GetHabbo().HasFuse("cmd_sa"))
         {
             ServerMessage Message = new ServerMessage(134u);
             Message.AppendUInt(0u);
             Message.AppendString(Session.GetHabbo().Username + ": " + text);
             GoldTree.GetGame().GetClientManager().method_17(Session, Message);
         }
         else
         {
             if (num == 0u)
             {
                 ServerMessage Message2 = new ServerMessage(261u);
                 Message2.AppendInt32(4);
                 Message2.AppendUInt(0u);
                 Session.SendMessage(Message2);
             }
             else
             {
                 if (Session != null && Session.GetHabbo() != null)
                 {
                     Session.GetHabbo().GetMessenger().method_18(num, text);
                 }
             }
         }
     }
 }
 public void Handle(GameClient Session, ClientMessage Event)
 {
     try
     {
         Room @class = GoldTree.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
         if (@class != null && @class.CheckRights(Session, true) && @class.class67_0 != null)
         {
             ServerMessage Message = new ServerMessage(365u);
             Message.AppendInt32(@class.class67_0.Presets.Count);
             Message.AppendInt32(@class.class67_0.CurrentPreset);
             int num = 0;
             foreach (MoodlightPreset current in @class.class67_0.Presets)
             {
                 num++;
                 Message.AppendInt32(num);
                 Message.AppendInt32(int.Parse(GoldTree.smethod_4(current.BackgroundOnly)) + 1);
                 Message.AppendStringWithBreak(current.ColorCode);
                 Message.AppendInt32(current.ColorIntensity);
             }
             Session.SendMessage(Message);
         }
     }
     catch
     {
     }
 }
 public void Destroy()
 {
     this.Session = null;
     this.RequestHandlers = null;
     this.Request = null;
     this.Response = null;
 }
Ejemplo n.º 25
0
 public ServerMessage method_10(string string_0)
 {
     DataTable dataTable = null;
     using (DatabaseClient @class = GoldTree.GetDatabase().GetClient())
     {
         @class.AddParamWithValue("query", string_0);
         dataTable = @class.ReadDataTable("SELECT Id,title FROM help_topics WHERE title LIKE @query OR body LIKE @query LIMIT 25");
     }
     ServerMessage Message = new ServerMessage(521u);
     ServerMessage result;
     if (dataTable == null)
     {
         Message.AppendBoolean(false);
         result = Message;
     }
     else
     {
         Message.AppendInt32(dataTable.Rows.Count);
         foreach (DataRow dataRow in dataTable.Rows)
         {
             Message.AppendUInt((uint)dataRow["Id"]);
             Message.AppendStringWithBreak((string)dataRow["title"]);
         }
         result = Message;
     }
     return result;
 }
 public void Handle(GameClient Session, ClientMessage Event)
 {
     if (GoldTree.GetGame().GetModerationTool().method_9(Session.GetHabbo().Id))
     {
         GoldTree.GetGame().GetModerationTool().method_10(Session.GetHabbo().Id);
         ServerMessage Message5_ = new ServerMessage(320u);
         Session.SendMessage(Message5_);
     }
 }
 public void Handle(GameClient Session, ClientMessage Event)
 {
     try
     {
         Room @class = GoldTree.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
         if (@class != null)
         {
             if (@class.method_72("stickiepole") > 0 || @class.method_26(Session))
             {
                 uint uint_ = Event.PopWiredUInt();
                 string text = Event.PopFixedString();
                 string[] array = text.Split(new char[]
                 {
                     ' '
                 });
                 if (array[0].Contains("-"))
                 {
                     array[0] = array[0].Replace("-", "");
                 }
                 UserItem class2 = Session.GetHabbo().method_23().method_10(uint_);
                 if (class2 != null)
                 {
                     if (array[0].StartsWith(":"))
                     {
                         string text2 = @class.method_98(text);
                         if (text2 == null)
                         {
                             ServerMessage Message = new ServerMessage(516u);
                             Message.AppendInt32(11);
                             Session.SendMessage(Message);
                             return;
                         }
                         RoomItem RoomItem_ = new RoomItem(class2.uint_0, @class.Id, class2.uint_1, class2.string_0, 0, 0, 0.0, 0, text2, @class);
                         if (@class.method_82(Session, RoomItem_, true, null))
                         {
                             Session.GetHabbo().method_23().method_12(uint_, 1u, false);
                         }
                     }
                     using (DatabaseClient class3 = GoldTree.GetDatabase().GetClient())
                     {
                         class3.ExecuteQuery(string.Concat(new object[]
                         {
                             "UPDATE items SET room_id = '",
                             @class.Id,
                             "' WHERE Id = '",
                             class2.uint_0,
                             "' LIMIT 1"
                         }));
                     }
                 }
             }
         }
     }
     catch
     {
     }
 }
 public void Handle(GameClient Session, ClientMessage Event)
 {
     Session.GetHabbo().method_22().method_5();
     using (DatabaseClient @class = GoldTree.GetDatabase().GetClient())
     {
         @class.ExecuteQuery("UPDATE user_badges SET badge_slot = '0' WHERE user_id = '" + Session.GetHabbo().Id + "'");
         goto IL_131;
     }
     IL_52:
     int num = Event.PopWiredInt32();
     string text = Event.PopFixedString();
     if (text.Length != 0)
     {
         if (!Session.GetHabbo().method_22().method_1(text) || num < 1 || num > 5)
         {
             return;
         }
         if (Session.GetHabbo().CurrentQuestId == 16u)
         {
             GoldTree.GetGame().GetQuestManager().ProgressUserQuest(16u, Session);
         }
         Session.GetHabbo().method_22().method_0(text).Slot = num;
         using (DatabaseClient @class = GoldTree.GetDatabase().GetClient())
         {
             @class.AddParamWithValue("slotid", num);
             @class.AddParamWithValue("badge", text);
             @class.AddParamWithValue("userid", Session.GetHabbo().Id);
             @class.ExecuteQuery("UPDATE user_badges SET badge_slot = @slotid WHERE badge_id = @badge AND user_id = @userid LIMIT 1");
         }
     }
     IL_131:
     if (Event.RemainingLength > 0)
     {
         goto IL_52;
     }
     ServerMessage Message = new ServerMessage(228u);
     Message.AppendUInt(Session.GetHabbo().Id);
     Message.AppendInt32(Session.GetHabbo().method_22().Int32_1);
     foreach (Badge current in Session.GetHabbo().method_22().List_0)
     {
         if (current.Slot > 0)
         {
             Message.AppendInt32(current.Slot);
             Message.AppendStringWithBreak(current.Code);
         }
     }
     if (Session.GetHabbo().InRoom && GoldTree.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId) != null)
     {
         GoldTree.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId).SendMessage(Message, null);
     }
     else
     {
         Session.SendMessage(Message);
     }
 }
 public void Handle(GameClient Session, ClientMessage Event)
 {
     Room @class = GoldTree.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
     if (@class != null && @class.CheckRights(Session, true) && @class.Event != null)
     {
         @class.Event = null;
         ServerMessage Message = new ServerMessage(370u);
         Message.AppendStringWithBreak("-1");
         @class.SendMessage(Message, null);
     }
 }
        public void Handle(GameClient Session, ClientMessage Event)
        {
            ServerMessage Message = new ServerMessage(950u);
            int StreamCount = 0;
            foreach (DataRow dRow in Session.GetHabbo().Class12_0.DataTable_12.Rows)
            {
                StreamCount = StreamCount + 1;
            }
            DataTable dataTable_ = Session.GetHabbo().Class12_0.DataTable_12;
            foreach (DataRow dataRow in dataTable_.Rows)
            {
                int type = (int)dataRow["type"];
                if (type == 1)
                {
                    DataRow[] DataRow_ = Session.GetHabbo().Class12_0.DataTable_8.Select("id = " + (uint)dataRow["userid"]);
                    uint userid = (uint)dataRow["userid"];
                    string username = (string)DataRow_[0]["username"];
                    string gender = (string)dataRow["gender"].ToString().ToLower();
                    string look = (string)dataRow["look"];
                    int time = (int)((GoldTree.GetUnixTimestamp() - (double)dataRow["time"]) / 60);
                    string data = (string)dataRow["data"];

                    Message.AppendInt32(StreamCount);
                    Message.AppendUInt(1u);
                    Message.AppendInt32(type);
                    Message.AppendStringWithBreak(userid.ToString());
                    Message.AppendStringWithBreak(username);
                    Message.AppendStringWithBreak(gender);
                    Message.AppendStringWithBreak("http://127.0.0.1/retro/r63/c_images/friendstream/index.gif?figure=" + look + ".gif");
                    Message.AppendInt32WithBreak(time);
                    Message.AppendInt32WithBreak(type + 1);

                    uint RoomID;
                    RoomData RoomData;
                    if (uint.TryParse(data, out RoomID))
                        RoomData = GoldTree.GetGame().GetRoomManager().method_12(RoomID);
                    else
                        RoomData = GoldTree.GetGame().GetRoomManager().method_12(0);

                    if (RoomData != null)
                    {
                        Message.AppendStringWithBreak(RoomData.Id.ToString()); //data
                        Message.AppendStringWithBreak(RoomData.Name); //extra data
                    }
                    else
                    {
                        Message.AppendStringWithBreak("");
                        Message.AppendStringWithBreak("Room deleted");
                    }
                }
            }
            Session.SendMessage(Message);
        }
Ejemplo n.º 31
0
 public GameClientMessageHandler(GameClient Session)
 {
     this.Session         = Session;
     this.RequestHandlers = new GameClientMessageHandler.Delegate[HIGHEST_MESSAGE_ID];
     this.Response        = new ServerMessage(0);
 }
Ejemplo n.º 32
0
        public void method_6()
        {
            Room @class = GoldTree.GetGame().GetRoomManager().GetRoom(this.Session.GetHabbo().uint_2);

            if (@class != null && this.Session.GetHabbo().bool_5)
            {
                ServerMessage Message = new ServerMessage(69u);
                Message.AppendStringWithBreak(@class.ModelName);
                Message.AppendUInt(@class.Id);
                this.Session.SendMessage(Message);
                if (this.Session.GetHabbo().bool_8)
                {
                    ServerMessage Message2 = new ServerMessage(254u);
                    this.Session.SendMessage(Message2);
                }
                if (@class.Type == "private")
                {
                    if (@class.Wallpaper != "0.0")
                    {
                        ServerMessage Message3 = new ServerMessage(46u);
                        Message3.AppendStringWithBreak("wallpaper");
                        Message3.AppendStringWithBreak(@class.Wallpaper);
                        this.Session.SendMessage(Message3);
                    }
                    if (@class.Floor != "0.0")
                    {
                        ServerMessage Logging = new ServerMessage(46u);
                        Logging.AppendStringWithBreak("floor");
                        Logging.AppendStringWithBreak(@class.Floor);
                        this.Session.SendMessage(Logging);
                    }
                    ServerMessage Message5 = new ServerMessage(46u);
                    Message5.AppendStringWithBreak("landscape");
                    Message5.AppendStringWithBreak(@class.Landscape);
                    this.Session.SendMessage(Message5);
                    if (@class.CheckRights(this.Session, true))
                    {
                        ServerMessage Message6 = new ServerMessage(42u);
                        this.Session.SendMessage(Message6);
                        ServerMessage Message7 = new ServerMessage(47u);
                        this.Session.SendMessage(Message7);
                    }
                    else
                    {
                        if (@class.method_26(this.Session))
                        {
                            ServerMessage Message6 = new ServerMessage(42u);
                            this.Session.SendMessage(Message6);
                        }
                    }
                    ServerMessage Message8 = new ServerMessage(345u);
                    if (this.Session.GetHabbo().list_4.Contains(@class.Id) || @class.CheckRights(this.Session, true))
                    {
                        Message8.AppendInt32(@class.Score);
                    }
                    else
                    {
                        Message8.AppendInt32(-1);
                    }
                    this.Session.SendMessage(Message8);
                    if (@class.Boolean_0)
                    {
                        this.Session.SendMessage(@class.Event.Serialize(this.Session));
                    }
                    else
                    {
                        ServerMessage Message9 = new ServerMessage(370u);
                        Message9.AppendStringWithBreak("-1");
                        this.Session.SendMessage(Message9);
                    }
                }
                this.method_4();
            }
        }
Ejemplo n.º 33
0
 public void method_5(uint uint_0, string string_0)
 {
     this.method_7();
     if (GoldTree.GetGame().GetRoomManager().method_12(uint_0) != null)
     {
         if (this.Session.GetHabbo().InRoom)
         {
             Room @class = GoldTree.GetGame().GetRoomManager().GetRoom(this.Session.GetHabbo().CurrentRoomId);
             if (@class != null)
             {
                 @class.method_47(this.Session, false, false);
             }
         }
         Room class2 = GoldTree.GetGame().GetRoomManager().method_15(uint_0);
         if (class2 != null)
         {
             this.Session.GetHabbo().uint_2 = uint_0;
             if (class2.method_68(this.Session.GetHabbo().Id))
             {
                 if (!class2.method_71(this.Session.GetHabbo().Id))
                 {
                     ServerMessage Message = new ServerMessage(224u);
                     Message.AppendInt32(4);
                     this.Session.SendMessage(Message);
                     ServerMessage Message2 = new ServerMessage(18u);
                     this.Session.SendMessage(Message2);
                     return;
                 }
                 class2.method_69(this.Session.GetHabbo().Id);
             }
             if (class2.UsersNow >= class2.UsersMax && !GoldTree.GetGame().GetRoleManager().method_1(this.Session.GetHabbo().Rank, "acc_enter_fullrooms") && !this.Session.GetHabbo().Vip)
             {
                 ServerMessage Message = new ServerMessage(224u);
                 Message.AppendInt32(1);
                 this.Session.SendMessage(Message);
                 ServerMessage Message2 = new ServerMessage(18u);
                 this.Session.SendMessage(Message2);
             }
             else
             {
                 if (class2.Type == "public")
                 {
                     if (class2.State > 0 && !this.Session.GetHabbo().HasFuse("acc_restrictedrooms"))
                     {
                         this.Session.SendNotif("This public room is accessible to GoldTree staff only.");
                         ServerMessage Message2 = new ServerMessage(18u);
                         this.Session.SendMessage(Message2);
                         return;
                     }
                     ServerMessage Message3 = new ServerMessage(166u);
                     Message3.AppendStringWithBreak("/client/public/" + class2.ModelName + "/0");
                     this.Session.SendMessage(Message3);
                 }
                 else
                 {
                     if (class2.Type == "private")
                     {
                         ServerMessage Logging = new ServerMessage(19u);
                         this.Session.SendMessage(Logging);
                         if (this.Session.GetHabbo().bool_7)
                         {
                             RoomItem class3 = class2.method_28(this.Session.GetHabbo().uint_5);
                             if (class3 == null)
                             {
                                 this.Session.GetHabbo().bool_7 = false;
                                 this.Session.GetHabbo().uint_5 = 0u;
                                 ServerMessage Message5 = new ServerMessage(131u);
                                 this.Session.SendMessage(Message5);
                                 return;
                             }
                         }
                         if (!this.Session.GetHabbo().HasFuse("acc_enter_anyroom") && !class2.CheckRights(this.Session, true) && !this.Session.GetHabbo().bool_7)
                         {
                             if (class2.State == 1)
                             {
                                 if (class2.Int32_0 == 0)
                                 {
                                     ServerMessage Message5 = new ServerMessage(131u);
                                     this.Session.SendMessage(Message5);
                                     return;
                                 }
                                 ServerMessage Message6 = new ServerMessage(91u);
                                 Message6.AppendStringWithBreak("");
                                 this.Session.SendMessage(Message6);
                                 this.Session.GetHabbo().bool_6 = true;
                                 ServerMessage Message7 = new ServerMessage(91u);
                                 Message7.AppendStringWithBreak(this.Session.GetHabbo().Username);
                                 class2.method_61(Message7);
                                 return;
                             }
                             else
                             {
                                 if (class2.State == 2 && string_0.ToLower() != class2.Password.ToLower())
                                 {
                                     ServerMessage Message8 = new ServerMessage(33u);
                                     Message8.AppendInt32(-100002);
                                     this.Session.SendMessage(Message8);
                                     ServerMessage Message2 = new ServerMessage(18u);
                                     this.Session.SendMessage(Message2);
                                     return;
                                 }
                             }
                         }
                         ServerMessage Message3 = new ServerMessage(166u);
                         Message3.AppendStringWithBreak("/client/private/" + class2.Id + "/Id");
                         this.Session.SendMessage(Message3);
                     }
                 }
                 this.Session.GetHabbo().bool_5 = true;
                 this.method_6();
             }
         }
     }
 }