예제 #1
0
        public void Handle(GameClient Session, ClientMessage Event)
        {
            Room @class = HabboIM.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (@class != null && @class.CheckRights(Session, true))
            {
                UserItem class2 = Session.GetHabbo().GetInventoryComponent().GetItemById(Event.PopWiredUInt());
                if (class2 != null)
                {
                    string text = "floor";
                    if (class2.method_1().Name.ToLower().Contains("wallpaper"))
                    {
                        text = "wallpaper";
                    }
                    else
                    {
                        if (class2.method_1().Name.ToLower().Contains("landscape"))
                        {
                            text = "landscape";
                        }
                    }
                    string text2 = text;
                    if (text2 != null)
                    {
                        if (!(text2 == "floor"))
                        {
                            if (!(text2 == "wallpaper"))
                            {
                                if (text2 == "landscape")
                                {
                                    @class.Landscape = class2.string_0;
                                }
                            }
                            else
                            {
                                @class.Wallpaper = class2.string_0;
                                if (Session.GetHabbo().CurrentQuestId > 0 && HabboIM.GetGame().GetQuestManager().GetQuestAction(Session.GetHabbo().CurrentQuestId) == "PLACEWALLPAPER")
                                {
                                    HabboIM.GetGame().GetQuestManager().ProgressUserQuest(Session.GetHabbo().CurrentQuestId, Session);
                                }
                            }
                        }
                        else
                        {
                            @class.Floor = class2.string_0;
                            if (Session.GetHabbo().CurrentQuestId > 0 && HabboIM.GetGame().GetQuestManager().GetQuestAction(Session.GetHabbo().CurrentQuestId) == "PLACEFLOOR")
                            {
                                HabboIM.GetGame().GetQuestManager().ProgressUserQuest(Session.GetHabbo().CurrentQuestId, Session);
                            }
                        }
                    }
                    using (DatabaseClient class3 = HabboIM.GetDatabase().GetClient())
                    {
                        class3.AddParamWithValue("extradata", class2.string_0);
                        class3.ExecuteQuery(string.Concat(new object[]
                        {
                            "UPDATE rooms SET ",
                            text,
                            " = @extradata WHERE Id = '",
                            @class.Id,
                            "' LIMIT 1"
                        }));
                    }
                    Session.GetHabbo().GetInventoryComponent().method_12(class2.uint_0, 0u, false);
                    ServerMessage Message = new ServerMessage(46u);
                    Message.AppendStringWithBreak(text);
                    Message.AppendStringWithBreak(class2.string_0);
                    @class.SendMessage(Message, null);
                    HabboIM.GetGame().GetRoomManager().method_18(@class.Id);
                }
            }
        }
        public void Handle(GameClient Session, ClientMessage Event)
        {
            if (Session != null && Session.GetHabbo() != null)
            {
                Room @class = HabboIM.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
                if (@class != null && @class.method_26(Session) && (ServerConfiguration.AllowFurniDrops || !(@class.Owner != Session.GetHabbo().Username)))
                {
                    string   text  = Event.PopFixedString();
                    string[] array = text.Split(new char[]
                    {
                        ' '
                    });
                    if (array[0].Contains("-"))
                    {
                        array[0] = array[0].Replace("-", "");
                    }
                    uint uint_ = 0u;
                    try
                    {
                        uint_ = uint.Parse(array[0]);
                    }
                    catch
                    {
                        return;
                    }
                    UserItem class2 = Session.GetHabbo().GetInventoryComponent().GetItemById(uint_);
                    if (class2 != null)
                    {
                        string text2 = class2.method_1().InteractionType.ToLower();
                        if (text2 != null && text2 == "dimmer" && @class.method_72("dimmer") >= 1)
                        {
                            Session.SendNotification("You can only have one moodlight in a room.");
                        }
                        else if (text2 != null && text2 == "jukebox" && @class.method_72("jukebox") >= 1)
                        {
                            Session.SendNotification("You can only have one jukebox in a room.");
                        }
                        else
                        {
                            RoomItem RoomItem_;
                            if (array[1].StartsWith(":"))
                            {
                                string text3 = @class.method_98(":" + text.Split(new char[]
                                {
                                    ':'
                                })[1]);
                                if (text3 == null)
                                {
                                    ServerMessage Message = new ServerMessage(516u);
                                    Message.AppendInt32(11);
                                    Session.SendMessage(Message);
                                    return;
                                }
                                RoomItem_ = new RoomItem(class2.uint_0, @class.Id, class2.uint_1, class2.string_0, 0, 0, 0.0, 0, text3, @class);
                                if ([email protected]_82(Session, RoomItem_, true, null))
                                {
                                    goto IL_32C;
                                }
                                Session.GetHabbo().GetInventoryComponent().method_12(uint_, 1u, false);
                                using (DatabaseClient class3 = HabboIM.GetDatabase().GetClient())
                                {
                                    class3.ExecuteQuery(string.Concat(new object[]
                                    {
                                        "UPDATE items SET room_id = '",
                                        @class.Id,
                                        "' WHERE Id = '",
                                        class2.uint_0,
                                        "' LIMIT 1"
                                    }));
                                    goto IL_32C;
                                }
                            }
                            int int_  = int.Parse(array[1]);
                            int int_2 = int.Parse(array[2]);
                            int int_3 = int.Parse(array[3]);
                            RoomItem_ = new RoomItem(class2.uint_0, @class.Id, class2.uint_1, class2.string_0, 0, 0, 0.0, 0, "", @class);
                            if (@class.method_79(Session, RoomItem_, int_, int_2, int_3, true, false, false))
                            {
                                Session.GetHabbo().GetInventoryComponent().method_12(uint_, 1u, false);
                                using (DatabaseClient class3 = HabboIM.GetDatabase().GetClient())
                                {
                                    class3.ExecuteQuery(string.Concat(new object[]
                                    {
                                        "UPDATE items SET room_id = '",
                                        @class.Id,
                                        "' WHERE Id = '",
                                        class2.uint_0,
                                        "' LIMIT 1"
                                    }));
                                }
                            }
IL_32C:
                            if (Session.GetHabbo().CurrentQuestId > 0 && HabboIM.GetGame().GetQuestManager().GetQuestAction(Session.GetHabbo().CurrentQuestId) == "PLACEITEM")
                            {
                                HabboIM.GetGame().GetQuestManager().ProgressUserQuest(Session.GetHabbo().CurrentQuestId, Session);
                            }
                        }
                    }
                }
            }
        }
