public void Handle(GameClient Session, ClientMessage Event)
 {
     try
     {
         Room @class = HabboIM.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
         if (@class != null && @class.CheckRights(Session, true) && @class.MoodlightData != null)
         {
             RoomItem class2 = null;
             foreach (RoomItem class3 in @class.Hashtable_1.Values)
             {
                 if (class3.GetBaseItem().InteractionType.ToLower() == "dimmer")
                 {
                     class2 = class3;
                     break;
                 }
             }
             if (class2 != null)
             {
                 if (@class.MoodlightData.Enabled)
                 {
                     @class.MoodlightData.method_1();
                 }
                 else
                 {
                     @class.MoodlightData.method_0();
                 }
                 class2.ExtraData = @class.MoodlightData.method_7();
                 class2.method_4();
             }
         }
     }
     catch
     {
     }
 }
Esempio n. 2
0
        public ServerMessage method_10(string string_0)
        {
            DataTable dataTable = null;

            using (DatabaseClient @class = HabboIM.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);
        }
Esempio n. 3
0
        public Item method_10()
        {
            switch (HabboIM.smethod_5(0, 6))
            {
            case 0:
                return(HabboIM.GetGame().GetItemManager().method_2(164U));

            case 1:
                return(HabboIM.GetGame().GetItemManager().method_2(165U));

            case 2:
                return(HabboIM.GetGame().GetItemManager().method_2(166U));

            case 3:
                return(HabboIM.GetGame().GetItemManager().method_2(167U));

            case 4:
                return(HabboIM.GetGame().GetItemManager().method_2(168U));

            case 5:
                return(HabboIM.GetGame().GetItemManager().method_2(169U));

            case 6:
                return(HabboIM.GetGame().GetItemManager().method_2(170U));

            default:
                return((Item)null);
            }
        }
 private void method_9(bool bool_1)
 {
     if (!this.bool_0 && bool_1)
     {
         this.bool_0 = true;
         try
         {
             base.Shutdown(SocketShutdown.Both);
             base.Close();
             base.Dispose();
         }
         catch
         {
         }
         Array.Clear(this.mDataBuffer, 0, this.mDataBuffer.Length);
         this.mDataBuffer                = null;
         this.mDataReceivedCallback      = null;
         this.mRouteReceivedDataCallback = null;
         HabboIM.GetSocketsManager().method_6(this.uint_0);
         AntiDDosSystem.FreeConnection(this.string_0);
         if (HabboIM.GetConfig().data["emu.messages.connections"] == "1")
         {
             Console.WriteLine(string.Concat(new object[]
             {
                 ">> Connection Dropped [",
                 this.uint_0,
                 "] from [",
                 this.String_0,
                 "]"
             }));
         }
     }
 }
Esempio n. 5
0
        public void Handle(GameClient Session, ClientMessage Event)
        {
            Room @class = HabboIM.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (@class != null)
            {
                if ([email protected])
                {
                    Session.GetHabbo().Whisper(HabboIMEnvironment.GetExternalText("trade_error_roomdisabled"));
                }
                else
                {
                    RoomUser class2 = @class.GetRoomUserByHabbo(Session.GetHabbo().Id);
                    RoomUser class3 = @class.method_52(Event.PopWiredInt32());
                    if (class2 != null && class3 != null && class3.GetClient().GetHabbo().TradingDisabled)
                    {
                        @class.method_77(class2, class3);
                    }
                    else
                    {
                        Session.GetHabbo().Whisper(HabboIMEnvironment.GetExternalText("trade_error_targetdisabled"));
                    }
                }
            }
        }
        public void Handle(GameClient Session, ClientMessage Event)
        {
            Room @class = HabboIM.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (@class != null)
            {
                RoomItem class2 = @class.method_28(Event.PopWiredUInt());
                if (class2 != null && !(class2.GetBaseItem().InteractionType.ToLower() != "postit"))
                {
                    string text  = Event.PopFixedString();
                    string text2 = text.Split(new char[]
                    {
                        ' '
                    })[0];
                    string str = HabboIM.DoFilter(text.Substring(text2.Length + 1), true, true);
                    if (@class.method_26(Session) || text.StartsWith(class2.ExtraData))
                    {
                        string text3 = text2;
                        if (text3 != null && (text3 == "FFFF33" || text3 == "FF9CFF" || text3 == "9CCEFF" || text3 == "9CFF9C"))
                        {
                            class2.ExtraData = text2 + " " + str;
                            class2.UpdateState(true, true);
                        }
                    }
                }
            }
        }
