java-client-event

Java

Java Client Events

All Rooms Event

This event is raised in response to the getAllRooms request. It is passed in the registered ZoneRequestListener’s onGetAllRoomsDone request. It exposes the following properties

  • byte result – Result status of the request.
  • String[] roomIds – room id array of all the rooms.
public byte getResult();
public String[] getRoomIds();
All Users Event

This event is raised in response to the getOnlineUsers request. It is passed in the registered ZoneRequestListener’s onGetOnlineUsersDone method. It exposes the following properties

  • byte result – Result status of the request.
  • String[] usernames – array of usernames for all the online users.
public byte getResult();
public String[] getUserNames();

Represents an array of usernames for all the online users if the request is successful.

Chat Event

This event is raised when a chat notification is received from a subscribed location such as room or lobby. It is passed in registered NotifyListener’s onChatReceived method. It exposes the following properties

  • String message – The string message sent by the sender.
  • String sender – The sender of the message.
  • String locationId – The id of the location in which the message was sent (eg: room id)
  • boolean isLocationLobby – Is the location a room or lobby.
public String getSender();
public String getMessage();
public String getLocationId();
public bool isLocationLobby();
Connect Event

This event is raised in response to a connectWithUsername request. It is passed in the registered ConnectionRequestListener’s onConnectDone method. It exposes the following properties

  • byte result – Result status of the request.
public byte getResult();
Live Room Info Event

This event is raised in response to the getLiveRoomInfo or getLiveLobbyInfo request. It is passed in the registered RoomRequestListener’s onGetLiveRoomInfoDone method and in the LobbyRequestListener’s onGetLiveLobbyInfoDone method. It exposes the following properties

  • String[] joinedUsers – Array of usernames who are joined in the room
  • String customData – Custom data associated with the room
  • Hashtable properties – Properties associated with the room (empty for lobby).
  • RoomData data – The static information structure of the room (or lobby).
  • byte result – Result status of the request.
public RoomData getData();
public byte getResult();
public String[] getJoinedUsers();
public String getCustomData();
public Dictionary<String, Object> getProperties();
Live User Info Event

This event is raised in response to the getLiveUserInfo request. It is passed in the registered ZoneRequestListener’s onGetLiverUserInfo request method. It exposes the following properties

  • byte result – Result status of the request.
  • String locationId – The id of the location in which the user is present.
  • String name – The username of the user
  • String customData – The custom data associated with the user
  • boolean isLocationLobby – Is the users location a room or a lobby.
public byte getResult();
public bool isLocationLobby();
public String getLocationId();
public String getName();
public String getCustomData();
Lobby Data

This represents a construct for holding lobby information. It exposes the following properties

  • String Id – The id of the lobby. This is always 0 and is reserved for future if multi-lobby support is added.
  • String owner – The owner of the lobby.
  • int maxUsers – The max concurrent users allowed in the lobby.
  • String name – The name of the lobby.
  • boolean isPrimary – Is the lobby the primary one. This is always true and is reserved for future if multi-lobby support is added.
public String getId();
public String getRoomOwner();
public String getName();
public int getMaxUsers();
public Boolean isPrimary();
Lobby Event

This event is raised in response to requests for join/leave/subscribe/unsubscribe lobby. It is passed in the corresponding methods of the registered LobbyRequestListener. It exposes the following properties.

  • byte result – Result status of the request.
  • LobbyData data – The static information structure of the lobby.
public LobbyData getInfo();
public byte getResult();
Room Data

This represents a construct for holding room information. It exposes the following properties

  • String roomId – Unique id of a room. It is unique across all the rooms.
  • String owner – owner of the room (behavior and usage of this meta property is up to the developer)
  • int maxUsers – number of maximum users allowed in the room
  • String name – name of the room
public String getId();
public String getRoomOwner();
public String getName();
public int getMaxUsers();
Room Event

This event is raised in response to requests for join/leave/subscribe/unsubscribe room. It is passed in the corresponding methods of the registered RoomRequestListener. It exposes the following properties.

  • RoomData data – The static information structure of the room.
  • byte result – Result status of the request.
public RoomData getData();
public byte getResult();
Update Event

This event is raised when a updatePeers notification is received from a subscribed location such as room or lobby. It is passed in registered NotifyListener’s onUpdatePeersReceived method. It exposes the following properties.

  • byte[] update – The byte array sent in the room.
  • boolean isUDP – Flag to indicate whether the byte array was sent using UDP or TCP.
public byte[] getUpdate();
public bool getIsUdp();
Matched Room Event

This event is raised in response to requests for matchmaking request(getRoomwithNUsers/getRoomWithProperties). It is passed in the corresponding methods of the registered ZoneRequestListener. It exposes the following properties.

  • byte[] result – Result status of the request.
  • RoomData[] roomData – Array RoomData objects representing each of the matched rooms.
public byte getResult();
public RoomData[] getRoomsData();
Move Event

This event is raised when a move completed notification is received from a subscribed turn based room. It is passed in registered NotifyListener’s onMoveCompleted method. It exposes the following properties

  • String moveData – The associated move data.
  • String sender – The sender of the move.
  • String RoomId – The id of the room in which the move was sent
  • String nextTurn – The username of the user whose turn it is now
public String getSender();
public String getMoveData();
public String getRoomId();
public bool getNextTurn();