Skip to content

Objective C API Reference

RajeevRShephertz edited this page Aug 26, 2013 · 34 revisions

Before going through the below API reference, it is recommended to take a quick look at SDK model link above.

WarpClient APIs

###initWarp

Initializes the singleton instance of WarpClient with the developer credentials. This has to be called only once during the lifetime of the application. It is required before you can call any other API.

    +(void)initWarp:(NSString*)apiKey secretKey:(NSString*)secretKey

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

###setRecoveryAllowance

-(void)setRecoveryAllowance:(int) maxRecoveryTime

Sets the connection recovery time (seconds) allowed that will be negotiated with the server. By default it is 0 so there is no connection recovery. During this time, the state of the user on the server will be paused and if the connection is not recovered in this period, it will be considered disconnected and will be removed from the room. It is important you invoke this right after you initialize the WarpClient and before you make your first call to connect. Recommended values are between 60 to 120 i.e. 1 minute to 2 minutes.

Parameters

maxRecoveryTime- time in seconds allowed for the client to recover

Returns

void

###connectWithUserName

Sets up your connection with the AppWarp cloud server. The username passed in this method must be unique across all other concurrently connected users. If two users with the same name try to connect at the same time, then the last one will win and the older one will get disconnected. The result of the operation is provided in the onConnectDone callback of the ConnectionRequestListener.

    -(void)connectWithUserName:(NSString*)userName

Parameters

username - name of the player

Returns

void

###recoverConnection

-(void)recoverConnection

Attempts to recover the previous connection if it was broken with a recoverable connection error event was raised. If connectivity is not there at the time of calling, it will again raise a recoverable connection error event ( guaranteed within 6 seconds ) and the application can choose to recover again immediately or after a while (back off period). The server may reject the recover request if received after the recovery allowance time negotiated. The result of the operation is provided in the onConnectDone callback of the ConnectionRequestListener. If successful, the result code is SUCCESS_RECOVERED.

Parameters

Returns

void

###disconnect

Disconnects the connection with the WARP server. The result for this request will be provided in the onDisconnectDone callback of the ConnectionRequestListener.

    -(void)disconnect

Parameters

Returns

void

###joinLobby

Sends a join lobby request to the server. Result of the request is provided in the onJoinLobbyDone callback of the registered LobbyRequestListener objects.

    -(void)joinLobby

Parameters

Returns

void

###leaveLobby Sends a leave lobby request to the server. Result of the request is provided in the onLeaveLobbyDone callback of the registered LobbyRequestListener objects.

    -(void)leaveLobby

Parameters

Returns

void

###subscribeLobby

Sends a subscribe lobby request to the server. Result of the request is provided in the onSubscribeLobbyDone callback of the registered LobbyRequestListener objects. Users which have subscribed to the lobby receive chat events from other users in the lobby as well as join/leave notifications about all players to and fro the lobby and all the rooms. In addition, lobby subscribers get notifications when a new room is created or deleted. All these notification events are given in the registered NotifyListener objects.

    -(void)subscribeLobby

Parameters

Returns

void

###unsubscribeLobby

Sends a unsubscribe lobby request to the server. Result of the request is provided in the onUnsubscribeLobbyDone callback of the registered LobbyRequestListener objects.

    -(void)unsubscribeLobby

Parameters

Returns

void

###joinRoom

Sends a join room request to the server. Result of the request is provided in the onJoinRoomDone callback of the registered RoomRequestListener objects. A user can only be joined in one location (room or lobby) at a time. If a user joins a room, it will automatically be removed from its current location.

    -(void)joinRoom:(NSString*)roomId

Parameters

roomId - Id of the room to be joined

Returns

void

###joinRoomWithNUser

    -(void)joinRoomWithNUser:(int) userCount

Sends a join room request to the server with the condition that the room must have at least the given number of users. Result of the request is provided in the onJoinRoomDone callback of the registered RoomRequestListener. This is useful is supporting quick play modes.

Parameters

userCount- number of users in room to be joined

Returns

void

###joinRoomInRange

    -(void)joinRoomInRangeBetweenMinUsers:(int)minUsers andMaxUsers:(int)maxUsers maxPrefered:(BOOL)maxPrefered

