Any Class can be deployed as a "Room" on the Server by implementing the RoomListener interface. An internal
Room Object is created to take care of maintenance and management of the Room. The RoomListener Object need
only worry about responding to events which are fired to create a powerful custom Room application.
RoomServices - Reference to the RoomServices for this Room. Most of the RoomServices a Room will want
to perform will be on itself in which case the reference should be saved for frequent use.
Once and only once when the Room is created.
ClientServices - ClientServices for the Client that wants to login to the Room.
ArrayList - Any other Objects passed to validate the Client.
true if the Client should be allowed to enter the Room
Whenever a request to login to the Room is made. If the method returns true the Client will
be granted access and enter the Room.
Message - The Message received.
Whenever a Message is received by the Room. Messages are guaranteed to be processed in the order they
ClientServices - ClientServices for the Client that was added.
When a new Client joins the Room.
ClientServices - ClientServices for the Client that was removed.
When a Client leaves the Room.
int - The new number of Clients in the Room.
When the number of Clients in the Room changes. This method is called in addition to either
onAddClient or onRemoveClient.
Once and only once when the Room is being removed from the Server but before it is removed
from the Room listing and any Clients inside are Removed from the Room. Resources used by the
Room should be cleaned up here. This is the last event fired.
When a Room is killed that has Clients still in the Room then they are removed
in a different manner than if they are removed from an active Room. In the case of Client removal because
the Room was killed the onRemoveClient is called for each Client in the Room to give the Room a chance to
perform any cleanup operations on the Clients before the Room is removed. However, onClientCountChange is NOT
called nor is the Client actually removed from the list of Clients in the Room.