This class is a wrapper for snipe.kit.game.data.UserKit providing access to user data from within action scripts.

It is available only on Snipe Kit server.

Constructor

new (user:UserKit)

Fields

read only attrs:UserAttributesKit

User attributes.

read only id:Int

User ID.

read only inventory:InventoryCore

User inventory.

read only lang:String

User language. Set on user login and saved to database.

read only logic:UserLogicFake

User logic state.

name:String

User name.

read only platform:String

Platform. Set on login, empty string by default. Is not saved to database.

state:String

User state in session. Can be changed from within scripts but is also changed by the matchmaking.

Methods

inline get (name:String):Dynamic

Returns client variable value. Client variables live only until the end of session.

Parameters:

name

Variable name.

Returns:

Variable value. Returns null if the variable does not exist.

inline getBool (name:String):Bool

Returns client variable value as Bool. Client variables live only until the end of session.

Parameters:

name

Variable name.

Returns:

Variable value. Returns false if the variable does not exist.

inline getFloat (name:String):Float

Returns client variable value as Float. Client variables live only until the end of session.

Parameters:

name

Variable name.

Returns:

Variable value. Returns 0 if the variable does not exist.

inline getInt (name:String):Int

Returns client variable value as Int. Client variables live only until the end of session.

Parameters:

name

Variable name.

Returns:

Variable value. Returns 0 if the variable does not exist.

inline getString (name:String):String

Returns client variable value as String. Client variables live only until the end of session.

Parameters:

name

Variable name.

Returns:

Variable value. Returns an empty string if the variable does not exist.

inline notify (msg:Dynamic):Void

Adds message to notification queue of the client logged in as this user.

Any pending notifications will be sent with the next client response in serverNotify parameter as a List<Dynamic>. Each 3 seconds the server checks if there are any messages in the notification queue. If there are, the client response with the type server.notify is sent.

Parameters:

msg

Notification to send to client.

inline response (type:String, params:Dynamic):Void

Sends response to the client logged in as this user.

Parameters:

type

Response type.

params

Response parameters.

inline set (name:String, val:Dynamic):Void

Sets temporary client variable. Client variables live only until the end of session.

Parameters:

name

Variable name.

val

Variable value. If it is null, then the variable is removed.