Esempio n. 1
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);
                        }
                    }
                }
            }
        }
Esempio n. 2
0
        internal void method_1(GameClient Session, string string_1, bool bool_13)
        {
            string object_ = string_1;

            if (Session == null || (Session.GetHabbo().HasFuse("ignore_roommute") || !this.method_17().bool_4))
            {
                this.Unidle();
                if (!this.IsBot && this.GetClient().GetHabbo().bool_3)
                {
                    this.GetClient().SendNotif(GoldTreeEnvironment.smethod_1("error_muted"));
                }
                else
                {
                    if (!string_1.StartsWith(":") || Session == null || !ChatCommandHandler.smethod_5(Session, string_1.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().bool_3 = true;
                                this.GetClient().GetHabbo().int_4  = Session.GetHabbo().method_4();
                                return;
                            }
                            Session.GetHabbo().dateTime_0 = DateTime.Now;
                            Session.GetHabbo().int_23++;
                        }
                        if (!this.IsBot && !Session.GetHabbo().isJuniori)
                        {
                            string_1 = ChatCommandHandler.smethod_4(string_1);
                        }
                        if (!this.method_17().method_9(this, string_1))
                        {
                            ServerMessage Message2 = new ServerMessage(num);
                            Message2.AppendInt32(this.VirtualId);
                            if (string_1.Contains("http://") || string_1.Contains("www.") || string_1.Contains("https://"))
                            {
                                string[] array = string_1.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;
                                    }
                                }
                                string_1 = text2;
                                string[] array3 = text.Split(new char[]
                                {
                                    ','
                                });
                                Message2.AppendStringWithBreak(string_1);
                                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(string_1);
                            }
                            Message2.AppendInt32(this.method_2(string_1));
                            Message2.AppendBoolean(false);
                            if (!this.IsBot)
                            {
                                this.method_17().method_58(Message2, Session.GetHabbo().list_2, Session.GetHabbo().Id);
                            }
                            else
                            {
                                this.method_17().SendMessage(Message2, null);
                            }
                        }
                        else
                        {
                            if (!this.IsBot)
                            {
                                Session.GetHabbo().method_28(string_1);
                            }
                        }
                        if (!this.IsBot)
                        {
                            this.method_17().method_7(this, string_1, bool_13);
                            if (Session.GetHabbo().CurrentQuestId == 3u)
                            {
                                GoldTree.GetGame().GetQuestManager().ProgressUserQuest(3u, Session);
                            }
                        }
                        if (LicenseTools.Boolean_4 && !this.IsBot && !this.GetClient().GetHabbo().isJuniori)
                        {
                            using (DatabaseClient @class = GoldTree.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.method_17().Id,
                                    "','",
                                    DateTime.Now.Hour,
                                    "','",
                                    DateTime.Now.Minute,
                                    "',UNIX_TIMESTAMP(),@message,'",
                                    Session.GetHabbo().Username,
                                    "','",
                                    DateTime.Now.ToLongDateString(),
                                    "')"
                                }));
                            }
                        }
                    }
                }
            }
        }
Esempio n. 3
0
        internal void HandleSpeech(GameClient Session, string str, bool bool_13)
        {
            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().SendNotification(GoldTreeEnvironment.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();
                                return;
                            }
                            Session.GetHabbo().dateTime_0 = DateTime.Now;
                            Session.GetHabbo().int_23++;
                        }

                        if (!this.IsBot && !Session.GetHabbo().IsJuniori)
                        {
                            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 (GoldTree.GetConfig().data.ContainsKey("anti.ads.enable") && GoldTree.GetConfig().data["anti.ads.enable"] == "1")
                                    {
                                        if (Session.GetHabbo().Rank <= uint.Parse(GoldTree.GetConfig().data["anti.ads.rank"]))
                                        {
                                            if (System.Text.RegularExpressions.Regex.IsMatch(str, linkRegex, System.Text.RegularExpressions.RegexOptions.IgnoreCase))
                                            {
                                                Session.SendNotification(GoldTree.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(ParseEmoticon(str));
                            Message2.AppendBoolean(false);

                            if (!this.IsBot)
                            {
                                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 > 0 && GoldTree.GetGame().GetQuestManager().GetQuestAction(Session.GetHabbo().CurrentQuestId) == "CHAT_WITH_SOMEONE")
                            {
                                GoldTree.GetGame().GetQuestManager().ProgressUserQuest(Session.GetHabbo().CurrentQuestId, Session);
                            }
                        }

                        if (ServerConfiguration.EnableChatlog && !this.IsBot && !this.GetClient().GetHabbo().IsJuniori)
                        {
                            using (DatabaseClient @class = GoldTree.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(),
                                    "')"
                                }));
                            }
                        }
                    }
                }
            }
        }