22.01.2013, 23:43
No idea which section I should have posted this in. This seemed to fit best.
As many of you know, sometimes when you timeout or re-join a server after a GMX or crash/restart, you will be 'banned'. The 'You are banned from this server.' message will apear. This is extremely frustrating as you have to re-connect. This is a massive nuisance when you are trying to develop a server and have to GMX a lot, and the server crashes often if you use certain plugins (BlueG's mySQL IIRC). This is a SA:MP bug that was introduced in 0.3e R2 as a side-effect of some connection security measures added.
Until now, nobody (AFAIK) has found a fix for this, but I had a brainwave, tried it, and was really surprised that it worked!
This is how simple it is........
SendRconCommand("reloadbans");
!
I've tested it time and time again. It works perfectly! All you have to do is put it in a timer (it has to be called while the client is trying to connect, and clients try to re-connect every 3 seconds or so. Less than 3 seconds is recommended. I put it in my global 1 second timer when testing.)
It's not PERFECT. The client will fail to connect TWICE before it will succeed. It will say
The server is restarting..
Connecting..
Didn't respond
Connecting..
Didn't respond
Connecting..
Connected!
It's better than re-logging though!
Can anyone confirm that this 100% works?
EDIT: Okay, did some testing and found out the following.
It seems the ban resets once the server has been running for about 10 seconds. When I tested it just now, I started the server, connected, then I shut it down (closed samp-server.exe) and re-started it. I got banned. If I wait 10 seconds or so though before I close the server, it doesn't ban you. You have to be connected for 10 seconds on the previous connection for this to work. You CAN restart the server straight away.
I've tested it over 20 times now and not been banned once.
I've also tested 'unbanip [my ip address]' but sadly this doesn't work. It's clearly an internal SA:MP thing. I'm not sure why reloadbans allows the connection. I hope this doesn't become a security issue..
As many of you know, sometimes when you timeout or re-join a server after a GMX or crash/restart, you will be 'banned'. The 'You are banned from this server.' message will apear. This is extremely frustrating as you have to re-connect. This is a massive nuisance when you are trying to develop a server and have to GMX a lot, and the server crashes often if you use certain plugins (BlueG's mySQL IIRC). This is a SA:MP bug that was introduced in 0.3e R2 as a side-effect of some connection security measures added.
Until now, nobody (AFAIK) has found a fix for this, but I had a brainwave, tried it, and was really surprised that it worked!
This is how simple it is........
SendRconCommand("reloadbans");
!
I've tested it time and time again. It works perfectly! All you have to do is put it in a timer (it has to be called while the client is trying to connect, and clients try to re-connect every 3 seconds or so. Less than 3 seconds is recommended. I put it in my global 1 second timer when testing.)
It's not PERFECT. The client will fail to connect TWICE before it will succeed. It will say
The server is restarting..
Connecting..
Didn't respond
Connecting..
Didn't respond
Connecting..
Connected!
It's better than re-logging though!
Can anyone confirm that this 100% works?
EDIT: Okay, did some testing and found out the following.
It seems the ban resets once the server has been running for about 10 seconds. When I tested it just now, I started the server, connected, then I shut it down (closed samp-server.exe) and re-started it. I got banned. If I wait 10 seconds or so though before I close the server, it doesn't ban you. You have to be connected for 10 seconds on the previous connection for this to work. You CAN restart the server straight away.
I've tested it over 20 times now and not been banned once.
I've also tested 'unbanip [my ip address]' but sadly this doesn't work. It's clearly an internal SA:MP thing. I'm not sure why reloadbans allows the connection. I hope this doesn't become a security issue..