SmartFoxServer Silverlight API
playerId Field
NamespacesSmartFoxClientAPISmartFoxClientplayerId
The current user's id as a player in a game room.
The playerId is available only after the user successfully joined a game room. This id is 1-based (player 1, player 2, etc.), but if the user is a spectator or the room is not a game room, its value is -1.
When a user joins a game room, a player id (or "slot") is assigned to him/her, based on the slots available in the room at the moment in which the user entered it; for example:
Declaration Syntax
C#Visual BasicVisual C++
public int playerId
Public playerId As Integer
public:
int playerId
Remarks

NOTE:
if multi-room join is allowed, this property contains only the last player id assigned to the user, and so it's useless. In this case the GetMyPlayerIndex()()() method should be used to retrieve the player id for each joined room.

Version:
SmartFoxServer Basic / Pro

Examples
The following example shows how to retrieve the user's own player id.
CopyC#
Debug.WriteLine("I'm player " + smartFox.playerId);
See Also

Assembly: SmartFoxClientAPI_Silverlight (Module: SmartFoxClientAPI_Silverlight) Version: 1.0.0.0 (1.0.0.0)