Sends a join room request to the server with the condition that the room must have at least minUsers and at Most maxUsers. Result of the request is provided in the onJoinRoomDone callback of the registered RoomRequestListener. This is useful is supporting quick play modes.

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

###joinRoomWithProperties

Sends a join room request to the server with the condition that the room must have a matching set of property value pairs associated with it. This is useful in match making. Result of the request is provided in the onJoinRoomDone callback of the registered RoomRequestListener.

    -(void)joinRoomWithProperties:(NSDictionary*)properties

Parameters

properties- properties of the room to be joined

Returns

void

###leaveRoom

Sends a leave room request to the server. Result of the request is provided in the onLeaveRoomDone callback of the registered RoomRequestListener.

    -(void)leaveRoom:(NSString*)roomId

Parameters

roomId - Id of the room to be left

Returns

void

###createRoom

Sends a create room request to the server with the given meta data. Result of the request is provided in the onCreateRoomDone callback of the registered ZoneRequestListener objects. If successful, this will create a dynamic room at the server. These rooms lifetime is limited till the time users are inside it. Read more about Rooms here.

    -(void)createRoomWithRoomName:(NSString*)roomName roomOwner:(NSString*)roomOwner properties:(NSDictionary*)properties maxUsers:(int)maxUsers

Parameters

roomName  - name of the room
roomOwner - owner of the room (behavior and usage of this meta property is up to the developer)
properties - properties of room (can be null)
maxUsers - number of maximum users allowed in the room

Returns

void

###deleteRoom

Sends a delete room request to the server. Result of the request is provided in the onDeleteRoomDone callback of the registered ZoneRequestListener objects. Only dynamic rooms can be deleted through this API. Static rooms (created from AppHQ) can not be deleted through this. Read more about Rooms here.

    -(void)deleteRoom:(NSString*)roomId

Parameters

roomId - Id of the room to be deleted

Returns

void

###subscribeRoom

Sends a subscribe room request to the server. Result of the request is provided in the onSubscribeRoomDone callback of the registered RoomRequestListener objects. Once subscribed, the client will receive all notifications from the room such as chat, update and property change events. In addition the client will also receive notifications when a user joins or leaves the subscribed room. These notifications are given in the registered NotifyListener objects.

    -(void)subscribeRoom:(NSString*)roomId

Parameters

roomId - Id of the room to be subscribed

Returns

###unsubscribeRoom

Sends a unsubscribe room request to the server. Result of the request is provided in the onUnSubscribeRoomDone callback of the registered RoomRequestListener objects.

    -(void)unsubscribeRoom:(NSString*)roomId

Parameters

roomId - Id of the room to be subscribed

Returns

void

###sendChat

Sends a chat message to the room (or lobby) in which the user is currently joined. Result of the request is provided in the onSendChatDone callback of the registered ChatRequestListener objects. The size of each chat message is limited to 500 bytes. All users who are subscribed to the location in which the message is sent will get a onChatReceived event on their registered NotifyListener objects.

    -(void)sendChat:(NSString*)message

Parameters

message - message to be send

Returns

void

###SendPrivateChat

Sends a private message to the given user if its online. Result of the request is provided in the onSendPrivateChatDone callback of the registered ChatRequestListener objects. The sender and receiver don't need to be in the same room or lobby for the private message to be delivered. This is useful in building invite/challenge friend like scenarios. If successful, the receiver will get a onPrivateChatReceived event on its registered NotifyListener objects.

    -(void)sendPrivateChat:(NSString*)message toUser:(NSString*)userName

Parameters

username - recipient of the message

message - message to be send

Returns

void

###sendUpdatePeers

Sends a byte array update message to room in which the user is currently joined. Result of the request is provided in the onSendUpdateDone callback of the registered UpdateRequestListener objects. The size of the byte array per API call is limited to 1000 bytes. All users who are subscribed to the room in which the update is sent will get a onUpdatePeersReceived event on their registered NotifyListener objects. This is useful if developers want to send their own binary encoded data across and is useful in minimizing the payload exchanged between the clients and AppWarp cloud server. The size of each message should be limited to 1000 bytes. The frequency at which these messages can be processed is not restricted by the server. However, the latency involved is largely determined by the client's bandwidth. The corresponding UDP flavor of this API is sendUdpUpdatePeers, which is unreliable and may not work over cellular data connections - hence no result callback should be expected from it. The behavior is otherwise similar.

    -(void)sendUpdatePeers:(NSData*)update

