|
It only needs to do the filtering once, when the chat is received. If you're in populated areas like Graal City you're going to experience lag anyways, so if you're actually interested in playing without performance issues you shouldn't really be in those areas. Loops and the likes are much more expensive.
|
I know that it would only be calculated once, upon a message being sent. But wouldn't it lag going through all the calculations to determine what to censor in a message? Graal Classic uses one of the most complex language filters I've ever seen in an online game;it doesn't just test if a string contains the words, but also for patterns like hiding the words between punctuation and alternative character(s) formed together to look similar, like |\|00b(except something offensive)
If you're receiving 5 messages a second, say of a length of 50 characters, wouldn't that have a drastic impact on performance?
If you calculate the censor serverside, it would only have to be calculated on the server, and would work for everyone with the censor on the same-you only need to calculate it once per message, so it isn't like walking where its unique for every character and where latency causes issues. You then send one of 2 messages to the player: the censored one, or the uncensored one.
The only thing clientside filtering would do better(efficiently) would be allowing you to censor words you don't like(I can finally censor "YOLO" and "Swag"!)
By having an optional swear filter(turned on by default to avoid angry parents), people wouldn't try to avoid it, and people with it on wouldn't have to deal with obscene words all the time, and those with it off won't have to deal with the strictness or inconveniences caused by it(I can't talk about the game Combat Arms without going to certain measures to avoid the filter, part of it is picked up as a rude word)