iOS
Android
Unity
REST Api
BDArenaChatConnector

Availability : ver 1.0 and later

Declared in : BDArenaChatConnector.h

Sample code : -

Overview

The BDArenaChatConnector class is the main interface for accessing the Arena Daemon chat features.

 

BDArenaChatConnector declares methods for joining chat rooms, sending public messages to that rooms and sending private messages to other players. 

 

The BDArenaChatConnector object is accessible through chatConnector property of the unique BDArenaConnector instance. 

 

 

    BDArenaChatConnector* chatConnector = [BDArenaConnector getInstance].chatConnector;

 

Methods

Connection to chat daemon

- connect

- disconnect

- isConnected

 

Operations 

- getRoomsList

- joinRoom:returnPlayersList:

leaveRoom:

sendMessage:inRoom:

sendPrivateMessage:toPlayerWithAuid:

getNumberOfPlayersInRoom:

getNumberOfPlayersGlobal

getPlayersListForRoom:

getRoomsForPlayerWithAuid:

getStatusForPlayerWithAuid:

 

Moderation : block/unblock of remote players messages

- startIgnoringMessagesFromPlayerWithAuid:

- endIgnoringMessagesFromPlayerWithAuid:

- getIgnoredPlayersList

 

Chat rooms Administration

- addRestriction:forPlayerWithAuid:inRoom:

- removeRestriction:forPlayerWithAuid:inRoom:

- setRestriction:forPlayerWithAuid:inRoom:

- getRestrictionMaskForPlayerWithAuid:inRoom:

- getRestrictionsForRoomsGlobal

 

Chat History management

- getHistoryForRoom:filter:ascending:

- clearHistoryForRoom:

- getPrivateHistoryForPlayerWithAuid:filter:ascending:

- clearPrivateHistoryForPlayerWithAuid:

 

 

 


 

 

 

connect

 

Performs connection to chat daemon.

 

- (void) connect;

 

Discussion

The results of this operation can be handled implementing arenaChatConnectionEstabilished and arenaChatConnectionFailedWithError: 

protocol methods of BDArenaChatConnectorDelegate.

 

Availability

available in SDK ver 1.0 and later

 

Declared in

BDArenaPlayConnector.h

 

 

 

disconnect

 

Performs disconnection from chat daemon.

 

- (void) disconnect;

 

Discussion

The result of this operation can be handled implementing arenaChatConnectionDidClose 

protocol methods of BDArenaChatConnectorDelegate.

 

Availability

available in SDK ver 1.0 and later

 

Declared in

BDArenaChatConnector.h

 

 

 

isConnected

 

Informs about connection status to chat daemon.

 

- (BOOL) isConnected;

 

Return value

YES if a connection to the chat daemon is already established. NO otherwise.

 

Availability

available in SDK ver 1.0 and later

 

Declared in

BDArenaChatConnector.h

 

 

 

getRoomsList

 

Retrieves chat rooms list.

 

- (ARENA_ERROR) getRoomsList;

 

Return value

An ARENA_ERROR value indicating the result of the call.

 

Discussion

The results of this operation can be handled implementing arenaChat:roomsListReceived: and arenaChat:requestDidFail: 

protocol methods of BDArenaChatConnectorDelegate.

 

Availability

available in SDK ver 1.0 and later

 

Declared in

BDArenaChatConnector.h

 

 

 

joinRoom:returnPlayersList:

 

Joins a specific chat room.

 

- (ARENA_ERROR) joinRoom:(NSString*)roomName returnPlayersList:(BOOL)returnPlayersList;

 

Return value

An ARENA_ERROR value indicating the result of the call.

 

Parameters 

roomName

    The name of the chat room in which the player wants to join. This is a user defined string

    and in many cases it is something like "friends", "tech" or "my room".

    The number of chat rooms simultaneously joinable is infinite.

returnPlayersList

    If YES, the list of players already present in the chat room is returned in playersList 

    parameter of arenaChat:roomJoined:numberOfPlayers:playersList: protocol method

    of BDArenaChatConnectorDelegate.

 

Discussion

The results of this operation can be handled implementing 

arenaChat:roomJoined:numberOfPlayers:playersList:arenaChat:roomAlreadyJoined: 

