Ulysses

Ulysses Stuff => Suggestions => Topic started by: Zyklus on January 14, 2007, 12:49:34 AM

Title: Better language filter...
Post by: Zyklus on January 14, 2007, 12:49:34 AM
Before I go to bed tonight, I thought this might be a good idea to talk about... There should be a good regexp language filter that filters a player's message and sends the filtered message to everyone else but the player who typed it.  The original message is sent back to the player who sent it, while for the other players, it is filtered and sent.  The player who sent the message cannot tell if his language is being filtered, since his messages are reflected back.  The other players (depending on if we want the filter to replace with "!@#$" or "dang", "crap", etc.) will receive the filtered message...  Bah, I'm tired let me explain that again...

1.  Player B sends a message containing one or more words that need to be filtered.
2.  The server receives the message.
3.  The server sends the message back to Player B to display on his/her HUD.
4.  The server filters the message.
5.  The server then sends the filtered message to the other players to display on their HUD.

Therefore, Player B does not know if his/her messages were ever filtered.  So, he/she won't try to get around a filter he/she doesn't know about... right?  ;) 


The reason I bring this up is because when I was playing hl1dm a while ago, I happened to be on some n00b server with a (horrible) language filter.  It replaced "noob" with "a good player" and among other things.  Every time I wanted to type noob, I had to put spaces in between the characters just to get my message across.  That was one retarded n o o b server.  Anywho, the moral of the story is, if the player doesn't see the filter, she doesn't know how to get around it.
Title: Re: Better language filter...
Post by: Megiddo on January 14, 2007, 12:57:56 AM
Been meaning to do something like this for a long time. :)

I was never able to do it on GM9 because lua doesn't implement the full regex library. Now that we have the ability to do modules though, we could easily implement that full library.

The most difficult parts of a swear filter as I see them are "unleeting" the string, since there's so many possibilities, and figuring out if they're trying to get around the filter with spaces.

Let me know if you need any help doing this! Have a few scraps of code that may or may not help you, and lots of ideas. ;)
Title: Re: Better language filter...
Post by: Zyklus on January 15, 2007, 08:43:57 PM
Been meaning to do something like this for a long time. :)

I was never able to do it on GM9 because lua doesn't implement the full regex library. Now that we have the ability to do modules though, we could easily implement that full library.

The most difficult parts of a swear filter as I see them are "unleeting" the string, since there's so many possibilities, and figuring out if they're trying to get around the filter with spaces.

Let me know if you need any help doing this! Have a few scraps of code that may or may not help you, and lots of ideas. ;)

... What?  The whole point of the filter is to make sure that the players don't know they are being filtered ;)
Title: Re: Better language filter...
Post by: Mank on January 17, 2007, 04:26:44 PM
... What?  The whole point of the filter is to make sure that the players don't know they are being filtered ;)

I'm not sure he read your post fully.
Title: Re: Better language filter...
Post by: Megiddo on January 17, 2007, 06:47:55 PM
I'm not sure he read your post fully.

;)
Title: Re: Better language filter...
Post by: Golden-Death on January 17, 2007, 08:20:13 PM
Code: [Select]
function censor(werdz)
if string.find(werds, "") then
x = string.gsub(werds, "", "***************")
return x
end

Blocks all swear words. Guaranteed.
Title: Re: Better language filter...
Post by: Mank on January 18, 2007, 09:41:13 AM
Code: [Select]
function censor(werdz)
if string.find(werds, "") then
x = string.gsub(werds, "", "***************")
return x
end

Blocks all swear words. Guaranteed.

I'm George Zimmerman creator and founder of the mens warehouse, I guarantee it!

Anyway, I'm suprised you took the time to make a mock lua script xD