|
@@ -728,6 +728,7 @@ public class LiveRoomServiceImpl extends ServiceImpl<LiveRoomDao, LiveRoom> impl
|
|
|
} catch (Exception e) {
|
|
|
log.error("destroyLiveRoom>>>> FORCED_OFFLINE {}", e.getMessage());
|
|
|
}
|
|
|
+ tryDestroyLiveRoom(room);
|
|
|
|
|
|
Date now = new Date();
|
|
|
//删除人员与房间关联关系缓存的方法
|
|
@@ -765,7 +766,6 @@ public class LiveRoomServiceImpl extends ServiceImpl<LiveRoomDao, LiveRoom> impl
|
|
|
//删除该临时直播间列表
|
|
|
RMap<Long, String> map = redissonClient.getMap(TEACHER_TEMP_LIVE_ROOM);
|
|
|
map.remove(room.getSpeakerId());
|
|
|
- tryDestroyLiveRoom(room);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -1009,6 +1009,11 @@ public class LiveRoomServiceImpl extends ServiceImpl<LiveRoomDao, LiveRoom> impl
|
|
|
.key(type.getCode())
|
|
|
.value(value)
|
|
|
.build());
|
|
|
+
|
|
|
+ appDefinedData.add(TencentRequest.ChatRoomGroupDefinedData.builder()
|
|
|
+ .key(EGroupDefinedDataType.UPDATE_INFO.getCode())
|
|
|
+ .value(type.getCode())
|
|
|
+ .build());
|
|
|
try {
|
|
|
livePluginContext.getPluginService(roomVo.getServiceProvider())
|
|
|
.chatRoomGroupDefinedData(TencentRequest.ChatRoomGroup.builder()
|
|
@@ -1059,6 +1064,11 @@ public class LiveRoomServiceImpl extends ServiceImpl<LiveRoomDao, LiveRoom> impl
|
|
|
.key(EGroupDefinedDataType.MEMBER_TOTAL.getCode())
|
|
|
.value(totalUser.toString())
|
|
|
.build());
|
|
|
+
|
|
|
+ appDefinedData.add(TencentRequest.ChatRoomGroupDefinedData.builder()
|
|
|
+ .key(EGroupDefinedDataType.UPDATE_INFO.getCode())
|
|
|
+ .value(StringUtils.join(EGroupDefinedDataType.MEMBER_ONLINE.getCode(),EGroupDefinedDataType.MEMBER_TOTAL.getCode(),","))
|
|
|
+ .build());
|
|
|
try {
|
|
|
livePluginContext.getPluginService(roomVo.getServiceProvider())
|
|
|
.chatRoomGroupDefinedData(TencentRequest.ChatRoomGroup.builder()
|
|
@@ -2157,14 +2167,14 @@ public class LiveRoomServiceImpl extends ServiceImpl<LiveRoomDao, LiveRoom> impl
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void joinRoom(String roomUid, Long userId, Boolean microphoneFlag) {
|
|
|
+ public long joinRoom(String roomUid, Long userId, Boolean microphoneFlag) {
|
|
|
Optional.ofNullable(roomUid).orElseThrow(() -> new BizException("房间编号不能为空!"));
|
|
|
Optional.ofNullable(userId).orElseThrow(() -> new BizException("人员编号不能为空!"));
|
|
|
|
|
|
// 设置进入时间
|
|
|
RBucket<Long> userStateTimeCache = redissonClient.getBucket(LIVE_USER_LAST_TIME.replace(USER_ID, userId.toString()));
|
|
|
- long time = new Date().getTime();
|
|
|
- log.info(" cacheTime: {}, userStateTime: {}", userStateTimeCache.get(), time);
|
|
|
+ long time = DateTime.now().plusSeconds(1).getMillis();
|
|
|
+ log.info(" join cacheTime: {}, userStateTime: {}", userStateTimeCache.get(), time);
|
|
|
userStateTimeCache.set(time, 60L, TimeUnit.MINUTES);
|
|
|
|
|
|
LiveRoomWrapper.LiveRoomVo liveRoomVo = queryRoomInfo(roomUid);
|
|
@@ -2232,6 +2242,7 @@ public class LiveRoomServiceImpl extends ServiceImpl<LiveRoomDao, LiveRoom> impl
|
|
|
log.info("joinRoom>>>> userInfo: {}", userJsonStr);
|
|
|
//记录当前用户对应的房间uid
|
|
|
redissonClient.getBucket(LIVE_USER_ROOM.replace(USER_ID, userId.toString())).set(roomUid, 2L, TimeUnit.DAYS);
|
|
|
+ return new Date().getTime();
|
|
|
}
|
|
|
|
|
|
/**
|