-
-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chat #463
Chat #463
Conversation
Copying over my proposal from the previous PR.. How about some advanced anti-spam features, like:
Measures against coordinated spamming, like:
Server owners can tweak the # of messages/polling interval based on what's normal for their server. For example, if it's a gamemode some people can get hyped up and send a burst of happy messages, like end-of-round, they would need to make the polling interval longer. If the server gets more popular (leading to increased chat activity), they would need a higher message count tolerance. So a spamming incident can be resolved without the presence of a server admin. If one is present when slowmode is activated, they should be able to use a command to lift it if they go to manually resolve it (like: ban the coordinated spammers) Bonus points: every time slowmode has been applied, automatically send a "suspected spamming incident report" into the admin panel reports list (submitter: not player, but system) eventually with a recap of the chat lines ( + author) around the time it got triggered. Using the same functionality that already captures a player's last chat messages if they got reported with /report & selected in the target player dropdown. |
In the upcoming code reviews (when all commits are added to the new PR), there should be extra attention for conditions/optimal branching of the code in onPlayerChat, to ensure that there's no grave performance consequences that comes with complexity; ideally, most chat messages (to say: ones that don't trigger any detection or additional checks) shouldn't take much more CPU time/be slower than 'clean' onPlayerChat handlers present in various gamemodes before this. I didn't review or test this, but we need to keep our eye on this aspect, it has to be checked off on when the PR is in its final state. |
A few people said it during the previous PR and also on Discord, they think it's not a good solution to implement the chat in the admin resource, since quite a lot of people use the admin resource in their own projects, so they need to turn off the chat or change the code if the latest version is used. In addition, if we want to implement all of this in the admin, two resources must be managed at the same time. What do you think, wouldn't it be easier to create a new resource called 'chat' for this? |
yes. Then also output a console warning if one of the gamemodes are running (that now rely on the chat resource) but the chat resource isn't.. or even preserve the original chat handlers in those resources, but attach/detach them based on whether or not the new chat resource is in use; this will provide server owners the freedom which road to walk entirely. It can also be compounded with an opt-in or opt-out (meta.xml) above the running state of 'chat', and since the old chat handlers containin the old code will be present as well, it can just fall back on it. Any server owners that run into issues can conveniently return to the old behavior. |
I think if you are going to go forward with these expanded features it makes sense for it to be in a separate resource. However, I would personally like to see a section in the |
It's a good idea, I'll think about it after completing the remaining tasks. |
Ok so a new chat resource needs to be created with Meta xml settings to manage the moderation and spam features. I don't see the need for a special panel in admin2 to control the settings because the admin panel already has a resource settings editing panel. You just double click the resource name in the list and it shows a pretty list of settings. |
I'm willing to finish this asap if y'all agree with above , |
My argument here is that because the chat is a "core functionality" and this resource is replacing functionality that was previously in I would be fine with omitting it for now. Perhaps it could be saved as a new feature just for |
For the sake of pushing progress to fix the chat bug ASAP, I think this main panel for configuring chat should be done in another PR for admin2 indeed. |
I can continue working with it from today, so I will finish it soon. |
I think that the admin2 user interface for configuration is an important and good feature, and since its implementation does not take much time, it fits in this pull request. If anyone has an idea about it, feel free to share. |
Okey, we can brainstorm ideas for the admin2 chat control panel. |
I was busy earlier.. |
I need some advice on how to store message logs. I thought of using an SQLite database, but the table cannot be filled with messages indefinitely, there should be a limit. |
SQL will be your best option. Add a column to the table for the timestamp of each message. In the resource, have a function to |
@Nico8340 I suggest logging to an SQLite DB, and periodically running a query that deletes log entries that are older than X days (e.g. 30 days). Alternatively, to keep a maximum number of rows in the table, you can save the last row ID and run this query to periodically delete the rows with IDs inferior to the lastRowID - Y: |
I'm going to open a new pull request, because the preps weren't right, since we agreed to leave the old handlers as a fallback option, and with this modification I would completely overturn the current structure. |
I will continue working on it as soon as I get home from vacation. |
Chat
This Pull Request removes chat management from all game modes and adds a new, separate solution that is highly configurable and customizable, with automatic moderation by today's standards.
Fixes #460
Follows #461
Preps
Tasks
Backlog
There was discussion that it would be nice to include a user interface in the existing admin panel to configure moderation. This will be implemented optionally after the later works.