Parameters

update - data of type NSData to be sent

Returns

void

###getLiveRoomInfo

Retrieves the live information of the given room from the server. Result is provided in the onGetLiveRoomInfoDone callback of the registered RoomRequestListener objects. The information includes the names of the currently joined users, the rooms properties and any associated customData. This is useful in getting a snapshot of a rooms state.

    -(void)getLiveRoomInfo:(NSString*)roomId

Parameters

roomId - Id of the room

Returns

void

###getLiveUserInfo

Retrieves the live information of the user from the server. Result is provided in the onGetLiveUserInfo callback of the registered ZoneRequestListener objects. The information (if user is online) includes the current location of the user and any associated custom data. It is useful in building scenarios where you want to find if a users friends are online or not and then join their room if found online.

    -(void)getLiveUserInfo:(NSString*)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

Retrieves live information of the lobby from the server. Result is provided in the onGetLiveLobbyInfo callback of the registered LobbyRequestListener objects. The information returned includes the names of the users who are currently joined in the lobby.

    -(void)getLiveLobbyInfo

Parameters

Returns

void

###setCustomUserData

Updates the custom data associated with the given user on the server (if the given user is online). Result is provided in the onSetCustomUserDataDone callback of the registered ZoneRequestListener objects. It can be useful in setting status messages or avatar url's etc for online users.

    -(void)setCustomUserData:(NSString*)username customData:(NSString*)customData

Parameters

userName - user for whom custom data has to be updated
customData - custom data that will be set for the user

Returns

void

###setCustomRoomData

Updates the custom data associated with the given room on the server. The result is provided in the onSetCustomRoomDataDone callback of the registered RoomRequestListener objects. It is recommended you use the room's properties where ever possible. Use this when you need to associate data with a room which can not be represented as key value pairs.

    -(void)setCustomRoomData:(NSString*)roomId customData:(NSString*)customData

Parameters

roomId - Id of the room
customRoomData - custom data that will be set for the room

Returns

void

###getOnlineUsers

Retrieves usernames of all the users connected (online) to the server. Result is provided in the onGetOnlineUsers callback of the registered ZoneRequestListener objects.

    -(void)getOnlineUsers

Parameters

Returns

void

###getAllRooms

Retrieves the room ids of all the rooms on the server. Result is provided in the onGetAllRoomsDone callback of the registered ZoneRequestListener objects. To get a filtered list of rooms, use the GetRoomWithNUser or GetRoomWithProperties APIs.

    -(void)getAllRooms

Parameters

Returns

void

###getRoomWithNUser

    -(void)getRoomWithNUser:(int) userCount

Retrieves information of the rooms that contain at least n users in them. Result is provided in the onGetMatchedRoomsDone callback of the registered ZoneRequestListener objects. This is useful in building a filtered list of rooms.

Parameters

userCount - number of users in room to be joined.

Returns

void

###getRoomWithProperties

Retrieves information of the room that contain properties which match with the given properties. Result is provided in the onGetMatchedRoomsDone callback of the registered ZoneRequestListener objects. This is useful in building a filtered list of rooms.

    -(void)getRoomWithProperties:(NSDictionary*) properties

Parameters

properties - properties of the room to be joined.

Returns

void

###getRoomInRange

    -(void)getRoomInRangeBetweenMinUser:(int)minUsers andMaxUser:(int)maxUsers

Retrieves information of the rooms that contain at least minUsers and at most maxUsers in them. Result is provided in the onGetMatchedRoomsDone callback of the registered ZoneRequestListener objects. This is useful in building a filtered list of rooms.

Parameters

minUsers- number of minimun users in room to be joined

maxUsers- number of maximum users in room to be joined

Returns

void

###updateRoom

