Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Q&A
Filter system plusemu
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="MasterJiq" data-source="post: 397734" data-attributes="member: 69646"><p>Hello!</p><p></p><p>I am trying to make filter word alert like we said ".com" and that word has been filtered, so alert come to the users.</p><p>I am making it on ChatEvent.</p><p>So someone could fix my code, the code seems not working ?</p><p>[CODE]using System;</p><p> </p><p>using Plus.Core;</p><p>using Plus.Communication.Packets.Incoming;</p><p>using Plus.Utilities;</p><p>using Plus.HabboHotel.Global;</p><p>using Plus.HabboHotel.Quests;</p><p>using Plus.HabboHotel.Rooms;</p><p>using Plus.HabboHotel.GameClients;</p><p>using Plus.HabboHotel.Rooms.Chat.Logs;</p><p>using Plus.Communication.Packets.Outgoing.Messenger;</p><p>using Plus.Communication.Packets.Outgoing.Rooms.Chat;</p><p>using Plus.Communication.Packets.Outgoing.Moderation;</p><p>using Plus.Communication.Packets.Outgoing.Rooms.Notifications;</p><p>using Plus.HabboHotel.Rooms.Chat.Styles;</p><p> </p><p>namespace Plus.Communication.Packets.Incoming.Rooms.Chat</p><p>{</p><p> public class ChatEvent : IPacketEvent</p><p> {</p><p> public void Parse(GameClient Session, ClientPacket Packet)</p><p> {</p><p> if (Session == null || Session.GetHabbo() == null || !Session.GetHabbo().InRoom)</p><p> return;</p><p> </p><p> Room Room = Session.GetHabbo().CurrentRoom;</p><p> if (Room == null)</p><p> return;</p><p> </p><p> RoomUser User = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);</p><p> if (User == null)</p><p> return;</p><p> </p><p> string Message = StringCharFilter.Escape(Packet.PopString());</p><p> if (Message.Length > 100)</p><p> Message = Message.Substring(0, 100);</p><p> </p><p> int Colour = Packet.PopInt();</p><p> </p><p> ChatStyle Style = null;</p><p> if (!PlusEnvironment.GetGame().GetChatManager().GetChatStyles().TryGetStyle(Colour, out Style) || (Style.RequiredRight.Length > 0 && !Session.GetHabbo().GetPermissions().HasRight(Style.RequiredRight)))</p><p> Colour = 0;</p><p> </p><p> User.UnIdle();</p><p> </p><p> if (PlusEnvironment.GetUnixTimestamp() < Session.GetHabbo().FloodTime && Session.GetHabbo().FloodTime != 0)</p><p> return;</p><p> </p><p> if (Session.GetHabbo().TimeMuted > 0)</p><p> {</p><p> Session.SendMessage(new MutedComposer(Session.GetHabbo().TimeMuted));</p><p> return;</p><p> }</p><p> if (PlusEnvironment.GetGame().GetChatManager().GetFilter().IsFiltered(Message))</p><p> {</p><p> </p><p> PlusEnvironment.GetGame().GetClientManager().StaffAlert(new RoomNotificationComposer("Filtered Words Alert",</p><p> "Hello <b>" + Session.GetHabbo().Username + "!<br>" +</p><p> </p><p> "<br></b> Seems like you've used word that has been filtered" + "<br>" +</p><p> </p><p> "<br><b>The filtered words:</b><br>" +</p><p> "<br>" + "<b>" + "<font color =\"#FF0000\">" + Message + "</font>" + "</b><br>" +</p><p> "<br>Click button below to reload this alert.</b>",</p><p> "filter", "Reload", "event:navigator/goto/" + Session.GetHabbo().CurrentRoomId));</p><p> Session.GetHabbo().GetClient().SendMessage(new WhisperComposer(User.VirtualId, "La siguiente Palabra esta prohibida en el hotel:" + " " + Message, 0, 34));</p><p> Message = null;</p><p> }</p><p> </p><p> if (!Session.GetHabbo().GetPermissions().HasRight("room_ignore_mute") && Room.CheckMute(Session))</p><p> {</p><p> Session.SendWhisper("Oops, you're currently muted.");</p><p> return;</p><p> }</p><p> </p><p> User.LastBubble = Session.GetHabbo().CustomBubbleId == 0 ? Colour : Session.GetHabbo().CustomBubbleId;</p><p> </p><p> if (!Session.GetHabbo().GetPermissions().HasRight("mod_tool"))</p><p> {</p><p> int MuteTime;</p><p> if (User.IncrementAndCheckFlood(out MuteTime))</p><p> {</p><p> Session.SendMessage(new FloodControlComposer(MuteTime));</p><p> return;</p><p> }</p><p> }</p><p> </p><p> if (Message.StartsWith(":", StringComparison.CurrentCulture) && PlusEnvironment.GetGame().GetChatManager().GetCommands().Parse(Session, Message))</p><p> return;</p><p> </p><p> if (Message.Contains(":amercianpie"))</p><p> {</p><p> Session.GetHabbo().Effects().ApplyEffect(104);</p><p> }</p><p> </p><p> PlusEnvironment.GetGame().GetChatManager().GetLogs().StoreChatlog(new ChatlogEntry(Session.GetHabbo().Id, Room.Id, Message, UnixTimestamp.GetNow(), Session.GetHabbo(), Room));</p><p> </p><p> if (PlusEnvironment.GetGame().GetChatManager().GetFilter().CheckBannedWords(Message))</p><p> {</p><p> Session.GetHabbo().BannedPhraseCount++;</p><p> </p><p> if (Session.GetHabbo().BannedPhraseCount >= PlusStaticGameSettings.BannedPhrasesAmount)</p><p> {</p><p> PlusEnvironment.GetGame().GetModerationManager().BanUser("System", HabboHotel.Moderation.ModerationBanType.USERNAME, Session.GetHabbo().Username, "Spamming banned phrases (" + Message + ")", (PlusEnvironment.GetUnixTimestamp() + 78892200));</p><p> Session.Disconnect();</p><p> return;</p><p> }</p><p> </p><p> Session.SendMessage(new ChatComposer(User.VirtualId, Message, 0, Colour));</p><p> return;</p><p> }</p><p> </p><p> if (!Session.GetHabbo().GetPermissions().HasRight("word_filter_override"))</p><p> Message = PlusEnvironment.GetGame().GetChatManager().GetFilter().CheckMessage(Message);</p><p> </p><p> </p><p> PlusEnvironment.GetGame().GetQuestManager().ProgressUserQuest(Session, QuestType.SOCIAL_CHAT);</p><p> </p><p> User.OnChat(User.LastBubble, Message, false);</p><p> }</p><p> }</p><p> }[/CODE]</p><p></p><p>So it is working ? I've tried and not working. lol</p></blockquote><p></p>
[QUOTE="MasterJiq, post: 397734, member: 69646"] Hello! I am trying to make filter word alert like we said ".com" and that word has been filtered, so alert come to the users. I am making it on ChatEvent. So someone could fix my code, the code seems not working ? [CODE]using System; using Plus.Core; using Plus.Communication.Packets.Incoming; using Plus.Utilities; using Plus.HabboHotel.Global; using Plus.HabboHotel.Quests; using Plus.HabboHotel.Rooms; using Plus.HabboHotel.GameClients; using Plus.HabboHotel.Rooms.Chat.Logs; using Plus.Communication.Packets.Outgoing.Messenger; using Plus.Communication.Packets.Outgoing.Rooms.Chat; using Plus.Communication.Packets.Outgoing.Moderation; using Plus.Communication.Packets.Outgoing.Rooms.Notifications; using Plus.HabboHotel.Rooms.Chat.Styles; namespace Plus.Communication.Packets.Incoming.Rooms.Chat { public class ChatEvent : IPacketEvent { public void Parse(GameClient Session, ClientPacket Packet) { if (Session == null || Session.GetHabbo() == null || !Session.GetHabbo().InRoom) return; Room Room = Session.GetHabbo().CurrentRoom; if (Room == null) return; RoomUser User = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id); if (User == null) return; string Message = StringCharFilter.Escape(Packet.PopString()); if (Message.Length > 100) Message = Message.Substring(0, 100); int Colour = Packet.PopInt(); ChatStyle Style = null; if (!PlusEnvironment.GetGame().GetChatManager().GetChatStyles().TryGetStyle(Colour, out Style) || (Style.RequiredRight.Length > 0 && !Session.GetHabbo().GetPermissions().HasRight(Style.RequiredRight))) Colour = 0; User.UnIdle(); if (PlusEnvironment.GetUnixTimestamp() < Session.GetHabbo().FloodTime && Session.GetHabbo().FloodTime != 0) return; if (Session.GetHabbo().TimeMuted > 0) { Session.SendMessage(new MutedComposer(Session.GetHabbo().TimeMuted)); return; } if (PlusEnvironment.GetGame().GetChatManager().GetFilter().IsFiltered(Message)) { PlusEnvironment.GetGame().GetClientManager().StaffAlert(new RoomNotificationComposer("Filtered Words Alert", "Hello <b>" + Session.GetHabbo().Username + "!<br>" + "<br></b> Seems like you've used word that has been filtered" + "<br>" + "<br><b>The filtered words:</b><br>" + "<br>" + "<b>" + "<font color =\"#FF0000\">" + Message + "</font>" + "</b><br>" + "<br>Click button below to reload this alert.</b>", "filter", "Reload", "event:navigator/goto/" + Session.GetHabbo().CurrentRoomId)); Session.GetHabbo().GetClient().SendMessage(new WhisperComposer(User.VirtualId, "La siguiente Palabra esta prohibida en el hotel:" + " " + Message, 0, 34)); Message = null; } if (!Session.GetHabbo().GetPermissions().HasRight("room_ignore_mute") && Room.CheckMute(Session)) { Session.SendWhisper("Oops, you're currently muted."); return; } User.LastBubble = Session.GetHabbo().CustomBubbleId == 0 ? Colour : Session.GetHabbo().CustomBubbleId; if (!Session.GetHabbo().GetPermissions().HasRight("mod_tool")) { int MuteTime; if (User.IncrementAndCheckFlood(out MuteTime)) { Session.SendMessage(new FloodControlComposer(MuteTime)); return; } } if (Message.StartsWith(":", StringComparison.CurrentCulture) && PlusEnvironment.GetGame().GetChatManager().GetCommands().Parse(Session, Message)) return; if (Message.Contains(":amercianpie")) { Session.GetHabbo().Effects().ApplyEffect(104); } PlusEnvironment.GetGame().GetChatManager().GetLogs().StoreChatlog(new ChatlogEntry(Session.GetHabbo().Id, Room.Id, Message, UnixTimestamp.GetNow(), Session.GetHabbo(), Room)); if (PlusEnvironment.GetGame().GetChatManager().GetFilter().CheckBannedWords(Message)) { Session.GetHabbo().BannedPhraseCount++; if (Session.GetHabbo().BannedPhraseCount >= PlusStaticGameSettings.BannedPhrasesAmount) { PlusEnvironment.GetGame().GetModerationManager().BanUser("System", HabboHotel.Moderation.ModerationBanType.USERNAME, Session.GetHabbo().Username, "Spamming banned phrases (" + Message + ")", (PlusEnvironment.GetUnixTimestamp() + 78892200)); Session.Disconnect(); return; } Session.SendMessage(new ChatComposer(User.VirtualId, Message, 0, Colour)); return; } if (!Session.GetHabbo().GetPermissions().HasRight("word_filter_override")) Message = PlusEnvironment.GetGame().GetChatManager().GetFilter().CheckMessage(Message); PlusEnvironment.GetGame().GetQuestManager().ProgressUserQuest(Session, QuestType.SOCIAL_CHAT); User.OnChat(User.LastBubble, Message, false); } } }[/CODE] So it is working ? I've tried and not working. lol [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
Filter system plusemu
Top