and arenaChat:requestDidFail: protocol methods of BDArenaChatConnectorDelegate.

If the local player has been restricted by an administrator with the 

BDArenaRestrictionMaskBan restriction type, this operation will fail and

arenaChat:joinRoom:didFailWithError: protocol method

of BDArenaChatConnectorDelegate will be invoked.

 

Availability

available in SDK ver 1.0 and later

 

Declared in

BDArenaChatConnector.h

 

 

 

leaveRoom:

 

Leaves a specific chat room.

 

- (ARENA_ERROR) leaveRoom:(NSString*)roomName;

 

Return value

An ARENA_ERROR value indicating the result of the call.

 

Parameters 

roomName

    The name of the chat room to leave.

 

Discussion

The results of this operation can be handled implementing arenaChat:roomLeft: and 

arenaChat:requestDidFail: protocol methods of BDArenaChatConnectorDelegate.

 

Availability

available in SDK ver 1.0 and later

 

Declared in

BDArenaChatConnector.h

 

 

 

sendMessage:inRoom:

 

Sends a message in a specific chat room.

 

- (ARENA_ERROR) sendMessage:(NSString*)message inRoom:(NSString*)roomName;

 

Return value

An ARENA_ERROR value indicating the result of the call.

 

Parameters 

message

    The message to send.

roomName

    The name of the chat room to leave.

 

Discussion

The results of this operation can be handled implementing 

arenaChat:messageSuccessfullySentInRoom: and 

arenaChat:requestDidFail: protocol methods of BDArenaChatConnectorDelegate.

If the local player has been restricted by an administrator with the 

BDArenaRestrictionMaskUnvoice restriction type, this operation will fail and 

arenaChat:messageFailedToSendBecauseLocalPlayerIsRestrictedInRoom: protocol method

of BDArenaChatConnectorDelegate will be invoked.

 

Availability

available in SDK ver 1.0 and later

 

Declared in

BDArenaChatConnector.h

 

 

 

sendPrivateMessage:toPlayerWithAuid:

 

Sends a private message to a specific player.

 

- (ARENA_ERROR) sendPrivateMessage:(NSString*)message toPlayerWithAuid:(NSInteger)auid;

 

Return value

An ARENA_ERROR value indicating the result of the call.

 

Parameters 

message

    The message to send.

auid

    The Arena Daemon Unique Id (auid) of the recipient player.

 

Discussion

The results of this operation can be handled implementing 

arenaChat:messageSuccessfullySentToPlayerWithAuid:,

arenaChat:messageFailedToSendBecauseLocalPlayerIsIgnoredByPlayerWithAuid: and

arenaChat:requestDidFail: protocol methods of BDArenaChatConnectorDelegate.

 

Availability

available in SDK ver 1.0 and later

 

Declared in

BDArenaChatConnector.h

 

 

 

getNumberOfPlayersInRoom:

 

Retrieves the number of players present in a specific chat room.

 

- (ARENA_ERROR) getNumberOfPlayersInRoom:(NSString*)roomName;

 

Return value

An ARENA_ERROR value indicating the result of the call.

 

Parameters 

roomName

    The name of the requested chat room.

 

Discussion

The results of this operation can be handled implementing 

arenaChat:numberOfPlayers:inRoom: and 

arenaChat:requestDidFail: protocol methods of BDArenaChatConnectorDelegate.

 

Availability

available in SDK ver 1.0 and later

 

Declared in

BDArenaChatConnector.h

 

 

 

getNumberOfPlayersGlobal

 

Retrieves the total number of players connected to the chat daemon.

 

- (ARENA_ERROR) getNumberOfPlayersGlobal;

 

Return value

An ARENA_ERROR value indicating the result of the call.

 

Discussion

The results of this operation can be handled implementing 

arenaChat:numberOfPlayersGlobal: and arenaChat:requestDidFail: 

protocol methods of BDArenaChatConnectorDelegate.

 

Availability

available in SDK ver 1.0 and later

 

Declared in

BDArenaChatConnector.h

 

 

 

getPlayersListForRoom:

 

Retrieves the list of players present in a specific chat room.

 

- (ARENA_ERROR) getPlayersListForRoom:(NSString*)roomName;

 