예제 #3
0
        internal void CloseAll()
        {
            StringBuilder stringBuilder = new StringBuilder();
            bool          flag          = false;

            using (DatabaseClient dbClient = HabboIM.GetDatabase().GetClient())
            {
                for (int i = 0; i < this.Clients.Length; i++)
                {
                    GameClient client = this.Clients[i];
                    if (client != null && client.GetHabbo() != null)
                    {
                        try
                        {
                            client.GetHabbo().GetInventoryComponent().SavePets(dbClient, true);
                            stringBuilder.Append(client.GetHabbo().UpdateQuery);
                            flag = true;
                        }
                        catch
                        {
                        }
                    }
                }
                if (flag)
                {
                    try
                    {
                        dbClient.ExecuteQuery(stringBuilder.ToString(), 30);
                    }
                    catch (Exception ex)
                    {
                        Logging.HandleException(ex.ToString());
                    }
                }
            }
            Console.WriteLine("Done saving users inventory!");
            Console.WriteLine("Closing server connections...");
            try
            {
                for (int i = 0; i < this.Clients.Length; i++)
                {
                    GameClient class2 = this.Clients[i];
                    if (class2 != null && class2.GetConnection() != null)
                    {
                        try
                        {
                            class2.GetConnection().Close();
                        }
                        catch
                        {
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Logging.HandleException(ex.ToString());
            }
            Array.Clear(this.Clients, 0, this.Clients.Length);
            Console.WriteLine("Connections closed!");
        }
예제 #4
0
        public void addAchievement(GameClient Session, uint uint_0, int int_0)
        {
            if (!AchievementManager.dictionary_0.ContainsKey(uint_0))
            {
                Console.ForegroundColor = ConsoleColor.Blue;
                Console.WriteLine("AchievementID: " + uint_0 + " does not exist in our database!");
                Console.ForegroundColor = ConsoleColor.White;
            }
            else
            {
                Achievement @class = AchievementManager.dictionary_0[uint_0];
                if (@class != null && !this.method_1(Session, @class.Id, int_0) && int_0 >= 1 && int_0 <= @class.Levels)
                {
                    int num  = AchievementManager.smethod_2(@class.Dynamic_badgelevel, @class.PixelMultiplier, int_0);
                    int num2 = AchievementManager.smethod_2(@class.ScoreBase, @class.PixelMultiplier, int_0);
                    using (TimedLock.Lock(Session.GetHabbo().GetBadgeComponent().GetBadges()))
                    {
                        List <string> list = new List <string>();
                        foreach (Badge current in Session.GetHabbo().GetBadgeComponent().GetBadges())
                        {
                            if (current.Code.StartsWith(@class.BadgeCode))
                            {
                                list.Add(current.Code);
                            }
                        }
                        foreach (string current2 in list)
                        {
                            Session.GetHabbo().GetBadgeComponent().RemoveBadge(current2);
                        }
                    }
                    Session.GetHabbo().GetBadgeComponent().SendBadge(Session, AchievementManager.smethod_3(@class.BadgeCode, int_0, @class.DynamicBadgeLevel), true);
                    if (Session.GetHabbo().dictionary_0.ContainsKey(@class.Id))
                    {
                        Session.GetHabbo().dictionary_0[@class.Id] = int_0;
                        using (DatabaseClient class2 = HabboIM.GetDatabase().GetClient())
                        {
                            class2.ExecuteQuery(string.Concat(new object[]
                            {
                                "UPDATE user_achievements SET achievement_level = '",
                                int_0,
                                "' WHERE user_id = '",
                                Session.GetHabbo().Id,
                                "' AND achievement_id = '",
                                @class.Id,
                                "' LIMIT 1; UPDATE user_stats SET AchievementScore = AchievementScore + ",
                                num2,
                                " WHERE Id = '",
                                Session.GetHabbo().Id,
                                "' LIMIT 1; "
                            }));
                            goto IL_346;
                        }
                    }
                    Session.GetHabbo().dictionary_0.Add(@class.Id, int_0);
                    using (DatabaseClient class2 = HabboIM.GetDatabase().GetClient())
                    {
                        class2.ExecuteQuery(string.Concat(new object[]
                        {
                            "INSERT INTO user_achievements (user_id,achievement_id,achievement_level) VALUES ('",
                            Session.GetHabbo().Id,
                            "','",
                            @class.Id,
                            "','",
                            int_0,
                            "'); UPDATE user_stats SET AchievementScore = AchievementScore + ",
                            num2,
                            " WHERE Id = '",
                            Session.GetHabbo().Id,
                            "' LIMIT 1; "
                        }));
                    }
IL_346:
                    ServerMessage Message = new ServerMessage(437u);
                    Message.AppendUInt(@class.Id);
                    Message.AppendInt32(int_0);
                    Message.AppendInt32(1337);
                    Message.AppendStringWithBreak(AchievementManager.smethod_3(@class.BadgeCode, int_0, @class.DynamicBadgeLevel));
                    Message.AppendInt32(num2);
                    Message.AppendInt32(num);
                    Message.AppendInt32(0);
                    Message.AppendInt32(0);
                    Message.AppendInt32(0);
                    if (int_0 > 1)
                    {
                        Message.AppendStringWithBreak(AchievementManager.smethod_3(@class.BadgeCode, int_0 - 1, @class.DynamicBadgeLevel));
                    }
                    else
                    {
                        Message.AppendStringWithBreak("");
                    }
                    Message.AppendStringWithBreak(@class.Type);
                    Session.SendMessage(Message);
                    Session.GetHabbo().AchievementScore += num2;
                    Session.GetHabbo().ActivityPoints   += num;
                    Session.GetHabbo().method_16(num);

                    if (Session.GetHabbo().FriendStreamEnabled)
                    {
                        using (DatabaseClient class2 = HabboIM.GetDatabase().GetClient())
                        {
                            string BadgeCode = "";
                            if (@class.DynamicBadgeLevel)
                            {
                                BadgeCode = @class.BadgeCode + int_0.ToString();
                            }
                            else
                            {
                                BadgeCode = @class.BadgeCode;
                            }

                            if (!string.IsNullOrEmpty(BadgeCode))
                            {
                                string look = HabboIM.FilterString(Session.GetHabbo().Figure);
                                class2.AddParamWithValue("look", look);
                                class2.ExecuteQuery("INSERT INTO `friend_stream` (`id`, `type`, `userid`, `gender`, `look`, `time`, `data`) VALUES (NULL, '2', '" + Session.GetHabbo().Id + "', '" + Session.GetHabbo().Gender + "', @look, UNIX_TIMESTAMP(), '" + BadgeCode + "');");
                            }
                        }
                    }
                }
            }
        }
예제 #5
0
        public void ParsePacket(string data)
        {
            string text = data.Split(new char[]
            {
                Convert.ToChar(1)
            })[0];
            string text2 = data.Split(new char[]
            {
                Convert.ToChar(1)
            })[1];
            GameClient client  = null;
            DataRow    dataRow = null;
            string     text3   = text.ToLower();

            if (text3 != null)
            {
                if (MusCommands.dictionary_0 == null)
                {
                    MusCommands.dictionary_0 = new Dictionary <string, int>(29)
                    {
                        {
                            "update_items",
                            0
                        },
                        {
                            "update_catalogue",
                            1
                        },
                        {
                            "update_catalog",
                            2
                        },
                        {
                            "updateusersrooms",
                            3
                        },
                        {
                            "senduser",
                            4
                        },
                        {
                            "updatevip",
                            5
                        },
                        {
                            "giftitem",
                            6
                        },
                        {
                            "giveitem",
                            7
                        },
                        {
                            "unloadroom",
                            8
                        },
                        {
                            "roomalert",
                            9
                        },
                        {
                            "updategroup",
                            10
                        },
                        {
                            "updateusersgroups",
                            11
                        },
                        {
                            "shutdown",
                            12
                        },
                        {
                            "update_filter",
                            13
                        },
                        {
                            "refresh_filter",
                            14
                        },
                        {
                            "updatecredits",
                            15
                        },
                        {
                            "updatesettings",
                            16
                        },
                        {
                            "updatepixels",
                            17
                        },
                        {
                            "updatepoints",
                            18
                        },
                        {
                            "reloadbans",
                            19
                        },
                        {
                            "update_bots",
                            20
                        },
                        {
                            "signout",
                            21
                        },
                        {
                            "exe",
                            22
                        },
                        {
                            "alert",
                            23
                        },
                        {
                            "sa",
                            24
                        },
                        {
                            "ha",
                            25
                        },
                        {
                            "hal",
                            26
                        },
                        {
                            "updatemotto",
                            27
                        },
                        {
                            "updatelook",
                            28
                        },
                        {
                            "infobuspoll",
                            29
                        },
                        {
                            "givebadge",
                            30
                        },
                        {
                            "addroom",
                            31
                        },
                        {
                            "updatescmd",
                            32
                        },
                        {
                            "whisperall",
                            33
                        }
                    };
                }
                int num;
                if (MusCommands.dictionary_0.TryGetValue(text3, out num))
                {
                    uint   uint_2;
                    string text5;
                    switch (num)
                    {
                    case 0:
                        using (DatabaseClient class2 = HabboIM.GetDatabase().GetClient())
                        {
                            HabboIM.GetGame().GetItemManager().method_0(class2);
                            goto IL_1379;
                        }
                        break;

                    case 1:
                    case 2:
                        break;

                    case 3:
                    {
                        Habbo class3 = HabboIM.GetGame().GetClientManager().method_2(Convert.ToUInt32(text2)).GetHabbo();
                        if (class3 != null)
                        {
                            using (DatabaseClient class2 = HabboIM.GetDatabase().GetClient())
                            {
                                class3.method_1(class2);
                            }
                        }
                        goto IL_1379;
                    }

                    case 4:
                    {
                        uint num2 = uint.Parse(text2.Split(new char[]
                            {
                                ' '
                            })[0]);
                        uint num3 = uint.Parse(text2.Split(new char[]
                            {
                                ' '
                            })[1]);
                        GameClient class4 = HabboIM.GetGame().GetClientManager().method_2(num2);
                        Room       class5 = HabboIM.GetGame().GetRoomManager().GetRoom(num3);
                        if (class4 != null)
                        {
                            ServerMessage Message7 = new ServerMessage(286u);
                            Message7.AppendBoolean(class5.IsPublic);
                            Message7.AppendUInt(num3);
                            class4.SendMessage(Message7);
                            goto IL_1379;
                        }
                        goto IL_1379;
                    }

                    case 5:
                    {
                        Habbo class3 = HabboIM.GetGame().GetClientManager().method_2(Convert.ToUInt32(text2)).GetHabbo();
                        if (class3 != null)
                        {
                            class3.UpdateRights();
                            goto IL_1379;
                        }
                        goto IL_1379;
                    }

                    case 6:
                    case 7:
                    {
                        uint num2 = uint.Parse(text2.Split(new char[]
                            {
                                ' '
                            })[0]);
                        uint uint_ = uint.Parse(text2.Split(new char[]
                            {
                                ' '
                            })[1]);
                        int int_ = int.Parse(text2.Split(new char[]
                            {
                                ' '
                            })[2]);
                        string string_ = text2.Substring(num2.ToString().Length + uint_.ToString().Length + int_.ToString().Length + 3);
                        HabboIM.GetGame().GetCatalog().method_7(string_, num2, uint_, int_);
                        goto IL_1379;
                    }

                    case 8:
                    {
                        uint_2 = uint.Parse(text2);
                        Room class5 = HabboIM.GetGame().GetRoomManager().GetRoom(uint_2);
                        HabboIM.GetGame().GetRoomManager().method_16(class5);
                        goto IL_1379;
                    }

                    case 9:
                    {
                        uint num3 = uint.Parse(text2.Split(new char[]
                            {
                                ' '
                            })[0]);
                        Room class5 = HabboIM.GetGame().GetRoomManager().GetRoom(num3);
                        if (class5 != null)
                        {
                            string string_2 = text2.Substring(num3.ToString().Length + 1);
                            for (int i = 0; i < class5.RoomUsers.Length; i++)
                            {
                                RoomUser class6 = class5.RoomUsers[i];
                                if (class6 != null)
                                {
                                    class6.GetClient().SendNotification(string_2);
                                }
                            }
                            goto IL_1379;
                        }
                        goto IL_1379;
                    }

                    case 10:
                    {
                        int int_2 = int.Parse(text2.Split(new char[]
                            {
                                ' '
                            })[0]);
                        using (DatabaseClient class2 = HabboIM.GetDatabase().GetClient())
                        {
                            Groups.smethod_3(class2, int_2);
                            goto IL_1379;
                        }
                        goto IL_5BF;
                    }

                    case 11:
                        goto IL_5BF;

                    case 12:
                        goto IL_119A;

                    case 13:
                    case 14:
                        using (DatabaseClient class2 = HabboIM.GetDatabase().GetClient())
                        {
                            ChatCommandHandler.InitWords(class2);
                            goto IL_1379;
                        }
                        goto IL_5F7;

                    case 15:
                        goto IL_5F7;

                    case 16:
                        using (DatabaseClient class2 = HabboIM.GetDatabase().GetClient())
                        {
                            HabboIM.GetGame().LoadServerSettings(class2);
                            goto IL_1379;
                        }
                        goto IL_62F;

                    case 17:
                        goto IL_62F;

                    case 18:
                        client = HabboIM.GetGame().GetClientManager().method_2(uint.Parse(text2));
                        if (client != null)
                        {
                            client.GetHabbo().UpdateVipPoints(true, false);
                            goto IL_1379;
                        }
                        goto IL_1379;

                    case 19:
                        using (DatabaseClient class2 = HabboIM.GetDatabase().GetClient())
                        {
                            HabboIM.GetGame().GetBanManager().Initialise(class2);
                        }
                        HabboIM.GetGame().GetClientManager().method_28();
                        goto IL_1379;

                    case 20:
                        using (DatabaseClient class2 = HabboIM.GetDatabase().GetClient())
                        {
                            HabboIM.GetGame().GetBotManager().method_0(class2);
                            goto IL_1379;
                        }
                        goto IL_6F1;

                    case 21:
                        goto IL_6F1;

                    case 22:
                        using (DatabaseClient class2 = HabboIM.GetDatabase().GetClient())
                        {
                            class2.ExecuteQuery(text2, 30);
                            goto IL_1379;
                        }
                        goto IL_727;

                    case 23:
                        goto IL_727;

                    case 24:
                    {
                        ServerMessage Message8 = new ServerMessage(134u);
                        Message8.AppendUInt(0u);
                        Message8.AppendString("System: " + text2);
                        HabboIM.GetGame().GetClientManager().method_16(Message8, Message8);
                        goto IL_1379;
                    }

                    case 25:
                    {
                        ServerMessage Message9 = new ServerMessage(808u);
                        Message9.AppendStringWithBreak(HabboIMEnvironment.GetExternalText("mus_ha_title"));
                        Message9.AppendStringWithBreak(text2);
                        ServerMessage Message10 = new ServerMessage(161u);
                        Message10.AppendStringWithBreak(text2);
                        HabboIM.GetGame().GetClientManager().method_15(Message9, Message10);
                        goto IL_1379;
                    }

                    case 26:
                    {
                        string text4 = text2.Split(new char[]
                            {
                                ' '
                            })[0];
                        text5 = text2.Substring(text4.Length + 1);
                        ServerMessage Message11 = new ServerMessage(161u);
                        Message11.AppendStringWithBreak(string.Concat(new string[]
                            {
                                HabboIMEnvironment.GetExternalText("mus_hal_title"),
                                "\r\n",
                                text5,
                                "\r\n-",
                                HabboIMEnvironment.GetExternalText("mus_hal_tail")
                            }));
                        Message11.AppendStringWithBreak(text4);
                        HabboIM.GetGame().GetClientManager().BroadcastMessage(Message11);
                        goto IL_1379;
                    }

                    case 27:
                    case 28:
                    {
                        uint_2 = uint.Parse(text2);
                        client = HabboIM.GetGame().GetClientManager().method_2(uint_2);
                        using (DatabaseClient class2 = HabboIM.GetDatabase().GetClient())
                        {
                            dataRow = class2.ReadDataRow("SELECT look,gender,motto,mutant_penalty,block_newfriends FROM users WHERE id = '" + client.GetHabbo().Id + "' LIMIT 1", 30);
                        }
                        client.GetHabbo().Figure          = (string)dataRow["look"];
                        client.GetHabbo().Gender          = dataRow["gender"].ToString().ToLower();
                        client.GetHabbo().Motto           = HabboIM.FilterString((string)dataRow["motto"]);
                        client.GetHabbo().BlockNewFriends = HabboIM.StringToBoolean(dataRow["block_newfriends"].ToString());
                        ServerMessage Message12           = new ServerMessage(266u);
                        Message12.AppendInt32(-1);
                        Message12.AppendStringWithBreak(client.GetHabbo().Figure);
                        Message12.AppendStringWithBreak(client.GetHabbo().Gender.ToLower());
                        Message12.AppendStringWithBreak(client.GetHabbo().Motto);
                        client.SendMessage(Message12);
                        if (client.GetHabbo().InRoom)
                        {
                            Room          class5    = HabboIM.GetGame().GetRoomManager().GetRoom(client.GetHabbo().CurrentRoomId);
                            RoomUser      class7    = class5.GetRoomUserByHabbo(client.GetHabbo().Id);
                            ServerMessage Message13 = new ServerMessage(266u);
                            Message13.AppendInt32(class7.VirtualId);
                            Message13.AppendStringWithBreak(client.GetHabbo().Figure);
                            Message13.AppendStringWithBreak(client.GetHabbo().Gender.ToLower());
                            Message13.AppendStringWithBreak(client.GetHabbo().Motto);
                            Message13.AppendInt32(client.GetHabbo().AchievementScore);
                            Message13.AppendStringWithBreak("");
                            class5.SendMessage(Message13, null);
                        }
                        text3 = text.ToLower();
                        if (text3 == null)
                        {
                            goto IL_1379;
                        }
                        if (text3 == "updatemotto")
                        {
                            client.GetHabbo().MottoAchievementsCompleted();
                            goto IL_1379;
                        }
                        if (text3 == "updatelook")
                        {
                            client.GetHabbo().AvatarLookAchievementsCompleted();
                            goto IL_1379;
                        }
                        goto IL_1379;
                    }

                    case 33:
                    {
                        HabboIM.GetGame().GetClientManager().method_WHISPER(text2);



                        goto IL_1379;
                    }

                    case 29:
                    {
                        int QuestionID = int.Parse(text2);
                        using (DatabaseClient dbClient = HabboIM.GetDatabase().GetClient())
                        {
                            DataRow   QuestionRow  = dbClient.ReadDataRow("SELECT * FROM infobus_questions WHERE id='" + QuestionID + "' LIMIT 1", 30);
                            string    Question     = dbClient.ReadString("SELECT question FROM infobus_questions WHERE id = '" + QuestionID + "' LIMIT 1", 30);
                            DataTable AnswersTable = dbClient.ReadDataTable("SELECT * FROM infobus_answers WHERE question_id='" + QuestionID + "'", 30);
                            Room      PollRoom     = HabboIM.GetGame().GetClientManager().GetClientByHabbo(QuestionRow["owner"].ToString()).GetHabbo().CurrentRoom;
                            PollRoom.CurrentPollId = QuestionID;
                            GameClient TargetUser = HabboIM.GetGame().GetClientManager().GetClientByHabbo(QuestionRow["owner"].ToString());
                            if (PollRoom.Owner == QuestionRow["owner"].ToString())
                            {
                                ServerMessage InfobusQuestion = new ServerMessage(79u);
                                InfobusQuestion.AppendStringWithBreak(Question);
                                InfobusQuestion.AppendInt32(AnswersTable.Rows.Count);
                                if (AnswersTable != null)
                                {
                                    foreach (DataRow Row in AnswersTable.Rows)
                                    {
                                        InfobusQuestion.AppendInt32((int)Row["id"]);
                                        InfobusQuestion.AppendStringWithBreak((string)Row["answer_text"]);
                                    }
                                }
                                PollRoom.SendMessage(InfobusQuestion, null);
                                Thread Infobus = new Thread(delegate()
                                    {
                                        Room.ShowResults(PollRoom, QuestionID, TargetUser);
                                    });
                                Infobus.Start();
                            }
                        }
                        goto IL_1379;
                    }

                    case 30:
                    {
                        uint UserId = uint.Parse(text2.Split(new char[]
                            {
                                ' '
                            })[0]);
                        string BadgeCode = text2.Split(new char[]
                            {
                                ' '
                            })[1];
                        GameClient Session = HabboIM.GetGame().GetClientManager().GetClientByHabbo(HabboIM.GetGame().GetClientManager().GetNameById(UserId));
                        Session.GetHabbo().GetBadgeComponent().SendBadge(Session, BadgeCode, true);
                        goto IL_1379;
                    }

                    case 31:
                    {
                        uint UserId = uint.Parse(text2.Split(new char[]
                            {
                                ' '
                            })[0]);
                        string RoomModel = text2.Split(new char[]
                            {
                                ' '
                            })[1];
                        string Caption = text2.Split(new char[]
                            {
                                ' '
                            })[2];
                        GameClient Session = HabboIM.GetGame().GetClientManager().GetClientByHabbo(HabboIM.GetGame().GetClientManager().GetNameById(UserId));
                        uint       uint_   = 0u;
                        using (DatabaseClient dbClient = HabboIM.GetDatabase().GetClient())
                        {
                            dbClient.AddParamWithValue("caption", Caption);
                            dbClient.AddParamWithValue("model", RoomModel);
                            dbClient.AddParamWithValue("username", Session.GetHabbo().Username);
                            dbClient.ExecuteQuery("INSERT INTO rooms (roomtype,caption,owner,model_name) VALUES ('private',@caption,@username,@model)", 30);
                            Session.GetHabbo().GetUserDataFactory().SetRooms(dbClient.ReadDataTable("SELECT * FROM rooms WHERE owner = @username ORDER BY Id ASC", 30));
                            uint_ = (uint)dbClient.ReadDataRow("SELECT Id FROM rooms WHERE owner = @username AND caption = @caption ORDER BY Id DESC", 30)[0];
                            Session.GetHabbo().method_1(dbClient);
                        }
                        RoomData result = HabboIM.GetGame().GetRoomManager().method_12(uint_);
                        if (result != null)
                        {
                            ServerMessage Message8 = new ServerMessage(59u);
                            Message8.AppendUInt(result.Id);
                            Message8.AppendStringWithBreak(result.Name);
                            Session.SendMessage(Message8);
                        }
                        goto IL_1379;
                    }

                    case 32:
                        uint_2 = uint.Parse(text2);
                        client = HabboIM.GetGame().GetClientManager().method_2(uint_2);
                        using (DatabaseClient class2 = HabboIM.GetDatabase().GetClient())
                        {
                            dataRow = class2.ReadDataRow("SELECT gc,block_newfriends,accept_trading,raumalert,werbercmd,changename FROM users WHERE id = '" + client.GetHabbo().Id + "' LIMIT 1", 30);
                        }
                        client.GetHabbo().Raumalert       = HabboIM.StringToBoolean(dataRow["raumalert"].ToString());
                        client.GetHabbo().WerberCmd       = HabboIM.StringToBoolean(dataRow["werbercmd"].ToString());
                        client.GetHabbo().BlockNewFriends = HabboIM.StringToBoolean(dataRow["block_newfriends"].ToString());
                        client.GetHabbo().TradingDisabled = HabboIM.StringToBoolean(dataRow["accept_trading"].ToString());
                        client.GetHabbo().ChangeName      = HabboIM.StringToBoolean(dataRow["changename"].ToString());
                        client.GetHabbo().gc = (int)dataRow["gc"];
                        goto IL_1379;

                    default:
                        goto IL_1379;
                    }
                    using (DatabaseClient class2 = HabboIM.GetDatabase().GetClient())
                    {
                        HabboIM.GetGame().GetCatalog().method_0(class2);
                    }
                    HabboIM.GetGame().GetCatalog().method_1();
                    HabboIM.GetGame().GetClientManager().BroadcastMessage(new ServerMessage(441u));
                    goto IL_1379;
IL_5BF:
                    uint_2 = uint.Parse(text2);
                    using (DatabaseClient class2 = HabboIM.GetDatabase().GetClient())
                    {
                        HabboIM.GetGame().GetClientManager().method_2(uint_2).GetHabbo().method_0(class2);
                        goto IL_1379;
                    }
                    goto IL_119A;
IL_5F7:
                    client = HabboIM.GetGame().GetClientManager().method_2(uint.Parse(text2));
                    if (client != null)
                    {
                        int int_3 = 0;
                        using (DatabaseClient class2 = HabboIM.GetDatabase().GetClient())
                        {
                            int_3 = (int)class2.ReadDataRow("SELECT credits FROM users WHERE id = '" + client.GetHabbo().Id + "' LIMIT 1", 30)[0];
                        }
                        client.GetHabbo().Credits = int_3;
                        client.GetHabbo().UpdateCredits(false);
                        goto IL_1379;
                    }
                    goto IL_1379;
IL_62F:
                    client = HabboIM.GetGame().GetClientManager().method_2(uint.Parse(text2));
                    if (client != null)
                    {
                        int int_4 = 0;
                        using (DatabaseClient class2 = HabboIM.GetDatabase().GetClient())
                        {
                            int_4 = (int)class2.ReadDataRow("SELECT activity_points FROM users WHERE id = '" + client.GetHabbo().Id + "' LIMIT 1", 30)[0];
                        }
                        client.GetHabbo().ActivityPoints = int_4;
                        client.GetHabbo().UpdateActivityPoints(false);
                        goto IL_1379;
                    }
                    goto IL_1379;
IL_6F1:
                    HabboIM.GetGame().GetClientManager().method_2(uint.Parse(text2)).method_12();
                    goto IL_1379;
IL_727:
                    string text6 = text2.Split(new char[]
                    {
                        ' '
                    })[0];
                    text5 = text2.Substring(text6.Length + 1);
                    ServerMessage Message14 = new ServerMessage(808u);
                    Message14.AppendStringWithBreak(HabboIMEnvironment.GetExternalText("mus_alert_title"));
                    Message14.AppendStringWithBreak(text5);
                    HabboIM.GetGame().GetClientManager().method_2(uint.Parse(text6)).SendMessage(Message14);
                    goto IL_1378;
IL_119A:
                    HabboIM.Close();
                }
                IL_1378 :;
            }
            IL_1379 :
            ServerMessage Message15 = new ServerMessage(1u);

            Message15.AppendString("Hallo Housekeeping :)");
            this.ClientSocket.Send(Message15.GetBytes());
        }
예제 #6
0
        public void Handle(GameClient Session, ClientMessage Event)
        {
            Room @class = HabboIM.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (@class != null && @class.CheckRights(Session, true))
            {
                Event.PopWiredInt32();
                Dictionary <int, int> dictionary = new Dictionary <int, int>();
                int num  = Event.PopWiredInt32();
                int num2 = Event.PopWiredInt32();
                int num3 = Event.PopWiredInt32();
                for (int i = 0; i < num3; i++)
                {
                    int num4 = Event.PopWiredInt32();
                    int num5 = Event.PopWiredInt32();
                    if (num4 < 0 || num4 > 10 || (num5 < 1 || num5 > 27) || dictionary.ContainsKey(num4))
                    {
                        return;
                    }
                    dictionary.Add(num4, num5);
                }
                if (num >= 1 && num <= 24 && (num2 >= 0 && num2 <= 11))
                {
                    StringBuilder stringBuilder = new StringBuilder();
                    int           num6          = 0;
                    foreach (KeyValuePair <int, int> current in dictionary)
                    {
                        if (num6 > 0)
                        {
                            stringBuilder.Append("|");
                        }
                        stringBuilder.Append(current.Key + "," + current.Value);
                        num6++;
                    }
                    using (DatabaseClient class2 = HabboIM.GetDatabase().GetClient())
                    {
                        class2.ExecuteQuery(string.Concat(new object[]
                        {
                            "UPDATE rooms SET icon_bg = '",
                            num,
                            "', icon_fg = '",
                            num2,
                            "', icon_items = '",
                            stringBuilder.ToString(),
                            "' WHERE Id = '",
                            @class.Id,
                            "' LIMIT 1"
                        }));
                    }
                    @class.RoomIcon = new RoomIcon(num, num2, dictionary);
                    ServerMessage Message = new ServerMessage(457u);
                    Message.AppendUInt(@class.Id);
                    Message.AppendBoolean(true);
                    Session.SendMessage(Message);
                    ServerMessage Message2 = new ServerMessage(456u);
                    Message2.AppendUInt(@class.Id);
                    Session.SendMessage(Message2);
                    RoomData      class27_ = @class.RoomData;
                    ServerMessage Message3 = new ServerMessage(454u);
                    Message3.AppendBoolean(false);
                    class27_.method_3(Message3, false, false);
                    Session.SendMessage(Message3);
                }
            }
        }
예제 #7
0
        public void Handle(GameClient Session, ClientMessage Event)
        {
            string text  = Event.PopFixedString().ToUpper();
            string text2 = HabboIM.FilterString(Event.PopFixedString());

            if (AntiMutant.ValidateLook(text2, text))
            {
                if (Session.GetHabbo().CurrentQuestId > 0 && HabboIM.GetGame().GetQuestManager().GetQuestAction(Session.GetHabbo().CurrentQuestId) == "CHANGE_FIGURE")
                {
                    HabboIM.GetGame().GetQuestManager().ProgressUserQuest(Session.GetHabbo().CurrentQuestId, Session);
                }
                Session.GetHabbo().Figure = text2;
                Session.GetHabbo().Gender = text.ToLower();
                using (DatabaseClient client = HabboIM.GetDatabase().GetClient())
                {
                    client.AddParamWithValue("look", text2);
                    client.AddParamWithValue("gender", text);
                    client.ExecuteQuery("UPDATE users SET look = @look, gender = @gender WHERE id = " + Session.GetHabbo().Id + " LIMIT 1;");
                }
                HabboIM.GetGame().GetAchievementManager().addAchievement(Session, 1u, 1);
                ServerMessage serverMessage = new ServerMessage(266u);
                serverMessage.AppendInt32(-1);
                serverMessage.AppendStringWithBreak(Session.GetHabbo().Figure);
                serverMessage.AppendStringWithBreak(Session.GetHabbo().Gender.ToLower());
                serverMessage.AppendStringWithBreak(Session.GetHabbo().Motto);
                serverMessage.AppendInt32(Session.GetHabbo().AchievementScore);
                serverMessage.AppendStringWithBreak("");
                Session.SendMessage(serverMessage);
                if (Session.GetHabbo().InRoom)
                {
                    Room currentRoom = Session.GetHabbo().CurrentRoom;
                    if (currentRoom != null)
                    {
                        RoomUser roomUserByHabbo = currentRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
                        if (roomUserByHabbo != null)
                        {
                            roomUserByHabbo.string_0 = "";
                            if (Session.GetHabbo().method_4() > 0)
                            {
                                TimeSpan timeSpan = DateTime.Now - Session.GetHabbo().dateTime_0;
                                if (timeSpan.Seconds > 4)
                                {
                                    Session.GetHabbo().int_23 = 0;
                                }
                                if (timeSpan.Seconds < 4 && Session.GetHabbo().int_23 > 5)
                                {
                                    ServerMessage serverMessage2 = new ServerMessage(27u);
                                    serverMessage2.AppendInt32(Session.GetHabbo().method_4());
                                    Session.SendMessage(serverMessage2);
                                    return;
                                }
                                Session.GetHabbo().dateTime_0 = DateTime.Now;
                                Session.GetHabbo().int_23++;
                            }
                            ServerMessage serverMessage3 = new ServerMessage(266u);
                            serverMessage3.AppendInt32(roomUserByHabbo.VirtualId);
                            serverMessage3.AppendStringWithBreak(Session.GetHabbo().Figure);
                            serverMessage3.AppendStringWithBreak(Session.GetHabbo().Gender.ToLower());
                            serverMessage3.AppendStringWithBreak(Session.GetHabbo().Motto);
                            serverMessage3.AppendInt32(Session.GetHabbo().AchievementScore);
                            serverMessage3.AppendStringWithBreak("");
                            currentRoom.SendMessage(serverMessage3, null);
                            Session.GetHabbo().Whisper("Wow, siehst du Toll aus!");
                        }
                    }
                }
            }
        }
예제 #8
0
        public ServerMessage method_5(int int_0, int int_1, string string_0, int int_2)
        {
            DataTable     dataTable     = null;
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append("WHERE state = '1' AND timestamp >= " + this.method_4());
            if (int_0 >= 0)
            {
                stringBuilder.Append(" AND total_price > " + int_0);
            }
            if (int_1 >= 0)
            {
                stringBuilder.Append(" AND total_price < " + int_1);
            }
            string text;

            switch (int_2)
            {
            case 1:
                text = "ORDER BY asking_price DESC";
                goto IL_82;
            }
            text = "ORDER BY asking_price ASC";
IL_82:
            using (DatabaseClient @class = HabboIM.GetDatabase().GetClient())
            {
                @class.AddParamWithValue("search_query", "%" + string_0 + "%");
                if (string_0.Length >= 1)
                {
                    stringBuilder.Append(" AND public_name LIKE @search_query");
                }
                dataTable = @class.ReadDataTable(string.Concat(new string[]
                {
                    "SELECT offer_id, item_type, sprite_id, total_price FROM catalog_marketplace_offers ",
                    stringBuilder.ToString(),
                    " ",
                    text,
                    " LIMIT 500"
                }));
            }
            ServerMessage Message = new ServerMessage(615u);

            this.list_1.Clear();
            this.list_0.Clear();
            if (dataTable != null)
            {
                foreach (DataRow dataRow in dataTable.Rows)
                {
                    if (!this.list_0.Contains((uint)dataRow["offer_id"]))
                    {
                        MarketplaceOffers item = new MarketplaceOffers((uint)dataRow["offer_id"], (int)dataRow["sprite_id"], (int)dataRow["total_price"], int.Parse(dataRow["item_type"].ToString()));
                        this.list_0.Add((uint)dataRow["offer_id"]);
                        this.list_1.Add(item);
                    }
                }
                return(this.method_6(int_0, int_1));
            }
            else
            {
                Message.AppendInt32(0);
                return(Message);
            }
        }
예제 #9
0
        public override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRights)
        {
            RoomUser User = Item.method_8().GetRoomUserByHabbo((uint)Session.GetHabbo().Id);

            if (User == null)
            {
                return;
            }

            if (Request == 0 && Item.FireWorkCount > 0 && Item.ExtraData == "1")
            {
                Item.ExtraData = "2";
                Item.UpdateState(false, true);

                if (Item.FireWorkCount > 0)
                {
                    Task T = null;
                    T = new Task(delegate() { Action(Item, T, "1"); });
                    T.Start();
                }
                else
                {
                    Task T = null;
                    T = new Task(delegate() { Action(Item, T, "0"); });
                    T.Start();
                }
            }
            else if (Request == 1)
            {
                ServerMessage PixelMessage = new ServerMessage(629);
                PixelMessage.AppendUInt(Item.uint_0);
                PixelMessage.AppendInt32(Item.FireWorkCount);
                PixelMessage.AppendBoolean(false);
                PixelMessage.AppendInt32(Pixels);    // pixels :D
                PixelMessage.AppendBoolean(false);
                PixelMessage.AppendInt32(Fireworks); // 10 fireworks :D
                Session.SendMessage(PixelMessage);
            }
            else if (Request == 2 && Session.GetHabbo().ActivityPoints >= 20)
            {
                Item.FireWorkCount += Fireworks;

                Session.GetHabbo().FireworkPixelLoadedCount += Pixels;
                Session.GetHabbo().ActivityPoints           -= 20;
                Session.GetHabbo().UpdateActivityPoints(true);

                using (DatabaseClient dbClient = HabboIM.GetDatabase().GetClient())
                {
                    dbClient.AddParamWithValue("itemid", Item.uint_0);
                    dbClient.AddParamWithValue("sessionid", Session.GetHabbo().Id);
                    dbClient.ExecuteQuery("UPDATE items_firework SET fw_count = fw_count + '" + Fireworks + "' WHERE item_id = @itemid LIMIT 1");
                    dbClient.ExecuteQuery("UPDATE user_stats SET fireworks = fireworks + '" + Pixels + "' WHERE id = @sessionid LIMIT 1");
                }

                ServerMessage PixelMessage = new ServerMessage(629);
                PixelMessage.AppendUInt(Item.uint_0);
                PixelMessage.AppendInt32(Item.FireWorkCount);
                PixelMessage.AppendBoolean(false);
                PixelMessage.AppendInt32(Pixels);    // pixels :D
                PixelMessage.AppendBoolean(false);
                PixelMessage.AppendInt32(Fireworks); // 10 fireworks :D
                Session.SendMessage(PixelMessage);

                if (Item.ExtraData == "0")
                {
                    Item.ExtraData = "1";
                    Item.UpdateState(true, true);
                }

                Session.GetHabbo().CheckFireworkAchievements();
            }
        }
        public void Handle(GameClient Session, ClientMessage Event)
        {
            string text = HabboIM.DoFilter(Event.PopFixedString(), false, true);

            if (text.Length < 3)
            {
                ServerMessage Message = new ServerMessage(571u);
                Message.AppendString("J");
                Session.SendMessage(Message);
            }
            else
            {
                if (text.Length > 15)
                {
                    ServerMessage Message = new ServerMessage(571u);
                    Message.AppendString("K");
                    Session.SendMessage(Message);
                }
                else
                {
                    if (text.Contains(" ") || !Session.GetClientMessageHandler().method_8(text) || text != ChatCommandHandler.smethod_4(text))
                    {
                        ServerMessage Message = new ServerMessage(571u);
                        Message.AppendString("QA");
                        Session.SendMessage(Message);
                    }
                    else
                    {
                        if (Event.Header == "GW")
                        {
                            ServerMessage Message = new ServerMessage(571u);
                            Message.AppendString("H");
                            Message.AppendString(text);
                            Session.SendMessage(Message);
                        }
                        else
                        {
                            if (Event.Header == "GV")
                            {
                                ServerMessage Message2 = new ServerMessage(570u);
                                Message2.AppendString("H");
                                Session.SendMessage(Message2);
                                ServerMessage Message3 = new ServerMessage(572u);
                                Message3.AppendUInt(Session.GetHabbo().Id);
                                Message3.AppendString("H");
                                Message3.AppendString(text);
                                Session.SendMessage(Message3);
                                if (Session.GetHabbo().CurrentRoomId > 0u)
                                {
                                    Room          @class   = HabboIM.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
                                    RoomUser      class2   = @class.GetRoomUserByHabbo(Session.GetHabbo().Id);
                                    ServerMessage Message4 = new ServerMessage(28u);
                                    Message4.AppendInt32(1);
                                    class2.method_14(Message4);
                                    @class.SendMessage(Message4, null);
                                }
                                Dictionary <Room, int> dictionary = HabboIM.GetGame().GetRoomManager().method_22();
                                IEnumerable <Room>     arg_204_0  = dictionary.Keys;
                                if (ChangeUserNameMessageEvent.func_0 == null)
                                {
                                    ChangeUserNameMessageEvent.func_0 = new Func <Room, int>(ChangeUserNameMessageEvent.smethod_0);
                                }
                                IOrderedEnumerable <Room> orderedEnumerable = arg_204_0.OrderByDescending(ChangeUserNameMessageEvent.func_0);
                                foreach (Room current in orderedEnumerable)
                                {
                                    if (current.Owner == Session.GetHabbo().Username)
                                    {
                                        current.Owner = text;
                                        HabboIM.GetGame().GetRoomManager().method_16(HabboIM.GetGame().GetRoomManager().GetRoom(current.Id));
                                    }
                                }
                                using (DatabaseClient class3 = HabboIM.GetDatabase().GetClient())
                                {
                                    class3.ExecuteQuery(string.Concat(new string[]
                                    {
                                        "UPDATE rooms SET owner = '",
                                        text,
                                        "' WHERE owner = '",
                                        Session.GetHabbo().Username,
                                        "'"
                                    }));
                                    class3.ExecuteQuery(string.Concat(new object[]
                                    {
                                        "UPDATE users SET username = '******' WHERE Id = '",
                                        Session.GetHabbo().Id,
                                        "' LIMIT 1"
                                    }));
                                    HabboIM.GetGame().GetClientManager().method_31(Session, "flagme", "OldName: " + Session.GetHabbo().Username + " NewName: " + text);
                                    Session.GetHabbo().Username = text;
                                    Session.GetHabbo().method_1(class3);
                                    foreach (RoomData current2 in Session.GetHabbo().OwnedRooms)
                                    {
                                        current2.Owner = text;
                                    }
                                }
                                Session.GetHabbo().ChangeNamaAchievementsCompleted();
                            }
                        }
                    }
                }
            }
        }
예제 #11
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 = HabboIM.GetGame().GetRoomManager().method_21();
                IEnumerable <RoomData> arg_11F_0  = HabboIM.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.RoomData);
                    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 = HabboIM.GetGame().GetClientManager().method_2(class2.UInt32_0);
                    if (class3 != null && class3.GetHabbo() != null && class3.GetHabbo().CurrentRoom != null)
                    {
                        RoomData class27_ = class3.GetHabbo().CurrentRoom.RoomData;
                        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().OwnedRooms.GetEnumerator())
            {
                while (enumerator4.MoveNext())
                {
                    RoomData current3 = enumerator4.Current;
                    list.Add(current3);
                }
                goto IL_508;
            }
IL_3E5:
            DataTable dataTable;

            using (DatabaseClient class4 = HabboIM.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(HabboIM.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 = HabboIM.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.RoomData);
            }
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);
        }
        public void Handle(GameClient Session, ClientMessage Event)
        {
            Room @class = HabboIM.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (@class != null && @class.method_26(Session))
            {
                int    num    = Event.PopWiredInt32();
                int    num2   = Event.PopWiredInt32();
                string text   = Event.PopFixedString();
                string text2  = Event.PopFixedString();
                string text3  = Event.PopFixedString();
                string text4  = Event.PopFixedString();
                string text5  = Event.PopFixedString();
                string text6  = Event.PopFixedString();
                string text7  = Event.PopFixedString();
                string text8  = Event.PopFixedString();
                string text9  = Event.PopFixedString();
                string text10 = Event.PopFixedString();
                string text11 = "";
                if (num2 == 10 || num2 == 8)
                {
                    text11 = string.Concat(new object[]
                    {
                        text,
                        "=",
                        text2,
                        Convert.ToChar(9),
                        text3,
                        "=",
                        text4,
                        Convert.ToChar(9),
                        text5,
                        "=",
                        text6,
                        Convert.ToChar(9),
                        text7,
                        "=",
                        text8
                    });
                    if (text9 != "")
                    {
                        text11 = string.Concat(new object[]
                        {
                            text11,
                            Convert.ToChar(9),
                            text9,
                            "=",
                            text10
                        });
                    }
                    using (DatabaseClient class2 = HabboIM.GetDatabase().GetClient())
                    {
                        class2.AddParamWithValue("extradata", text11);
                        class2.ExecuteQuery("UPDATE items_extra_data SET extra_data = @extradata WHERE item_id = '" + num + "' LIMIT 1");
                    }
                    ServerMessage Message = new ServerMessage(88u);
                    Message.AppendStringWithBreak(num.ToString());
                    Message.AppendStringWithBreak(text11);
                    @class.SendMessage(Message, null);
                    @class.method_28((uint)num).ExtraData = text11;
                    @class.method_28((uint)num).UpdateState(true, false);
                }
            }
        }
