|
@@ -599,16 +599,10 @@ public class ImLiveBroadcastRoomServiceImpl extends ServiceImpl<ImLiveBroadcastR
|
|
|
if (!onlineUserInfo.isExists()) {
|
|
|
return;
|
|
|
}
|
|
|
- //在线人数
|
|
|
- int count = 0;
|
|
|
- //大于1就发送实际人数,如果是最后一个人离开房间则发送一条0人数消息给主播
|
|
|
- if (onlineUserInfo.size() > 1) {
|
|
|
- count = onlineUserInfo.size();
|
|
|
- }
|
|
|
- //向直播间发送当前在线人数消息
|
|
|
- this.sendOnlineUserCount(roomUid, userId, count);
|
|
|
//从在线人员列表删除该人员
|
|
|
onlineUserInfo.fastRemove(userId);
|
|
|
+ //向直播间发送当前在线人数消息
|
|
|
+ this.sendOnlineUserCount(roomUid, userId, onlineUserInfo.size());
|
|
|
log.info("opsRoom>>>> looker userInfo: {}", JSONObject.toJSONString(userInfo));
|
|
|
});
|
|
|
}
|
|
@@ -740,7 +734,7 @@ public class ImLiveBroadcastRoomServiceImpl extends ServiceImpl<ImLiveBroadcastR
|
|
|
//进入房间写如在线人员列表
|
|
|
onlineUserInfo.fastPut(userId, JSONObject.toJSONString(userInfo));
|
|
|
//向直播间发送当前在线人数消息
|
|
|
-// this.sendOnlineUserCount(roomUid, userId, count);
|
|
|
+ this.sendOnlineUserCount(roomUid, userId, onlineUserInfo.size());
|
|
|
log.info("joinRoom>>>> userInfo: {}", JSONObject.toJSONString(userInfo));
|
|
|
}
|
|
|
|
|
@@ -993,6 +987,13 @@ public class ImLiveBroadcastRoomServiceImpl extends ServiceImpl<ImLiveBroadcastR
|
|
|
* 测试
|
|
|
*/
|
|
|
public Map<String, Object> test(String roomUid) {
|
|
|
+ List<ImUserState> userStateList = new ArrayList<>();
|
|
|
+ ImUserState userState1 = new ImUserState();
|
|
|
+ userState1.setStatus("3");
|
|
|
+ userState1.setUserid("100071");
|
|
|
+ userStateList.add(userState1);
|
|
|
+ opsRoom(userStateList);
|
|
|
+
|
|
|
//test
|
|
|
Map<String, Object> result = new HashMap<>();
|
|
|
//点赞数
|