Return value

An ARENA_ERROR value indicating the result of the call.

 

Parameters 

roomName

    The name of the requested chat room.

 

Discussion

The results of this operation can be handled implementing 

arenaChat:playersList:receivedForRoom: and arenaChat:requestDidFail: 

protocol methods of BDArenaChatConnectorDelegate.

 

Availability

available in SDK ver 1.0 and later

 

Declared in

BDArenaChatConnector.h

 

 

 

getRoomsForPlayerWithAuid:

 

Retrieves all the chat rooms where a specific player is present.

 

- (ARENA_ERROR) getRoomsForPlayerWithAuid:(NSInteger)auid;

 

Return value

An ARENA_ERROR value indicating the result of the call.

 

Parameters 

auid

    The Arena Daemon Unique Id (auid) of the requested player.

 

Discussion

The results of this operation can be handled implementing

arenaChat:roomsList:receivedForPlayerWithAuid: and arenaChat:requestDidFail: 

protocol methods of BDArenaChatConnectorDelegate.

 

Availability

available in SDK ver 1.0 and later

 

Declared in

BDArenaChatConnector.h

 

 

 

getStatusForPlayerWithAuid:

 

Retrieves information about a specific player.

 

- (ARENA_ERROR) getStatusForPlayerWithAuid:(NSInteger)auid;

 

Return value

An ARENA_ERROR value indicating the result of the call.

 

Parameters 

auid

    The Arena Daemon Unique Id (auid) of the requested player.

 

Discussion

The results of this operation can be handled implementing 

arenaChat:status:receivedForPlayerWithAuid: and arenaChat:requestDidFail: 

protocol methods of BDArenaChatConnectorDelegate.

 

Availability 

available in SDK ver 1.0 and later

 

Declared in 

BDArenaChatConnector.h

 

 

 

startIgnoringMessagesFromPlayerWithAuid:

 

Starts to ignore, both in rooms and in a private conversation, incoming messages 

sent by a specific player.

 

- (ARENA_ERROR) startIgnoringMessagesFromPlayerWithAuid:(NSInteger)auid;

 

Return value

An ARENA_ERROR value indicating the result of the call.

 

Parameters 

auid

    The Arena Daemon Unique Id (auid) of the player to ignore.

 

Discussion

The results of this operation can be handled implementing 

arenaChat:startIgnoringMessageDidSucceedForPlayerWithAuid: ,

arenaChat:startIgnoringMessageAlreadySetForPlayerWithAuid: and 

arenaChat:startIgnoringMessageFromPlayerWithAuid:didFailWithError:

protocol methods of BDArenaChatConnectorDelegate.

 

Availability 

available in SDK ver 2.5 and later

 

Declared in 

BDArenaChatConnector.h

 

 

 

endIgnoringMessagesFromPlayerWithAuid:

 

Stops to ignore, both in rooms and in a private conversation, incoming messages 

sent by a specific player.

 

- (ARENA_ERROR) endIgnoringMessagesFromPlayerWithAuid:(NSInteger)auid;

 

Return value

An ARENA_ERROR value indicating the result of the call.

 

Parameters 

auid

    The Arena Daemon Unique Id (auid) of the remote player to stop ignoring.

 

Discussion

The results of this operation can be handled implementing 

arenaChat:endIgnoringMessageDidSucceedForPlayerWithAuid: ,

arenaChat:endIgnoringMessageAlreadySetForPlayerWithAuid: and 

arenaChat:endIgnoringMessageFromPlayerWithAuid:didFailWithError:

protocol methods of BDArenaChatConnectorDelegate.

 

Availability 

available in SDK ver 2.5 and later

 

Declared in 

BDArenaChatConnector.h

 

 

 

getIgnoredPlayersList

 

Retrieves the list of players ignored by the local player.

 

- (ARENA_ERROR) getIgnoredPlayersList;

 

Return value

An ARENA_ERROR value indicating the result of the call.

 

Discussion

The result of this operation can be handled implementing 

arenaChat:ignoredPlayersListReceived: 

protocol method of BDArenaChatConnectorDelegate.

 

Availability 

available in SDK ver 2.5 and later

 

Declared in 

