-
-
Notifications
You must be signed in to change notification settings - Fork 168
Improved chat + Fix #460 (Chat messages sent twice) #461
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
Conversation
This breaks playercolors if you want to use it independently of freeroam. The reason chat messages are sent twice now is because playercolors got added to mtaserver.config as a default starting resource where this wasn't this case before. |
I misunderstood things a bit, now I went over everything again. It is true that if we want to use it without freeroam, it will not work properly because of this commit. However, the solution is not to remove it from mtaserver.conf, since playerblips needs the playercolors resource to work properly. |
Now playercolors work properly even if freeroam is not running. |
having playercolors running does nothing other than suppress a warning from playerblips. It might make more sense to change playerblips to ignore the running of playercolors if freeroam is running or remove the functionality from freeroam that already assigns random player nametag colours. |
In this case, I think it is simpler and more meaningful to modify playerblips, since freeroam's onPlayerChat event handler contains other things, such as word repetition checking and spam protection. For this reason, playercolors must be removed again from mtaserver.conf. |
The changes have been made, if they are accepted in their current form, a pull request will be created in the main repository regarding the removal of the playercolors resource from mtaserver.conf. |
The proper fix (imo, which I was working on) is the following:
|
It's ok, I'll work on the solution. |
The new implementation is ready, the onPlayerChat event handlers have been removed from all gamemodes -- A completely new and configurable solution has been added to admin and admin2. It is possible to turn off Anti-Spam, edit monitoring and suspension times, disable word repetition, enable linking with playercolors and allow players to use custom HEX color codes. |
It would be nice to use this opportunity for blocking common spam characters (like Bismillah).. there is a way to select by charset to stop weird characters like that, if you don't know how i will post it soon |
I am not against having admin filter chat messages that may be considered harmful. But having a chat-system which cancels the original chat just to display coloured name tags which are set in a different resource, just seems out of place for an admin system. At that point why not just set the random coloured name tags in admin? Along side attaching coloured blips? Why are those not in admin but having a coloured names chatbox is? |
The filtering should be done inside the chat resource and not the admin resource (unless you want to have all the chat resource in the admin panel) (exports are slow). The admin panel does not handle the chat. If you want the admin panel to have an option to enable or disable the chat maybe add a setting to the meta.xml for the filtering or create some exports. |
This implementation handles the chat in the admin resources. (admin and admin2) (see conversation history) |
I fixed the errors in the review and added the option to completely disable the chat handler. If anyone has an idea for implementing the spam filter mentioned by Dutchman, feel free to share it. |
This will eliminate a bunch of spam characters: function removeChatSpam(msg)
local newMsg = ""
for i = 1, utfLen(msg) do
local char = utfCode(utfSub(msg,i,i))
if(not (char >= 768 and char <= 879)) then
newMsg = newMsg .. utfSub(msg,i,i)
end
end
return newMsg
end I didn't test it with Bismillah, you may want to do that and handle it with match if not covered |
There's a conflict with d8834a8 (i dont know why it's not been detected) |
I see that the whole Pull Request is bugged, but since there are still a lot of unnecessary commits and I messed up the whole branching, I'm closing this PR and opening a new PR soon. |
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. |
It's fine by me, please copy this message to the new PR when i open it, and continue any future conversation there. |
A completely new and configurable solution has been added to admin and admin2.
It is possible to turn off Anti-Spam, edit monitoring and suspension times, disable word repetition, enable linking with playercolors and allow players to use custom HEX color codes. (And it fixes #460)