How could I change the word "bobba" to another word?
How could I change the word "bobba" to another word?
yes is work witsh spazz emu or Blah's Emulator?
Your attempt at a filter runs a MySQL query every single time someone talks, enjoy your MySQL rape.
If you want to do it properly then load the filtered words on bootup and cache them, then check against the cache rather than running a MySQL query each time cos on a big hotel this will seriously rape CPU for MySQL.
or you make mysql Cache higher :P
Still good but, on KM there is a better Bobba Filer that you can configure in config like on and replace word etc. Word you can do in config. I will release it soon here.
i have the code on off is easy ^^
if you wana cache them make a 'dictionary' (C#) and do 2 fields (MySQL DB) 'to_filter' and 'filter_with' then for filter_with the default could be 'bobba' so it auto uses bobba when someone adds a word, then just load all the words into the 'dictionary' at start up, ta-da cached filter.
The only time Aaron's ever said anything intelligent? -gasp- but wait caching has been done for ages now everyone knows this.
Last edited by Moogly; 14-01-11 at 02:23 PM.
Even more advanced:
Now this will check for FuCK or Fuck or FuCK or F-U-CK or F*ck or F-ck or F uck or F'ckCode:DataTable Data2 = null; using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient()) { Data2 = dbClient.ReadDataTable("SELECT SQL_NO_CACHE * FROM wordfilter"); } if (Data2 != null) { foreach (DataRow Row2 in Data2.Rows) { string Lowered = Message.ToLower(); Lowered = Lowered.Replace(" ", ""); Lowered = Lowered.Replace("´", ""); Lowered = Lowered.Replace("`", ""); Lowered = Lowered.Replace("^", ""); Lowered = Lowered.Replace("*", ""); Lowered = Lowered.Replace("'", ""); Lowered = Lowered.Replace("-", ""); if (Lowered.Contains(Row2["word"].ToString())) { Message = "**** The Super Hotel spam filter has blocked this text! ****"; GetClient().SendNotif("You have swore or have been classified as a spammer. \nYou have now been muted for 30 seconds!"); ServerMessage Packet = new ServerMessage(27); Packet.AppendInt32(30); //Blocked for 1 Minute GetClient().SendMessage(Packet); } //} }
And will also mute them for 30 seconds!
Last edited by Beny.; 02-04-11 at 09:38 PM.
nom nom nom nom nom nom nom, nub don't bump.