multitheftauto / amx

MTA AMX compatibility layer.
zlib License
31 stars 8 forks source link

BlockIpAddress and UnBlockIpAddress #25

Open Disinterpreter opened 4 years ago

Disinterpreter commented 4 years ago

Function name BlockIpAddress(ip_address[], timems) UnBlockIpAddress(ip_address[])

ip_address The IP to block. timems The time (in milliseconds) that the connection will be blocked for. 0 can be used for an indefinite block.

Describe the function Blocks an IP address from further communication with the server for a set amount of time (with wildcards allowed). Players trying to connect to the server with a blocked IP address will receive the generic "You are banned from this server." message. Players that are online on the specified IP before the block will timeout after specific amount of seconds and, upon reconnect, will receive the same message. Effect takes place only when server is running (it is not persistent).

Equivalent in MTA https://wiki.multitheftauto.com/wiki/AddBan https://wiki.multitheftauto.com/wiki/RemoveBan

But there is a problem.

Blocks an IP address from further communication with the server for a set amount of time (with wildcards allowed).

Additional information BlockIpAddress UnBlockIpAddress

Disinterpreter commented 4 years ago

Blocks an IP address from further communication with the server for a set amount of time (with wildcards allowed).

Need to rewrite it to AMX https://github.com/hamishforbes/lua-resty-iputils/blob/master/lib/resty/iputils.lua

But it will a long operation for big subnets. I think I will set the label 'depends on blue'