public void Handle(GameClient Session, ClientMessage Event) { string message = Essential.FilterString(Event.PopFixedString()); if (string.IsNullOrEmpty(message.Trim())) { return; } if (Essential.GetAntiAd().ContainsIllegalWord(message)) { ServerMessage Message2 = new ServerMessage(Outgoing.InstantChat); Message2.AppendUInt(0u); Message2.AppendString("[AWS] " + Session.GetHabbo().Username + ": " + message); Message2.AppendString(Essential.GetUnixTimestamp() + string.Empty); Essential.GetGame().GetClientManager().SendToStaffs(Session, Message2); Session.SendNotification(Essential.GetGame().GetRoleManager().GetConfiguration().getData("antiad.alert")); return; } // I don't "bobba" filter the word.. I just check if the message contains a Illegal word. And if, // I "close" the Event! Essential.GetGame().GetGuideManager().GetTicket(Session.GetHabbo().Id).StoreMessage(message, Session.GetHabbo().Id); ServerMessage Message = new ServerMessage(Outgoing.GuideSessionMessage); //Rootkit Message.AppendString(message); Message.AppendInt32(Session.GetHabbo().Id); Essential.GetGame().GetGuideManager().GetTicket(Session.GetHabbo().Id).SendToTicket(Message); }
public void Handle(GameClient Session, ClientMessage Event) { Room @class = Essential.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId); if (@class != null && Session != null && Session.GetHabbo().PassedSafetyQuiz) { Session.GetHabbo().CheckForUnmute(); if (Session.GetHabbo().IsMuted) { Session.SendNotification(EssentialEnvironment.GetExternalText("error_muted")); } else { if (Session.GetHabbo().HasFuse("ignore_roommute") || [email protected]_4) { string text = Essential.FilterString(Event.PopFixedString()); if (!String.IsNullOrEmpty(text) || !String.IsNullOrWhiteSpace(text)) { string text2 = text.Split(new char[] { ' ' })[0]; string text3 = text.Substring(text2.Length + 1); text3 = ChatCommandHandler.ApplyFilter(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(Outgoing.FloodFilter); 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(Outgoing.Whisp); // OLD 25 UPDATED Message2.AppendInt32(class2.VirtualId); Message2.AppendStringWithBreak(text3); Message2.AppendInt32(0); Message2.AppendInt32(Event.PopWiredInt32()); Message2.AppendInt32(0); Message2.AppendInt32(-1); if (class2 != null && !class2.IsBot && !Essential.GetAntiAd().ContainsIllegalWord(text3)) { class2.GetClient().SendMessage(Message2); } class2.Unidle(); if (class3 != null && !class3.IsBot && (class3.GetClient().GetHabbo().list_2.Count <= 0 || !class3.GetClient().GetHabbo().list_2.Contains(Session.GetHabbo().Id))) { if (!Essential.GetAntiAd().ContainsIllegalWord(text3)) { class3.GetClient().SendMessage(Message2); } if (ServerConfiguration.EnableChatlog) { using (DatabaseClient class4 = Essential.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(), "')" })); } } if (Essential.GetAntiAd().ContainsIllegalWord(text3)) { ServerMessage Message3 = new ServerMessage(Outgoing.InstantChat); Message3.AppendUInt(0u); Message3.AppendString("[AWS] " + Session.GetHabbo().Username + ": " + text3); Message3.AppendString(Essential.GetUnixTimestamp() + string.Empty); Essential.GetGame().GetClientManager().SendToStaffs(Session, Message3); Session.SendNotification(Essential.GetGame().GetRoleManager().GetConfiguration().getData("antiad.alert")); } } } } } } }
internal void HandleSpeech(GameClient Session, string str, bool bool_13, int TextColor = 0) { if (TextColor == 23 && Session.GetHabbo().Rank < 4) { TextColor = 0; } if (TextColor > 23 || TextColor < 0 || TextColor == 1 || TextColor == 8 || TextColor == 2) { TextColor = 0; } if (!String.IsNullOrEmpty(str) || !String.IsNullOrWhiteSpace(str)) { 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(EssentialEnvironment.GetExternalText("error_muted")); } else { if (!str.StartsWith(":") || Session == null || !ChatCommandHandler.HandleCommands(Session, str.Substring(1))) { uint num = Outgoing.Talk; // Updated if (bool_13) { num = Outgoing.Shout; // Updated } 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(Outgoing.FloodFilter); 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) { str = ChatCommandHandler.ApplyFilter(str); } if (!this.GetRoom().method_9(this, str)) { ServerMessage Message2 = new ServerMessage(num); Message2.AppendInt32(this.VirtualId); string Site = ""; if (str.Contains("http://") || str.Contains("www.")) { string[] Split = str.Split(' '); foreach (string Msg in Split) { if (Msg.StartsWith("http://") || Msg.StartsWith("www.")) { Site = Msg; } } //str = str.Replace(Site, "{0}"); } Message2.AppendStringWithBreak(str); Message2.AppendInt32(ParseEmoticon(str)); Message2.AppendInt32(this.IsBot && !this.IsPet ? 2 : TextColor); Message2.AppendInt32(0); Message2.AppendInt32(-1); if (!Essential.GetAntiAd().ContainsIllegalWord(object_)) { if (!this.IsBot && this.GetClient() != null && this.GetClient().GetHabbo().PassedSafetyQuiz) { this.GetRoom().method_58(Message2, Session.GetHabbo().list_2, Session.GetHabbo().Id); } else { this.GetRoom().SendMessage(Message2, this.IsPet ? this.GetRoom().RoomUsers.Where(p => p != null && p.GetClient() != null && p.GetClient().GetHabbo() != null && p.GetClient().GetHabbo().MutePets).Select(o => o.GetClient().GetHabbo().Id).ToList() : this.IsBot ? this.GetRoom().RoomUsers.Where(p => p != null && p.GetClient() != null && p.GetClient().GetHabbo() != null && p.GetClient().GetHabbo().MuteBots).Select(o => o.GetClient().GetHabbo().Id).ToList() : null); } } else if (Essential.GetAntiAd().ContainsIllegalWord(object_) && this.GetClient() != null) { ServerMessage Message3 = new ServerMessage(Outgoing.InstantChat); Message3.AppendUInt(0u); Message3.AppendString("[AWS] " + Session.GetHabbo().Username + ": " + object_); Message3.AppendString(Essential.GetUnixTimestamp() + string.Empty); Essential.GetGame().GetClientManager().SendToStaffs(Session, Message3); Session.SendNotification(Essential.GetGame().GetRoleManager().GetConfiguration().getData("antiad.alert")); return; } } else { if (!this.IsBot) { Session.GetHabbo().Whisper(str); } } if (!this.IsBot) { this.GetRoom().method_7(this, str, bool_13); if (Session.GetHabbo().CurrentQuestId > 0 && Essential.GetGame().GetQuestManager().GetQuestAction(Session.GetHabbo().CurrentQuestId) == "CHAT_WITH_SOMEONE") { Essential.GetGame().GetQuestManager().ProgressUserQuest(Session.GetHabbo().CurrentQuestId, Session); } } if (ServerConfiguration.EnableChatlog && !this.IsBot && !Essential.GetAntiAd().ContainsIllegalWord(object_) && this.GetRoom().Id != 74402) { using (DatabaseClient @class = Essential.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(), "')" })); } } } } } } }