Updates the properties associated with the given room on the server. Result is provided in the onUpdatePropertyDone callback of the registered RoomRequestListener objects. Properties which are not found on the server, will be added while properties which are already present will simply be updated with the new values. You can also specify the list of properties that you want to remove from the remove. This request (if successful) will also result in an onUserChangeRoomProperty notification on the registered NotifyListener objects to be triggered for all subscribed users of the room.

    -(void)updateRoom:(NSString *)roomID  addProperties:(NSDictionary*)properties removeProperties:(NSArray*)propertiesKeyArray

Parameters

roomId - Id of the room
properties - properties that will be set for the room
propertiesKeyArray - properties that will be removed for the room

Returns

void

###addConnectionRequestListener

Adds (registers) the given listener object to the list of objects on which callbacks will be invoked when a response from the server is received for Connect and Disconnect APIs. The object must implement the ConnectionRequestListener interface.

    -(void)addConnectionRequestListener:(id)connectionListener

Parameters

connectionListener - instance of ConnectionRequestListener for listening to the request

Returns

void

###addZoneRequestListener

Adds (registers) the given listener object to the list of objects on which callbacks will be invoked when a response from the server is received for zone level requests such as create/delete room or live user info requests. The object must implement the ZoneRequestListener interface.

    -(void)addZoneRequestListener:(id)zoneListener

Parameters

zoneListener - instance of ZoneListener for listening to the request

Returns

void

###lockRoomProperties

   -(void)lockRoomProperties:(NSDictionary*)lockProperties

Lock the properties associated with the joined room on the server for requested user. Result is provided in the onLockPropertyDone callback of the registered RoomRequestListener objects. Lock properties will fail if any other user has lock on same property, otherwise property will be added in lockTable with owner name. This request (if successful) will also result in an onUserChangeRoomProperty notification on the registered NotifyListener objects to be triggered for all subscribed users of the room.

Parameters

lockProperties - properties to be lock for the room

Returns

void

###unlockRoomProperties

   -(void)unlockRoomProperties:(NSArray*) unlockProperties

Unlock the properties associated with the joined room on the server for requested user. Result is provided in the onUnlockPropertyDone callback of the registered RoomRequestListener objects. Unlock properties will fail if any other user has lock on same property, otherwise property will be removed from lock table. This request (if successful) will also result in an onUserChangeRoomProperty notification on the registered NotifyListener objects to be triggered for all subscribed users of the room.

Parameters

unlockProperties - properties to be unlock for the room

Returns

void

###addRoomRequestListener

Adds (registers) the given listener object to the list of objects on which callbacks will be invoked when a response from the server is received for requests pertaining to a room. The object must implement the RoomRequestListener interface.

    -(void)addRoomRequestListener:(id)roomListener

Parameters

roomListener - instance of RoomListener for listening to the request

Returns

void

###addLobbyRequestListener

Adds (registers) the given listener object to the list of objects on which callbacks will be invoked when a response from the server is received for lobby level request. The object must implement the LobbyRequestListener interface.

    -(void)addLobbyRequestListener:(id)lobbyListener

Parameters

lobbyListener - instance of LobbyListener for listening to the request

Returns

void

###addNotificationListener

Adds (registers) the given listener object to the list of objects on which callbacks will be invoked when a notification is received from the server from any subscribed location (room or lobby). The object must implement the NotifyListener interface.

    -(void)addNotificationListener:(id)notifyListener

Parameters

notifyListener - instance of NotificationListener for listening to the request

Returns

void

###addUpdateRequestListener

Adds (registers) the given listener object to the list of objects on which callbacks will be invoked when a response from the server is received for a SendUpdatePeers request. The object must implement the UpdateRequestListener interface.

    -(void)addUpdateRequestListener:(id)updateListener

Parameters

updateListener - listener object

Returns

void

###addChatRequestListener

Adds (registers) the given listener object to the list of objects on which callbacks will be invoked when a response from the server is received for a SendChat request. The object must implement the ChatRequestListener interface.

    -(void)addChatRequestListener:(id)chatListener

Parameters

chatListener - listener object

Returns

void

WarpClient Events

###AllRoomsEvent

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

*result - Result status of the request. *roomIds - room id array of all the rooms.

@property Byte result;
@property (nonatomic, retain) NSMutableArray *roomIds;

###AllUsersEvent

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

  • result - Result status of the request.
  • usernames - array of usernames for all the online users.
