18.08.2009, 00:37
Quote:
Originally Posted by Jay_
Instead of using a timer to remove the record, you could just check if 5 mins or whatever has passed when that IP reconnects and if so remove the record there. If the IP doesn't reconnect, could could store the time to the database and check when initialising it whether any IPs have expired.
GetTickCount is a useful function for things like these. |
On disconnect, their ip is added to a table, a 5 second timer is then set to remove it.
If the player rejoins before its removed (rejoins within 5 seconds) the ip s banned. There is no way to load back in that fast.
It also takes into consideration of reason on disconnect, if its a timeout, it wont add the ip because their is a delay from actual timeout and the server noticing.