Users module.

Methods

getOnlineCount ():List<{name:String, cnt:Int}>

Returns online users count per each game server.

Returns:

List of records: { server name, user count }.

getOnlineCountSNS ():List<{name:String, cnt:Int}>

Returns online users count per each SNS type.

Returns:

List of records: { SNS type, user count }.

getServerID (id:Int):Int

Returns game server ID of a user by his user ID.

Parameters:

id

User ID.

Returns:

Game server ID that this user is currently on. Returns 0 in case if user is offline.

isOnline (id:Int):Bool

Returns online status of a user by his user ID. User is online when he is currently logged in to one of the game servers.

Parameters:

id

User ID.

Returns:

True, if this user is currently online.

isOnlineByNetworkID (networktype:String, networkid:String):Bool

Returns online status of a user by his SNS ID and SNS type. User is online when he is currently logged in to one of the game servers.

Parameters:

networktype

SNS type.

networkid

SNS ID.

Returns:

True, if this user is currently online.

sendTo (id:Int, msg:Dynamic):Void

Sends a message to a client of an online user through the game server he's on.

The message object has to have _type string field with message type. This will be the type of the message that the client will receive.

Parameters:

id

User ID.

msg

Anonymous object with message parameters.

userExists (id:Int):Bool

Returns whether the database record for this user exist.

Parameters:

id

User ID.

Returns:

True, if the record exists in database. False otherwise.