Esempio n. 7
0
        public ServerMessage ComposeBadgeListMessage()
        {
            List <Badge> list = new List <Badge>();

            ServerMessage Message = new ServerMessage(229u);

            Message.AppendInt32(this.BadgeCount);

            foreach (Badge current in this.Badges)
            {
                Message.AppendUInt(HabboIM.GetGame().GetAchievementManager().method_0(current.Code));
                Message.AppendStringWithBreak(current.Code);

                if (current.Slot > 0)
                {
                    list.Add(current);
                }
            }

            Message.AppendInt32(list.Count);

            foreach (Badge current in list)
            {
                Message.AppendInt32(current.Slot);
                Message.AppendStringWithBreak(current.Code);
            }

            return(Message);
        }
Esempio n. 8
0
        public void method_1(int int_1)
        {
            AvatarEffect @class = this.method_5(int_1, true);

            if (@class != null && @class.Boolean_0)
            {
                using (DatabaseClient class2 = HabboIM.GetDatabase().GetClient())
                {
                    class2.ExecuteQuery(string.Concat(new object[]
                    {
                        "DELETE FROM user_effects WHERE user_id = '",
                        this.uint_0,
                        "' AND effect_id = '",
                        int_1,
                        "' AND is_activated = '1' LIMIT 1"
                    }));
                }
                this.list_0.Remove(@class);
                ServerMessage Message = new ServerMessage(463u);
                Message.AppendInt32(int_1);
                this.method_8().SendMessage(Message);
                if (this.int_0 >= 0)
                {
                    this.method_2(-1, false);
                }
            }
        }
		public void Handle(GameClient Session, ClientMessage Event)
		{
			Room @class = HabboIM.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
			if (@class != null && Session.GetHabbo().RespectPoints > 0)
			{
				RoomUser class2 = @class.GetRoomUserByHabbo(Event.PopWiredUInt());
				if (class2 != null && class2.GetClient().GetHabbo().Id != Session.GetHabbo().Id && !class2.IsBot)
				{
					Session.GetHabbo().RespectPoints--;
					Session.GetHabbo().RespectGiven++;
					class2.GetClient().GetHabbo().Respect++;
					using (DatabaseClient class3 = HabboIM.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 > 0 && HabboIM.GetGame().GetQuestManager().GetQuestAction(Session.GetHabbo().CurrentQuestId) == "GIVE_RESPECT")
					{
                        HabboIM.GetGame().GetQuestManager().ProgressUserQuest(Session.GetHabbo().CurrentQuestId, Session);
					}
				}
			}
		}
