|
|
@ -8,6 +8,7 @@ import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.ccsens.game.bean.dto.ClientDto; |
|
|
|
import com.ccsens.game.bean.dto.message.*; |
|
|
|
import com.ccsens.game.bean.po.GameGroup; |
|
|
|
import com.ccsens.game.bean.po.GameRecord; |
|
|
|
import com.ccsens.game.netty.ChannelManager; |
|
|
|
import com.ccsens.game.service.IClientService; |
|
|
|
import com.ccsens.game.service.IMessageService; |
|
|
@ -151,10 +152,19 @@ public class WebSocketHandler extends SimpleChannelInboundHandler<BaseMessageDto |
|
|
|
public GameMessageCountOut clientAddTimes(String userId, String recordId) { |
|
|
|
GameMessageCountOut gameMessageCountOut = new GameMessageCountOut(); |
|
|
|
log.info("userId:{}", userId); |
|
|
|
if (StrUtil.isBlank(userId) || StrUtil.isBlank(userId)) { |
|
|
|
if (StrUtil.isBlank(userId) || StrUtil.isBlank(recordId)) { |
|
|
|
return gameMessageCountOut; |
|
|
|
} |
|
|
|
|
|
|
|
Long recordIdLong = Long.parseLong(recordId); |
|
|
|
String gameRecordStr = (String) redisUtil.get(GameConstant.generateGameStatusKey(recordIdLong)); |
|
|
|
if(StrUtil.isEmpty(gameRecordStr)){ |
|
|
|
return gameMessageCountOut; |
|
|
|
} |
|
|
|
GameRecord record = JSON.parseObject(gameRecordStr, GameRecord.class); |
|
|
|
if(record.getGameStatus() == GameConstant.GAME_COMPLETED){ |
|
|
|
return gameMessageCountOut; |
|
|
|
} |
|
|
|
String gameUserKey = GameConstant.generateGameKey(recordIdLong); |
|
|
|
Set<ZSetOperations.TypedTuple<Object>> typedTuples = redisUtil.zsRevGetWithScore(gameUserKey, 0, -1); |
|
|
|
|
|
|
|