|
|
@ -8,6 +8,7 @@ import com.ccsens.game.bean.po.GameUserJoinExample; |
|
|
|
import com.ccsens.game.netty.ChannelManager; |
|
|
|
import com.ccsens.game.persist.dao.GameUserJoinDao; |
|
|
|
import com.ccsens.util.JacksonUtil; |
|
|
|
import com.ccsens.util.WebConstant; |
|
|
|
import com.ccsens.util.config.RabbitMQConfig; |
|
|
|
import io.netty.channel.ChannelHandlerContext; |
|
|
|
import org.springframework.amqp.core.AmqpTemplate; |
|
|
@ -88,21 +89,24 @@ public class MessageService implements IMessageService { |
|
|
|
gameUserJoinExample.createCriteria().andRecordIdEqualTo(recordId); |
|
|
|
List<GameUserJoin> userJoinList = gameUserJoinDao.selectByExample(gameUserJoinExample); |
|
|
|
if (CollectionUtil.isNotEmpty(userJoinList)) { |
|
|
|
for(GameUserJoin userJoin : userJoinList){ |
|
|
|
sendTo(userJoin.getUserId().toString(),gameMessage); |
|
|
|
for (GameUserJoin userJoin : userJoinList) { |
|
|
|
sendTo(userJoin.getUserId().toString(), gameMessage); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 发送状态改变的消息 |
|
|
|
* |
|
|
|
* @param gameMessages |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public void doChangeStatusMessage(List<GameMessageWithChangeStatusOut> gameMessages) { |
|
|
|
if(CollectionUtil.isNotEmpty(gameMessages)){ |
|
|
|
gameMessages.forEach(gameMessage ->{ |
|
|
|
sendTo(gameMessage.getUserId().toString(),gameMessage.getData()); |
|
|
|
if (CollectionUtil.isNotEmpty(gameMessages)) { |
|
|
|
gameMessages.forEach(gameMessage -> { |
|
|
|
gameMessage.setType(WebConstant.Message_Type.ChangeStatus.phase); |
|
|
|
|
|
|
|
sendTo(gameMessage.getUserId().toString(), gameMessage.getData()); |
|
|
|
// List<ChangeStatusMessageDto> changeStatusMessageDtoList = gameMessage.getData().getChangeStatusMessageDto();
|
|
|
|
// if(CollectionUtil.isNotEmpty(changeStatusMessageDtoList)){
|
|
|
|
// for(ChangeStatusMessageDto changeStatus : changeStatusMessageDtoList){
|
|
|
|