fix:修复福袋公屏未区分地区问题

This commit is contained in:
max
2024-05-11 16:56:21 +08:00
parent 9f7187e7ae
commit d7be587078
3 changed files with 27 additions and 28 deletions

View File

@@ -2,9 +2,6 @@ package com.chwl.app.avroom.activity;
import static android.view.View.VISIBLE;
import static com.chwl.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_FAIRY;
import static com.chwl.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_LUCKY_GIFT;
import static com.chwl.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_LUCKY_GIFT_SERVER_ALL;
import static com.chwl.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_LUCKY_GIFT_SERVER_NOTIFY;
import static com.chwl.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_LUCKY_SEA;
import static com.chwl.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_LUCKY_SEA_GIFT_SERVER_ALL;
import static com.chwl.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_ROOM_PK;
@@ -91,7 +88,6 @@ import com.chwl.core.bean.BaseProtocol;
import com.chwl.core.channel_page.bean.HelloMessageInfo;
import com.chwl.core.gift.GiftModel;
import com.chwl.core.gift.bean.GiftInfo;
import com.chwl.core.gift.bean.LuckyBagNoticeInfo;
import com.chwl.core.im.custom.bean.CustomAttachment;
import com.chwl.core.im.custom.bean.FairyMsgAttachment;
import com.chwl.core.im.custom.bean.NotifyH5Attachment;
@@ -100,7 +96,6 @@ import com.chwl.core.im.custom.bean.RoomLuckySeaAttachment;
import com.chwl.core.im.custom.bean.RoomLuckySeaMsgBean;
import com.chwl.core.im.custom.bean.RoomPKAttachment;
import com.chwl.core.im.custom.bean.RoomPkBean;
import com.chwl.core.im.custom.bean.RoomReceivedLuckyGiftAttachment;
import com.chwl.core.im.custom.bean.TarotAttachment;
import com.chwl.core.im.custom.bean.TarotMsgBean;
import com.chwl.core.initial.InitialModel;
@@ -1267,15 +1262,15 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
IMNetEaseManager.get().noticeRoomEvent(message, RoomEvent.LUCKY_SEA_GIFT_SERVER_NOTIFY);
}
break;
case CUSTOM_MSG_LUCKY_GIFT://福袋
if (baseProtocol.getSecond() == CUSTOM_MSG_LUCKY_GIFT_SERVER_NOTIFY || baseProtocol.getSecond() == CUSTOM_MSG_LUCKY_GIFT_SERVER_ALL) {
RoomReceivedLuckyGiftAttachment attachment = new RoomReceivedLuckyGiftAttachment(CUSTOM_MSG_LUCKY_GIFT_SERVER_NOTIFY);
attachment.setLuckyBagNoticeInfo(JSON.parseObject(String.valueOf(baseProtocol.getData()), LuckyBagNoticeInfo.class));
ChatRoomMessage message = ChatRoomMessageBuilder.createChatRoomCustomMessage(String.valueOf(AvRoomDataManager.get().getRoomId()), attachment);
// case CUSTOM_MSG_LUCKY_GIFT://福袋
// if (baseProtocol.getSecond() == CUSTOM_MSG_LUCKY_GIFT_SERVER_NOTIFY || baseProtocol.getSecond() == CUSTOM_MSG_LUCKY_GIFT_SERVER_ALL) {
// RoomReceivedLuckyGiftAttachment attachment = new RoomReceivedLuckyGiftAttachment(CUSTOM_MSG_LUCKY_GIFT_SERVER_NOTIFY);
// attachment.setLuckyBagNoticeInfo(JSON.parseObject(String.valueOf(baseProtocol.getData()), LuckyBagNoticeInfo.class));
// ChatRoomMessage message = ChatRoomMessageBuilder.createChatRoomCustomMessage(String.valueOf(AvRoomDataManager.get().getRoomId()), attachment);
// IMNetEaseManager.get().noticeServiceLuckyBagNotice(message);
IMNetEaseManager.get().addMessages(message);
}
break;
// IMNetEaseManager.get().addMessages(message);
// }
// break;
case CUSTOM_MSG_FAIRY://夺宝精灵
if (baseProtocol.getSecond() == CUSTOM_MSG_SUB_DRAW_GIFT_L5) {
FairyMsgAttachment attachment = new FairyMsgAttachment(CUSTOM_MSG_FAIRY, CUSTOM_MSG_SUB_DRAW_GIFT_L5);

View File

@@ -29,6 +29,7 @@ import com.chwl.core.gift.bean.LuckyBagNoticeInfo
import com.chwl.core.im.custom.bean.CustomAttachment
import com.chwl.core.im.custom.bean.RoomBoxPrizeAttachment
import com.chwl.core.im.custom.bean.RoomBoxPrizeInfo
import com.chwl.core.im.custom.bean.RoomReceivedLuckyGiftAttachment
import com.chwl.core.im.custom.bean.RoomTemplateNotifyMsgBean
import com.chwl.core.manager.AvRoomDataManager
import com.chwl.core.manager.IMNetEaseManager
@@ -188,7 +189,17 @@ object GlobalNotifyManager : Observer<BroadcastMessage>, ILog {
LuckyBagNoticeInfo::class.java
)
if (UserModel.get().isSamePartition(data.partitionId)) {
// 添加飘屏
queue.addLast(data)
// 添加公屏
val attachment =
RoomReceivedLuckyGiftAttachment(CustomAttachment.CUSTOM_MSG_LUCKY_GIFT_SERVER_NOTIFY)
attachment.luckyBagNoticeInfo = data
val message = ChatRoomMessageBuilder.createChatRoomCustomMessage(
AvRoomDataManager.get().roomId.toString(),
attachment
)
IMNetEaseManager.get().addMessages(message)
}
}
}

