Java Client APIs
- initialize
- connectWithUserName
- disconnect
- joinLobby
- leaveLobby
- subscribeLobby
- unsubscribeLobby
- joinRoom
- joinRoomWithNUser
- joinRoomInRange
- joinRoomWithProperties
- leaveRoom
- createRoom
- createTurnRoom
public static void initialize ( String appKey , String s2Address )
Parameters
appKey - The Application key of the zone its created from the admin dashboard. s2Address - The IP address of the server where the AppWarp S2 zone is hosted.
Returns
void
public void connectWithUserName ( String username, String authData )
Parameters
username - Username of the player
authData - custom data for validation by the zone adaptor on the server
Returns
void
public void disconnect ()
Parameters
Returns
void
public void joinLobby ()
Parameters
Returns
void
public void leaveLobby ()
Parameters
Returns
void
public void subscribeLobby ()
Parameters
Returns
void
public void unsubscribeLobby ()
Parameters
Returns
void
public void joinRoom ( String roomId )
Parameters
roomId - Id of the room to be joined
Returns
void
public void joinRoomWithNUser ( int userCount )
Parameters
userCount- number of users in room to be joined
Returns
void
public void joinRoomInRange ( int minUesrs , int maxUesrs , boolean maxPreferred )
Parameters
minUsers- number of minimum users in room to be joined
maxUsers- number of maximum users in room to be joined
maxPreferred- flag to specify search priority for room to be joined
Returns
void
public void joinRoomWithProperties ( Hashtable < String , Object > tableProperties )
Parameters
tableProperties- properties of the room to be joined
Returns
void
public void leaveRoom ( String roomId )
Parameters
roomId - Id of the room to be left
Returns
void
public void createRoom ( String name , String owner , int maxUsers , Hashtable < String , Object > tableProperties )
Parameters
name - name of the room owner - administrator of the room maxUsers - number of maximum users allowed in the room tableProperties - properties of room for matchmaking ( pass null if not required )
Returns
void
public void createTurnRoom ( String name , String owner , int maxUsers , Hashtable < String , Object > tableProperties , int turnTime )
Parameters
name - name of the room owner - owner of the room ( behavior and usage of this meta property is up to the developer ) maxUsers - number of maximum users allowed in the room tableProperties - properties of room ( can be null ) turnTime - the time ( in seconds ) allowed for a user to complete its turn and send a move .
Returns
void
public void sendMove ( String moveData )
Parameters
moveData - any meta data associated with the move
Returns
void
public void deleteRoom ( String roomId )
Parameters
roomId - Id of the room to be deleted
Returns
void
public void subscribeRoom ( String roomId )
Parameters
roomId - Id of the room to be subscribed
Returns
‘void’
public void unsubscribeRoom ( String roomId )
Parameters
roomId - Id of the room to be subscribed
Returns
void
public void sendChat ( String message )
Parameters
message - message to be send
Returns
void
public void sendPrivateChat ( String username , String message )
Parameters
username - recipient of the message
message - message to be send
Returns
void
public void sendUpdatePeers ( byte [] update )
Parameters
update - binary data to be send
Returns
void
public void getLiveRoomInfo ( String roomId )
Parameters
roomId - Id of the room
Returns
void
public void getLiveUserInfo ( String username )
Parameters
username - user who's information is requested
Returns
void
public void getLiveLobbyInfo ()
Parameters
Returns
void
public void setCustomUserData ( String userName , String customData )
Parameters
userName - user for whom custom data has to be update customData - custom data that will be set for the user
Returns
void
public void SetCustomRoomData ( String roomId , String customRoomData )
Parameters
roomId - Id of the room customRoomData - custom data that will be set for the room
Returns
void
public void updateRoomProperties ( String roomID , Hashtable < String , Object > tableProperties , String [] removeArray )
Parameters
roomId - Id of the room tableProperties - properties that will be set for the room removeArray - properties that will be removed for the room
Returns
void
public void lockProperties ( Hashtable < String , Object > tableProperties )
Parameters
lockProperties - properties to be lock for the room
Returns
void
public void lockProperties ( String [] unlockProperties )
Parameters
unlockProperties - properties to be unlock for the room
Returns
void
public void getOnlineUsers ()
Parameters
Returns
void
public void getAllRooms ()
Parameters
Returns
void
public void getRoomWithNUser ( int userCount )
Parameters
userCount- number of users in room to be joined
Returns
void
public void getRoomInRange ( int minUsers , int maxUsers )
Parameters
minUsers- number of minimun users in room to be joined
maxUsers- number of maximum users in room to be joined
Returns
void
public void getRoomWithProperties ( Hashtable < String , Object > properties )
Parameters
properties- properties of the room to be joined
Returns
void
public void addConnectionRequestListener ( ConnectionRequestListener listener )
Parameters
listener - method for listening to the request
Returns
void
public void addZoneRequestListener ( ZoneRequestListener listener )
Parameters
listener - method for listening to the request
Returns
void
public void addRoomRequestListener ( RoomRequestListener listener )
Parameters
listener - method for listening to the request
Returns
void
public void addLobbyRequestListener ( LobbyRequestListener listener )
Parameters
listener - method for listening to the request
Returns
void
public void addNotificationListener ( NotifyListener listener )
Parameters
listener - method for listening to the request
Returns
void
public void addUpdateRequestListener ( UpdateRequestListener listener )
Parameters
listener - method for listening to the request
Returns
void
int CONNECTED = 0 ; int CONNECTING = 1 ; int DISCONNECTED = 2 ;
public int getConnectionState ()
Parameters
void
Returns
int
public void AddTurnBasedRoomRequestListener ( TurnBasedRoomListener listener )
Parameters
listener - listener object
Returns
void