14.04.2015, 16:46
This has been part of YSI for many years, but I don't remember ever documenting it.
There is just one function:
Both the parameters are optional, calling it with no parameters:
Removes all limits, and lets as many people as they like connect from the same IP.
The first parameter limits the number of connections from one IP:
That will let just two people (clients) connect at once on one IP.
The second parameter tells the system what to do if any extra clients connect from that IP. The default is "BLOCK" - any further connections will be refused. There are several other options:
There is just one function:
Code:
SetMaxConnections(max, action);
Code:
SetMaxConnections();
The first parameter limits the number of connections from one IP:
Code:
SetMaxConnections(2);
The second parameter tells the system what to do if any extra clients connect from that IP. The default is "BLOCK" - any further connections will be refused. There are several other options:
- e_FLOOD_ACTION_BLOCK - Kick the latest player on this IP (don't let them connect)
- e_FLOOD_ACTION_KICK - Kick all players on this IP.
- e_FLOOD_ACTION_BAN - Ban the IP and have the players time out.
- e_FLOOD_ACTION_FBAN - Ban the IP and kick all the players instantly.
- e_FLOOD_ACTION_GHOST - Silently force all players on the IP to reconnect.
- e_FLOOD_ACTION_OTHER - Call the "OnFloodLimitExcceded" callback.
Code:
public OnFloodLimitExcceded(ip[16], count) { foreach (new i : FloodingPlayer) { SendClientMessage(i, 0xFF0000AA, "There are too many of you on this IP!"); Kick(i); } }