Skip to main content
GameDev.net gamedev.net
🔒 Locked

filtering chat

Started by EkEk Apr 10, 2006 at 9:56 PM 3 replies 950+ views
Original Post
EkEk
EkEk
hi everybody, i'm currently making a game server. and my friend told me that for chat, i should filter the language, so when a user chat on my server say a bad word, i can block the word and automatic kick the user. what is the best and most optimize way to do this? thank you.
cherryhouse
cherryhouse
Unless you're making a sesame street game, I would suggest forgetting about your friends idea. Not only would it be un-necessary to kick someone for saying "dick", referring to someones name, it would also result in random kicks for people trying to say other words. A word filter won't block bad words, it will only make users spell them slightly different.

For example, let's say you wanted to filter out all bad words:
Quote:
Jim: Hey ted.
Ted: Hey jim.
Jim: I heard you've gotten a new sound system. How's the b#$@ on it?
Server: User Jim - Kicked for saying "ass"


If you still want to do this, just loop through everyone character received from all clients and if any amount of characters adds up to a swear word, filter, send the filtered message back to the clients, and punish the user who sent the message.
Hello?
EkEk
EkEk
thank you cherryhouse :D, I think I'll skip the filtering thing.
hplus0603
hplus0603
I would suggest implementing filtering, but doing it client side. That way, individual users can turn filtering on or off.

Policing users who don't follow community standards is best done by the community.
enum Bool { True, False, FileNotFound };
EkEk
EkEk
great idea.
never thought of that.
thx.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.