Messages containing the phrase “cumulative upkeep” are not being sent.
The regex string is looking for "cum" without filtering out if it is part of a larger word.
So the fix would be, what, '\bcum\b'? Which in the code needs to be entered as '\\bcum\\b' due to the character escape. Quick test here on my end fixed that.
That would be a step in the right direction. Other things we could do to make the filter less annoying:
I am using 1.4.19V0. And I am not talking about the game log, I am talking about the chat. Try saying “cumulative upkeep” in the game chat; the message will simply not be sent. It will appear to be lost just like when the chat was having delay issues. Except now the message just never arrives.
I don't know what you're trying to argue for when you say that XMage “isn't a democracy” etc, but I'm fairly sure I wouldn't want to live in a jurisdiction where I can't talk about the Magic rules in a polite fashion with someone who has expressed interest in the topic. Implementing any of the 4 things I suggested would allow me to do this, but right now the various chat rooms are pretty much unusable because random messages will be filtered out with no indication whatsoever that the filtering was intentional and not caused by another network/memory error, or which word it was that triggered the filter.
I'll note that you can still whisper without it being filtered if it's intended to go to a single person.
This is unnecessarily complicated, especially in multiplayer games.
I'd argue that it's fairly obvious which words would cause the filter to stop it being sent through.
It may be obvious to you, since you seem to have written the filter. I guarantee you it is not obvious to an average user, not with the way it is implemented currently.
Using RegEx for censorship is never actually going to work. IDK how good the system is now, but the best case scenario is you will make sure nobody uses words the subset of "bad words" that you can think of in their messages. Worst case your chat is now semi-unusable because your censorship RegEx is not perfect.
You can still flame pretty effectively, all this encourages is clever use of words/characters. Allowing people to vote to silence someone would be much more effective. You don't have to make decisions about what is or is not too offensive for the users, and there are no false positives.
You can even be intelligent about it and give per-vote warnings to the offenders, or limit votes to prevent abuse of the feature.
Edit: btw, if what we are talking about is containsSwearing() from ChatManager.java, that list filters out at least 46 actual magic cards.
So right now we have a clbuttic mistake with a Scunthorpe problem. Maybe look into if there's a good filtering engine already out there in java?
While what I did provide as a quick and dirty fix works, it will allow other word though that contain the word cum then. I.e., calling someone a dumcum gets though.
Well, this is probably fixed now I guess. The filter is optional and client side now so less pain for the server.
Most helpful comment
Using RegEx for censorship is never actually going to work. IDK how good the system is now, but the best case scenario is you will make sure nobody uses words the subset of "bad words" that you can think of in their messages. Worst case your chat is now semi-unusable because your censorship RegEx is not perfect.
You can still flame pretty effectively, all this encourages is clever use of words/characters. Allowing people to vote to silence someone would be much more effective. You don't have to make decisions about what is or is not too offensive for the users, and there are no false positives.
You can even be intelligent about it and give per-vote warnings to the offenders, or limit votes to prevent abuse of the feature.
Edit: btw, if what we are talking about is containsSwearing() from ChatManager.java, that list filters out at least 46 actual magic cards.