예제 #13
0
        public void Handle(GameClient Session, ClientMessage Event)
        {
            int num = Event.PopWiredInt32();

            if (num > 0 && (Session != null && Session.GetHabbo() != null))
            {
                GroupsManager @class = Groups.smethod_2(num);
                if (@class != null && !Session.GetHabbo().list_0.Contains(@class.int_0) && [email protected]_0.Contains((int)Session.GetHabbo().Id))
                {
                    if (@class.string_3 == "open")
                    {
                        @class.method_0((int)Session.GetHabbo().Id);
                        using (DatabaseClient class2 = HabboIM.GetDatabase().GetClient())
                        {
                            class2.ExecuteQuery(string.Concat(new object[]
                            {
                                "INSERT INTO group_memberships (groupid, userid) VALUES (",
                                @class.int_0,
                                ", ",
                                Session.GetHabbo().Id,
                                ");"
                            }));
                            Session.GetHabbo().dataTable_0 = class2.ReadDataTable("SELECT * FROM group_memberships WHERE userid = " + Session.GetHabbo().Id);
                            goto IL_1C4;
                        }
                    }
                    if (@class.string_3 == "locked")
                    {
                        Session.GetHabbo().list_0.Add(@class.int_0);
                        using (DatabaseClient class2 = HabboIM.GetDatabase().GetClient())
                        {
                            class2.ExecuteQuery(string.Concat(new object[]
                            {
                                "INSERT INTO group_requests (groupid, userid) VALUES (",
                                @class.int_0,
                                ", ",
                                Session.GetHabbo().Id,
                                ");"
                            }));
                        }
                    }
IL_1C4:
                    if (@class != null)
                    {
                        ServerMessage Message = new ServerMessage(311u);
                        Message.AppendInt32(@class.int_0);
                        Message.AppendStringWithBreak(@class.string_0);
                        Message.AppendStringWithBreak(@class.string_1);
                        Message.AppendStringWithBreak(@class.string_2);
                        if (@class.uint_0 > 0u)
                        {
                            Message.AppendUInt(@class.uint_0);
                            if (HabboIM.GetGame().GetRoomManager().GetRoom(@class.uint_0) != null)
                            {
                                Message.AppendStringWithBreak(HabboIM.GetGame().GetRoomManager().GetRoom(@class.uint_0).Name);
                                goto IL_2FC;
                            }
                            using (DatabaseClient class2 = HabboIM.GetDatabase().GetClient())
                            {
                                try
                                {
                                    DataRow dataRow_ = class2.ReadDataRow("SELECT * FROM rooms WHERE Id = " + @class.uint_0 + " LIMIT 1;");
                                    string  string_  = HabboIM.GetGame().GetRoomManager().method_17(@class.uint_0, dataRow_).Name;
                                    Message.AppendStringWithBreak(string_);
                                }
                                catch
                                {
                                    Message.AppendInt32(-1);
                                    Message.AppendStringWithBreak("");
                                }
                                goto IL_2FC;
                            }
                        }
                        Message.AppendInt32(-1);
                        Message.AppendStringWithBreak("");
IL_2FC:
                        bool flag = false;
                        foreach (DataRow dataRow in Session.GetHabbo().dataTable_0.Rows)
                        {
                            if ((int)dataRow["groupid"] == @class.int_0)
                            {
                                flag = true;
                            }
                        }
                        if (Session.GetHabbo().list_0.Contains(@class.int_0))
                        {
                            Message.AppendInt32(2);
                        }
                        else
                        {
                            if (flag)
                            {
                                Message.AppendInt32(1);
                            }
                            else
                            {
                                if (@class.string_3 == "closed")
                                {
                                    Message.AppendInt32(1);
                                }
                                else
                                {
                                    if (@class.list_0.Contains((int)Session.GetHabbo().Id))
                                    {
                                        Message.AppendInt32(1);
                                    }
                                    else
                                    {
                                        Message.AppendInt32(0);
                                    }
                                }
                            }
                        }
                        Message.AppendInt32(@class.list_0.Count);
                        if (Session.GetHabbo().int_0 == @class.int_0)
                        {
                            Message.AppendBoolean(true);
                        }
                        else
                        {
                            Message.AppendBoolean(false);
                        }
                        Session.SendMessage(Message);
                    }
                }
            }
        }