View File

@@ -1,8 +1,5 @@
package com.chwl.app.treasure_box.activity;
import static com.chwl.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_LUCKY_GIFT;
import static com.chwl.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_LUCKY_GIFT_SERVER_ALL;
import static com.chwl.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_LUCKY_GIFT_SERVER_NOTIFY;
import static com.chwl.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_LUCKY_SEA;
import static com.chwl.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_LUCKY_SEA_GIFT_SERVER_ALL;
import static com.chwl.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_TEMPLATE_NOTIFY;
@@ -20,7 +17,6 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
@@ -49,10 +45,8 @@ import com.chwl.core.treasure_box.model.BoxModel;
import com.chwl.core.DemoCache;
import com.chwl.core.bean.BaseProtocol;
import com.chwl.core.exception.FailReasonException;
import com.chwl.core.gift.bean.LuckyBagNoticeInfo;
import com.chwl.core.im.custom.bean.RoomLuckySeaAttachment;
import com.chwl.core.im.custom.bean.RoomLuckySeaMsgBean;
import com.chwl.core.im.custom.bean.RoomReceivedLuckyGiftAttachment;
import com.chwl.core.im.custom.bean.RoomTemplateNotifyAttachment;
import com.chwl.core.im.custom.bean.RoomTemplateNotifyMsgBean;
import com.chwl.core.manager.AvRoomDataManager;
@@ -67,7 +61,6 @@ import com.chwl.library.utils.ResUtil;
import com.chwl.library.utils.SingleToastUtil;
import com.chwl.library.utils.TimeUtils;
import com.opensource.svgaplayer.SVGADrawable;
import com.opensource.svgaplayer.SVGAImageView;
import com.opensource.svgaplayer.SVGAParser;
import com.opensource.svgaplayer.SVGAVideoEntity;
@@ -469,15 +462,15 @@ public class TreasureBoxActivity extends BaseBindingActivity<ActivityTreasureBox
IMNetEaseManager.get().noticeRoomEvent(message, RoomEvent.TEMPLATE_NOTIFY);
}
break;
case CUSTOM_MSG_LUCKY_GIFT://福袋
if (baseProtocol.getSecond() == CUSTOM_MSG_LUCKY_GIFT_SERVER_NOTIFY || baseProtocol.getSecond() == CUSTOM_MSG_LUCKY_GIFT_SERVER_ALL) {
RoomReceivedLuckyGiftAttachment attachment = new RoomReceivedLuckyGiftAttachment(CUSTOM_MSG_LUCKY_GIFT_SERVER_NOTIFY);
attachment.setLuckyBagNoticeInfo(JSON.parseObject(String.valueOf(baseProtocol.getData()), LuckyBagNoticeInfo.class));
ChatRoomMessage message = ChatRoomMessageBuilder.createChatRoomCustomMessage(String.valueOf(AvRoomDataManager.get().getRoomId()), attachment);
// case CUSTOM_MSG_LUCKY_GIFT://福袋
// if (baseProtocol.getSecond() == CUSTOM_MSG_LUCKY_GIFT_SERVER_NOTIFY || baseProtocol.getSecond() == CUSTOM_MSG_LUCKY_GIFT_SERVER_ALL) {
// RoomReceivedLuckyGiftAttachment attachment = new RoomReceivedLuckyGiftAttachment(CUSTOM_MSG_LUCKY_GIFT_SERVER_NOTIFY);
// attachment.setLuckyBagNoticeInfo(JSON.parseObject(String.valueOf(baseProtocol.getData()), LuckyBagNoticeInfo.class));
// ChatRoomMessage message = ChatRoomMessageBuilder.createChatRoomCustomMessage(String.valueOf(AvRoomDataManager.get().getRoomId()), attachment);
// IMNetEaseManager.get().noticeServiceLuckyBagNotice(message);
IMNetEaseManager.get().addMessages(message);
}
break;
// IMNetEaseManager.get().addMessages(message);
// }
// break;
default:
break;
}