BDArenaChatConnector.h

 

 

 

addRestriction:forPlayerWithAuid:inRoom:

 

Adds a restriction to a specific player in a specific chat room.

 

- (ARENA_ERROR) addRestriction:(BDArenaRestriction)restriction

        forPlayerWithAuid:(NSInteger)auid

        inRoom:(NSString*)roomName;

 

Parameters  

restriction

    The restriction to add. Refer to Constants and types for available values.

auid

    The Arena Daemon Unique Id (auid) of the player.

roomName

    The name of the chat room.

 

Return value

An ARENA_ERROR value indicating the result of the call.

 

Discussion

The result of this operation can be handled implementing 

arenaChat:restrictionMask:successfullyUpdatedToMask:forPlayerWithAuid:inRoom:,

arenaChat:restrictionMask:alreadySetForPlayerWithAuid:inRoom: and

arenaChat:restrictionMask:forPlayerWithAuid:inRoom:didFailWithError:

protocol method of BDArenaChatConnectorDelegate.

 

Availability 

available in SDK ver 2.6 and later

 

Declared in 

BDArenaChatConnector.h

 

 

 

removeRestriction:forPlayerWithAuid:inRoom:

 

Removes a restriction from a specific player in a specific chat room.

 

- (ARENA_ERROR) removeRestriction:(BDArenaRestriction)restriction

        forPlayerWithAuid:(NSInteger)auid

        inRoom:(NSString*)roomName;

 

Parameters 

restriction

    The restriction to remove. Refer to Constants and types for available values.

auid

    The Arena Daemon Unique Id (auid) of the player.

roomName

    The name of the chat room.

 

Return value

An ARENA_ERROR value indicating the result of the call.

 

Discussion

The result of this operation can be handled implementing 

arenaChat:restrictionMask:successfullyUpdatedToMask:forPlayerWithAuid:inRoom:,

arenaChat:restrictionMask:alreadySetForPlayerWithAuid:inRoom: and

arenaChat:restrictionMask:forPlayerWithAuid:inRoom:didFailWithError:

protocol method of BDArenaChatConnectorDelegate.

 

Availability 

available in SDK ver 2.6 and later

 

Declared in 

BDArenaChatConnector.h

 

 

 

setRestriction:forPlayerWithAuid:inRoom:

 

Sets a new restriction mask to a specific player in a specific chat room, overwriting the previous mask.

 

- (ARENA_ERROR) setRestriction:(BDArenaRestriction)restriction

        forPlayerWithAuid:(NSInteger)auid

        inRoom:(NSString*)roomName;

 

Parameters 

restriction

    The restriction to set. Refer to Constants and types for available values.

auid

    The Arena Daemon Unique Id (auid) of the player.

roomName

    The name of the chat room.

 

Return value

An ARENA_ERROR value indicating the result of the call.

 

Discussion

The result of this operation can be handled implementing 

arenaChat:restrictionMask:successfullyUpdatedToMask:forPlayerWithAuid:inRoom:,

arenaChat:restrictionMask:alreadySetForPlayerWithAuid:inRoom: and

arenaChat:restrictionMask:forPlayerWithAuid:inRoom:didFailWithError:

protocol method of BDArenaChatConnectorDelegate.

 

Availability 

available in SDK ver 2.6 and later

 

Declared in 

BDArenaChatConnector.h

 

 

 

getRestrictionMaskForPlayerWithAuid:inRoom:

 

Requests the current restriction mask for a specific player in a specific chat room.

 

- (ARENA_ERROR) getRestrictionMaskForPlayerWithAuid:(NSInteger)auid

        inRoom:(NSString*)roomName;

 

Parameters 

auid

    The Arena Daemon Unique Id (auid) of the player.

roomName

    The name of the chat room.

 

Return value

An ARENA_ERROR value indicating the result of the call.

 

Discussion

The result of this operation can be handled implementing 

arenaChat:restrictionMask:receivedForPlayerWithAuid:forRoom: and

and arenaChat:requestDidFail: 

protocol method of BDArenaChatConnectorDelegate.

 

Availability 

available in SDK ver 2.6 and later

 

Declared in 

BDArenaChatConnector.h

 

 

 

getRestrictionsForRoomsGlobal

 

