更新 XPMineUserInfoEditViewController 以支持 GIF 图像上传,修改视频时长检查逻辑,确保错误提示信息动态化,同时更新本地化字符串以反映视频时长的变化。
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
//
|
||||
|
||||
#import "XPRoomViewController.h"
|
||||
#include <Foundation/NSObjCRuntime.h>
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
#import <NIMSDK/NIMSDK.h>
|
||||
@@ -203,6 +204,7 @@ XPCandyTreeInsufficientBalanceViewDelegate>
|
||||
// 🔧 防护机制:房间状态标志位
|
||||
@property (atomic, assign) BOOL isExitingRoom; // 是否正在退出房间
|
||||
@property (atomic, assign) BOOL isViewActive; // VC 是否可见/活跃
|
||||
@property (atomic, assign) BOOL isMinimizingRoom; // 是否正在最小化到悬浮窗
|
||||
@property(nonatomic,copy) NSString *myCoins;
|
||||
|
||||
@property(nonatomic,strong) UIButton *exitGameButton;
|
||||
@@ -312,9 +314,6 @@ XPCandyTreeInsufficientBalanceViewDelegate>
|
||||
|
||||
NSLog(@"🔄 XPRoomViewController: 开始销毁");
|
||||
|
||||
// 🔧 防护:强制清理 TRTC 连接,防止资源泄漏
|
||||
[[RtcManager instance] exitRoom];
|
||||
|
||||
// 🔧 防护:标记房间正在退出,防止后续异步回调
|
||||
self.isExitingRoom = YES;
|
||||
self.isViewActive = NO;
|
||||
@@ -578,10 +577,12 @@ XPCandyTreeInsufficientBalanceViewDelegate>
|
||||
// 🔧 防护:标记 VC 即将不可见
|
||||
self.isViewActive = NO;
|
||||
|
||||
// 🔧 防护:如果 VC 被移除或 dismiss,强制清理 TRTC
|
||||
// 🔧 防护:如果 VC 被移除或 dismiss,强制清理 TRTC(最小化时跳过断开)
|
||||
if (self.isMovingFromParentViewController || self.isBeingDismissed) {
|
||||
[[RtcManager instance] exitRoom];
|
||||
self.isExitingRoom = YES;
|
||||
if (!self.isMinimizingRoom) {
|
||||
[[RtcManager instance] exitRoom];
|
||||
self.isExitingRoom = YES;
|
||||
}
|
||||
}
|
||||
|
||||
// 如果连击正在进行,强制重置
|
||||
@@ -599,11 +600,13 @@ XPCandyTreeInsufficientBalanceViewDelegate>
|
||||
// 🔧 防护:确保标记为不可见
|
||||
self.isViewActive = NO;
|
||||
|
||||
// 🔧 修复:发送房间退出通知,让 BuglyManager 知道用户已退出房间
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"RoomDidExit"
|
||||
object:nil
|
||||
userInfo:@{@"roomId": self.roomUid ?: @"unknown"}];
|
||||
NSLog(@"🎮 房间退出通知已发送 - RoomID: %@", self.roomUid);
|
||||
// 🔧 修复:发送房间退出通知,让 BuglyManager 知道用户已退出房间(最小化时不发送)
|
||||
if (!self.isMinimizingRoom) {
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"RoomDidExit"
|
||||
object:nil
|
||||
userInfo:@{@"roomId": self.roomUid ?: @"unknown"}];
|
||||
NSLog(@"🎮 房间退出通知已发送 - RoomID: %@", self.roomUid);
|
||||
}
|
||||
}
|
||||
- (void)viewDidAppear:(BOOL)animated {
|
||||
[super viewDidAppear:animated];
|
||||
@@ -613,6 +616,8 @@ XPCandyTreeInsufficientBalanceViewDelegate>
|
||||
|
||||
// 🔧 防护:标记 VC 可见
|
||||
self.isViewActive = YES;
|
||||
// 🔧 最小化恢复后复位标志
|
||||
self.isMinimizingRoom = NO;
|
||||
|
||||
// 🔧 修复:发送房间进入通知,让 BuglyManager 知道用户已进入房间
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"RoomDidEnter"
|
||||
@@ -2205,13 +2210,13 @@ XPCandyTreeInsufficientBalanceViewDelegate>
|
||||
case NIMChatroomEventTypeAddBlack:
|
||||
case NIMChatroomEventTypeKicked:
|
||||
case NIMChatroomEventTypeExit:
|
||||
onLineNumber -= 1;
|
||||
onLineNumber = MAX(onLineNumber - 1, 0);
|
||||
// 🔧 新增:若退出用户与CP相关,移除其CP SVGA并重绘
|
||||
if (content.source && content.source.userId.length > 0) {
|
||||
NSInteger exitUid = content.source.userId.integerValue;
|
||||
if (exitUid > 0) {
|
||||
[self removeCpDataForUids:@[@(exitUid)]];
|
||||
// 构造剩余在麦用户列表,触发一次 CP 刷新,等价于补充一次“下麦”的逻辑
|
||||
// 构造剩余在麦用户列表,触发一次 CP 刷新,等价于补充一次"下麦"的逻辑
|
||||
NSMutableDictionary<NSString *,MicroQueueModel *> *currentQueue = [self.stageView getMicroQueue];
|
||||
if (currentQueue) {
|
||||
NSMutableArray<NSString *> *remainingUids = [NSMutableArray array];
|
||||
@@ -3253,6 +3258,7 @@ XPCandyTreeInsufficientBalanceViewDelegate>
|
||||
}
|
||||
|
||||
- (void)miniRoom {
|
||||
self.isMinimizingRoom = YES;
|
||||
if(self.freeModel != nil){
|
||||
[XPRoomMiniManager shareManager].curState = self.freeModel.curStage;
|
||||
}
|
||||
|
Reference in New Issue
Block a user