Packagecom.kongregate.as3.client.services
Interfacepublic interface IUserServices

The interface for the User Services. This interface indicates which methods are available to the developer for player information retrieval. User services are only partially supported in this initial release of the API.



Public Methods
 MethodDefined by
  
getName():String
Returns the name of the current player.
IUserServices
  
getPlayerInfo(returnMethod:Function):void
Retrieves specific information describing the player.
IUserServices
Method detail
getName()method
public function getName():String

Returns the name of the current player. Unlike the getPlayerInfo() method, getName() immediately returns the player's name without any need to wait for data to load. If you just need the player's name, make sure to use getName().

Returns
String — Player name (e.g. "arcaneCoder"). Returns "Guest" for unregistered users.

See also


Example
import com.kongregate.as3.client.KongregateAPI;
trace ( KongregateAPI.getInstance().user.getName() );

getPlayerInfo()method 
public function getPlayerInfo(returnMethod:Function):void

Retrieves specific information describing the player. If this information has previously loaded, a cached version is returned.

Parameters
returnMethod:Function — The method to call when player info has loaded. The data will be passed to returnMethod in the first parameter.

See also


Example
import com.kongregate.as3.client.KongregateAPI;
  
function onUserInfo ( playerData:Object ):void
{ trace ( "isGuest: "+ playerData.isGuest );
}
KongregateAPI.getInstance().user.getPlayerInfo ( onUserInfo );