@property Byte result;
@property (nonatomic, retain) NSMutableArray *userNames;

###ChatEvent

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

  • message - The string message sent by the sender.
  • sender - The sender of the message.
  • locationId - The id of the location in which the message was sent (eg: room id)
  • isLocationLobby - Is the location a room or lobby.
@property (nonatomic, retain) NSString* sender;
@property (nonatomic, retain) NSString* message;
@property (nonatomic, retain) NSString* locId;
@property bool isLocationLobby;

###ConnectEvent

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

  • result - Result status of the request.
@property Byte result;

###LiveRoomInfoEvent

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

  • joinedUsers - Array of usernames who are joined in the room
  • customData - Custom data associated with the room
  • properties - Properties associated with the room (empty for lobby).
  • roomData - The static information structure of the room (or lobby).
  • result - Result status of the request.
@property (nonatomic, retain) NSMutableArray *joinedUsers;
@property (nonatomic, retain) NSString* customData;
@property (nonatomic, retain) NSDictionary* properties;
@property(nonatomic,retain)RoomData *roomData;
@property Byte result;

###LiveUserInfoEvent

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

  • result - Result status of the request.
  • locationId - The id of the location in which the user is present.
  • name - The username of the user
  • customData - The custom data associated with the user
  • isLocationLobby - Is the users location a room or a lobby.
@property Byte result;
@property (nonatomic,retain) NSString *locationId;
@property (nonatomic,retain) NSString *name;
@property (nonatomic,retain) NSString *customData;
@property bool isLocationLobby;

###LobbyData

This represents a construct for holding static lobby information. It extends the RoomData class and exposes the following properties

  • Id - The id of the lobby. This is always 0 and is reserved for future if multi-lobby support is added.
  • owner - The owner of the lobby.
  • maxUsers - The max concurrent users allowed in the lobby.
  • name - The name of the lobby.
  • isPrimary - Is the lobby the primary one. This is always true and is reserved for future if multi-lobby support is added.
@property(nonatomic,retain)NSString *name;
@property(nonatomic,retain)NSString *roomId;
@property(nonatomic,retain)NSString *owner;
@property int maxUsers;
@property bool isPrimary;

###LobbyEvent

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.

  • result - Result status of the request.
  • info - The static information structure of the lobby.
@property (nonatomic, retain) LobbyData* info;
@property Byte result;

###RoomData

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

  • roomId - unique id of a room. It is unique across all the rooms.
  • owner - owner of the room (behavior and usage of this meta property is up to the developer)
  • name - name of the room
  • maxUsers - number of maximum users allowed in the room
@property(nonatomic,retain)NSString *roomId;
@property(nonatomic,retain)NSString *owner;
@property(nonatomic,retain)NSString *name;
@property int maxUsers;

###RoomEvent

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 - The static information structure of the room.
  • result - Result status of the request.
@property(nonatomic,retain)RoomData *roomData;
@property Byte result;

###UpdateEvent

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

  • update - The binary data sent in the room.
  • isUDP - Flag to indicate whether the byte array was sent using UDP or TCP.
@property(nonatomic,retain)NSData *update;
@property Boolean isUDP;

###MatchedRoomEvent

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.

  • result - Result status of the request.
  • roomData - Array RoomData objects representing each of the matched rooms.
@property Byte result;
@property(nonatomic,retain)NSArray *roomData;

WarpClient Listeners

###ConnectionRequestListener

    /**
     * Invoked in response to a connect request.
     * @param event
     */
    -(void)onConnectDone:(ConnectEvent*) event;

    /**
     * Invoked in response to a disconnect request.
     * @param event
     */
    -(void)onDisconnectDone:(ConnectEvent*) event;

