How to disable reconnection to a server after lost connection?
#1

I develop a plugin now and often need debugging it with Visual Studio in runtime. When I insert a breakpoint to debug any code my server is stopped for a time. When all have been debugged the server continue working again. But when the server stopped my samp client has lost connection and is doing reconnection in 15-20sec.



I have a question: how to disable reconnection to a server after lost connection? For example, increase playtimeout on client side to 1000 sec? Then I could continue play on my server to debug the plugin without reconnection, repeated signing in, etc...
Reply
#2

Adjust your "playertimeout" and "sleep" in server.cfg according to your debug break time, might be necessary to disable the connection cookie and time because you'd expect "You are banned from this server" Anything in the "networking" section here

Try to increase the update rates too (client section here), but only if that's okay for you to feel lag/slow/desync every time (as it is not changeable from /rcon). Use pawn's "sleep()" (note: bugged/leaks) or some a busy for/while loop code (you can customize it i.e. a code to communicate while "breakpoint" = true) on OnPlayerUpdate and return 0, so it looks like a server lag for the client.

You can also try BlockIpAddress() according to your "playertimeout" value (e.g. if playertimeout is 10000, set it to 9999 or less).

Just my opinion (never tried), maybe also start the client in debug mode? Not sure if it can help.
Launch samp_debug.exe and click "connect localhost".

If reconnecting isn't the issue with your script/plugin development (which you are just lazy to wait), you can find some cl*o script/hack out there for fast reconnect, and restore your previous player states after onplayerconnect (e.g. setting back skin, position, etc from previously saved data) in your pawn script.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)