예제 #14
0
        public void method_8(uint uint_0, GameClient Session)
        {
            Session.GetHabbo().CurrentQuestId = 0u;
            Session.GetHabbo().uint_7         = uint_0;
            using (DatabaseClient @class = HabboIM.GetDatabase().GetClient())
            {
                @class.AddParamWithValue("userid", Session.GetHabbo().Id);
                @class.AddParamWithValue("questid", uint_0);
                @class.ExecuteQuery(string.Concat(new string[]
                {
                    "UPDATE user_stats SET quest_id = '0',quest_progress = '0', lev_",
                    this.method_6(uint_0).Type.Replace("room_", ""),
                    " = lev_",
                    this.method_6(uint_0).Type.Replace("room_", ""),
                    " + 1 WHERE Id = @userid LIMIT 1"
                }));
                @class.ExecuteQuery("INSERT INTO user_quests (user_id,quest_id) VALUES (@userid,@questid)");
            }
            string text = this.method_6(uint_0).Type.ToLower();

            if (text != null)
            {
                if (!(text == "identity"))
                {
                    if (!(text == "room_builder"))
                    {
                        if (!(text == "social"))
                        {
                            if (!(text == "explore"))
                            {
                                if (text == "custom1")
                                {
                                    Session.GetHabbo().QuestsCustom1Progress++;
                                }
                            }
                            else
                            {
                                Session.GetHabbo().ExplorerLevel++;
                            }
                        }
                        else
                        {
                            Session.GetHabbo().SocialLevel++;
                        }
                    }
                    else
                    {
                        Session.GetHabbo().BuilderLevel++;
                    }
                }
                else
                {
                    Session.GetHabbo().IdentityLevel++;
                }
            }
            Session.GetHabbo().LoadQuests();
            ServerMessage Message = new ServerMessage(801u);
            Quest         class2  = this.method_6(uint_0);

            class2.Serialize(Message, Session, true);
            this.method_9(Session, Message);
            Message.AppendInt32(1);
            Session.SendMessage(Message);
            Session.GetHabbo().ActivityPoints += class2.PixelReward;
            Session.GetHabbo().UpdateActivityPoints(true);
            Session.GetHabbo().CurrentQuestProgress = 0;
        }
        public void Handle(GameClient Session, ClientMessage Event)
        {
            Session.SendNotification("GetHabboGroupDetailsMessageEvent");
            int num = Event.PopWiredInt32();

            if (num > 0 && (Session != null && Session.GetHabbo() != null))
            {
                GroupsManager @class = Groups.smethod_2(num);
                if (@class != null)
                {
                    ServerMessage Message = new ServerMessage(311u);
                    Message.AppendInt32(@class.int_0);
                    Message.AppendStringWithBreak(@class.string_0);
                    Message.AppendStringWithBreak(@class.string_1);
                    Message.AppendStringWithBreak(@class.string_2);
                    if (@class.uint_0 > 0u)
                    {
                        Message.AppendUInt(@class.uint_0);
                        if (HabboIM.GetGame().GetRoomManager().GetRoom(@class.uint_0) != null)
                        {
                            Message.AppendStringWithBreak(HabboIM.GetGame().GetRoomManager().GetRoom(@class.uint_0).Name);
                            goto IL_15A;
                        }
                        using (DatabaseClient class2 = HabboIM.GetDatabase().GetClient())
                        {
                            try
                            {
                                DataRow dataRow_ = class2.ReadDataRow("SELECT * FROM rooms WHERE Id = " + @class.uint_0 + " LIMIT 1;");
                                string  string_  = HabboIM.GetGame().GetRoomManager().method_17(@class.uint_0, dataRow_).Name;
                                Message.AppendStringWithBreak(string_);
                            }
                            catch
                            {
                                Message.AppendInt32(-1);
                                Message.AppendStringWithBreak("");
                            }
                            goto IL_15A;
                        }
                    }
                    Message.AppendInt32(-1);
                    Message.AppendStringWithBreak("");
IL_15A:
                    bool flag = false;
                    foreach (DataRow dataRow in Session.GetHabbo().dataTable_0.Rows)
                    {
                        if ((int)dataRow["groupid"] == @class.int_0)
                        {
                            flag = true;
                        }
                    }
                    if (Session.GetHabbo().list_0.Contains(@class.int_0))
                    {
                        Message.AppendInt32(2);
                    }
                    else
                    {
                        if (flag)
                        {
                            Message.AppendInt32(1);
                        }
                        else
                        {
                            if (@class.string_3 == "closed")
                            {
                                Message.AppendInt32(1);
                            }
                            else
                            {
                                if (@class.list_0.Contains((int)Session.GetHabbo().Id))
                                {
                                    Message.AppendInt32(1);
                                }
                                else
                                {
                                    Message.AppendInt32(0);
                                }
                            }
                        }
                    }
                    Message.AppendInt32(@class.list_0.Count);
                    if (Session.GetHabbo().int_0 == @class.int_0)
                    {
                        Message.AppendBoolean(true);
                    }
                    else
                    {
                        Message.AppendBoolean(false);
                    }
                    Session.SendMessage(Message);
                }
            }
        }
        public void Handle(GameClient Session, ClientMessage Event)
        {
            Room @class = HabboIM.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (@class != null && Session != null)
            {
                if (Session.GetHabbo().IsMuted)
                {
                    Session.SendNotification(HabboIMEnvironment.GetExternalText("error_muted"));
                }
                else if (Session.GetHabbo().HasFuse("ignore_roommute") || [email protected]_4)
                {
                    string text  = HabboIM.FilterString(Event.PopFixedString());
                    string text2 = text.Split(new char[]
                    {
                        ' '
                    })[0];
                    string text3           = text.Substring(text2.Length + 1);
                    string antiweberstring = text3;
                    text3 = ChatCommandHandler.smethod_4(text3);
                    RoomUser class2 = @class.GetRoomUserByHabbo(Session.GetHabbo().Id);
                    RoomUser class3 = @class.method_56(text2);
                    if (Session.GetHabbo().method_4() > 0)
                    {
                        TimeSpan timeSpan = DateTime.Now - Session.GetHabbo().dateTime_0;
                        if (timeSpan.Seconds > 4)
                        {
                            Session.GetHabbo().int_23 = 0;
                        }
                        if (timeSpan.Seconds < 4 && Session.GetHabbo().int_23 > 5 && !class2.IsBot)
                        {
                            ServerMessage Message = new ServerMessage(27u);
                            Message.AppendInt32(Session.GetHabbo().method_4());
                            Session.SendMessage(Message);
                            Session.GetHabbo().IsMuted = true;
                            Session.GetHabbo().int_4   = Session.GetHabbo().method_4();
                            return;
                        }
                        Session.GetHabbo().dateTime_0 = DateTime.Now;
                        Session.GetHabbo().int_23++;
                    }
                    ServerMessage Message2 = new ServerMessage(25u);
                    Message2.AppendInt32(class2.VirtualId);
                    Message2.AppendStringWithBreak(text3);
                    Message2.AppendBoolean(false);
                    if (class2 != null && !class2.IsBot)
                    {
                        class2.GetClient().SendMessage(Message2);
                        try {
                            var class266 = HabboIM.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

                            for (int i = 0; i < class266.RoomUsers.Length; i++)
                            {
                                try {
                                    RoomUser class5 = class266.RoomUsers[i];
                                    if (class5 != null && class3 != null)
                                    {
                                        if (class5.GetClient().GetHabbo().whisperlog == true && class5.GetClient().GetHabbo().Rank >= 6 && class5.GetClient().GetHabbo().Id != Session.GetHabbo().Id&& class5.GetClient().GetHabbo().Id != class3.GetClient().GetHabbo().Id)
                                        {
                                            class5.GetClient().GetHabbo().Whisper(" < " + Session.GetHabbo().Username + " flüstert zu " + class3.GetClient().GetHabbo().Username + " > " + text.Substring(text2.Length + 1));
                                        }
                                    }
                                } catch { }
                            }
                        }  catch { }
                        //HabboIM.GetGame().GetClientManager().method_StaffWhisper("<" + Session.GetHabbo().Username + " flüstert zu " + class3.GetClient().GetHabbo().Username + "> " + text3);
                    }
                    class2.Unidle();
                    if (class3 != null && !class3.IsBot && (class3.GetClient().GetHabbo().list_2.Count <= 0 || !class3.GetClient().GetHabbo().list_2.Contains(Session.GetHabbo().Id)))
                    {
                        class3.GetClient().SendMessage(Message2);
                        if (ServerConfiguration.EnableChatlog)
                        {
                            using (DatabaseClient class4 = HabboIM.GetDatabase().GetClient())
                            {
                                class4.AddParamWithValue("message", "<Whisper to " + class3.GetClient().GetHabbo().Username + ">: " + text3);
                                class4.ExecuteQuery(string.Concat(new object[]
                                {
                                    "INSERT INTO chatlogs (user_id,room_id,hour,minute,timestamp,message,user_name,full_date) VALUES ('",
                                    Session.GetHabbo().Id,
                                    "','",
                                    @class.Id,
                                    "','",
                                    DateTime.Now.Hour,
                                    "','",
                                    DateTime.Now.Minute,
                                    "',UNIX_TIMESTAMP(),@message,'",
                                    Session.GetHabbo().Username,
                                    "','",
                                    DateTime.Now.ToLongDateString(),
                                    "')"
                                }), 30);
                            }
                        }
                        if (HabboIM.GetGame().AntiWerberStatus)
                        {
                            string textaw = ChatCommandHandler.smethod_4b(Session, antiweberstring, "Raum");
                        }
                    }
                }
            }
        }
        public WebSocketServerManager(string SocketURL)
        {
            FleckLog.Level = LogLevel.Error;
            allSockets     = new List <IWebSocketConnection>();
            socketbyName   = new Dictionary <string, IWebSocketConnection>();
            namebySocket   = new Dictionary <IWebSocketConnection, string>();
            server         = new WebSocketServer(SocketURL);

            server.Start(socket =>
            {
                socket.OnOpen = () =>
                {
                    if (allSockets.Contains(socket))
                    {
                        allSockets.Remove(socket);
                    }
                    allSockets.Add(socket);
                };
                socket.OnClose = () =>
                {
                    string name = "";
                    if (namebySocket.ContainsKey(socket))
                    {
                        name = namebySocket[socket].ToString();
                        namebySocket.Remove(socket);
                    }
                    if (socketbyName.ContainsKey(name) && name != "")
                    {
                        socketbyName.Remove(name);
                    }
                    if (allSockets.Contains(socket))
                    {
                        allSockets.Remove(socket);
                    }
                    if (name != "")
                    {
                        using (DatabaseClient dbClient = HabboIM.GetDatabase().GetClient())
                        {
                            dbClient.AddParamWithValue("name", name);
                            dbClient.ExecuteQuery("UPDATE users SET websocket='0' WHERE username=@name");
                        }
                    }
                };
                socket.OnMessage = message =>
                {
                    var msg = message;
                    int pId = 0;
                    if (!int.TryParse(msg.Split('|')[0], out pId))
                    {
                        return;
                    }
                    if (msg.Length > 1024)
                    {
                        return;
                    }
                    if (msg.StartsWith("1|"))
                    {
                        using (DatabaseClient dbClient = HabboIM.GetDatabase().GetClient())
                        {
                            dbClient.AddParamWithValue("auth", msg.Substring(2));
                            DataRow drow = null;
                            drow         = dbClient.ReadDataRow("SELECT username FROM users WHERE auth_ticket= @auth LIMIT 1");
                            if (drow == null)
                            {
                                socket.Close();
                            }
                            else
                            {
                                if (socketbyName.ContainsKey((string)drow["username"]))
                                {/* socketbyName[(string)drow["username"]].Close();*/
                                    socketbyName.Remove((string)drow["username"]);
                                }
                                socketbyName.Add(drow["username"].ToString(), socket);
                                if (namebySocket.ContainsKey(socket))
                                {
                                    namebySocket.Remove(socket);
                                }
                                namebySocket.Add(socket, drow["username"].ToString());
                                dbClient.AddParamWithValue("name", drow["username"].ToString());
                            }
                        }
                    }
                    else
                    {
                        GameClient Session = HabboIM.GetGame().GetClientManager().GetClientByHabbo(GetNameByWebSocket(socket));
                        Room room          = Session.GetHabbo().CurrentRoom;
                        string[] args      = msg.Split('|');
                        switch (int.Parse(args[0]))
                        {
                        case 88:
                            {
                                GameClient class4 = HabboIM.GetGame().GetClientManager().method_2(Convert.ToUInt32(args[1]));



                                if (class4 == null)
                                {
                                    Session.GetHabbo().Whisper("Diese Person ist bereits offline. Du kannst die Anfrage deshalb nicht mehr annehmen.");
                                    break;
                                }

                                if (class4.GetHabbo().sexanfrage != Session.GetHabbo().Id)
                                {
                                    Session.GetHabbo().Whisper("Ooops, da lief wohl etwas schief.");
                                    break;
                                }
                                if (class4.GetHabbo().boyfriend != 0 || Session.GetHabbo().boyfriend != 0)
                                {
                                    Session.GetHabbo().Whisper("Du bist noch mit wem zusammen.");
                                    break;
                                }
                                if (args[2] == "1")
                                {
                                    class4.GetHabbo().lovepoints  = 0;
                                    class4.GetHabbo().kissed      = 0;
                                    class4.GetHabbo().lovedate    = 0;
                                    class4.GetHabbo().hugged      = 0;
                                    class4.GetHabbo().hugtime     = 0;
                                    class4.GetHabbo().kisstime    = 0;
                                    class4.GetHabbo().boyfriend   = 0;
                                    Session.GetHabbo().lovepoints = 0;
                                    Session.GetHabbo().kissed     = 0;
                                    Session.GetHabbo().lovedate   = 0;
                                    Session.GetHabbo().hugged     = 0;
                                    Session.GetHabbo().hugtime    = 0;
                                    Session.GetHabbo().kisstime   = 0;


                                    Session.GetHabbo().lovedate  = HabboIM.GetUnixTimestamp();
                                    class4.GetHabbo().lovedate   = HabboIM.GetUnixTimestamp();
                                    class4.GetHabbo().boyfriend  = Convert.ToInt32(Session.GetHabbo().Id);
                                    Session.GetHabbo().boyfriend = Convert.ToInt32(class4.GetHabbo().Id);

                                    try
                                    {
                                        using (DatabaseClient dbClient = HabboIM.GetDatabase().GetClient())
                                        {
                                            dbClient.ExecuteQuery(string.Concat(new object[]
                                            {
                                                "UPDATE users SET boyfriend = '",
                                                Session.GetHabbo().Id,
                                                "', love_date = '",
                                                class4.GetHabbo().lovedate,
                                                "' WHERE Id = '",
                                                class4.GetHabbo().Id,
                                                "'  LIMIT 1;"
                                            }));

                                            dbClient.ExecuteQuery(string.Concat(new object[]
                                            {
                                                "UPDATE users SET boyfriend = '",
                                                class4.GetHabbo().Id,
                                                "', love_date = '",
                                                Session.GetHabbo().lovedate,
                                                "' WHERE Id = '",
                                                Session.GetHabbo().Id,
                                                "'  LIMIT 1;"
                                            }));
                                        }


                                        HabboIM.GetWebSocketManager().getWebSocketByName(Session.GetHabbo().Username).Send("textosteron|Beziehung|Du bist jetzt in einer Beziehung mit " + class4.GetHabbo().Username + ".");
                                        HabboIM.GetWebSocketManager().getWebSocketByName(class4.GetHabbo().Username).Send("textosteron|Beziehung|Du bist jetzt in einer Beziehung mit " + Session.GetHabbo().Username + ".");
                                    }
                                    catch
                                    {
                                    }
                                }

                                if (args[2] == "2")
                                {
                                    HabboIM.GetWebSocketManager().getWebSocketByName(Session.GetHabbo().Username).Send("textosteron|Beziehungsanfrage|Die Beziehungsanfrage wurde abgelehnt.");
                                    HabboIM.GetWebSocketManager().getWebSocketByName(class4.GetHabbo().Username).Send("textosteron|Beziehungsanfrage|Die Beziehungsanfrage wurde abgelehnt.");
                                }
                                class4.GetHabbo().sexanfrage  = 0;
                                Session.GetHabbo().sexanfrage = 0;

                                break;
                            }


                        case 74:
                            {
                                try {
                                    using (DatabaseClient dbClient = HabboIM.GetDatabase().GetClient())
                                    {
                                        dbClient.ExecuteQuery(string.Concat(new object[]
                                        {
                                            "UPDATE users SET lastkiss_time = '0', lasthug_time = '0', lovepoints = '0', kisses_bf = '0', hugs_bf = '0', boyfriend = '0' WHERE Id = '",
                                            Session.GetHabbo().Id,
                                            "' OR Id = '",
                                            Session.GetHabbo().boyfriend,
                                            "' LIMIT 2;"
                                        }));
                                    }


                                    Session.GetHabbo().lovepoints = 0;
                                    Session.GetHabbo().kissed     = 0;
                                    Session.GetHabbo().lovedate   = 0;
                                    Session.GetHabbo().hugged     = 0;
                                    Session.GetHabbo().hugtime    = 0;
                                    Session.GetHabbo().kisstime   = 0;

                                    GameClient class4 = HabboIM.GetGame().GetClientManager().method_2(Convert.ToUInt32(Session.GetHabbo().boyfriend));

                                    if (class4 != null)
                                    {
                                        class4.GetHabbo().lovepoints = 0;
                                        class4.GetHabbo().kissed     = 0;
                                        class4.GetHabbo().lovedate   = 0;
                                        class4.GetHabbo().hugged     = 0;
                                        class4.GetHabbo().hugtime    = 0;
                                        class4.GetHabbo().kisstime   = 0;
                                        class4.GetHabbo().boyfriend  = 0;
                                        HabboIM.GetWebSocketManager().getWebSocketByName(Session.GetHabbo().Username).Send("textosteron|Trennung|Du hast mit " + class4.GetHabbo().Username + " Schluss gemacht.");
                                        HabboIM.GetWebSocketManager().getWebSocketByName(class4.GetHabbo().Username).Send("textosteron|Trennung|" + Session.GetHabbo().Username + " hat mit dir Schluss gemacht.");
                                    }
                                    Session.GetHabbo().boyfriend = 0;
                                    if (class4 == null)
                                    {
                                        HabboIM.GetWebSocketManager().getWebSocketByName(Session.GetHabbo().Username).Send("textosteron|Trennung|Du hast Schluss gemacht.");
                                    }
                                } catch (Exception x)
                                {
                                }



                                break;
                            }

                        case 6:
                            {
                                try
                                {
                                    room = HabboIM.GetGame().GetRoomManager().GetRoom(uint.Parse(args[1]));
                                    if (Session != null && room != null)
                                    {
                                        ServerMessage Message = new ServerMessage(286u);
                                        Message.AppendBoolean(room.IsPublic);
                                        Message.AppendUInt(room.Id);
                                        Session.SendMessage(Message);
                                    }
                                }
                                catch { }
                                break;
                            }

                        case 9:
                            {
                                try
                                {
                                    if (Session.GetHabbo().CurrentRoom.CheckRights(Session, false))
                                    {
                                        int ItemId  = int.Parse(args[1]);
                                        double newZ = double.Parse(args[2]);
                                        RoomItem ri = Session.GetHabbo().CurrentRoom.method_28((uint)ItemId);
                                        if (ri != null && ri.GetBaseItem().InteractionType == "stackfield")
                                        {
                                            ri.setHeight(newZ);
                                            ri.method_8().method_80(ri);
                                            ServerMessage Message = new ServerMessage(94u);
                                            Message.AppendRawUInt(ri.uint_0);
                                            Message.AppendStringWithBreak("");
                                            Message.AppendBoolean(false);
                                            Session.GetHabbo().CurrentRoom.SendMessage(Message, null);
                                            ServerMessage Message5_ = new ServerMessage(95u);
                                            ri.SerializeStackField(Message5_);
                                            Session.GetHabbo().CurrentRoom.SendMessage(Message5_, null);
                                            ServerMessage Message1_ = new ServerMessage(93u);
                                            ri.SerializeStackField(Message1_);
                                            Session.GetHabbo().CurrentRoom.SendMessage(Message1_, null);
                                        }
                                    }
                                }
                                catch { }
                                break;
                            }

                        case 10:
                            {
                                try
                                {
                                    if (Session.GetHabbo().CurrentRoom.CheckRights(Session, false))
                                    {
                                        uint itemid    = uint.Parse(args[1]);
                                        int handitemId = int.Parse(args[2]);
                                        RoomItem ri    = Session.GetHabbo().CurrentRoom.method_28(itemid);
                                        if (ri != null && ri.GetBaseItem().InteractionType == "wf_cnd_has_handitem")
                                        {
                                            ri.string_2 = handitemId.ToString();
                                            ri.UpdateState(true, false);
                                        }
                                    }
                                }
                                catch { }
                                break;
                            }

                        case 12:
                            {
                                try
                                {
                                    if (Session.GetHabbo().CurrentRoom.CheckRights(Session, false))
                                    {
                                        uint itemid = uint.Parse(args[1]);
                                        string team = args[2];
                                        RoomItem ri = Session.GetHabbo().CurrentRoom.method_28(itemid);
                                        if (ri != null && (ri.GetBaseItem().InteractionType == "wf_cnd_actor_in_team" || ri.GetBaseItem().InteractionType == "wf_cnd_not_in_team") && Session.GetHabbo().CurrentRoom.IsValidTeam(team))
                                        {
                                            ri.string_2 = team;
                                            ri.UpdateState(true, false);
                                        }
                                    }
                                }
                                catch { }
                                break;
                            }

                        case 14:
                            {
                                try
                                {
                                    Session.GetHabbo().CurrentRoom.method_56(Session.GetHabbo().Username).CarryItem(int.Parse(args[1]));
                                }
                                catch { }
                                break;
                            }

                        case 32:
                            {
                                if (Session.GetHabbo().CurrentRoom.CheckRights(Session, true))
                                {
                                    try
                                    {
                                        RoomItem ri = Session.GetHabbo().CurrentRoom.method_28(uint.Parse(args[1]));
                                        if (ri != null && ri.GetBaseItem().InteractionType == "wf_act_yt")
                                        {
                                            string ytlink = args[2].Split('=')[1];
                                            ri.string_2   = ytlink;
                                            ri.UpdateState(true, false);
                                        }
                                    }
                                    catch { }
                                }
                                break;
                            }

                        case 35:
                            {
                                if (Session.GetHabbo().CurrentRoom.CheckRights(Session, true))
                                {
                                    try
                                    {
                                        RoomItem ri = Session.GetHabbo().CurrentRoom.method_28(uint.Parse(args[1]));
                                        if (ri != null && (ri.GetBaseItem().InteractionType == "wf_cnd_has_purse" || ri.GetBaseItem().InteractionType == "wf_cnd_hasnot_purse"))
                                        {
                                            string currency = Session.GetHabbo().CurrentRoom.IsValidCurrency(args[2]) ? args[2] : "credits";
                                            int number      = 1337;
                                            int.TryParse(args[3], out number);
                                            ri.string_2 = currency + ";" + number;
                                            ri.UpdateState(true, false);
                                        }
                                    }
                                    catch { }
                                }
                                break;
                            }

                        case 36:
                            {
                                if (Session.GetHabbo().CurrentRoom.CheckRights(Session, true))
                                {
                                    try
                                    {
                                        RoomItem ri = Session.GetHabbo().CurrentRoom.method_28(uint.Parse(args[1]));
                                        if (ri != null && ri.GetBaseItem().InteractionType == "wf_act_img" && IsValidFile(args[2]))
                                        {
                                            ri.string_2 = args[2];
                                            ri.UpdateState(true, false);
                                        }
                                    }
                                    catch { }
                                }
                                break;
                            }

                        case 93076201:
                            {
                                if (HabboIM.zufallsrare == false)
                                {
                                    HabboIM.zufallsrare = true;
                                    uint item           = uint.Parse(args[1]);
                                    uint user           = uint.Parse(args[2]);
                                    uint id             = uint.Parse(args[3]);
                                    uint geschenk       = 169;
                                    var geschenkmsg     = "!HabboIM Zufallsrare - Was hier wohl drin sein mag?";
                                    uint amount         = 1;

                                    using (DatabaseClient dbclient = HabboIM.GetDatabase().GetClient())
                                    {
                                        dbclient.AddParamWithValue("spieler", uint.Parse(args[2]));
                                        dbclient.AddParamWithValue("raum", '0');
                                        dbclient.AddParamWithValue("moebel", uint.Parse(args[1]));
                                        dbclient.AddParamWithValue("geschenk", geschenk);
                                        dbclient.AddParamWithValue("geschenkmsg", geschenkmsg);
                                        dbclient.AddParamWithValue("amount", amount);
                                        StringBuilder StringGetiditem = new StringBuilder();
                                        DataTable Getiditem           = dbclient.ReadDataTable("SELECT * FROM items ORDER BY RAND() LIMIT 1");
                                        foreach (DataRow StaffRow in Getiditem.Rows)
                                        {
                                            uint num5 = HabboIM.GetGame().GetCatalog().method_14();
                                            dbclient.AddParamWithValue("id", num5);
                                            Console.WriteLine(StaffRow["id"]);
                                            dbclient.ExecuteQuery(string.Concat(new object[]
                                            {
                                                "INSERT INTO items (Id,user_id,base_item,wall_pos) VALUES ('",
                                                (object)num5,
                                                "','",
                                                uint.Parse(args[2]),
                                                "','169','')"
                                            }));
                                            dbclient.ExecuteQuery(string.Concat(new object[]
                                            {
                                                "INSERT INTO items_extra_data (item_id,extra_data) VALUES ('",
                                                (object)num5,
                                                "','",
                                                "!HabboIM Zufallsrare - Was hier wohl drin sein mag?",
                                                "')"
                                            }));
                                            dbclient.ExecuteQuery(string.Concat(new object[]
                                                                                { "INSERT INTO user_presents (item_id,base_id,amount,extra_data) VALUES ('",
                                                                                  (object)num5,
                                                                                  "','",
                                                                                  uint.Parse(args[1]),
                                                                                  "','1','')" }));

                                            /*
                                             * dbclient.ExecuteQuery("INSERT INTO items (id, user_id, room_id, base_item) VALUES ('" + (object)num5 + "', @spieler, @raum, @geschenk)");
                                             * dbclient.ExecuteQuery("INSERT INTO items_extra_data (item_id, extra_data) VALUES ('" + (object)num5 + "', @geschenkmsg)");
                                             * dbclient.ExecuteQuery("INSERT INTO user_presents (item_id, base_id, amount) VALUES ('" + (object)num5 + "', @moebel, @amount)");*/
                                        }
                                    }
                                    //Staffchat Ausgabe
                                    ServerMessage Logging = new ServerMessage(134u);
                                    Logging.AppendUInt(0u);
                                    Logging.AppendString("INFO: Der Spieler " + args[4] + " hat eine Zufallsrarität erhalten!");
                                    HabboIM.GetGame().GetClientManager().method_16(Logging, Logging);

                                    if (int.Parse(HabboIM.GetConfig().data["habboim.customdesign"]) == 1)
                                    {
                                        string rmessage = "rndrmsg";
                                        HabboIM.GetWebSocketManager().SendMessageToEveryConnection(rmessage);
                                        HabboIM.GetGame().GetClientManager().method_WHISPER("Nächste Zufallsrare wird in " + HabboIM.nxt_rr + " Minuten verteilt!");
                                    }
                                    else
                                    {
                                        HabboIM.GetGame().GetClientManager().method_WHISPER("Die Zufallsrare wurde soeben verteilt!");
                                        HabboIM.GetGame().GetClientManager().method_WHISPER("Nächste Zufallsrare wird in " + HabboIM.nxt_rr + " Minuten verteilt!");
                                    }

                                    GameClient gameClient = HabboIM.GetGame().GetClientManager().method_2(uint.Parse(args[2]));
                                    if (gameClient != null)
                                    {
                                        gameClient.SendNotification("Überprüfe dein Inventar, denn du hast eine Zufallsrarität erhalten!");
                                        gameClient.GetHabbo().GetInventoryComponent().method_9(true);

                                        ++gameClient.GetHabbo().RandomRares;
                                        gameClient.GetHabbo().CheckRandomRares();
                                    }
                                    return;
                                }
                                break;
                            }

                        case 51:
                            {
                                if (Session.GetHabbo().CurrentRoom.CheckRights(Session, true))
                                {
                                    try
                                    {
                                        RoomItem ri = Session.GetHabbo().CurrentRoom.method_28(uint.Parse(args[1]));
                                        if (ri != null && (ri.GetBaseItem().InteractionType == "wf_cnd_user_count_in" || ri.GetBaseItem().InteractionType == "wfc_cnd_not_user_count") && IsValidFile(args[2]))
                                        {
                                            int min = 1;
                                            int max = 50;
                                            int.TryParse(args[2], out min);
                                            int.TryParse(args[3], out max);
                                            ri.string_3 = min + ";" + max;
                                            ri.UpdateState(true, false);
                                        }
                                    }
                                    catch { }
                                }
                                break;
                            }

                        default:
                            break;
                        }
                    }
                };
            });
        }
