Posted on 28 March 2014 - 04:59 PM
Well guys, we all know that when the server has a lot of players on, there is a LOT more trash talking going on. Many players are constantly saying eZ or ease. Why don't we just cancel the message if it contains eZ or any variation of that word. It would keep the chat more cleaner and while we're at it, let it mute the player for 5 minutes the first offense, 15 for the second, an hour for the third, 5 days for the 4th and perm for the 5th . It takes a load off the mods shoulders as well.Posted on 28 March 2014 - 06:25 PM
HiDD3NxSHAD0W wrote
What was wrong with it
Posted on 28 March 2014 - 07:48 PM
when you said eZ in chat "I am easy" came up instead. But the problem was when you said ReaVeZz it became ReaVeI am easy. So we shut it down.Posted on 28 March 2014 - 08:13 PM
filtering one word will barely do anything. people will always find another variation (when eZ was filtered people said "ease")Posted on 28 March 2014 - 08:24 PM
ZombieForce wrote
Theres a way to fix that, when checking for the term eZ, if(message.contains.equalsIgnoreCase(" ez " || " ease " replace " ez ", " ")){ You put space between the message before that and after that
The code would look something like that. I just thought of that off the top of my head
Posted on 29 March 2014 - 07:58 AM
Cavasi wrote
It's a good first attempt. Some things to consider:
1. What happens when the chat message starts with those? There is no beginning space.
2. What happens if that section is the last thing. Now that end space doesn't exist, so it doesn't match.
3. Wouldn't it be better just to cancel the event and send them a warning of what not to say, instead of flooding the chat with "I am easy"?
4. Efficiency. It would be much easier to just cancel it the first time you encounter a bad phrase. This way you could use else if's instead, and as soon as it finds one it can stop checking the message.
5. Look into a term called regex (regular expressions).
6. Test your code before submitting, as at first glance I don't think it would work. You need to make a listener (let's call it ChatListener) class, throw onChat in there, and attach the listener in your onEnable using something like this "this.getServer().getPluginManager().registerEvents(new ChatListener(this), this);" Make sure your constructor of your chatlistener takes your plugin.
I'm all for people learning how to code minecraft, and code in general. While what you are doing is nice (in attempting to help), I'm already programming a chat filter in my new ban manager that will be integrated into the website and profiles.
Posted on 29 March 2014 - 08:38 AM
Archybot wrote
I'm all for people learning how to code minecraft, and code in general. While what you are doing is nice (in attempting to help), I'm already programming a chat filter in my new ban manager that will be integrated into the website and profiles.
Release date: Never
On a serious note I'm going to revisit the chat filter.
@HiddenShadow, it didn't fail, it did EXACTLY what i wanted it to do :) For a while after that there were less ez's.
Posted on 29 March 2014 - 02:39 PM
MasterGberry wrote
Archybot wrote...
Release date: Never
On a serious note I'm going to revisit the chat filter.
@HiddenShadow, it didn't fail, it did EXACTLY what i wanted it to do :) For a while after that there were less ez's.
Before I had it cancelling the event but then I thought you guys wanted to get it replaced with I am easy
Posted on 29 March 2014 - 02:40 PM
Archybot wrote
Cavasi wrote...
It's a good first attempt. Some things to consider:
1. What happens when the chat message starts with those? There is no beginning space.
2. What happens if that section is the last thing. Now that end space doesn't exist, so it doesn't match.
3. Wouldn't it be better just to cancel the event and send them a warning of what not to say, instead of flooding the chat with "I am easy"?
4. Efficiency. It would be much easier to just cancel it the first time you encounter a bad phrase. This way you could use else if's instead, and as soon as it finds one it can stop checking the message.
5. Look into a term called regex (regular expressions).
6. Test your code before submitting, as at first glance I don't think it would work. You need to make a listener (let's call it ChatListener) class, throw onChat in there, and attach the listener in your onEnable using something like this "this.getServer().getPluginManager().registerEvents(new ChatListener(this), this);" Make sure your constructor of your chatlistener takes your plugin.
I'm all for people learning how to code minecraft, and code in general. While what you are doing is nice (in attempting to help), I'm already programming a chat filter in my new ban manager that will be integrated into the website and profiles.
Also, I feel like you think I'm a retard. I just did this code really fast. Its psuedocode. Also, I have a chat listener, the class implements listener. You Don't need separate classes to code a plugin
Posted on 29 March 2014 - 04:33 PM
Cavasi wrote
Archybot wrote...
Also, I feel like you think I'm a retard. I just did this code really fast. Its psuedocode. Also, I have a chat listener, the class implements listener. You Don't need separate classes to code a plugin
You should though: http://en.wikipedia.org/wiki/Object-oriented_programming
Posted on 29 March 2014 - 04:36 PM
MasterGberry wrote
Once again, like I said. I just put it together fast. I dont want to spend so much time on a plugin thats not even going anywhere
Posted on 29 March 2014 - 04:45 PM
Cavasi wrote
If it worked well and did it's job I don't mind using it. Just gotta be clean etc for future usage.
Posted on 29 March 2014 - 04:49 PM
Yeah, we aren't calling you stupid at all. We are bringing up valid points/concerns you should think about when programming. If you think we are being mean you should see our dev chat where we scrutinize every little thing in our plugin development.Posted on 29 March 2014 - 07:30 PM
Archybot wrote
If I were a dev I would pay a lot more attention to detail. Since I'm not, I wont