-
Notifications
You must be signed in to change notification settings - Fork 12
Reference
The individual methods available from WarpClient have been explained below.
- initialize
- connect
- disconnect
- joinZone
- joinLobby
- leaveLobby
- subscribeLobby
- unsubscribeLobby
- joinRoom
- leaveRoom
- createRoom
- deleteRoom
- subscribeRoom
- unsubscribeRoom
- sendChat
- sendUpdate
- getLiveRoomInfo
- getLiveUserInfo
- getLiveLobbyInfo
- setCustomUserData
- setCustomRoomData
- getOnlineUsers
- getAllRooms
- addZoneRequestListener
- addRoomRequestListener
- addLobbyRequestListener
- addNotificationListener
- addConnectionRequestListener
#initialize
WarpClient.initialize(apiKey, privateKey)Initializes the singleton instance of WarpClient with the developer credentials
Parameters
apiKey - The Application key given when the application was created.
secretKey - The secret key corresponding to the application key given when the application was created.
Returns
void
#connect
WarpClient.connect()Initiates your connection with the WARP server. The result of the operation is provided in the onConnectDone callback of the ConnectionListener.
Parameters
Returns
void
#disconnect
WarpClient.disconnect()Disconnects the connection with the WARP server. The result for this request will be provided in the onDisconnectDone callback of the ConnectionListener
Parameters
Returns
void
#joinZone
WarpClient.joinZone(username)Sends a join zone request to the server. Result of the request is provided in the onJoinZoneDone callback of the ConnectionRequestListener
Parameters
username - name of the player
Returns
void
#joinLobby
WarpClient.joinLobby()Sends a join lobby request to the server. Result of the request is provided in the onJoinLobbyDone callback of the LobbyListener
Parameters
Returns
void
WarpClient.leaveLobby()Sends a leave lobby request to the server. Result of the request is provided in the onLeaveLobbyDone callback of the LobbyListener
Parameters
Returns
void
#subscribeLobby
WarpClient.subscribeLobby()Sends a subscribe lobby request to the server. Result of the request is provided in the onSubscribeLobbyDone callback of the LobbyListener
Parameters
Returns
void
#unsubscribeLobby
WarpClient.unsubscribeLobby()Sends a unsubscribe lobby request to the server. Result of the request is provided in the onUnsubscribeLobbyDone callback of the LobbyListener
Parameters
Returns
void
#joinRoom
WarpClient.joinRoom(roomId)Sends a join room request to the server. Result of the request is provided in the onJoinRoomDone callback of the RoomListener
Parameters
roomId - Id of the room to be joined
Returns
void
#leaveRoom
WarpClient.leaveRoom(roomId)Sends a leave room request to the server. Result of the request is provided in the onLeaveRoomDone callback of the RoomListener
Parameters
roomId - Id of the room to be left
Returns
void
#createRoom
WarpClient.createRoom(name, owner, maxUsers)Sends a create room request to the server with the given parameters. Result of the request is provided in the onCreateRoomDone callback of the ZoneListener.
Parameters
name - name of the room
owner - administrator of the room
maxUsers - number of maximum users allowed in the room
Returns
void
#deleteRoom
WarpClient.deleteRoom(roomId)Sends a delete room request to the server. Result of the request is provided in the onDeleteRoomDone callback of the ZoneListener.
Parameters
roomId - Id of the room to be deleted
Returns
void
#subscribeRoom
WarpClient.subscribeRoom(roomId)Sends a subscribe room request to the server. Result of the request is provided in the onSubscribeRoomDone callback of the RoomListener.
Parameters
roomId - Id of the room to be subscribed
Returns
#unsubscribeRoom
WarpClient.unsubscribeRoom(roomId)Sends a unsubscribe room request to the server. Result of the request is provided in the onUnsubscribeRoomDone callback of the RoomListener.
Parameters
roomId - Id of the room to be subscribed
Returns
void
#sendChat
WarpClient.sendChat(message)Sends a chat message to room in which the user is currently joined. Result of the request is provided in the onSendChatDone callback of the ChatListener
Parameters
message - message to be send
Returns
void
#sendUpdate
WarpClient.sendUpdate(update)Sends a custom update message to room in which the user is currently joined. Result of the request is provided in the onSendUpdateDone callback of the UpdateListener.
Parameters
update - binary data to be send
Returns
void
#getLiveRoomInfo
WarpClient.getLiveRoomInfo(roomId)Retrieves live information of the room from the server. Result is provided in the onGetLiveRoomInfo callback of the RoomListener.
Parameters
roomId - Id of the room
Returns
void
#getLiveUserInfo
WarpClient.getLiveUserInfo(username)Retrieves live information of the user from the server. Result is provided in the onGetLiveUserInfo callback of the ZoneListener.
Parameters
username - user who's information is requested
Returns
void
#getLiveLobbyInfo
WarpClient.getLiveLobbyInfo()Retrieves live information of the lobby from the server. Result is provided in the onGetLiveLobbyInfo callback of the LobbyListener.
Parameters
Returns
void
#setCustomUserData
WarpClient.setCustomUserData(userName, customData)Updates the custom data associated with the given user on the server. Result is provided in the onSetCustomUserDataDone callback of the ZoneListener.
Parameters
userName - user for whom custom data has to be update
customData - custom data that will be set for the user
Returns
void
#setCustomRoomData
WarpClient.setCustomRoomData(roomId, customRoomData)Updates the custom data associated with the given room on the server. Result is provided in the onSetCustomRoomDataDone callback of the RoomListener.
Parameters
roomId - Id of the room
customRoomData - custom data that will be set for the room
Returns
void
#getOnlineUsers
WarpClient.getOnlineUsers()Retrieves usernames of all the users connected to the server. Result is provided in the onGetOnlineUsers callback of the ZoneListener.
Parameters
Returns
void
#getAllRooms
WarpClient.getAllRooms()Retrieves room ids of all the live rooms on the server. Result is provided in the onGetAllRoomsDone callback of the ZoneListener.
Parameters
Returns
void
#addZoneRequestListener
WarpClient.addZoneRequestListener(listner)add your listener object on which callbacks will be invoked when a response from the server is received for Zone level requests like create/deleteRoom, User requests etc.
Parameters
listener - method for listening to the request
Returns
void
#addRoomRequestListener
WarpClient.addZoneRequestListener(listner)add your listener object on which callbacks will be invoked when a response from the server is received for Room requests like join/leaveRoom, subscribe/unsubscribeRoom and getLiveRoomInfo
Parameters
listener - method for listening to the request
Returns
void
#addLobbyRequestListener
WarpClient.addLobbyRequestListener(listner)add your listener object on which callbacks will be invoked when a response from the server is received for Lobby requests like join/leaveLobby, subscribe/unsubscribeLobby and getLiveLobbyInfo
Parameters
listener - method for listening to the request
Returns
void
#addNotificationListener
WarpClient.addNotificationListener(listner)add your listener object on which callbacks will be invoked when a notification is received from the server for any resource that has been subscribed to.
Parameters
listener - method for listening to the request
Returns
void
#addConnectionRequestListener
WarpClient.addConnectionRequestListener(listner)add your listener object on which callbacks will be invoked when a response from the server is received for connect, authenticate and disconnect APIs.
Parameters
listener - method for listening to the request
Returns
void