Posts: 723
Threads: 366
Joined: Jun 2016
Hi,
When player disconnect and this callback get called, other player can't connect until all content in onplayerdisconnect will be completed?
Posts: 3,715
Threads: 358
Joined: Apr 2012
Reputation:
0
Nope, Players can connect while the OnPlayerDisconnect is being called.
Posts: 10,066
Threads: 38
Joined: Sep 2007
Reputation:
0
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.
Posts: 723
Threads: 366
Joined: Jun 2016
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
Posts: 416
Threads: 47
Joined: May 2011
Reputation:
0
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.
Posts: 723
Threads: 366
Joined: Jun 2016
I talk not about saving. But also about simple variable checks. It's possible just in OnPlayerDisconnect check how much time takes call?
Posts: 723
Threads: 366
Joined: Jun 2016
Or still i don't understand server will give new player new slot, until that slot in which player disconnect was onplayerdisconnect not called?
Posts: 1,506
Threads: 13
Joined: Jun 2015
reset the variables on player connect.
Posts: 1,578
Threads: 15
Joined: Feb 2013
Reputation:
0
The server will give a free playerid. They won't overlap, if that's what you're talking about.
Posts: 723
Threads: 366
Joined: Jun 2016
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?