JBStrap client events
The Client objects handles the following two events:
- A new client is connected
- A client is disconnected.
Both events receive the actual client instance – when connecting the connected client instance, when disconnecting the disconnected client instance.
ClientConnected event
The client connection event is executed after creating and initializing the Client object. This means that the client object in the event is fully functional. The event handler must be set by using the CLIENT_CONNECTED_EVENT_HANDLER parameter. The ClientDisconnectedHandler must be implemented in order to properly use the event handler.
ClientDisconnected event
The client disconnected event happens when the connection between the user (client) and the server is disrupted. Technically this means that on the server side a client class still exists, but is unable to execute any operations. The client disconnected event handler must be set using the CLIENT_DISCONNECT_EVENT_HANDLER parameter. In order to properly use the event handler, the ClientDisconnectedHandler must be implemented in the parameter.