only a simple idea, nothing else:
http://aluigi.org/patches/playerslimiter.zipfeel free to try it and to ask here for doubts, help, comments, suggestions or feedback.
note that for the games based on the Quake 3 engine (so for games like Quake 3, Jedi Knight/Academy, RTCW, Enemy Territory, Soldier of Fortune II, Call of Duty 1/2/4/5, Elite Force I/II and so on) I have worked on a specific experimental project which uses a similar idea but an additional cross-checking of the informations which allow to really limit the number of players from the same IP:
http://aluigi.org/patches/q3playersperip.zipthe following is the Introduction in the text file of the zip of playerslimiter:
Code:
This is an experimental beta project which does the following simple
job: hooking recvfrom and dropping a certain packet if it's received
within some seconds.
So this can be considered an experimental way to "limit" the fake
players bug or just to reduce the amount of players from the same IP
but it must be NOT considered a real solution.
It's only a simple idea, nothing else so don't expect miracles.
The following is the concept of this small project:
- monitor all the incoming packets
- if the packet starts with the same bytes contained in the file
packet.dat the source IP address and the current time are stored in
the internal database
- if the same packet (a packet which starts with the same bytes of
packet.dat) is received again from the same IP within 15 seconds it
will be set to a length of zero so that the main program (the game
server) will ignore it and the new player will not join
the time is recorded each time the packet is received so if the player
from IP 1.2.3.4 sends the join packet each 5 seconds it will be ever
ignored (except the first one obviously) because the time of the last
packet received is ever minor than 15 seconds.
The idea is very basic just because the purpose is applying it to
almost any existent game with a minimal configuration (packet.dat).
The only downsides are that:
- this is a time based limitation in the joining of the players from
the same IP and NOT a way to limit the maximum number of players from
the same IP, so an user which launches 16 clients on his same machine
with 15 seconds of delay between each connection is still able to
fill the server without problems
- there is no protection versus spoofed packets for obvious technical
and logical limits
- if a legit player joins the server and then disconnect immediately
and rejoins within 15 seconds he will fail
The source code of the project is very small and enough commented so is
possible to customize it for matching the exact needs of the game to
which adding this "IP limitation".
It's even possible to enhance it adding major features like smart
filters, a rudimental firewall or anything else which can be
implemented at that level (recvfrom).