예제 #18
0
        public Game(int conns)
        {
            this.ClientManager = new GameClientManager(conns);
            if (HabboIM.GetConfig().data["client.ping.enabled"] == "1")
            {
                this.ClientManager.method_10();
            }
            DateTime now = DateTime.Now;

            Logging.Write("Verbinde mit Datenbank.. ");
            try
            {
                using (DatabaseClient dbClient = HabboIM.GetDatabase().GetClient())
                {
                    Console.BackgroundColor = ConsoleColor.Black;
                    Logging.WriteLine("Fertig!", ConsoleColor.Green);
                    HabboIM.Game = this;
                    this.LoadServerSettings(dbClient);
                    this.BanManager           = new ModerationBanManager();
                    this.RoleManager          = new RoleManager();
                    this.HelpTool             = new HelpTool();
                    this.Catalog              = new Catalog();
                    this.Navigator            = new Navigator();
                    this.ItemManager          = new ItemManager();
                    this.RoomManager          = new RoomManager();
                    this.AdvertisementManager = new AdvertisementManager();
                    this.PixelManager         = new PixelManager();
                    this.AchievementManager   = new AchievementManager();
                    this.ModerationTool       = new ModerationTool();
                    this.BotManager           = new BotManager();
                    this.Marketplace          = new Marketplace();
                    this.QuestManager         = new QuestManager();
                    this.HabboIMEnvironment   = new HabboIMEnvironment();
                    this.Groups = new Groups();
                    HabboIMEnvironment.LoadExternalTexts(dbClient);
                    this.BanManager.Initialise(dbClient);
                    this.RoleManager.method_0(dbClient);
                    this.HelpTool.method_0(dbClient);
                    this.HelpTool.method_3(dbClient);
                    this.ModerationTool.method_1(dbClient);
                    this.ModerationTool.method_2(dbClient);
                    this.ItemManager.method_0(dbClient);
                    this.Catalog.method_0(dbClient);
                    this.Catalog.method_1();
                    this.Navigator.method_0(dbClient);
                    this.RoomManager.method_8(dbClient);
                    this.RoomManager.method_0();
                    this.NavigatorCache = new NavigatorCache();
                    this.AdvertisementManager.method_0(dbClient);
                    this.BotManager.method_0(dbClient);
                    AchievementManager.smethod_0(dbClient);
                    this.PixelManager.method_0();
                    ChatCommandHandler.smethod_0(dbClient);
                    this.QuestManager.method_0();
                    Groups.smethod_0(dbClient);
                    this.RestoreStatistics(dbClient, 1);
                }
            }
            catch (MySqlException e)
            {
                Console.BackgroundColor = ConsoleColor.Black;
                Logging.WriteLine("Fehler!", ConsoleColor.Red);
                Logging.WriteLine(e.Message + " Check the given configuration details in config.conf\r\n", ConsoleColor.Blue);
                HabboIM.Destroy("", true, true);
                return;
            }
            this.task_0 = new Task(new Action(LowPriorityWorker.Initialise));
            this.task_0.Start();
            this.StartGameLoop();
        }
