org.moock.unity.core
Interface RoomListener

All Known Implementing Classes:
UPCRoom

public interface RoomListener

All Objects deployed as Rooms implement this interface.

Author:
Derek Clayton

Method Summary
 void onAddClient(ClientServices client)
          Called when a Client joins the room.
 void onClientCountChange(int newCount)
          Called when the number of clients in the room changes.
 boolean onLogin(ClientServices client, java.util.ArrayList args)
          Called when a Client attempts to login to the room.
 void onReceiveMessage(Message message)
          Called when the Room receives a Message from a Client.
 void onRemoveClient(ClientServices client)
          Called when a Client is removed.
 void onRoomDie()
          Called when the Room is asked to be killed but before Clients are removed and the Room is removed from the Server.
 void onRoomInit(RoomServices roomServices)
          Called when the Room is started.
 

Method Detail

onRoomInit

public void onRoomInit(RoomServices roomServices)
Called when the Room is started.
Parameters:
RoomServices - the RoomServices for this Room

onLogin

public boolean onLogin(ClientServices client,
                       java.util.ArrayList args)
Called when a Client attempts to login to the room.
Returns:
true if the Client should be granted access.

onReceiveMessage

public void onReceiveMessage(Message message)
Called when the Room receives a Message from a Client.

onAddClient

public void onAddClient(ClientServices client)
Called when a Client joins the room.

onRemoveClient

public void onRemoveClient(ClientServices client)
Called when a Client is removed.

onClientCountChange

public void onClientCountChange(int newCount)
Called when the number of clients in the room changes.

onRoomDie

public void onRoomDie()
Called when the Room is asked to be killed but before Clients are removed and the Room is removed from the Server. Perform cleanup of resources used by the Room here.