FuncList | DESC |
Callback for received the battle start. | |
Callback for received tht battle end. | |
Callback for received user notification of joined the battle. | |
Callback for received user notification of exited the battle. | |
Callback for received score update notification of battle user. | |
Callback for received the battle invitation | |
Callback for canceled the connection invitation | |
Callback for timeout the battle invitation | |
Callback for accpeted the battle invitation | |
Callback for rejected the battle invitation |
FuncList | DESC |
Add event callback | |
Remove event callback | |
Request battle invitation. | |
Cancel request about battle invitation. | |
Accept the battle invitaion. | |
Reject the battle invitaion. | |
Exit the battle |
FuncList | DESC |
Battle User Info | |
Battle Config | |
Battle Info |
EnumType | DESC |
Battle Request Status | |
Battle Stopped Reason |
- (void)onBattleStarted: |
Param | DESC |
battleInfo | Battle information. |
- (void)onBattleEnded: | |
reason: |
Param | DESC |
battleInfo | Battle information. |
reason | The reason why the PK ended. |
- (void)onUserJoinBattle: | (NSString*)battleId |
battleUser: |
Param | DESC |
battleId | Battle ID. |
battleUser |
- (void)onUserExitBattle: | (NSString*)battleId |
battleUser: |
Param | DESC |
battleId | Battle ID. |
battleUser |
- (void)onBattleScoreChanged: | (NSString*)battleId |
battleUserList: |
Param | DESC |
battleId | Battle ID. |
battleUserList |
- (void)onBattleRequestReceived: | |
inviter: | |
invitee: |
Param | DESC |
battleInfo | Battle information. |
invitee | |
inviter |
- (void)onBattleRequestCancelled: | |
inviter: | |
invitee: |
Param | DESC |
battleInfo | Battle information. |
invitee | |
inviter |
- (void)onBattleRequestTimeout: | |
inviter: | |
invitee: |
Param | DESC |
battleInfo | Battle information. |
invitee | |
inviter |
- (void)onBattleRequestAccept: | |
inviter: | |
invitee: |
Param | DESC |
battleInfo | Battle information. |
invitee | |
inviter |
- (void)onBattleRequestReject: | |
inviter: | |
invitee: |
Param | DESC |
battleInfo | Battle information. |
invitee | |
inviter |
- (void)addObserver: |
Param | DESC |
observer | The instance being listened to. |
- (void)removeObserver: |
Param | DESC |
observer | The instance being listened to. |
- (void)requestBattle: | |
roomIdList: | (NSArray<NSString *> *)roomIdList |
timeout: | (NSTimeInterval)timeout |
onSuccess: | (TUIBattleRequestBlock)onSuccess |
onError: | (TUIErrorBlock)onError |
Param | DESC |
config | Battle configuration. |
roomIdList | The list of room IDs will be invited. |
timeout | Timeout time. |
- (void)cancelBattleRequest: | (NSString*)battleId |
userIdList: | (NSArray<NSString *> *)userIdList |
onSuccess: | (TUISuccessBlock)onSuccess |
onError: | (TUIErrorBlock)onError |
Param | DESC |
battleId | Battle ID. |
roomIdList | The list of room IDs whose battle requests will be canceled. |
- (void)acceptBattle: | (NSString *)battleId |
onSuccess: | (TUISuccessBlock)onSuccess |
onError: | (TUIErrorBlock)onError |
Param | DESC |
battleId | Battle ID. |
- (void)rejectBattle: | (NSString *)battleId |
onSuccess: | (TUISuccessBlock)onSuccess |
onError: | (TUIErrorBlock)onError |
Param | DESC |
battleId | Battle ID. |
- (void)exitBattle: | (NSString *)battleId |
onSuccess: | (TUISuccessBlock)onSuccess |
onError: | (TUIErrorBlock)onError |
Param | DESC |
battleId | Battle ID. |
Enum | Value | DESC |
TUIBattleCodeUnknown | -1 | default. |
TUIBattleCodeSuccess | 0 | Request success. |
TUIBattleCodeRoomNotExist | 1 | Request Room not exist. |
TUIBattleCodeBattling | 2 | The room you are invited to join the battle is already joined battle. |
TUIBattleCodeBattlingOtherRoom | 3 | The room you are invited to battle to is battling with other rooms. |
TUIBattleCodeRoomExit | 4 | The room is exited. |
TUIBattleCodeRetry | 5 | An internal error occurs. You are advised to try again. |
Enum | Value | DESC |
TUIBattleStoppedReasonTimeOver | 0 | The Battle reaches the maximum duration and the timeout ends. |
TUIBattleStoppedReasonOtherExit | 1 | The rest of the users has exited. |
EnumType | DESC |
avatarUrl | The user avatar url of the battle user. |
roomId | The room id of the battle user. |
score | The score of the battle user. |
userId | The user id of the battle user. |
userName | The user name of the battle user. |
EnumType | DESC |
duration | The maximum duration of the battle (Unit: seconds). |
extensionInfo | The extension information of battle. |
needResponse | Whether the invited user needs to reply accept/reject. |
EnumType | DESC |
battleId | Battle ID. |
config | The configuration of battle. |
endTime | The timestamp marking the end of the battle (Unit: seconds). |
inviteeList | The people who are invited to join the battle. |
inviter | The person who requests the battle. |
startTime | The timestamp marking the start of the battle (Unit: seconds). |
Was this page helpful?