Original Post
🔒 Locked
filtering chat
Advertisement
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:
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.
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.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement