回调 | 函数名 |
---|---|
void | onHummerLogin |
void | onRefreshToken |
通知 | 函数名 |
---|---|
void | onHummerStateChanged |
void | onHummerKicked |
void | onHummerPreviousTokenExpired |
回调 | 函数名 |
---|---|
void | onSetRoomAttributes |
void | onAddOrUpdateRoomAttributes |
void | onDeleteRoomAttributes |
void | onClearRoomAttributes |
void | onQueryRoomAttributes |
void | onQueryRoomAttributesByKeys |
void | onQueryMembers |
void | onQueryMemberCounts |
void | onSendMessage |
通知 | 函数名 |
---|---|
void | onRoomMessageReceived |
void | onRoomAttributesSet |
void | onRoomAttributesDeleted |
void | onRoomAttributesCleared |
void | onRoomAttributesAddedOrUpdated |
回调 | 函数名 |
---|---|
void | onJoinRoom |
void | onLeaveRoom |
void | onSetMemberAttributes |
void | onAddOrUpdateMemberAttributes |
void | onClearMemberAttributes |
void | onDeleteMemberAttributes |
void | onQueryMemberAttributes |
void | onQueryMemberAttributesByKeys |
回调 | 函数名 |
---|---|
void | onSendMessage |
void | onQueryUserOnlineStatus |
通知 | 函数名 |
---|---|
void | onPeerMessageReceived |
void onHummerStateChanged(State oldState, State newState, const hmr::String& reason)
Hummer SDK 状态变更回调
参数 | 描述 |
---|---|
oldState | 旧状态 |
newState | 新状态 |
reason | 变更说明 |
void onHummerKicked(const Code& kickCode)
SDK收到多端登录被踢的回调方法
参数 | 描述 |
---|---|
kickCode | 错误码 |
void onHummerPreviousTokenExpired()
token过期失效,SDK给予业务层的回调通知
注意:
- 只有在 SDK 断线重连时token过期才会触发,收到该回调时,请调用 refreshToken 方法刷新Token
void onHummerLogin(RequestId requestId,
UserId userId,
const Code& code)
Hummer登录结果回调
参数 | 描述 |
---|---|
requestId | 对应请求时产生的请求标识 |
UserId | 操作者标识 |
code | 错误码 |
void onRefreshToken(RequestId requestId, const Code& code)
用户凭证刷新结果回调
参数 | 描述 |
---|---|
requestId | 对应请求时产生的请求标识 |
code | 错误码 |
void onRoomAttributesSet(const RoomId& roomId,
UserId userId,
const Dictionary& attributes)
房间属性设置通知
参数 | 描述 |
---|---|
roomId | 房间标识 |
userId | 操作者标识 |
attributes | 全量设置的属性 |
void onRoomMessageReceived(const RoomId& roomId,
UserId userId,
const Message& msg)
当有一个用户往房间内发一条信令消息时,房间内所有的成员都会收到该事件的通知回调
参数 | 描述 |
---|---|
roomId | 房间标识 |
userId | 发送者标识 |
msg | 信令消息 |
void onRoomAttributesDeleted(const RoomId& roomId,
UserId userId,
const Dictionary& attributes)
房间属性删除通知
参数 | 描述 |
---|---|
roomId | 房间标识 |
userId | 操作者标识 |
attributes | 全量设置的属性 |
void onRoomAttributesCleared(const RoomId& roomId,
UserId userId,
const Dictionary& attributes)
房间属性清空通知
参数 | 描述 |
---|---|
roomId | 房间标识 |
userId | 操作者标识 |
attributes | 对应属性 |
void onRoomAttributesAddedOrUpdated(const RoomId& roomId,
UserId userId,
const Dictionary& attributes)
房间信息更新通知
参数 | 描述 |
---|---|
roomId | 房间标识 |
userId | 操作者标识 |
attributes | 对应属性 |
void onSetRoomAttributes(RequestId requestId,
const Code& code,
const RoomId& roomId,
const Dictionary& attributes,
const RoomAttributeOptions& options)
设置房间属性设置结果回调
注意:
- 该方法通过调用 setRoomAttributes 发生回调。
参数 | 描述 |
---|---|
requestId | 对应请求时产生的请求标识 |
code | 房操作结果返回码标识 |
roomId | 房间标识 |
attributes | 对应属性 |
options | 发送的信令消息的配置信息 |
onAddOrUpdateRoomAttributes(RequestId requestId,
const Code& code,
const RoomId& roomId,
const Dictionary& attributes,
const RoomAttributeOptions& options)
更新指定房间的属性结果回调
注意:
- 该方法通过调用 addOrUpdateRoomAttributes 发生回调。
参数 | 描述 |
---|---|
requestId | 对应请求时产生的请求标识 |
code | 房操作结果返回码标识 |
roomId | 房间标识 |
attributes | 对应属性 |
options | 发送的信令消息的配置信息 |
void onDeleteRoomAttributes(RequestId requestId,
const Code& code,
const RoomId& roomId,
const String keys[],
int numberOfKeys,
const RoomAttributeOptions& options)
删除房间属性结果回调
注意:
- 该方法通过调用 deleteRoomAttributes 发生回调。
参数 | 描述 |
---|---|
requestId | 对应请求时产生的请求标识 |
code | 房操作结果返回码标识 |
roomId | 房间标识 |
keys | 属性数组 |
numberOfKeys | 属性数量 |
options | 发送的信令消息的配置信息 |
void onClearRoomAttributes(RequestId requestId,
const Code& code,
const RoomId& roomId,
const RoomAttributeOptions& options)
清除房间所有属性结果回调
注意:
- 该方法通过调用 clearRoomAttributes 发生回调。
参数 | 描述 |
---|---|
requestId | 对应请求时产生的请求标识 |
code | 房操作结果返回码标识 |
roomId | 房间标识 |
options | 发送的信令消息的配置信息 |
void onQueryRoomAttributes(RequestId requestId,
const Code& code,
const RoomId& roomId,
const Dictionary& attributes)
查询房间所有属性结果回调
注意:
- 该方法通过调用 queryRoomAttributes 发生回调。
参数 | 描述 |
---|---|
requestId | 对应请求时产生的请求标识 |
code | 房操作结果返回码标识 |
roomId | 房间标识 |
attributes | 全量设置的属性 |
void onQueryRoomAttributesByKeys(RequestId requestId,
const Code& code,
const RoomId& roomId,
const Dictionary& attributes)
查询房间指定属性结果回调
注意:
- 该方法通过调用 queryRoomAttributesByKeys 发生回调。
参数 | 描述 |
---|---|
requestId | 对应请求时产生的请求标识 |
code | 房操作结果返回码标识 |
roomId | 房间标识 |
attributes | 全量设置的属性 |
void onRoomMemberJoined(const RoomId& roomId,
const UserId userIds[],
int numberOfUserIds)
成员进入房间通知 当房间人数超过500人时,将不会有该通知
参数 | 描述 |
---|---|
roomId | 房间标识 |
userIds | 用户ID数组 |
numberOfUserIds | 用户ID数量 |
void onRoomMemberLeft(const RoomId& roomId,
const UserId userIds[],
int numberOfUserIds)
成员离开房间通知 当房间人数超过500人时,将不会有该通知
参数 | 描述 |
---|---|
roomId | 房间标识 |
userIds | 用户ID数组 |
numberOfUserIds | 用户ID数量 |
void onRoomMemberOffline(const RoomId roomIds[], int numberOfRoomIds)
当前用户断线超时离开房间通知
注意:
- 只有当前用户因本地断线超时离开房间时才会触发该通知
参数 | 描述 |
---|---|
userIds | 用户ID数组 |
numberOfUserIds | 用户ID数量 |
void onRoomMemberCountChanged(const RoomMemberCount memberCounts[], int numberOfCounts)
房间人数变化通知
参数 | 描述 |
---|---|
memberCounts | 房间用户数组 |
numberOfCounts | 房间用户数量 |
void onRoomMemberAttributesSet(const RoomId& roomId,
UserId userId,
const Dictionary& attributes)
设置成员属性通知
参数 | 描述 |
---|---|
roomId | 房间标识 |
userId | 操作者标识 |
attributes | 对应属性 |
void onRoomMemberAttributesDeleted(const RoomId& roomId,
UserId userId,
const Dictionary& attributes)
删除成员属性通知
参数 | 描述 |
---|---|
roomId | 房间标识 |
userId | 操作者标识 |
attributes | 对应属性 |
void onRoomMemberAttributesCleared(const RoomId& roomId,
UserId userId,
const Dictionary& attributes)
房间成员信息清空回调通知
参数 | 描述 |
---|---|
roomId | 房间标识 |
userId | 操作者标识 |
attributes | 对应属性 |
void onRoomMemberAttributesAddedOrUpdated(const RoomId& roomId,
UserId userId,
const Dictionary& attributes)
房间成员信息更新回调通知
参数 | 描述 |
---|---|
roomId | 房间标识 |
userId | 操作者标识 |
attributes | 对应属性 |
void onJoinRoom(RequestId requestId,
const Code& code,
const RoomId& roomId,
const Dictionary& extras,
const RoomJoinningOptions& options)
进入房间结果回调
注意:
- 该方法通过调用 joinRoom 发生回调。
参数 | 描述 |
---|---|
requestId | 对应请求时产生的请求标识 |
code | 房操作结果返回码标识 |
roomId | 房间标识 |
extras | 加入房间时的扩展信息 |
options | 加入房间时可选参数 |
void onLeaveRoom(RequestId requestId,
const Code& code,
const RoomId& roomId)
离开房间结果回调
注意:
- 该方法通过调用 leaveRoom 发生回调。
参数 | 描述 |
---|---|
requestId | 对应请求时产生的请求标识 |
code | 房操作结果返回码标识 |
roomId | 房间标识 |
void onQueryMembers(RequestId requestId,
const Code& code,
const RoomId& roomId,
const UserId userIds[],
int numberOfUserIds)
房间成员列表查询结果回调
注意:
- 该方法通过调用 queryMembers 发生回调。
参数 | 描述 |
---|---|
requestId | 对应请求时产生的请求标识 |
code | 操作结果返回码标识 |
roomId | 房间标识 |
userIds | 用户ID数组 |
numberOfUserIds | 用户ID数量 |
void onQueryMemberCounts(RequestId requestId,
const Code& code,
const RoomMemberCount memberCounts[],
int numberOfCounts)
房间成员查询结果回调
注意:
- 该方法通过调用 queryMemberCounts 发生回调。
参数 | 描述 |
---|---|
requestId | 对应请求时产生的请求标识 |
code | 操作结果返回码标识 |
memberCounts | 房间人数集合 |
numberOfCounts | 房间人数集合的大小 |
void onSendMessage(RequestId requestId,
const Code& code,
const RoomId& roomId,
const Message& msg,
const MessagingOptions& options)
发送房间消息结果回调
注意:
- 该方法通过调用 sendMessage 发生回调。
参数 | 描述 |
---|---|
requestId | 对应请求时产生的请求标识 |
code | 房操作结果返回码标识 |
roomId | 房间标识 |
msg | 消息 |
options | 消息选项 |
void onSetMemberAttributes(RequestId requestId,
const Code& code,
const RoomId& roomId,
UserId userId,
const Dictionary& attributes,
const MemberAttributeOptions& options)
房间成员属性设置结果回调
注意:
- 该方法通过调用 setMemberAttributes 发生回调。
参数 | 描述 |
---|---|
requestId | 对应请求时产生的请求标识 |
code | 房操作结果返回码标识 |
roomId | 房间标识 |
userId | 发送者标识 |
attributes | 消息 |
options | 消息选项 |
void onAddOrUpdateMemberAttributes(RequestId requestId,
const Code& code,
const RoomId& roomId,
UserId userId,
const Dictionary& attributes,
const MemberAttributeOptions& options)
房间成员属性更新结果回调
注意:
- 该方法通过调用 addOrUpdateMemberAttributes 发生回调。
参数 | 描述 |
---|---|
requestId | 对应请求时产生的请求标识 |
code | 房操作结果返回码标识 |
roomId | 房间标识 |
userId | 发送者标识 |
attributes | 消息 |
options | 消息选项 |
void onClearMemberAttributes(RequestId requestId,
const Code& code,
const RoomId& roomId,
UserId userId,
const MemberAttributeOptions& options)
清除房间成员所有属性结果回调
注意:
- 该方法通过调用 clearMemberAttributes 发生回调。
参数 | 描述 |
---|---|
requestId | 对应请求时产生的请求标识 |
code | 房操作结果返回码标识 |
roomId | 房间标识 |
userId | 发送者标识 |
options | 消息选项 |
void onDeleteMemberAttributes(RequestId requestId,
const Code& code,
const RoomId& roomId,
UserId userId,
const String keys[],
int numberOfKeys,
const MemberAttributeOptions& options)
房间成员属性删除结果回调
注意:
- 该方法通过调用 deleteMemberAttributes 发生回调。
参数 | 描述 |
---|---|
requestId | 对应请求时产生的请求标识 |
code | 房操作结果返回码标识 |
roomId | 房间标识 |
userId | 发送者标识 |
keys | 属性数组 |
numberOfKeys | 属性数量 |
options | 消息选项 |
void onQueryMemberAttributes(RequestId requestId,
const Code& code,
const RoomId& roomId,
UserId userId,
const Dictionary& attributes)
查询房间成员所有属性结果回调
注意:
- 该方法通过调用 queryMemberAttributes 发生回调。
参数 | 描述 |
---|---|
requestId | 对应请求时产生的请求标识 |
code | 房操作结果返回码标识 |
roomId | 房间标识 |
userId | 发送者标识 |
attributes | 全量设置的属性 |
void onQueryMemberAttributesByKeys(RequestId requestId,
const Code& code,
const RoomId& roomId,
UserId userId,
const Dictionary& attributes)
查询房间成员指定属性结果回调
注意:
- 该方法通过调用 queryMemberAttributesByKeys 发生回调。
参数 | 描述 |
---|---|
requestId | 对应请求时产生的请求标识 |
code | 房操作结果返回码标识 |
roomId | 房间标识 |
userId | 发送者标识 |
attributes | 全量设置的属性 |
void onPeerMessageReceived(UserId userId, const Message& message)
当收到点对点信令消息时,会收到该事件的通知
参数 | 描述 |
---|---|
userId | 发送者标识 |
message | 收到的信令消息 |
void onSendMessage(RequestId requestId,
const Code& code,
UserId userId,
const Message& message,
const MessagingOptions& options)
当发送点对点信令消息时,结果通过该事件进行回调
注意:
- 该方法通过调用 sendMessage 发生回调。
参数 | 描述 |
---|---|
requestId | 对应请求时产生的请求标识 |
code | 房操作结果返回码标识 |
userId | 发送者标识 |
message | 收到的信令消息 |
options | 发送的信令消息的配置信息 |
void onQueryUserOnlineStatus(RequestId requestId,
const Code& code,
const UserOnlineStatus status[],
int count)
批量查询用户在线结果回调
注意:
- 该方法通过调用 queryUserOnlineStatus 发生回调。
参数 | 描述 |
---|---|
requestId | 对应请求时产生的请求标识 |
code | 房操作结果返回码标识 |
status | 查询结果 |
count | 列表个数 |