Requests the list of rooms, and the associated players data, in which restrictions have been activated.

 

- (ARENA_ERROR) getRestrictionsForRoomsGlobal;

 

Return value

An ARENA_ERROR value indicating the result of the call.

 

Discussion

The result of this operation can be handled implementing 

arenaChat:restrictionsReceivedForRoomsGlobal: and

and arenaChat:requestDidFail: 

protocol method of BDArenaChatConnectorDelegate.

 

Availability 

available in SDK ver 2.6 and later

 

Declared in 

BDArenaChatConnector.h

 

 

 

getHistoryForRoom:filter:ascending:

 

Requests the array of history items for a specific room,

applying a specific filter and with a specific order based on events timestamp.

 

- (ARENA_ERROR) getHistoryForRoom:(NSString*)roomName

        filter:(BDArenaChatHistoryFilterType)filter

        ascending:(BOOL)asc;

 

Parameters 

roomName

    The name of the chat room.

filter

    The filter type. Refer to Constants And Types for more information about available filters.

asc

    The order type based on events timestamp.

 

Return value

An ARENA_ERROR value indicating the result of the call.

 

Discussion

In order to have all the filter types working, the developer needs to enable

the retrievable event types through the ArenaDaemon's website,

in the Dashboard/Manage Apps/Chat section.

 

The result of this operation can be handled implementing

arenaChat:historySuccessfullyReceivedWithData:forRoom:withFilterMask: and

and arenaChat:historyFailedToReceiveForRoom:withError:

protocol method of BDArenaChatConnectorDelegate.

 

Availability 

available in SDK ver 3.4.0 and later

 

Declared in 

BDArenaChatConnector.h 

 

 

 

clearHistoryForRoom:

 

Clears the history of a specific room.

 

- (ARENA_ERROR) clearHistoryForRoom:(NSString*)roomName;

 

Parameters 

roomName

    The name of the chat room.

 

Return value

An ARENA_ERROR value indicating the result of the call.

 

Discussion

The result of this operation can be handled implementing

arenaChat:historySuccessfullyClearedForRoom: and

and arenaChat:historyFailedToClearForRoom:withError:

protocol method of BDArenaChatConnectorDelegate.

 

Availability 

available in SDK ver 3.4.0 and later

 

Declared in 

BDArenaChatConnector.h

 

 

 

getPrivateHistoryForPlayerWithAuid:filter:ascending:

 

Requests the array of history items for a specific private conversation,

applying a specific filter and with a specific order based on events timestamp.

 

- (ARENA_ERROR) getPrivateHistoryForPlayerWithAuid:(NSInteger)auid

        filter:(BDArenaChatHistoryFilterType)filter

        ascending:(BOOL)asc; 

 

Parameters 

auid

    The Arena Daemon Unique Id (auid) of the player.

filter

    The filter type. Refer to Constants And Types for more information about available filters.

asc

    The order type based on events timestamp.

 

Return value

An ARENA_ERROR value indicating the result of the call.

 

Discussion 

The result of this operation can be handled implementing

arenaChat:historyPrivateSuccessfullyReceivedWithData:forPlayerWithAuid:withFilterMask: and

and arenaChat:historyPrivateFailedToReceiveForPlayerWithAuid:withError:

protocol method of BDArenaChatConnectorDelegate.

 

Availability 

available in SDK ver 3.4.0 and later

 

Declared in 

BDArenaChatConnector.h

 

 

 

clearPrivateHistoryForPlayerWithAuid:

 

Clears the history of a specific private conversation.

 

- (ARENA_ERROR) clearPrivateHistoryForPlayerWithAuid:(NSInteger)auid;

 

Parameters 

auid

    The Arena Daemon Unique Id (auid) of the player.

 

Return value

An ARENA_ERROR value indicating the result of the call.

 

Discussion

The result of this operation can be handled implementing

arenaChat:historyPrivateSuccessfullyClearedForPlayerWithAuid: and

and arenaChat:historyPrivateFailedToClearForPlayerWithAuid:withError:

protocol method of BDArenaChatConnectorDelegate.

 

Availability 

available in SDK ver 3.4.0 and later

 

Declared in 

BDArenaChatConnector.h