优化音量评估参数,将最大评估时间从900毫秒更改为300毫秒;在处理公共房间消息时,新增对 NIM 通知对象的类型检查,确保在特定事件类型下不进行处理;扩展礼物和游戏相关的横幅清理逻辑,确保在特定条件下正确移除横幅;新增清理 CP 相关横幅的逻辑,确保在关闭礼物特效时不再展示;实现麦克风队列的深度复制,确保数据一致性;重置声波动画状态以避免视图复用问题。
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
AudioVolumeParams.enableVadDetection = YES;
|
||||
AudioVolumeParams.enablePitchCalculation = YES;
|
||||
AudioVolumeParams.enableSpectrumCalculation = YES;
|
||||
[self.engine enableAudioVolumeEvaluation:900 withParams:AudioVolumeParams];
|
||||
[self.engine enableAudioVolumeEvaluation:300 withParams:AudioVolumeParams];
|
||||
[TRTCCloud setConsoleEnabled:NO];
|
||||
[_engine addDelegate:self];
|
||||
}
|
||||
|
@@ -741,7 +741,11 @@ BannerSchedulerDelegate
|
||||
}
|
||||
} else if (obj.second == Custom_Message_Sub_Super_Gift_Banner ||
|
||||
obj.second == Custom_Message_Sub_Gift_ChannelNotify ||
|
||||
obj.second == Custom_Message_Sub_LuckyPackage) {
|
||||
obj.second == Custom_Message_Sub_LuckyPackage ||
|
||||
obj.second == Custom_Message_Sub_Super_Gift_Winning_Coins_ALL_Room ||
|
||||
obj.second == Custom_Message_Sub_Room_Gift_LuckBag ||
|
||||
obj.second == Custom_Message_Sub_Room_Gift_LuckBag_Server ||
|
||||
obj.second == Custom_Message_Sub_Room_Gift_LuckBag_FullScree) {
|
||||
// 礼物相关banner
|
||||
BOOL allowGiftScreen = [[TurboModeStateManager sharedManager] isGlobalGiftScreenEnabledForRoom:roomIdForTurbo];
|
||||
if (!allowGiftScreen) {
|
||||
@@ -3900,7 +3904,8 @@ BannerSchedulerDelegate
|
||||
for (UIView *subview in self.bannerContainer.subviews) {
|
||||
if ([subview isKindOfClass:[BravoGiftBannerView class]] ||
|
||||
[subview isKindOfClass:[LuckyGiftWinningBannerView class]] ||
|
||||
[subview isKindOfClass:[RoomHighValueGiftBannerAnimation class]]) {
|
||||
[subview isKindOfClass:[RoomHighValueGiftBannerAnimation class]] ||
|
||||
[subview isKindOfClass:[LuckyPackageBannerView class]]) {
|
||||
[viewsToRemove addObject:subview];
|
||||
}
|
||||
}
|
||||
@@ -3909,6 +3914,22 @@ BannerSchedulerDelegate
|
||||
[view removeFromSuperview];
|
||||
}
|
||||
|
||||
// 清空队列中礼物相关的banner(包括:超级礼物banner、礼物频道通知、福袋banner)
|
||||
if (self.bannerScheduler) {
|
||||
// 逆序移除以避免索引移动问题
|
||||
for (NSInteger i = self.bannerScheduler.queueCount - 1; i >= 0; i--) {
|
||||
id queued = [self.bannerScheduler bannerAtIndex:i];
|
||||
if ([queued isKindOfClass:[AttachmentModel class]]) {
|
||||
AttachmentModel *att = (AttachmentModel *)queued;
|
||||
if (att.second == Custom_Message_Sub_Super_Gift_Banner ||
|
||||
att.second == Custom_Message_Sub_Gift_ChannelNotify ||
|
||||
att.second == Custom_Message_Sub_LuckyPackage) {
|
||||
[self.bannerScheduler removeBannerAtIndex:i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 标记banner播放完成,继续下一个
|
||||
if (self.isRoomBannerV2Displaying) {
|
||||
self.isRoomBannerV2Displaying = NO;
|
||||
@@ -3934,6 +3955,20 @@ BannerSchedulerDelegate
|
||||
[view removeFromSuperview];
|
||||
}
|
||||
|
||||
// 清空队列中游戏相关的banner(通用飘屏:单房/全房)
|
||||
if (self.bannerScheduler) {
|
||||
for (NSInteger i = self.bannerScheduler.queueCount - 1; i >= 0; i--) {
|
||||
id queued = [self.bannerScheduler bannerAtIndex:i];
|
||||
if ([queued isKindOfClass:[AttachmentModel class]]) {
|
||||
AttachmentModel *att = (AttachmentModel *)queued;
|
||||
if (att.second == Custom_Message_Sub_General_Floating_Screen_One_Room ||
|
||||
att.second == Custom_Message_Sub_General_Floating_Screen_All_Room) {
|
||||
[self.bannerScheduler removeBannerAtIndex:i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 标记banner播放完成,继续下一个
|
||||
if (self.isRoomBannerV2Displaying) {
|
||||
self.isRoomBannerV2Displaying = NO;
|
||||
@@ -3977,14 +4012,38 @@ BannerSchedulerDelegate
|
||||
#pragma mark - BannerSchedulerDelegate
|
||||
|
||||
- (void)bannerScheduler:(BannerScheduler *)scheduler shouldPlayBanner:(id)banner {
|
||||
|
||||
// 将 Banner 数据转换为 AttachmentModel 并播放
|
||||
if ([banner isKindOfClass:[AttachmentModel class]]) {
|
||||
AttachmentModel *attachment = (AttachmentModel *)banner;
|
||||
[self _playBannerWithAttachment:attachment];
|
||||
} else {
|
||||
// 将 Banner 数据转换为 AttachmentModel
|
||||
if (![banner isKindOfClass:[AttachmentModel class]]) {
|
||||
NSLog(@"⚠️ BannerSchedulerDelegate: Banner 不是 AttachmentModel 类型");
|
||||
[self.bannerScheduler markBannerFinished];
|
||||
return;
|
||||
}
|
||||
AttachmentModel *attachment = (AttachmentModel *)banner;
|
||||
|
||||
// 二次校验:出队播放前按 TurboMode 再过滤一次,防止进房竞态导致漏过滤
|
||||
NSString *roomIdForTurbo = self.currentRoomId ?: @([self.hostDelegate getRoomInfo].roomId).stringValue;
|
||||
BOOL allowed = YES;
|
||||
|
||||
if (attachment.second == Custom_Message_Sub_General_Floating_Screen_One_Room ||
|
||||
attachment.second == Custom_Message_Sub_General_Floating_Screen_All_Room) {
|
||||
allowed = [[TurboModeStateManager sharedManager] isGlobalGameScreenEnabledForRoom:roomIdForTurbo];
|
||||
} else if (attachment.second == Custom_Message_Sub_Super_Gift_Banner ||
|
||||
attachment.second == Custom_Message_Sub_Gift_ChannelNotify ||
|
||||
attachment.second == Custom_Message_Sub_LuckyPackage) {
|
||||
allowed = [[TurboModeStateManager sharedManager] isGlobalGiftScreenEnabledForRoom:roomIdForTurbo];
|
||||
} else if (attachment.second == Custom_Message_Sub_CP_Gift ||
|
||||
attachment.second == Custom_Message_Sub_CP_Upgrade ||
|
||||
attachment.second == Custom_Message_Sub_CP_Binding) {
|
||||
allowed = [[TurboModeStateManager sharedManager] isGiftEffectsEnabledForRoom:roomIdForTurbo];
|
||||
}
|
||||
|
||||
if (!allowed) {
|
||||
NSLog(@"🎮 TurboMode 二次校验拒绝播放 banner(second=%ld) - 房间ID:%@", (long)attachment.second, roomIdForTurbo);
|
||||
[self.bannerScheduler markBannerFinished];
|
||||
return;
|
||||
}
|
||||
|
||||
[self _playBannerWithAttachment:attachment];
|
||||
}
|
||||
|
||||
- (void)bannerSchedulerDidFinishPlaying:(BannerScheduler *)scheduler {
|
||||
@@ -4188,6 +4247,12 @@ BannerSchedulerDelegate
|
||||
// 如果关闭,清理当前效果
|
||||
if (!enabled) {
|
||||
[self cleanupGiftEffects];
|
||||
// 同时清理 CP 类 Banner(礼物特效开关关闭时不应再展示 CP 相关)
|
||||
if (self.currentRoomId.length > 0) {
|
||||
[self cleanupCpBanners];
|
||||
} else {
|
||||
[self cleanupCpBanners];
|
||||
}
|
||||
}
|
||||
|
||||
NSLog(@"🎮 RoomAnimationView 礼物特效状态变化: %@", enabled ? @"开启" : @"关闭");
|
||||
@@ -4225,6 +4290,50 @@ BannerSchedulerDelegate
|
||||
NSLog(@"🎮 RoomAnimationView CP麦位开关状态变化: %@", enabled ? @"开启" : @"关闭");
|
||||
}
|
||||
|
||||
// 🔧 新增:清理 CP 相关 banner(受礼物特效开关影响)
|
||||
- (void)cleanupCpBanners {
|
||||
NSLog(@"🎮 清理 CP 相关banner");
|
||||
|
||||
// 清理可见的 CP 相关视图
|
||||
NSMutableArray *viewsToRemove = [NSMutableArray array];
|
||||
for (UIView *subview in self.bannerContainer.subviews) {
|
||||
if ([subview isKindOfClass:[CPGiftBanner class]]) {
|
||||
[viewsToRemove addObject:subview];
|
||||
}
|
||||
}
|
||||
for (UIView *subview in self.topContainer.subviews) {
|
||||
if ([subview isKindOfClass:[CPBindingAnimation class]] ||
|
||||
[subview isKindOfClass:[CPLevelUpAnimation class]]) {
|
||||
[viewsToRemove addObject:subview];
|
||||
}
|
||||
}
|
||||
for (UIView *v in viewsToRemove) {
|
||||
[v removeFromSuperview];
|
||||
}
|
||||
|
||||
// 清空队列中 CP 相关的 banner(CP 礼物/升级/绑定)
|
||||
if (self.bannerScheduler) {
|
||||
for (NSInteger i = self.bannerScheduler.queueCount - 1; i >= 0; i--) {
|
||||
id queued = [self.bannerScheduler bannerAtIndex:i];
|
||||
if ([queued isKindOfClass:[AttachmentModel class]]) {
|
||||
AttachmentModel *att = (AttachmentModel *)queued;
|
||||
if (att.second == Custom_Message_Sub_CP_Gift ||
|
||||
att.second == Custom_Message_Sub_CP_Upgrade ||
|
||||
att.second == Custom_Message_Sub_CP_Binding) {
|
||||
[self.bannerScheduler removeBannerAtIndex:i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (self.isRoomBannerV2Displaying) {
|
||||
self.isRoomBannerV2Displaying = NO;
|
||||
[self.bannerScheduler markBannerFinished];
|
||||
}
|
||||
|
||||
NSLog(@"🎮 CP 相关banner清理完成");
|
||||
}
|
||||
|
||||
// 🔧 新增:处理当前房间ID设置通知
|
||||
- (void)handleCurrentRoomIdSet:(NSNotification *)notification {
|
||||
NSString *roomId = notification.userInfo[@"roomId"];
|
||||
|
@@ -14,6 +14,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
///开始展示声波动画
|
||||
- (void)startWaveAnimationWithUrl:(NSString *)url;
|
||||
- (void)startWaveAnimationWithVideoItem:(SVGAVideoEntity *)videoItem;
|
||||
///结束声波动画
|
||||
- (void)stopWaveAnimation;
|
||||
|
||||
@end
|
||||
|
||||
|
@@ -584,6 +584,9 @@
|
||||
self.microModel = model;
|
||||
MicroStateModel * micStats = model.microState;
|
||||
UserInfoModel * userInfo = model.userInfo;
|
||||
// 重置声波/贵族光圈动画状态,避免复用视图在多次切换麦位后处于不可见/不可重启状态
|
||||
[self.animationView stopWaveAnimation];
|
||||
[self.nobleWaveView stopWaveAnimation];
|
||||
[self configMicroState:micStats];
|
||||
[self configUser:userInfo];
|
||||
}
|
||||
@@ -638,6 +641,9 @@
|
||||
- (void)configUser:(UserInfoModel *)userInfo {
|
||||
|
||||
self.userInfo = userInfo;
|
||||
// 绑定新用户时重置一次动画,确保后续 userSpeaking 立即可启动
|
||||
[self.animationView stopWaveAnimation];
|
||||
[self.nobleWaveView stopWaveAnimation];
|
||||
|
||||
self.nickLabel.hidden = NO;
|
||||
self.sexImageView.hidden = YES;
|
||||
|
@@ -42,9 +42,8 @@
|
||||
return;
|
||||
}
|
||||
|
||||
if (self.isAnimationing) {
|
||||
[self.firstView.layer removeAllAnimations];
|
||||
}
|
||||
[self.firstView.layer removeAllAnimations];
|
||||
|
||||
self.isAnimationing = YES;
|
||||
self.firstView.hidden = NO;
|
||||
[self animationWithLayer:self.firstView];
|
||||
|
@@ -281,6 +281,7 @@
|
||||
[RtcManager instance].localMuted = YES;
|
||||
}
|
||||
}
|
||||
|
||||
if (roomInfo.type == RoomType_Anchor && [[AccountInfoStorage instance].getUid isEqualToString:[NSString stringWithFormat:@"%ld", roomInfo.uid]]) {
|
||||
selfNeedBroadcast = YES;///个播房房主默认角色为主播
|
||||
}
|
||||
@@ -290,8 +291,7 @@
|
||||
[statisMicArray addObject:str];
|
||||
}
|
||||
}
|
||||
if (statisMicArray.count) {
|
||||
}
|
||||
|
||||
if (leaveMode) {
|
||||
UserInfoModel *owner = [[UserInfoModel alloc] init];
|
||||
owner.avatar = anchorModel.userInfo.avatar? anchorModel.userInfo.avatar : roomInfo.avatar;
|
||||
@@ -428,7 +428,142 @@
|
||||
}
|
||||
|
||||
- (NSMutableDictionary<NSString *,MicroQueueModel *> *)getMicroQueue {
|
||||
return self.micQueue;
|
||||
// 创建 micQueue 的深度副本,确保所有内部对象都是副本
|
||||
NSMutableDictionary<NSString *,MicroQueueModel *> *deepCopy = [NSMutableDictionary dictionary];
|
||||
|
||||
for (NSString *position in self.micQueue.allKeys) {
|
||||
MicroQueueModel *originalModel = [self.micQueue objectForKey:position];
|
||||
MicroQueueModel *copiedModel = [[MicroQueueModel alloc] init];
|
||||
|
||||
// 复制 microState
|
||||
if (originalModel.microState) {
|
||||
MicroStateModel *copiedMicroState = [[MicroStateModel alloc] init];
|
||||
copiedMicroState.position = originalModel.microState.position;
|
||||
copiedMicroState.posState = originalModel.microState.posState;
|
||||
copiedMicroState.micState = originalModel.microState.micState;
|
||||
copiedMicroState.datingMicType = originalModel.microState.datingMicType;
|
||||
copiedMicroState.indexOffset = originalModel.microState.indexOffset;
|
||||
copiedModel.microState = copiedMicroState;
|
||||
}
|
||||
|
||||
// 复制 userInfo(深度复制)
|
||||
if (originalModel.userInfo) {
|
||||
UserInfoModel *copiedUserInfo = [[UserInfoModel alloc] init];
|
||||
// 复制所有基本属性
|
||||
copiedUserInfo.bindType = originalModel.userInfo.bindType;
|
||||
copiedUserInfo.createTime = originalModel.userInfo.createTime;
|
||||
copiedUserInfo.parentMode = originalModel.userInfo.parentMode;
|
||||
copiedUserInfo.isBindPhone = originalModel.userInfo.isBindPhone;
|
||||
copiedUserInfo.erbanNo = originalModel.userInfo.erbanNo;
|
||||
copiedUserInfo.registerDay = originalModel.userInfo.registerDay;
|
||||
copiedUserInfo.isFirstCharge = originalModel.userInfo.isFirstCharge;
|
||||
copiedUserInfo.hasPrettyErbanNo = originalModel.userInfo.hasPrettyErbanNo;
|
||||
copiedUserInfo.isBindApple = originalModel.userInfo.isBindApple;
|
||||
copiedUserInfo.fansNum = originalModel.userInfo.fansNum;
|
||||
copiedUserInfo.isBindBankCard = originalModel.userInfo.isBindBankCard;
|
||||
copiedUserInfo.hasRegPacket = originalModel.userInfo.hasRegPacket;
|
||||
copiedUserInfo.gender = originalModel.userInfo.gender;
|
||||
copiedUserInfo.platformRole = originalModel.userInfo.platformRole;
|
||||
copiedUserInfo.uid = originalModel.userInfo.uid;
|
||||
copiedUserInfo.defUser = originalModel.userInfo.defUser;
|
||||
copiedUserInfo.remainDay = originalModel.userInfo.remainDay;
|
||||
copiedUserInfo.isReview = originalModel.userInfo.isReview;
|
||||
copiedUserInfo.newUser = originalModel.userInfo.newUser;
|
||||
copiedUserInfo.followNum = originalModel.userInfo.followNum;
|
||||
copiedUserInfo.isBindPaymentPwd = originalModel.userInfo.isBindPaymentPwd;
|
||||
copiedUserInfo.isBindXCZAccount = originalModel.userInfo.isBindXCZAccount;
|
||||
copiedUserInfo.isBindAlipay = originalModel.userInfo.isBindAlipay;
|
||||
copiedUserInfo.isBindPasswd = originalModel.userInfo.isBindPasswd;
|
||||
copiedUserInfo.visitNum = originalModel.userInfo.visitNum;
|
||||
copiedUserInfo.inRoomNum = originalModel.userInfo.inRoomNum;
|
||||
copiedUserInfo.showLimitCharge = originalModel.userInfo.showLimitCharge;
|
||||
copiedUserInfo.limitChargeEndTime = originalModel.userInfo.limitChargeEndTime;
|
||||
copiedUserInfo.isCertified = originalModel.userInfo.isCertified;
|
||||
copiedUserInfo.isCustomWord = originalModel.userInfo.isCustomWord;
|
||||
copiedUserInfo.otherViewType = originalModel.userInfo.otherViewType;
|
||||
copiedUserInfo.headwearType = originalModel.userInfo.headwearType;
|
||||
copiedUserInfo.headWearType = originalModel.userInfo.headWearType;
|
||||
copiedUserInfo.vipMic = originalModel.userInfo.vipMic;
|
||||
copiedUserInfo.hasSelectUser = originalModel.userInfo.hasSelectUser;
|
||||
copiedUserInfo.selectMicPosition = originalModel.userInfo.selectMicPosition;
|
||||
copiedUserInfo.gameStatus = originalModel.userInfo.gameStatus;
|
||||
copiedUserInfo.groupType = originalModel.userInfo.groupType;
|
||||
copiedUserInfo.preventKick = originalModel.userInfo.preventKick;
|
||||
copiedUserInfo.fromSayHelloChannel = originalModel.userInfo.fromSayHelloChannel;
|
||||
copiedUserInfo.banAccount = originalModel.userInfo.banAccount;
|
||||
copiedUserInfo.isRechargeUser = originalModel.userInfo.isRechargeUser;
|
||||
copiedUserInfo.isNoProhibitMic = originalModel.userInfo.isNoProhibitMic;
|
||||
copiedUserInfo.hasSuperRole = originalModel.userInfo.hasSuperRole;
|
||||
copiedUserInfo.uploadGifAvatarPrice = originalModel.userInfo.uploadGifAvatarPrice;
|
||||
copiedUserInfo.birth = originalModel.userInfo.birth;
|
||||
|
||||
// 复制字符串属性
|
||||
copiedUserInfo.phone = [originalModel.userInfo.phone copy];
|
||||
copiedUserInfo.email = [originalModel.userInfo.email copy];
|
||||
copiedUserInfo.nick = [originalModel.userInfo.nick copy];
|
||||
copiedUserInfo.avatar = [originalModel.userInfo.avatar copy];
|
||||
copiedUserInfo.reviewingAvatar = [originalModel.userInfo.reviewingAvatar copy];
|
||||
copiedUserInfo.region = [originalModel.userInfo.region copy];
|
||||
copiedUserInfo.userDesc = [originalModel.userInfo.userDesc copy];
|
||||
copiedUserInfo.nameplatePic = [originalModel.userInfo.nameplatePic copy];
|
||||
copiedUserInfo.nameplateWord = [originalModel.userInfo.nameplateWord copy];
|
||||
copiedUserInfo.roomUid = [originalModel.userInfo.roomUid copy];
|
||||
copiedUserInfo.roomTitle = [originalModel.userInfo.roomTitle copy];
|
||||
copiedUserInfo.carEffect = [originalModel.userInfo.carEffect copy];
|
||||
copiedUserInfo.viewUrl = [originalModel.userInfo.viewUrl copy];
|
||||
copiedUserInfo.carName = [originalModel.userInfo.carName copy];
|
||||
copiedUserInfo.headwearEffect = [originalModel.userInfo.headwearEffect copy];
|
||||
copiedUserInfo.headwearPic = [originalModel.userInfo.headwearPic copy];
|
||||
copiedUserInfo.headWearUrl = [originalModel.userInfo.headWearUrl copy];
|
||||
copiedUserInfo.capUrl = [originalModel.userInfo.capUrl copy];
|
||||
copiedUserInfo.userInfoCardPic = [originalModel.userInfo.userInfoCardPic copy];
|
||||
copiedUserInfo.micCircle = [originalModel.userInfo.micCircle copy];
|
||||
copiedUserInfo.micNickColor = [originalModel.userInfo.micNickColor copy];
|
||||
copiedUserInfo.fromNick = [originalModel.userInfo.fromNick copy];
|
||||
copiedUserInfo.fromUid = [originalModel.userInfo.fromUid copy];
|
||||
copiedUserInfo.androidBubbleUrl = [originalModel.userInfo.androidBubbleUrl copy];
|
||||
copiedUserInfo.iosBubbleUrl = [originalModel.userInfo.iosBubbleUrl copy];
|
||||
copiedUserInfo.phoneAreaCode = [originalModel.userInfo.phoneAreaCode copy];
|
||||
copiedUserInfo.partitionId = [originalModel.userInfo.partitionId copy];
|
||||
copiedUserInfo.guildNameplateIcon = [originalModel.userInfo.guildNameplateIcon copy];
|
||||
copiedUserInfo.regionIcon = [originalModel.userInfo.regionIcon copy];
|
||||
copiedUserInfo.visitTimeDesc = [originalModel.userInfo.visitTimeDesc copy];
|
||||
|
||||
// 复制数组属性(浅复制,因为数组元素通常是不可变的)
|
||||
copiedUserInfo.labels = [originalModel.userInfo.labels copy];
|
||||
copiedUserInfo.privatePhoto = [originalModel.userInfo.privatePhoto copy];
|
||||
copiedUserInfo.absCardPics = [originalModel.userInfo.absCardPics copy];
|
||||
copiedUserInfo.userGiftWall = [originalModel.userInfo.userGiftWall copy];
|
||||
copiedUserInfo.userLuckyBagGiftWall = [originalModel.userInfo.userLuckyBagGiftWall copy];
|
||||
copiedUserInfo.dynamicInfo = [originalModel.userInfo.dynamicInfo copy];
|
||||
copiedUserInfo.userNameplateList = [originalModel.userInfo.userNameplateList copy];
|
||||
copiedUserInfo.medalsPic = [originalModel.userInfo.medalsPic copy];
|
||||
|
||||
// 复制复杂对象属性(浅复制,因为这些对象通常不需要深度修改)
|
||||
copiedUserInfo.userExpand = originalModel.userInfo.userExpand;
|
||||
copiedUserInfo.userLevelVo = originalModel.userInfo.userLevelVo;
|
||||
copiedUserInfo.userInfoSkillVo = originalModel.userInfo.userInfoSkillVo;
|
||||
copiedUserInfo.userVipInfoVO = originalModel.userInfo.userVipInfoVO;
|
||||
copiedUserInfo.audioCard = originalModel.userInfo.audioCard;
|
||||
copiedUserInfo.medals = originalModel.userInfo.medals;
|
||||
copiedUserInfo.relationUserVO = originalModel.userInfo.relationUserVO;
|
||||
copiedUserInfo.guildInfo = originalModel.userInfo.guildInfo;
|
||||
copiedUserInfo.usingPersonalBackground = originalModel.userInfo.usingPersonalBackground;
|
||||
copiedUserInfo.infoCardVo = originalModel.userInfo.infoCardVo;
|
||||
|
||||
// 复制属性字符串(这些是计算属性,直接复制)
|
||||
copiedUserInfo.levelAtt = [originalModel.userInfo.levelAtt copy];
|
||||
copiedUserInfo.idAtt = [originalModel.userInfo.idAtt copy];
|
||||
|
||||
copiedModel.userInfo = copiedUserInfo;
|
||||
} else {
|
||||
copiedModel.userInfo = nil;
|
||||
}
|
||||
|
||||
[deepCopy setObject:copiedModel forKey:position];
|
||||
}
|
||||
|
||||
return deepCopy;
|
||||
}
|
||||
|
||||
- (void)onRoomUpdate {
|
||||
@@ -486,9 +621,7 @@
|
||||
NSString* position = [data objectForKey:NIMChatroomEventInfoQueueChangeItemKey];
|
||||
UserInfoModel* userInfo = [UserInfoModel modelWithJSON:[data objectForKey:NIMChatroomEventInfoQueueChangeItemValueKey]];
|
||||
NSInteger changeType = [data[NIMChatroomEventInfoQueueChangeTypeKey] integerValue];
|
||||
// if (userInfo.uid == [AccountInfoStorage instance].getUid.integerValue) {
|
||||
// ownerRTCChanged = YES;
|
||||
// }
|
||||
|
||||
// 先清除该用户旧的麦位
|
||||
for (MicroQueueModel *sequence in self.micQueue.allValues) {
|
||||
if (userInfo.uid == sequence.userInfo.uid) {
|
||||
@@ -496,7 +629,19 @@
|
||||
}
|
||||
}
|
||||
RoomInfoModel *roomInfo = self.hostDelegate.getRoomInfo;
|
||||
if (changeType == 2){
|
||||
if (changeType == 2){ // 下麦
|
||||
// 移除对应 position 的 MicroQueueModel 的 userInfo
|
||||
MicroQueueModel *sequence = [self.micQueue objectForKey:position];
|
||||
if (sequence) {
|
||||
sequence.userInfo = nil;
|
||||
|
||||
// 确保 micQueue 更新后立即同步到视图
|
||||
UIView<MicroViewProtocol> *microView = [self findMicroViewByIndex:[self positionToIndex:position]];
|
||||
if (microView) {
|
||||
[microView configMicroView:sequence];
|
||||
}
|
||||
}
|
||||
|
||||
if (userInfo.uid == [AccountInfoStorage instance].getUid.integerValue && roomInfo.roomModeType == RoomModeType_Open_Blind){
|
||||
if (roomInfo.roomModeType != RoomModeType_Open_AcrossRoomPK_mode){
|
||||
if ([RtcManager instance].isAnckorPk == NO){
|
||||
@@ -510,6 +655,12 @@
|
||||
}else if (changeType == 1) { // 上麦
|
||||
MicroQueueModel *sequence = [self.micQueue objectForKey:position];
|
||||
sequence.userInfo = userInfo;
|
||||
|
||||
// 确保 micQueue 更新后立即同步到视图
|
||||
UIView<MicroViewProtocol> *microView = [self findMicroViewByIndex:[self positionToIndex:position]];
|
||||
if (microView) {
|
||||
[microView configMicroView:sequence];
|
||||
}
|
||||
if (self.hostDelegate.getRoomInfo.showGiftValue && userInfo.uid == [AccountInfoStorage instance].getUid.integerValue) {
|
||||
RoomInfoModel * roomInfo =self.hostDelegate.getRoomInfo;
|
||||
NSString * roomUid = [NSString stringWithFormat:@"%ld", roomInfo.uid];
|
||||
@@ -546,9 +697,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[RtcManager instance].isMiniEnter = NO;
|
||||
});
|
||||
[RtcManager instance].isMiniEnter = NO;
|
||||
}
|
||||
}
|
||||
if(userInfo.isNoProhibitMic == YES){
|
||||
@@ -590,6 +739,10 @@
|
||||
case NIMChatroomEventTypeExit:
|
||||
case NIMChatroomEventTypeKicked:
|
||||
{
|
||||
if (message.session.sessionId == self.hostDelegate.getRoomInfo.roomId) {
|
||||
|
||||
}
|
||||
|
||||
for (NIMChatroomNotificationMember *member in content.targets) {
|
||||
for (MicroQueueModel *sequence in self.micQueue.allValues) {
|
||||
if (member.userId.integerValue == sequence.userInfo.uid) {
|
||||
@@ -1379,6 +1532,7 @@
|
||||
}
|
||||
|
||||
- (NSMutableDictionary<NSString *, MicroQueueModel *> *)micQueue {
|
||||
// 可能是使用的對象不一致- stageview 和 當前選擇(比如 nineteenmicstageview)的保存 queue 內容不一致。
|
||||
if (!_micQueue) {
|
||||
_micQueue= [NSMutableDictionary dictionary];
|
||||
for (int i = 0; i < self.countOfMicroView; i++) {
|
||||
|
@@ -3720,9 +3720,19 @@ XPCandyTreeInsufficientBalanceViewDelegate>
|
||||
return;
|
||||
}
|
||||
|
||||
if ([message.messageObject isKindOfClass:[NIMNotificationObject class]]) {
|
||||
NIMNotificationObject *notiMsg = (NIMNotificationObject *)message.messageObject;
|
||||
if ([notiMsg respondsToSelector:@selector(content)]) {
|
||||
NIMChatroomNotificationContent *content = (NIMChatroomNotificationContent *)notiMsg.content;
|
||||
|
||||
if (content.eventType == NIMChatroomEventTypeExit || content.eventType == NIMChatroomEventTypeKicked) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch (message.messageType) {
|
||||
case NIMMessageTypeNotification:
|
||||
[self handleNIMNotificationTypeMessage:message];
|
||||
break;
|
||||
case NIMMessageTypeCustom:
|
||||
[self handleNimCustomTypeMessage:message];
|
||||
|
Reference in New Issue
Block a user