###RoomRequestListener

   /**
    * Invoked in response to a subscribeRoom request.
    * @param event
    */
   -(void)onSubscribeRoomDone:(RoomEvent*)roomEvent;

  /**
   * Invoked in response to a UnSubscribeRoom request.
   * @param event
   */
  -(void)onUnSubscribeRoomDone:(RoomEvent*)roomEvent;

  /**
   * Invoked in response to a joinRoom request.
   * @param event
   */
  -(void)onJoinRoomDone:(RoomEvent*)roomEvent;

  /**
   * Invoked in response to a leaveRoom request.
   * @param event
   */
  -(void)onLeaveRoomDone:(RoomEvent*)roomEvent;

  /**
   * Invoked in response to a getLiveRoomInfo request.
   * @param event
   */
  -(void)onGetLiveRoomInfoDone:(LiveRoomInfoEvent*)event;

  /**
   * Invoked in response to a setCustomRoomData request.
   * @param event
   */
  -(void)onSetCustomRoomDataDone:(LiveRoomInfoEvent*)event;

  /**
   * Invoked in response to a updateRoomProperties request.
   * @param event
   */
  -(void)onUpdatePropertyDone:(LiveRoomInfoEvent*)event;

  /*
   * Invoked in response to lock room property to any room.
   * @param result
   */
  -(void)onLockPropertiesDone:(Byte)result;

 /*
  * Invoked in response to unlock room property to any room.
  * @param result
  */
  -(void)onUnlockPropertiesDone:(Byte)result;

###ZoneRequestListener

    /**
     * Invoked in response to a deleteRoom request.
     * @param event
     */
     -(void)onDeleteRoomDone:(RoomEvent*)roomEvent;

    /**
     * Invoked in response to a getAllRooms request.
     * @param event
     */
    -(void)onGetAllRoomsDone:(AllRoomsEvent*)event;

    /**
     * Invoked in response to a createRoom request.
     * @param event
     */
    -(void)onCreateRoomDone:(RoomEvent*)roomEvent;

    /**
     * Invoked in response to a getOnlineUsers request.
     * @param event
     */
    -(void)onGetOnlineUsersDone:(AllUsersEvent*)event;

    /**
     * Invoked in response to a getLiveUserInfo request.
     * @param event
     */
    -(void)onGetLiveUserInfoDone:(LiveUserInfoEvent*)event;

    /**
     * Invoked in response to a setCustomRoomData request.
     * @param event
     */
    -(void)onSetCustomUserDataDone:(LiveUserInfoEvent*)event;
    
     /**
      * Invoked in response to a getMatchMaking Rooms request.
      * @param event
      */
    -(void)onGetMatchedRoomsDone:(MatchedRoomsEvent*)matchedRoomsEvent;

###LobbyRequestListener

    /**
     * Invoked in response to a joinLobby request.
     * @param event
     */
    -(void)onJoinLobbyDone:(LobbyEvent*)lobbyEvent;
    /**
     * Invoked in response to a leaveLobby request.
     * @param event
     */
    -(void)onLeaveLobbyDone:(LobbyEvent*)lobbyEvent;
    /**
     * Invoked in response to a subscribeLobby request.
     * @param event
     */
    -(void)onSubscribeLobbyDone:(LobbyEvent*)lobbyEvent;
    /**
     * Invoked in response to a UnSubscribeLobby request.
     * @param event
     */
    -(void)onUnSubscribeLobbyDone:(LobbyEvent*)lobbyEvent;
    /**
     * Invoked in response to a getLiveLobbyInfo request.
     * @param event
     */
    -(void)onGetLiveLobbyInfoDone:(LiveRoomInfoEvent*)event;

###UpdateRequestListener

    /**
     * Result of SendUpdatePeers request. The result value maps to a WarpResponseResultCode
     * @param result
     */
    -(void)onSendUpdatePeersDone:(Byte)result;

###ChatRequestListener

    /**
     * Result of SendChat request. The result value maps to a WarpResponseResultCode
     * @param result
     */
    -(void)onSendChatDone:(Byte)result;

    /**
     * Invoked when a response for sendPrivateChat is received. Result of the 
     * operation is passed as an argument of value WarpResponseResultCode.
     * @param result
     */
    -(void)onSendPrivateChatDone:(Byte)result;

