onUserLeaveRoom and playerid

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

Post Reply
dvine
Posts: 47
Joined: 21 Sep 2006, 10:08
Location: Köln, Germany
Contact:

onUserLeaveRoom and playerid

Post by dvine »

How can i get the playerId from an onUserLeaveRoom event in a game room?
ramindeja
Posts: 74
Joined: 31 Mar 2008, 17:54

Post by ramindeja »

You can either cash that information upon a user entering a room on the client-side or you can use the userId provided by the onUserLeaveRoom() event and make a call to the extension.

If the user is not disconnected, you can have an extension API that finds the User instance of the given userId and returns you the corresponding player id.

For the extension API solution, you should find out about two things:

1- if that user is currently inside a non-game room, he/she may no longer have any playerId

2- if the user enters another game room, does his/her playerId change or not (my guess is that it may change)
Post Reply