Posts: 285
Threads: 154
Joined: Mar 2016
Reputation:
0
Hi,
Can be issue if player out from server onplayerdisconnect callback get called and i at same moment call kick, it's possible that 2 onplayerdisconnect can call?
Posts: 249
Threads: 29
Joined: Apr 2011
Reputation:
0
I've seen 2 admins banned one person but the thing you mentioned is unlikely to be happen
Posts: 285
Threads: 154
Joined: Mar 2016
Reputation:
0
Another question is this callback OnPlayerDisconnect always call when player disconnect can by times that it's not by called lagg or smth? because if i'am saving player stats it's get bad if one time it's not save.
Posts: 48
Threads: 5
Joined: Apr 2012
Reputation:
0
It's always called when the player disconnects unless your server crashes.
What I would suggest is creating a timer that regularly saves your players accounts, this will reduce the likeliness of a significant rollback should a Player disconnect and not have their stats save.
Posts: 1,801
Threads: 21
Joined: Mar 2008
Reputation:
0
OnPlayerDisconnect will never call twice, no matter what you do.
The only thing that might make it not call is accessing invalid array slots (or similar "bugs"), which can lead to weird and unpredicted behaviour, but that would be your fault/a script-related bug.