Esempio n. 10
0
        public void RestoreStatistics(DatabaseClient dbClient, int status)
        {
            Console.BackgroundColor = ConsoleColor.Black;
            Logging.Write(HabboIMEnvironment.GetExternalText("emu_cleandb"));
            bool flag = true;

            try
            {
                if (int.Parse(HabboIM.GetConfig().data["debug"]) == 1)
                {
                    flag = false;
                }
            }
            catch
            {
            }
            if (flag)
            {
                Console.BackgroundColor = ConsoleColor.Black;
                dbClient.ExecuteQuery("UPDATE users SET online = '0' WHERE online != '0'", 30);
                dbClient.ExecuteQuery("UPDATE rooms SET users_now = '0' WHERE users_now != '0'", 30);
                dbClient.ExecuteQuery("UPDATE user_roomvisits SET exit_timestamp = UNIX_TIMESTAMP() WHERE exit_timestamp <= 0", 30);
                dbClient.ExecuteQuery(string.Concat(new object[]
                {
                    "UPDATE server_status SET status = '",
                    status,
                    "', users_online = '0', rooms_loaded = '0', server_ver = '",
                    HabboIM.Version,
                    "', stamp = UNIX_TIMESTAMP() LIMIT 1;"
                }), 30);
            }
            Logging.WriteLine("Fertig!", ConsoleColor.Green);
        }
Esempio n. 11
0
        public void method_3(int int_1)
        {
            AvatarEffect @class = this.method_5(int_1, false);

            if (@class != null && [email protected]_0 && [email protected]_0 && (this.method_8() != null && this.method_8().GetHabbo() != null))
            {
                Room class2 = this.method_9();
                if (class2 != null)
                {
                    RoomUser class3 = class2.GetRoomUserByHabbo(this.method_8().GetHabbo().Id);
                    if (class3.byte_1 <= 0 && class3.class34_1 == null)
                    {
                        using (DatabaseClient class4 = HabboIM.GetDatabase().GetClient())
                        {
                            class4.ExecuteQuery(string.Concat(new object[]
                            {
                                "UPDATE user_effects SET is_activated = '1', activated_stamp = '",
                                HabboIM.GetUnixTimestamp(),
                                "' WHERE user_id = '",
                                this.uint_0,
                                "' AND effect_id = '",
                                int_1,
                                "' LIMIT 1"
                            }));
                        }
                        @class.method_0();
                        ServerMessage Message = new ServerMessage(462u);
                        Message.AppendInt32(@class.int_0);
                        Message.AppendInt32(@class.int_1);
                        this.method_8().SendMessage(Message);
                    }
                }
            }
        }
Esempio n. 12
0
        public void Handle(GameClient Session, ClientMessage Event)
        {
            uint num = Event.PopWiredUInt();

            Event.PopFixedString();
            Event.PopWiredInt32();
            RoomData @class = HabboIM.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)
 {
     try
     {
         Room @class = HabboIM.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
         if (@class != null && @class.CheckRights(Session, true) && @class.MoodlightData != null)
         {
             ServerMessage Message = new ServerMessage(365u);
             Message.AppendInt32(@class.MoodlightData.Presets.Count);
             Message.AppendInt32(@class.MoodlightData.CurrentPreset);
             int num = 0;
             foreach (MoodlightPreset current in @class.MoodlightData.Presets)
             {
                 num++;
                 Message.AppendInt32(num);
                 Message.AppendInt32(int.Parse(HabboIM.BooleanToString(current.BackgroundOnly)) + 1);
                 Message.AppendStringWithBreak(current.ColorCode);
                 Message.AppendInt32(current.ColorIntensity);
             }
             Session.SendMessage(Message);
         }
     }
     catch
     {
     }
 }
        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 = HabboIM.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);
                    }
                }
            }
        }
