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.
Printable View
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.
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!
nom nom nom nom nom nom nom, nub don't bump.