예제 #19
0
        internal void HandleSpeech(GameClient Session, string str, bool bool_13)
        {
            if (!this.IsBot)
            {
                if (Session.GetHabbo().jail == 1 && Session.GetHabbo().jailtime > 10 * 60)
                {
                    Session.GetHabbo().Whisper("Du bist mehr als 10 Minuten gebannt und kannst deswegen nicht chatten!");

                    return;
                }
            }

            string object_   = str;
            string linkRegex = "((http|https):\\/\\/|www.)?[a-zA-Z0-9\\-\\.]+\\b(com|co\\.uk|org|net|eu|cf|info|ml|nl|ca|es|fi)\\b";

            if (Session == null || Session.GetHabbo().HasFuse("ignore_roommute") || !this.GetRoom().bool_4)
            {
                this.Unidle();
                if (!this.IsBot && this.GetClient().GetHabbo().IsMuted)
                {
                    this.GetClient().GetHabbo().Whisper(HabboIMEnvironment.GetExternalText("error_muted"));
                }
                else if (!str.StartsWith(":") || Session == null || !ChatCommandHandler.smethod_5(Session, str.Substring(1)))
                {
                    uint num = 24u;
                    if (bool_13)
                    {
                        num = 26u;
                    }
                    if (!this.IsBot && Session.GetHabbo().method_4() > 0)
                    {
                        TimeSpan timeSpan = DateTime.Now - Session.GetHabbo().dateTime_0;
                        if (timeSpan.Seconds > 4)
                        {
                            Session.GetHabbo().int_23 = 0;
                        }
                        if (timeSpan.Seconds < 4 && Session.GetHabbo().int_23 > 5 && !this.IsBot)
                        {
                            ServerMessage Message = new ServerMessage(27u);
                            Message.AppendInt32(Session.GetHabbo().method_4());
                            this.GetClient().SendMessage(Message);
                            this.GetClient().GetHabbo().IsMuted = true;
                            this.GetClient().GetHabbo().int_4   = Session.GetHabbo().method_4();
                            this.GetClient().GetHabbo().GetEffectsInventoryComponent().method_2(620, true);
                            this.GetClient().GetHabbo().Whisper("Du wurdest stumm geschaltet, da du zu schnell getippt hast!");

                            return;
                        }
                        Session.GetHabbo().dateTime_0 = DateTime.Now;
                        Session.GetHabbo().int_23++;
                    }
                    bool aws = false;
                    if (!this.IsBot && HabboIM.GetGame().AntiWerberStatus)
                    {
                        str = ChatCommandHandler.smethod_4b(Session, object_, "Raum");
                        str = ChatCommandHandler.amina_zikki(Session, str, "Raum");
                        if (str != object_)
                        {
                            aws = true;
                        }
                    }
                    if (!this.IsBot)
                    {
                        str = ChatCommandHandler.smethod_4(str);
                    }
                    if (!this.GetRoom().method_9(this, str))
                    {
                        ServerMessage Message2 = new ServerMessage(num);
                        Message2.AppendInt32(this.VirtualId);
                        if (!this.IsBot && !this.IsPet)
                        {
                            try
                            {
                                if (HabboIM.GetConfig().data.ContainsKey("anti.ads.enable") && HabboIM.GetConfig().data["anti.ads.enable"] == "1")
                                {
                                    if (Session.GetHabbo().Rank <= uint.Parse(HabboIM.GetConfig().data["anti.ads.rank"]))
                                    {
                                        if (Regex.IsMatch(str, linkRegex, RegexOptions.IgnoreCase))
                                        {
                                            Session.SendNotification(HabboIM.GetConfig().data["anti.ads.msg"]);
                                            return;
                                        }
                                    }
                                }
                            }
                            catch
                            {
                            }
                        }
                        if (str.Contains("http://") || str.Contains("www.") || str.Contains("https://"))
                        {
                            string[] array = str.Split(new char[]
                            {
                                ' '
                            });
                            int      num2   = 0;
                            string   text   = "";
                            string   text2  = "";
                            string[] array2 = array;
                            for (int i = 0; i < array2.Length; i++)
                            {
                                string text3 = array2[i];
                                if (ChatCommandHandler.InitLinks(text3))
                                {
                                    if (num2 > 0)
                                    {
                                        text += ",";
                                    }
                                    text += text3;
                                    object obj = text2;
                                    text2 = string.Concat(new object[]
                                    {
                                        obj,
                                        " {",
                                        num2,
                                        "}"
                                    });
                                    num2++;
                                }
                                else
                                {
                                    text2 = text2 + " " + text3;
                                }
                            }
                            text = text2;
                            string[] array3 = text.Split(new char[]
                            {
                                ','
                            });
                            Message2.AppendStringWithBreak(text);
                            if (array3.Length > 0)
                            {
                                Message2.AppendBoolean(false);
                                Message2.AppendInt32(num2);
                                array2 = array3;
                                for (int i = 0; i < array2.Length; i++)
                                {
                                    string text4 = array2[i];
                                    string text5 = ChatCommandHandler.smethod_3(text4.Replace("http://", "").Replace("https://", ""));
                                    Message2.AppendStringWithBreak(text5.Replace("http://", "").Replace("https://", ""));
                                    Message2.AppendStringWithBreak(text4);
                                    Message2.AppendBoolean(false);
                                }
                            }
                        }
                        else
                        {
                            Message2.AppendStringWithBreak(str);
                        }
                        Message2.AppendInt32(this.ParseEmoticon(str));

                        try
                        {
                            if (this.ParseSmileys(str) != 0 && Session.GetHabbo().GetEffectsInventoryComponent().int_0 == 0)
                            {
                                Session.GetHabbo().GetEffectsInventoryComponent().method_2(this.ParseSmileys(str), true);


                                Thread thread = new Thread(delegate()
                                {
                                    try
                                    {
                                        Thread.Sleep(3000);
                                        Session.GetHabbo().GetEffectsInventoryComponent().method_2(0, true);
                                    }
                                    catch
                                    {
                                    }
                                });

                                thread.Start();
                            }
                        } catch
                        {
                            Console.WriteLine("Error in Smiley to Enable Function.");
                        }


                        Message2.AppendBoolean(false);
                        if (!this.IsBot)
                        {
                            if (aws == false)
                            {
                                this.GetRoom().method_58(Message2, Session.GetHabbo().list_2, Session.GetHabbo().Id);
                            }
                        }
                        else
                        {
                            this.GetRoom().SendMessage(Message2, null);
                        }
                    }
                    else if (!this.IsBot)
                    {
                        Session.GetHabbo().Whisper(str);
                    }
                    if (!this.IsBot)
                    {
                        this.GetRoom().method_7(this, str, bool_13);
                        if (Session.GetHabbo().CurrentQuestId > 0u && HabboIM.GetGame().GetQuestManager().GetQuestAction(Session.GetHabbo().CurrentQuestId) == "CHAT_WITH_SOMEONE")
                        {
                            HabboIM.GetGame().GetQuestManager().ProgressUserQuest(Session.GetHabbo().CurrentQuestId, Session);
                        }
                    }
                    if (ServerConfiguration.EnableChatlog && !this.IsBot)
                    {
                        using (DatabaseClient @class = HabboIM.GetDatabase().GetClient())
                        {
                            @class.AddParamWithValue("message", object_);
                            @class.ExecuteQuery(string.Concat(new object[]
                            {
                                "INSERT INTO chatlogs (user_id,room_id,hour,minute,timestamp,message,user_name,full_date) VALUES ('",
                                Session.GetHabbo().Id,
                                "','",
                                this.GetRoom().Id,
                                "','",
                                DateTime.Now.Hour,
                                "','",
                                DateTime.Now.Minute,
                                "',UNIX_TIMESTAMP(),@message,'",
                                Session.GetHabbo().Username,
                                "','",
                                DateTime.Now.ToLongDateString(),
                                "')"
                            }), 30);
                        }
                    }
                }
            }
        }
