Slave client class.

Fields

read only config:Config

Copy of slave client configuration.

read only connectionID:Int

Slave client connection ID (for network connections without login).

read only externalHost:String

External slave client host (for game client connections).

read only externalPort:Int

External slave client port (for game client connections).

read only fullName:String

Full slave client name with IP address and port.

read only host:String

Local slave client host (for game client connections).

read only id:Int

Slave client ID.

isLogin:Bool

Is this slave client logged in?

isOnline:Bool

Is this slave client offline or online?

read only localID:Int

Slave local ID (in metaserver scope).

read only name:String

Slave client name.

read only port:Int

Local slave client port (for game client connections).

read only type:String

Slave client type.

Methods

getIP ():String

Returns client IP address.

Returns:

Slave client IP address. If it is called in uniserver mode, returns thread string instead.

isLocal ():Bool

Returns whether this client has a local IP address.

Returns:

True if IP address is local.

inline notify (msg:Dynamic):Void

Marks messages as notification and sends it to this client. This method is thread-safe. Cache server notifications are described in Notifications article.

The message object has to have _type string field with message type.

Usage example:

    var s = server.getClient(serverID);
    s.notify({
      _type: 'game.start',
      // ...
      });

Parameters:

msg

Server message. Anonymous object.