USER_DISCONNECT getPlayerId() returns 0

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

louissi
Posts: 48
Joined: 03 Mar 2006, 20:55

USER_DISCONNECT getPlayerId() returns 0

Postby louissi » 18 Oct 2011, 20:31

When a user is disconnected, I want to get the playerId he had at the moment he was disconnected. However, It is always 0. My guess is that since he left the room, he doesn't have a player id anymore. What would be the best way to access this information? :?:
louissi
Posts: 48
Joined: 03 Mar 2006, 20:55

Postby louissi » 19 Oct 2011, 12:58

Is there any information I can add that would help you answer?
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Postby rjgtav » 19 Oct 2011, 14:35

hello. Well, i think that.s the expected behavior, as when an user disconnects, he first leaves all the joined rooms.

Are you using this in a room extension? Also, are you listening for the USER_LEAVE or the USER_DISCONNECT event?

Finally, why do you need to access the playerId when an user disconnects?
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.

Return to “SFS2X Questions”

Who is online

Users browsing this forum: JanerHymn, XyrisKenn and 61 guests