예제 #20
0
        public void BanUser(GameClient Session, string string_0, double length, string reason, bool banIp, bool banStatic)
        {
            if (!Session.GetHabbo().IsJuniori)
            {
                ModerationBanType enum4_  = ModerationBanType.USERNAME;
                string            text    = Session.GetHabbo().Username;
                string            object_ = "user";

                double timestamp = HabboIM.GetUnixTimestamp() + length;

                if (banIp)
                {
                    enum4_ = ModerationBanType.IP;

                    if (!ServerConfiguration.IPLastBan)
                    {
                        text = Session.GetConnection().String_0;
                    }
                    else
                    {
                        using (DatabaseClient dbClient = HabboIM.GetDatabase().GetClient())
                        {
                            text = dbClient.ReadString("SELECT ip_last FROM users WHERE Id = " + Session.GetHabbo().Id + " LIMIT 1;");
                        }
                    }
                    object_ = "ip";
                }


                if (banStatic)
                {
                    enum4_  = ModerationBanType.STATICID;
                    text    = Session.GetHabbo().static_id;
                    object_ = "static_id";
                }

                this.Bans.Add(new ModerationBan(enum4_, text, reason, timestamp));

                using (DatabaseClient dbClient = HabboIM.GetDatabase().GetClient())
                {
                    dbClient.AddParamWithValue("rawvar", object_);
                    dbClient.AddParamWithValue("var", text);
                    dbClient.AddParamWithValue("reason", reason);
                    dbClient.AddParamWithValue("mod", string_0);

                    dbClient.ExecuteQuery(string.Concat(new object[]
                    {
                        "INSERT INTO bans (bantype,value,reason,expire,added_by,added_date,appeal_state) VALUES (@rawvar,@var,@reason,'",
                        timestamp,
                        "',@mod,'",
                        DateTime.Now.ToLongDateString(),
                        "', '1')"
                    }));
                }

                if (banIp)
                {
                    DataTable dataTable = null;

                    using (DatabaseClient dbClient = HabboIM.GetDatabase().GetClient())
                    {
                        dbClient.AddParamWithValue("var", text);
                        dataTable = dbClient.ReadDataTable("SELECT Id FROM users WHERE ip_last = @var");
                    }

                    if (dataTable != null)
                    {
                        IEnumerator enumerator = dataTable.Rows.GetEnumerator();
                        try
                        {
                            while (enumerator.MoveNext())
                            {
                                DataRow dataRow = (DataRow)enumerator.Current;
                                using (DatabaseClient @class = HabboIM.GetDatabase().GetClient())
                                {
                                    @class.ExecuteQuery("UPDATE user_info SET bans = bans + 1 WHERE user_id = '" + (uint)dataRow["Id"] + "' LIMIT 1");
                                }
                            }
                        }
                        finally
                        {
                            IDisposable disposable = enumerator as IDisposable;
                            if (disposable != null)
                            {
                                disposable.Dispose();
                            }
                        }
                    }
                }


                if (banStatic)
                {
                    DataTable dataTable = null;

                    using (DatabaseClient dbClient = HabboIM.GetDatabase().GetClient())
                    {
                        dbClient.AddParamWithValue("var", text);
                        dataTable = dbClient.ReadDataTable("SELECT Id FROM users WHERE static_id_last = @var AND static_id_last != ''");
                    }

                    if (dataTable != null)
                    {
                        IEnumerator enumerator = dataTable.Rows.GetEnumerator();
                        try
                        {
                            while (enumerator.MoveNext())
                            {
                                DataRow dataRow = (DataRow)enumerator.Current;
                                using (DatabaseClient @class = HabboIM.GetDatabase().GetClient())
                                {
                                    @class.ExecuteQuery("UPDATE user_info SET bans = bans + 1 WHERE user_id = '" + (uint)dataRow["Id"] + "' LIMIT 1");
                                }
                            }
                        }
                        finally
                        {
                            IDisposable disposable = enumerator as IDisposable;
                            if (disposable != null)
                            {
                                disposable.Dispose();
                            }
                        }
                    }
                }


                using (DatabaseClient dbClient = HabboIM.GetDatabase().GetClient())
                {
                    dbClient.ExecuteQuery("UPDATE user_info SET bans = bans + 1 WHERE user_id = '" + Session.GetHabbo().Id + "' LIMIT 1");
                }

                Session.NotifyBan("Du bist gebannt: " + reason);
                Session.method_12();
            }
        }
        public static void Initialise()
        {
            double lastDatabaseUpdate  = HabboIM.GetUnixTimestamp();
            double lastDatabaseUpdate2 = HabboIM.GetUnixTimestamp();

            while (true)
            {
                try
                {
                    DateTime now      = DateTime.Now;
                    TimeSpan timeSpan = now - HabboIM.ServerStarted;
                    new PerformanceCounter("Processor", "% Processor Time", "_Total");
                    int Status = 1;

                    int UsersOnline = HabboIM.GetGame().GetClientManager().ClientCount;
                    int RoomsLoaded = HabboIM.GetGame().GetRoomManager().LoadedRoomsCount;

                    try
                    {
                        if (HabboIM.GetConfig().data["shutdown-server"] != null)
                        {
                            DateTime shutdown_server_time = Convert.ToDateTime(HabboIM.GetConfig().data["shutdown-server"]);
                            var      time  = shutdown_server_time.TimeOfDay.TotalSeconds;
                            string   s     = DateTime.Now.ToString("HH:mm:ss");
                            DateTime dt2   = DateTime.ParseExact(s, "HH:mm:ss", CultureInfo.InvariantCulture);
                            var      time2 = dt2.TimeOfDay.TotalSeconds;
                            try
                            {
                                if (HabboIM.GetConfig().data["shutdown-warning-alert"] != null)
                                {
                                    if (time - time2 <= 60 && time - time2 >= 50)
                                    {
                                        try
                                        {
                                            if (int.Parse(HabboIM.GetConfig().data["shutdown-server-player-limit"]) < UsersOnline || int.Parse(HabboIM.GetConfig().data["shutdown-server-player-limit"]) <= 0)
                                            {
                                                string        str      = HabboIM.GetConfig().data["shutdown-warning-alert"];
                                                ServerMessage Message2 = new ServerMessage(808u);
                                                Message2.AppendStringWithBreak(HabboIMEnvironment.GetExternalText("cmd_ha_title"));
                                                Message2.AppendStringWithBreak(str + "\r\n- " + "Hotel");
                                                ServerMessage Message3 = new ServerMessage(161u);
                                                Message3.AppendStringWithBreak(str + "\r\n- " + "Hotel");
                                                HabboIM.GetGame().GetClientManager().method_15(Message2, Message3);
                                            }
                                        }
                                        catch
                                        {
                                        }
                                    }
                                }
                            }
                            catch
                            {
                            }
                            if (time - time2 <= 11 && time - time2 >= 0)
                            {
                                try
                                {
                                    if (int.Parse(HabboIM.GetConfig().data["shutdown-server-player-limit"]) < UsersOnline || int.Parse(HabboIM.GetConfig().data["shutdown-server-player-limit"]) <= 0)
                                    {
                                        HabboIM.Destroy("SERVER SHUTDOWN! YOU HAVE SETUP TO CONFIG.CONF FILE SHUTDOWN TIME!", true);
                                    }
                                }
                                catch
                                {
                                    HabboIM.Destroy("SERVER SHUTDOWN! YOU HAVE SETUP TO CONFIG.CONF FILE SHUTDOWN TIME!", true);
                                }
                            }
                        }
                    }
                    catch
                    {
                    }

                    double timestamp = HabboIM.GetUnixTimestamp() - lastDatabaseUpdate;

                    if (timestamp >= 5)
                    {
                        using (DatabaseClient dbClient = HabboIM.GetDatabase().GetClient())
                        {
                            dbClient.ExecuteQuery(string.Concat(new object[]
                            {
                                "UPDATE server_status SET stamp = UNIX_TIMESTAMP(), status = '", Status, "', users_online = '", UsersOnline, "', rooms_loaded = '", RoomsLoaded, "', server_ver = '", HabboIM.Version, "' LIMIT 1"
                            }));
                            uint num3 = (uint)dbClient.ReadInt32("SELECT users FROM system_stats ORDER BY ID DESC LIMIT 1");
                            if ((long)UsersOnline > (long)((ulong)num3))
                            {
                                dbClient.ExecuteQuery(string.Concat(new object[]
                                {
                                    "UPDATE system_stats SET users = '",
                                    UsersOnline,
                                    "', rooms = '",
                                    RoomsLoaded,
                                    "' ORDER BY ID DESC LIMIT 1"
                                }));
                            }
                        }

                        lastDatabaseUpdate = HabboIM.GetUnixTimestamp();
                    }
                    double timestamp2 = HabboIM.GetUnixTimestamp() - lastDatabaseUpdate2;
                    if (timestamp2 >= 30.0)
                    {
                        using (DatabaseClient dbClient = HabboIM.GetDatabase().GetClient())
                        {
                            dbClient.ExecuteQuery(string.Concat(new object[]
                            {
                                "INSERT INTO online_statistik (`useronline`,`rooms_loaded`,`timestamp`) VALUES ('",
                                UsersOnline,
                                "','",
                                RoomsLoaded,
                                "', '",
                                HabboIM.GetUnixTimestamp(),
                                "');"
                            }), 30);
                        }
                        lastDatabaseUpdate2 = HabboIM.GetUnixTimestamp();
                    }
                    HabboIM.GetGame().GetClientManager().method_23();

                    Console.Title = string.Concat(new object[]
                    {
                        "HabboIM Emulator | Spieler: ",
                        UsersOnline,
                        " | Räume: ",
                        RoomsLoaded,
                        " | Online: ",
                        timeSpan.Days,
                        " Tage, ",
                        timeSpan.Hours,
                        " Stunden und ",
                        timeSpan.Minutes,
                        " Minuten"
                    });

                    if (HabboIM.hour_lastlotto != now.Hour)
                    {
                        HabboIM.hour_lastlotto = now.Hour;

                        //ServerMessage Message2 = new ServerMessage(808u);
                        //Message2.AppendStringWithBreak("MyHuBBa Lotterie");
                        //Message2.AppendStringWithBreak("Aufgepasst, nun könnt ihr an unserer Lotterie teilnehmen. Verwende hierzu den Befehl :lotto ZAHL und schon nimmst du teil. Die Zahl darf zwischen 1 & 50 liegen. Kosten für Teilnahme beträgt 3.500 Taler!\r\n- System");
                        ServerMessage Message3 = new ServerMessage(161u);
                        //Message3.AppendStringWithBreak("Aufgepasst, nun könnt ihr an unserer Lotterie teilnehmen. Verwende hierzu den Befehl :lotto ZAHL und schon nimmst du teil. Die Zahl darf zwischen 1 & 50 liegen. Kosten für Teilnahme beträgt 3.500 Taler!\r\n- System");
                        //HabboIM.GetGame().GetClientManager().method_15(Message2, Message3);

                        HabboIM.GetGame().GetClientManager().method_WHISPER("Lotto: Sende jetzt eine Zahl von 0-50 mit :lotto Zahl ein. Kosten: 3.500 Taler.");
                        HabboIM.lotto = true;


                        Random rand      = new Random();
                        int    lottozahl = rand.Next(1, 50); // Lottozahlen definieren
                        Console.BackgroundColor = ConsoleColor.Black;
                        Console.ForegroundColor = ConsoleColor.DarkCyan;
                        Console.WriteLine("Lotto: Ziehung gestartet! Die Zahl lautet " + lottozahl);

                        HabboIM.lottozahl   = lottozahl;
                        HabboIM.lottowinner = 0;
                        HabboIM.lotto_end   = HabboIM.GetUnixTimestamp() + 5 * 60;
                        //Info für den dummen Hazed:
                        // 5 * 60 steht für 5 Minuten, da 5 Minuten 5 mal 60 Sekunden sind.
                        HabboIM.lotto_einsatz = 3500;
                    }
                    if (HabboIM.GetUnixTimestamp() >= HabboIM.lotto_end && HabboIM.lotto == true)
                    {
                        Console.BackgroundColor = ConsoleColor.Black;
                        Console.ForegroundColor = ConsoleColor.DarkCyan;
                        Console.WriteLine("Lotto: Ziehung gestoppt!");
                        HabboIM.lotto = false;
                        HabboIM.GetGame().GetClientManager().resetlotto();

                        GameClients.GameClient client;
                        try
                        {
                            client = HabboIM.GetGame().GetClientManager().method_2(HabboIM.lottowinner);


                            client.GetHabbo().Credits += HabboIM.lotto_einsatz;
                            client.GetHabbo().UpdateCredits(true);

                            HabboIM.GetGame().GetClientManager().method_WHISPER("" + client.GetHabbo().Username + " hat den Jackpot in Höhe von " + HabboIM.lotto_einsatz.ToString() + " Talern geknackt! (Zahl: " + HabboIM.lottozahl + ")");
                            HabboIM.lotto_einsatz   = 3500;
                            Console.BackgroundColor = ConsoleColor.Black;
                            Console.ForegroundColor = ConsoleColor.DarkCyan;
                            Console.WriteLine("Lotto: " + client.GetHabbo().Username + " hat den Jackpot geknackt.");
                        }
                        catch
                        {
                            HabboIM.GetGame().GetClientManager().method_WHISPER("Lotto: Heute hat leider keiner den Jackpot geknackt!");
                            HabboIM.lotto_einsatz   = 3500;
                            Console.BackgroundColor = ConsoleColor.Black;
                            Console.ForegroundColor = ConsoleColor.DarkCyan;
                            Console.WriteLine("Lotto: Keiner konnte den Jackpot knacken.");
                        }
                    }



                    var minimum_users = int.Parse(HabboIM.GetConfig().data["habboim.zufallsrare_minimum_spieler"]);

                    if (HabboIM.hour_lastrr + HabboIM.nxt_rr * 60 < HabboIM.GetUnixTimestamp())
                    {
                        HabboIM.hour_lastrr = HabboIM.GetUnixTimestamp();
                        if (int.Parse(HabboIM.GetConfig().data["habboim.zufallsrare"]) == 1)
                        {
                            //Wenn genug Habbos Online
                            if (UsersOnline >= minimum_users)
                            {
                                //Ausgabe in Konsole
                                Console.BackgroundColor = ConsoleColor.Black;
                                Console.ForegroundColor = ConsoleColor.Green;
                                Console.WriteLine("____________________________________________________________________________________________________");
                                Console.WriteLine("                                                                                                    ");
                                Console.ForegroundColor = ConsoleColor.DarkGreen;
                                Console.Write("[");
                                string time1 = DateTime.Now.ToString();
                                Console.Write(time1 + "] ");
                                Console.ForegroundColor = ConsoleColor.Green;
                                Console.Write("Zufallsrare: Verteilt!");
                                Console.WriteLine();
                                Console.ForegroundColor = ConsoleColor.DarkGreen;
                                Console.Write("[");
                                string time2 = DateTime.Now.ToString();
                                Console.Write(time2 + "] ");
                                Console.ForegroundColor = ConsoleColor.Green;
                                Console.Write("Nächste Zufallsrare wird in " + HabboIM.nxt_rr + " Minuten verteilt!");
                                Console.WriteLine();
                            }
                            else
                            {
                                if (UsersOnline < minimum_users)
                                {
                                    string time3 = DateTime.Now.ToString();
                                    Console.BackgroundColor = ConsoleColor.Black;
                                    Console.ForegroundColor = ConsoleColor.Red;
                                    Console.WriteLine("____________________________________________________________________________________________________");
                                    Console.WriteLine("                                                                                                    ");
                                    Console.ForegroundColor = ConsoleColor.DarkRed;
                                    Console.Write("[");
                                    Console.Write(time3 + "] ");
                                    Console.ForegroundColor = ConsoleColor.Red;
                                    Console.Write("Zufallsrare nicht verteilt. Grund: Nicht genug Online! Minimum: " + minimum_users + " Habbos.");
                                    Console.WriteLine();
                                    HabboIM.zufallsrare = false;
                                }
                            }

                            if (UsersOnline >= minimum_users)
                            {
                                //Ermittle über Websocket den Gewinner des Zufallsrare
                                HabboIM.zufallsrare = false;
                                string random_rare = "9307620";
                                HabboIM.GetWebSocketManager().SendMessageToEveryConnection(random_rare);
                            }
                        }

                        //string random_rare = "5|ZUFALLSRARE|Baumstamm|15180";
                        //HabboIM.GetWebSocketManager().SendMessageToEveryConnection(random_rare);

                        /* using (DatabaseClient stafflist = HabboIM.GetDatabase().GetClient())
                         * {
                         *   //DataTable start = stafflist.ReadDataTable("SELECT id FROM users ORDER BY desc LIMIT 1")
                         *   //DataTable Staffs = stafflist.ReadDataTable("SELECT * FROM users WHERE id = '" + testst + "' LIMIT 1");
                         *   StringBuilder StringStaff = new StringBuilder();
                         *   DataTable Staffs = stafflist.ReadDataTable("SELECT * FROM users ORDER BY id desc");
                         *   foreach(DataRow testRow in Staffs.Rows)
                         *   {
                         *       int dreiund = rand.Next(Staffs.Rows.Count, Staffs.Rows.Count);
                         *       Console.WriteLine("ZUFALL (MIT FOREACH) " + dreiund);
                         *   }
                         *   int testst = rand.Next(Staffs.Rows.Count, Staffs.Rows.Count);
                         *   Console.WriteLine("STAFF ROW " + Staffs.Rows.Count);
                         *
                         *           Console.WriteLine("ZUFALL (OHNE FOREACH) " + testst);
                         *
                         *
                         *   //Console.WriteLine("User gefunden ID:" + testst);
                         *    foreach (DataRow baumstammRow in Staffs.Rows)
                         *    {
                         *        //Console.WriteLine("User gefunden ID:" + testst);
                         *        // Console.WriteLine((string)baumstammRow["username"]);
                         *        Console.WriteLine(testst);
                         *    }
                         *   //Console.WriteLine((string)baumstammRow["username"]);
                         *
                         * }*/
                    }
                }
                catch (Exception ex)
                {
                    Program.DeleteMenu(Program.GetSystemMenu(Program.GetConsoleWindow(), true), Program.SC_CLOSE, Program.MF_BYCOMMAND);
                    Logging.LogThreadException(ex.ToString(), "Server status update task");
                }
                Thread.Sleep(5000);
            }
        }
