Fix for 'You are banned from this server.' bug [!!!]
#1

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..
Reply
#2

Where to reload the bans, gamemodeinit?

Edit:nvm , im derping and blind.

Awesome, gonna test it!
Reply
#3

No, it has to be called WHEN THE PLAYER IS CONNECTING, which can't be known unless you somehow find a way to detect the 'incoming connection' message.

It'd be nice if it was just as simple as that, wouldn't it?
Reply
#4

Nice job. I have been looking for a solution to this for some time now. It's extremely annoying when you're trying to test your script and it requires a GMX.
Reply
#5

This is awesome! Frustrating beyond belief, having to reconnect, is. Wish there was an OnPlayerLoadingScreen callback lol..
Reply
#6

Quote:
Originally Posted by Rajat_Pawar
Посмотреть сообщение
This is awesome! Frustrating beyond belief, having to reconnect, is. Wish there was an OnPlayerLoadingScreen callback lol..
The fixes2 plugin (click) allows you to read messages sent to the server console. You can use it to reload the bans when someone connects to the server (incoming connection).

Example:
pawn Код:
public OnServerMessage(const msg[])
{
    if(strfind(msg, "Incoming connection: ", false) > -1) {
        SendRconCommand("reloadbans");
    }
}
Untested
Reply
#7

I may look in to that.
Reply
#8

Yes, but that is way over my head. BlueG tried to fix it before and couldn't. Maybe you could give it a go?
Reply
#9

This actually would happen to me quite frequently, even with servers that run no plugins (I.E. testing) and when there was no GMX involved. So, this is a really good find!

However, this could prove a problem for live servers as they probably rely somewhat on SA:MP's ban file. Actually, I never even recall having this issue on my local server.
Reply
#10

Quote:
Originally Posted by ******
Посмотреть сообщение
Surely the better fix would be to repair the MySQL plugin so you can just GMX correctly? As in, that is a fix, this is a workaround.
The issue isn't the plugin.

The issue is SA-MP, as it shuts down the client and re-opens it causes this error.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)