Cuberite Forum
AntiFlood - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Plugins (https://forum.cuberite.org/forum-1.html)
+--- Forum: Plugin Releases (https://forum.cuberite.org/forum-2.html)
+--- Thread: AntiFlood (/thread-2220.html)



AntiFlood - DrMasik - 11-23-2015

This plugin kicks players that spam chat messages and commands too quickly.

There are two settings in the main.lua file:
gMsgDelay - How many seconds must a player wait between messages before their "Warning Level" goes up.
gWarningsBeforeKick - How large can the "Warning Level" get before the plugin kicks them.

Source:
Git


RE: AntiFlood - NiLSPACE - 11-23-2015

But.. what does it do?


RE: AntiFlood - DrMasik - 11-23-2015

(11-23-2015, 01:30 AM)NiLSPACE Wrote: But.. what does it do?

Updated


RE: AntiFlood - ThuGie - 11-23-2015

I think he actually means flood against what, to me its clear its for chat, but not for all, it could be login flooding.

Proper description would be wanted as well
"It is kick player."

If a player floods the chat to much after a certain set amount of warnings the player will be kicked

Something like that ?


RE: AntiFlood - Zee1234 - 11-24-2015

(11-23-2015, 12:26 AM)DrMasik Wrote: AntiFlood it is simple antiflood plugin.

It is kick player.

There are 2 params into main.lua file:
gMsgDelay - Delay before send message by player
gWarningsBeforeKick - How many warnings before kick

Source:
Git

Better description:
Code:
This plugin kicks players that spam chat messages and commands too quickly.

There are two settings in the main.lua file:
[b]gMsgDelay[/b] - How many (seconds? Pretty sure this is actually Milliseconds) must a player wait between messages before their "Warning Level" goes up?
[b]gWarningsBeforeKick[/b] - How large can the "Warning Level" get before the plugin kicks them?

Suggestion 1:
Replace
local plUID = aPlayer:GetUniqueID();
with
local plUID = aPlayer:GetUUID();

Why? GetUUID will work if a player logs off and logs back on without the server restarting. GetUniqueID "forgets" when they log in/out, and actually has a chance to apply to a different player (I think. I might be wrong, but GetUUID is still smarter).

Suggestion 2:
Include an onDisable function and just return the default value.


RE: AntiFlood - Schwertspize - 11-24-2015

"Replace GetUniqueID with GetUUID"
why? of course a reason is, you can kick offline player, because you can still get the uuids when they left


RE: AntiFlood - DrMasik - 11-24-2015

(11-24-2015, 01:42 PM)Zee1234 Wrote: Better description:
Code:
This plugin kicks players that spam chat messages and commands too quickly.

There are two settings in the main.lua file:
[b]gMsgDelay[/b] - How many (seconds? Pretty sure this is actually Milliseconds) must a player wait between messages before their "Warning Level" goes up?
[b]gWarningsBeforeKick[/b] - How large can the "Warning Level" get before the plugin kicks them?

Thank you for better translation!

(11-24-2015, 01:42 PM)Zee1234 Wrote: Suggestion 1:
Replace
local plUID = aPlayer:GetUniqueID();
with
local plUID = aPlayer:GetUUID();

Why? GetUUID will work if a player logs off and logs back on without the server restarting. GetUniqueID "forgets" when they log in/out, and actually has a chance to apply to a different player (I think. I might be wrong, but GetUUID is still smarter).

I'm don't want to ban player. Kick - it is warning for the player. In any case, I'm want to disable global chat. And use it is for system messages.

In any case GetUUID() change if player change nick name. So, It is right to ban by IP. But we can lose players behind NAT.
It is better ban by name. How many times and how long?
If you want, I can create some rules for ban player.

(11-24-2015, 01:42 PM)Zee1234 Wrote: Suggestion 2:
Include an onDisable function and just return the default value.

I'm update the function (hook) in future.


RE: AntiFlood - xoft - 11-25-2015

GetUniqueID() returns an ID that is used internally by cuberite to identify all entities currently present in the world. It is not permanently "assigned" to any player. It is unique only within one run of the server, and is never recycled for another entity until the server is restarted. This means that reconnecting will give you a different UniqueID.

GetUUID() returns either the Mojang identifier for the player (if the server authenticates, "online mode"), or a similarly structured identifier used to uniquely identify a player between sessions. Reconnecting will not give you a different UUID. Renaming your account will give you a different UUID only if "online mode" is disabled.