예제 #22
0
        public void Handle(GameClient Session, ClientMessage Event)
        {
            if (Session.GetHabbo().HasFuse("acc_staffpicks"))
            {
                Room Room = HabboIM.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

                int AlreadyStaffPicks;
                AlreadyStaffPicks = 0;

                using (DatabaseClient dbClient = HabboIM.GetDatabase().GetClient())
                {
                    if (dbClient.ReadDataRow("SELECT * FROM navigator_publics WHERE room_id = '" + Room.Id + "'") != null)
                    {
                        AlreadyStaffPicks = 1;
                    }
                }


                if (AlreadyStaffPicks == 0)
                {
                    string Owner;
                    int    OwnerID;
                    using (DatabaseClient dbClient = HabboIM.GetDatabase().GetClient())
                    {
                        Owner = dbClient.ReadString("SELECT owner FROM rooms WHERE id = '" + Room.Id + "'");
                        dbClient.AddParamWithValue("roomname", Room.Name);
                        dbClient.ExecuteQuery("INSERT INTO `navigator_publics` (`bannertype`, `caption`, `room_id`, `category_parent_id`, `image`, `image_type`) VALUES ('1', @roomname, '" + Room.Id + "', '" + ServerConfiguration.StaffPicksID + "', 'officialrooms_hq/staffpickfolder.gif', 'external')");
                    }

                    GameClient RoomOwner = HabboIM.GetGame().GetClientManager().GetClientByHabbo(Owner);
                    if (RoomOwner != null)
                    {
                        RoomOwner.GetHabbo().StaffPicks++;
                        RoomOwner.GetHabbo().CheckStaffPicksAchievement();
                    }
                    else
                    {
                        using (DatabaseClient dbClient = HabboIM.GetDatabase().GetClient())
                        {
                            try
                            {
                                OwnerID = dbClient.ReadInt32("SELECT id FROM users WHERE username = '******'");
                                dbClient.ExecuteQuery("UPDATE user_stats SET staff_picks = staff_picks + 1 WHERE id = '" + OwnerID + "' LIMIT 1");
                            }
                            catch (Exception)
                            {
                                Session.SendNotification("Room owner is not in database!");
                            }
                        }
                    }

                    using (DatabaseClient dbClient = HabboIM.GetDatabase().GetClient())
                    {
                        HabboIM.GetGame().GetNavigator().method_0(dbClient);
                    }

                    Session.SendNotification("Room added to Staff Picks successfully.");
                }
                else
                {
                    using (DatabaseClient dbClient = HabboIM.GetDatabase().GetClient())
                    {
                        dbClient.ExecuteQuery("DELETE FROM `navigator_publics` WHERE (`room_id`='" + Room.Id + "')");
                    }

                    using (DatabaseClient dbClient = HabboIM.GetDatabase().GetClient())
                    {
                        HabboIM.GetGame().GetNavigator().method_0(dbClient);
                    }

                    Session.SendNotification("Room removed from Staff Picks successfully.");
                }
            }
        }
예제 #23
0
 public void Handle(GameClient Session, ClientMessage Event)
 {
     try
     {
         Room @class = HabboIM.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
         if (@class != null && @class.CheckRights(Session, true))
         {
             RoomItem class2 = @class.method_28(Event.PopWiredUInt());
             UserItem class3 = Session.GetHabbo().GetInventoryComponent().GetItemById(class2.uint_0);
             if (class2 != null)
             {
                 if (class2.GetBaseItem().Name.StartsWith("CF_") || class2.GetBaseItem().Name.StartsWith("CFC_") || class2.GetBaseItem().Name.StartsWith("PixEx_") || class2.GetBaseItem().Name.StartsWith("PntEx_"))
                 {
                     if (class3 != null)
                     {
                         @class.method_29(null, class3.uint_0, true, true);
                     }
                     else
                     {
                         DataRow dataRow = null;
                         using (DatabaseClient class4 = HabboIM.GetDatabase().GetClient())
                         {
                             dataRow = class4.ReadDataRow("SELECT ID FROM items WHERE ID = '" + class2.uint_0 + "' LIMIT 1");
                         }
                         if (dataRow != null)
                         {
                             string[] array = class2.GetBaseItem().Name.Split(new char[]
                             {
                                 '_'
                             });
                             int num = int.Parse(array[1]);
                             if (num > 0)
                             {
                                 if (class2.GetBaseItem().Name.StartsWith("CF_") || class2.GetBaseItem().Name.StartsWith("CFC_"))
                                 {
                                     Session.GetHabbo().Credits += num;
                                     Session.GetHabbo().UpdateCredits(true);
                                 }
                                 else
                                 {
                                     if (class2.GetBaseItem().Name.StartsWith("PixEx_"))
                                     {
                                         Session.GetHabbo().ActivityPoints += num;
                                         Session.GetHabbo().UpdateActivityPoints(true);
                                     }
                                     else
                                     {
                                         if (class2.GetBaseItem().Name.StartsWith("PntEx_"))
                                         {
                                             Session.GetHabbo().VipPoints += num;
                                             Session.GetHabbo().UpdateVipPoints(false, true);
                                         }
                                     }
                                 }
                             }
                         }
                         @class.method_29(null, class2.uint_0, true, true);
                         ServerMessage Message5_ = new ServerMessage(219u);
                         Session.SendMessage(Message5_);
                     }
                 }
             }
         }
     }
     catch
     {
     }
 }