Esempio n. 15
0
        public void method_10()
        {
            List <UserItem> list_  = this.method_1(this.uint_1).OfferedItems;
            List <UserItem> list_2 = this.method_1(this.uint_2).OfferedItems;

            foreach (UserItem current in list_)
            {
                if (this.method_1(this.uint_1).method_1().GetHabbo().GetInventoryComponent().GetItemById(current.uint_0) == null)
                {
                    this.method_1(this.uint_1).method_1().SendNotification("Trade failed.");
                    this.method_1(this.uint_2).method_1().SendNotification("Trade failed.");
                    return;
                }
            }
            foreach (UserItem current in list_2)
            {
                if (this.method_1(this.uint_2).method_1().GetHabbo().GetInventoryComponent().GetItemById(current.uint_0) == null)
                {
                    this.method_1(this.uint_1).method_1().SendNotification("Trade failed.");
                    this.method_1(this.uint_2).method_1().SendNotification("Trade failed.");
                    return;
                }
            }
            this.method_1(this.uint_2).method_1().GetHabbo().GetInventoryComponent().SavePets();
            this.method_1(this.uint_1).method_1().GetHabbo().GetInventoryComponent().SavePets();
            foreach (UserItem current in list_)
            {
                using (DatabaseClient @class = HabboIM.GetDatabase().GetClient())
                {
                    @class.ExecuteQuery(string.Concat(new object[]
                    {
                        "UPDATE items SET room_id = '0', user_id = '",
                        this.method_1(this.uint_2).method_1().GetHabbo().Id,
                        "' WHERE Id = '",
                        current.uint_0,
                        "' LIMIT 1"
                    }));
                }
                this.method_1(this.uint_1).method_1().GetHabbo().GetInventoryComponent().method_12(current.uint_0, this.method_1(this.uint_2).method_1().GetHabbo().Id, true);
                this.method_1(this.uint_2).method_1().GetHabbo().GetInventoryComponent().method_11(current.uint_0, current.uint_1, current.string_0, false);
            }
            foreach (UserItem current in list_2)
            {
                using (DatabaseClient @class = HabboIM.GetDatabase().GetClient())
                {
                    @class.ExecuteQuery(string.Concat(new object[]
                    {
                        "UPDATE items SET room_id = '0', user_id = '",
                        this.method_1(this.uint_1).method_1().GetHabbo().Id,
                        "' WHERE Id = '",
                        current.uint_0,
                        "' LIMIT 1"
                    }));
                }
                this.method_1(this.uint_2).method_1().GetHabbo().GetInventoryComponent().method_12(current.uint_0, this.method_1(this.uint_1).method_1().GetHabbo().Id, true);
                this.method_1(this.uint_1).method_1().GetHabbo().GetInventoryComponent().method_11(current.uint_0, current.uint_1, current.string_0, false);
            }
            this.method_1(this.uint_1).method_1().GetHabbo().GetInventoryComponent().method_9(true);
            this.method_1(this.uint_2).method_1().GetHabbo().GetInventoryComponent().method_9(true);
        }
Esempio n. 16
0
        public void Handle(GameClient Session, ClientMessage Event)
        {
            uint     num    = Event.PopWiredUInt();
            RoomData @class = HabboIM.GetGame().GetRoomManager().method_12(num);

            if (num == 0u || (@class != null && !(@class.Owner.ToLower() != Session.GetHabbo().Username.ToLower())))
            {
                Session.GetHabbo().HomeRoomId = num;
                using (DatabaseClient class2 = HabboIM.GetDatabase().GetClient())
                {
                    class2.ExecuteQuery(string.Concat(new object[]
                    {
                        "UPDATE users SET home_room = '",
                        num,
                        "' WHERE Id = '",
                        Session.GetHabbo().Id,
                        "' LIMIT 1;"
                    }));
                    Session.GetHabbo().Whisper("Dein Hauptwohnsitz wurde erfolgreich aktualisiert!");
                }
                ServerMessage Message = new ServerMessage(455u);
                Message.AppendUInt(num);
                Session.SendMessage(Message);
            }
        }
 internal void SavePets()
 {
     using (DatabaseClient dbClient = HabboIM.GetDatabase().GetClient())
     {
         this.SavePets(dbClient, false);
     }
 }
 public void Handle(GameClient Session, ClientMessage Event)
 {
     if (Session.GetHabbo().HasFuse("acc_chatlogs"))
     {
         Session.SendMessage(HabboIM.GetGame().GetModerationTool().method_20(Event.PopWiredUInt()));
     }
 }
