Client information class.
read only connectionID:Int
Unique connection ID. Used for asynchronous responses when the client did not login yet.
Client language. In the case of game server it is set to a given language on successful client login.
dynamic callPost (type:String, params:Params, response:Dynamic):Void
Called after each client request. Needs to be overriden.
Parameters:
type
Request type.
params
Request parameters.
response
Request response. Can be modified.
This method should update and unlock all additional client blocks.
Called on client disconnect if the client is online and
after Server.onCacheNotify()
if the client is offline.
Needs to be overriden.
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.
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.
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.
Returns client IP address.
Returns:
Client IP address. If socket is not connected, returns an empty string.
If socket is null, returns ?dc?
string.
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.
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.
Returns true if this client has a local IP address.
Returns:
True, if this client has a local IP address. False otherwise.
inline notify (msg:Dynamic):Void
Adds message to notification queue.
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.