OnPlayerDisconnect
#1

Hi,

When player disconnect and this callback get called, other player can't connect until all content in onplayerdisconnect will be completed?
Reply
#2

Nope, Players can connect while the OnPlayerDisconnect is being called.
Reply
#3

Pretty sure that they can't occupy the same playerslot as the disconnecting player, though. It also wouldn't make sense. In case of a crash or a timeout OnPlayerDisconnect sometimes isn't even called until 30 seconds after the player's game has closed.
Reply
#4

So how to make other player in that slot can't connect until onplayerdisconnect will be called? because if you say 30 seconds need wait, then all saving can bugg. I use player variables, then new connect player can change them and no saving
Reply
#5

The information here can be misleading. A player can connect once the saving process is finished, saving process ends in a few ms's. If you are using MySQL, you can wipe the playerid's cache data to prevent the script to overwritw saves but that's about it. I doubt anyone has faced an issue where a player's data got saved into another player's before.
Reply
#6

I talk not about saving. But also about simple variable checks. It's possible just in OnPlayerDisconnect check how much time takes call?
Reply
#7

Or still i don't understand server will give new player new slot, until that slot in which player disconnect was onplayerdisconnect not called?
Reply
#8

reset the variables on player connect.
Reply
#9

The server will give a free playerid. They won't overlap, if that's what you're talking about.
Reply
#10

Yes i reset player variables onplayerconnect, but what if 0 playerid connect and after 5 seconds call onplayerdisconnect with playerid 0 with old player disconnecting, so it's get bugged. Or this never happin? just it's possible when player connecting onplayerconnect get call, and during ddos, lagg or other shit, onplayerdisconnect was delay to call, and it calls?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)