###NotifyListener

    /**
     * Invoked when a room is created. Lobby subscribers will receive this.
     * @param event
     */
    -(void)onRoomCreated:(RoomData*)roomData;
    /**
     * Invoked when a room is deleted. Lobby subscribers will receive this.
     * @param event
     */
    -(void)onRoomDestroyed:(RoomData*)roomData;
    /**
     * Invoked when a user leaves a room. Lobby and the concerned room subscribers 
     * will receive this.
     * @param event
     * @param username
     */
    -(void)onUserLeftRoom:(RoomData*)roomData username:(NSString*)username;
    /**
     * Invoked when a user joins a room. Lobby and the concerned room subscribers 
     * will receive this.
     * @param event
     * @param username
     */
    -(void)onUserJoinedRoom:(RoomData*)roomData username:(NSString*)username;

    /**
     * Invoked when a user leaves a lobby. Lobby subscribers will receive this.
     * @param event
     * @param username
     */
    -(void)onUserLeftLobby:(LobbyData*)lobbyData username:(NSString*)username;
    /**
     * Invoked when a user joins a lobby. Lobby subscribers will receive this.
     * @param event
     * @param username
     */
    -(void)onUserJoinedLobby:(LobbyData*)lobbyData username:(NSString*)username;   
    
    /**
     * Invoked when a joined user sends a chat. Rooms subscribers will receive this.
     * @param event
     */
    -(void)onChatReceived:(ChatEvent*)chatEvent;

    /**
     * Invoked when a private chat is received from the given sender.
     * @param sender
     * @param message
     */
    -(void)onPrivateChatReceived:(NSString*)message fromUser:(NSString*)senderName;

    /**
     * Invoked when a joined user sends a updatePeers request. Rooms subscribers 
     * will receive this.
     * @param event
     */
    -(void)onUpdatePeersReceived:(UpdateEvent*)updateEvent;
    /**
     * Invoked when a user change room property. Lobby and the concerned room subscribers
     * will receive this.
     * @param event
     * @param username
     * @param properties
     * @param lockedProperties
     */
    -(void)onUserChangeRoomProperty:(RoomData*)event username:(NSString*)username properties:
      (NSDictionary*)properties lockedProperties:(NSDictionary*)lockedProperties;

    /**
     * Invoked to indicate that a user has lost connectivity. Subscribers of the users location 
     * will receive this.
     * @param locid
     * @param isLobby
     * @param username
     */
     -(void) onUserPaused:(NSString*)userName withLocation:(NSString*)locId isLobby:(BOOL)isLobby;

    /**
     * Invoked when a user's connectivity is restored. Subscribers of the users location 
     * will receive this.
     * @param locid
     * @param isLobby 
     * @param username
     */
     -(void) onUserResumed:(NSString*)userName withLocation:(NSString*)locId isLobby:(BOOL)isLobby;

WarpClient Event Result Codes

    static const Byte SUCCESS = 0;    
    static const Byte AUTH_ERROR = 1;    
    static const Byte RESOURCE_NOT_FOUND = 2;    
    static const Byte RESOURCE_MOVED = 3;     
    static const Byte BAD_REQUEST = 4;
    static const Byte CONNECTION_ERR = 5;
    static const Byte UNKNOWN_ERROR = 6;
    static const Byte RESULT_SIZE_ERROR = 7;
    static const Byte SUCCESS_RECOVERED = 8;
    static const Byte CONNECTION_ERROR_RECOVERABLE = 9;

SUCCESS

The request was successfully received and processed by the server.

AUTH_ERROR

The session id sent in the request was incorrect. This can happen if the client connects without initializing with the correct keys.

RESOURCE_NOT_FOUND

The resource for which the request was intended is not known to the server. For example a bad room id is given to a joinRoom request.

RESOURCE_MOVED

The resource for which the request was intended to has moved to a state where it can't process the request. For example, if a client sends a chat or updatePeers message and the connected user is not present in any room.

UNKNOWN_ERROR

This is an unexpected error. Retrying the request is recommended if this happens.

BAD_REQUEST

This occurs if the parameters passed to the request are invalid. For example if null or empty string is passed in the roomId parameter of a joinRoom request.

CONNECTION_ERR

This occurs if the underlying TCP connection with AppWarp cloud service got broken. The client will need to reconnect to the service and retry the operation. SUCCESS_RECOVERED

This indicates that the user connection has been successfully restored.

CONNECTION_ERROR_RECOVERABLE

This occurs if the underlying TCP connection with AppWarp cloud service got broken. But also indicates that it is possible to recover the connection if the application requires by calling the RecoverConnection API.

Clone this wiki locally