Esempio n. 19
0
        public void AddBadge(string code, int slotId, bool addToDatabase)
        {
            if (this.HasBadge(code))
            {
                return;
            }

            if (addToDatabase)
            {
                using (DatabaseClient dbClient = HabboIM.GetDatabase().GetClient())
                {
                    dbClient.AddParamWithValue("badge", code);

                    dbClient.ExecuteQuery(string.Concat(new object[]
                    {
                        "INSERT INTO user_badges (user_id,badge_id,badge_slot) VALUES ('",
                        this.UserId,
                        "',@badge,'",
                        slotId,
                        "')"
                    }));
                }
            }

            this.Badges.Add(new Badge(code, slotId));
        }
Esempio n. 20
0
        public void Handle(GameClient Session, ClientMessage Event)
        {
            uint num    = Event.PopWiredUInt();
            Room @class = HabboIM.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (@class != null && [email protected])
            {
                RoomUser class2 = @class.method_48(num);
                if (class2 == null || class2.PetData == null)
                {
                    DataRow dataRow = null;
                    using (DatabaseClient class3 = HabboIM.GetDatabase().GetClient())
                    {
                        class3.AddParamWithValue("petid", num);
                        dataRow = class3.ReadDataRow("SELECT Id, user_id, room_id, name, type, race, color, expirience, energy, nutrition, respect, createstamp, x, y, z FROM user_pets WHERE Id = @petid LIMIT 1");
                    }
                    if (dataRow != null)
                    {
                        Session.SendMessage(HabboIM.GetGame().GetCatalog().method_12(dataRow).SerializeInfo());
                    }
                }
                else
                {
                    Session.SendMessage(class2.PetData.SerializeInfo());
                }
            }
        }
 public void Handle(GameClient Session, ClientMessage Event)
 {
     if (Session != null && Session.GetHabbo() != null)
     {
         Event.PopWiredInt32();
         Room @class = HabboIM.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
         if (@class != null && @class.CheckRights(Session, true))
         {
             RoomItem class2 = @class.method_28(Event.PopWiredUInt());
             if (class2 != null)
             {
                 string text = class2.GetBaseItem().InteractionType.ToLower();
                 if (text == null || !(text == "postit"))
                 {
                     @class.method_29(Session, class2.uint_0, false, true);
                     Session.GetHabbo().GetInventoryComponent().method_11(class2.uint_0, class2.uint_2, class2.ExtraData, false);
                     Session.GetHabbo().GetInventoryComponent().method_9(true);
                     if (Session.GetHabbo().CurrentQuestId > 0 && HabboIM.GetGame().GetQuestManager().GetQuestAction(Session.GetHabbo().CurrentQuestId) == "PICKUPITEM")
                     {
                         HabboIM.GetGame().GetQuestManager().ProgressUserQuest(Session.GetHabbo().CurrentQuestId, Session);
                     }
                 }
             }
         }
     }
 }
Esempio n. 22
0
        public void Handle(GameClient session, ClientMessage message)
        {
            if (session != null && session.GetHabbo() != null)
            {
                Room room = HabboIM.GetGame().GetRoomManager().GetRoom(session.GetHabbo().CurrentRoomId);

                if (room != null)
                {
                    RoomUser targetUser = room.GetRoomUserByHabbo(message.PopWiredUInt());

                    if (targetUser != null && !targetUser.IsBot && targetUser.GetClient() != null)
                    {
                        ServerMessage Message = new ServerMessage(228u);

                        Message.AppendUInt(targetUser.GetClient().GetHabbo().Id);
                        Message.AppendInt32(targetUser.GetClient().GetHabbo().GetBadgeComponent().VisibleBadges);

                        using (TimedLock.Lock(targetUser.GetClient().GetHabbo().GetBadgeComponent().GetBadges()))
                        {
                            foreach (Badge current in targetUser.GetClient().GetHabbo().GetBadgeComponent().GetBadges())
                            {
                                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(36u);

            Message.AppendInt32(HabboIM.GetGame().GetCatalog().method_8(Event.PopFixedString()) ? 0 : 2);
            Session.SendMessage(Message);
        }
Esempio n. 24
0
        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 = HabboIM.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);
                    }
                }
            }
        }
Esempio n. 25
0
 public void Handle(GameClient Session, ClientMessage Event)
 {
     if (Session != null)
     {
         Session.SendMessage(HabboIM.GetGame().GetNavigator().method_12(Session, -3));
     }
 }
Esempio n. 26
0
        private int method_4()
        {
            RoomUser @class = base.GetRoomUser();
            int      result = 5;

            if (@class.PetData.Level >= 1)
            {
                result = HabboIM.smethod_5(1, 8);
            }
            else
            {
                if (@class.PetData.Level >= 5)
                {
                    result = HabboIM.smethod_5(1, 7);
                }
                else
                {
                    if (@class.PetData.Level >= 10)
                    {
                        result = HabboIM.smethod_5(1, 6);
                    }
                }
            }
            return(result);
        }
Esempio n. 27
0
        public void method_7(string string_0, uint uint_1, uint uint_2, int int_0)
        {
            CatalogItem catalogItem = this.method_5(int_0).method_1(uint_2);
            uint        num         = this.method_14();
            Item        obj         = this.method_10();

            using (DatabaseClient client = HabboIM.GetDatabase().GetClient())
            {
                client.AddParamWithValue("gift_message", (object)("!" + ChatCommandHandler.smethod_4(HabboIM.DoFilter(string_0, true, true))));
                client.ExecuteQuery("INSERT INTO items (Id,user_id,base_item,wall_pos) VALUES ('" + (object)num + "','" + (object)uint_1 + "','" + (object)obj.UInt32_0 + "','')", 30);
                client.ExecuteQuery(string.Concat(new object[3]
                {
                    (object)"INSERT INTO items_extra_data (item_id,extra_data) VALUES ('",
                    (object)num,
                    (object)"',@gift_message)"
                }), 30);
                client.ExecuteQuery("INSERT INTO user_presents (item_id,base_id,amount,extra_data) VALUES ('" + (object)num + "','" + (object)catalogItem.method_0().UInt32_0 + "','" + (object)catalogItem.int_3 + "','')", 30);
            }
            GameClient gameClient = HabboIM.GetGame().GetClientManager().method_2(uint_1);

            if (gameClient == null)
            {
                return;
            }
            gameClient.SendNotification("Du hast ein Geschenk in Inventar erhalten!");
            gameClient.GetHabbo().GetInventoryComponent().method_9(true);
        }
 public void Handle(GameClient Session, ClientMessage Event)
 {
     if (Session != null && Session.GetConnection() != null)
     {
         Session.GetConnection().SendData(HabboIM.GetGame().GetNavigator().SerializeNavigator(Session, Event.PopFixedInt32()));
     }
 }
Esempio n. 29
0
        public EcotronReward method_15()
        {
            uint uint_1 = 1;

            if (HabboIM.smethod_5(1, 2000) == 2000)
            {
                uint_1 = 5U;
            }
            else if (HabboIM.smethod_5(1, 200) == 200)
            {
                uint_1 = 4U;
            }
            else if (HabboIM.smethod_5(1, 40) == 40)
            {
                uint_1 = 3U;
            }
            else if (HabboIM.smethod_5(1, 4) == 4)
            {
                uint_1 = 2U;
            }
            List <EcotronReward> list = this.method_16(uint_1);

            if (list != null && list.Count >= 1)
            {
                return(list[HabboIM.smethod_5(0, list.Count - 1)]);
            }
            return(new EcotronReward(0U, 0U, 1479U, 0U));
        }
        public void Handle(GameClient Session, ClientMessage Event)
        {
            Room @class = HabboIM.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(HabboIM.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);
            }
        }