移除 XPRoomViewController 和 RoomAnimationView 中的调试代码,提升代码整洁性和可维护性。

This commit is contained in:
edwinQQQ
2025-08-21 18:54:04 +08:00
parent 1bfc989fe9
commit b9de95b4e6
2 changed files with 13 additions and 62 deletions

View File

@@ -2651,9 +2651,6 @@ BannerSchedulerDelegate
- (XPRoomAnimationHitView *)bannerContainer {
if (!_bannerContainer) {
_bannerContainer = [[XPRoomAnimationHitView alloc] init];
#if DEBUG
_bannerContainer.backgroundColor = [UIColor colorWithWhite:0.8 alpha:0.4];
#endif
}
return _bannerContainer;
}
@@ -3649,14 +3646,6 @@ BannerSchedulerDelegate
self.savedTapPoint = CGPointZero;
}
- (void)debugBannerSchedulerStatus {
NSLog(@"🔍 BannerScheduler 调试信息:");
NSLog(@"%@", [self.bannerScheduler debugStatus]);
NSLog(@"🔍 RoomAnimationView 状态:");
NSLog(@" - isRoomBannerV2Displaying: %@", self.isRoomBannerV2Displaying ? @"YES" : @"NO");
NSLog(@" - bannerContainer.subviews.count: %ld", (long)self.bannerContainer.subviews.count);
}
- (CGRect)calculateInteractiveBoundsForView:(UIView *)view {
//
// Banner
@@ -3674,44 +3663,6 @@ BannerSchedulerDelegate
return bounds;
}
- (void)testBannerScheduler {
NSLog(@"🧪 开始测试 BannerScheduler");
// Banner
AttachmentModel *testBanner = [[AttachmentModel alloc] init];
testBanner.second = Custom_Message_Sub_Super_Gift_Banner;
testBanner.data = @{@"test": @"data"};
[self.bannerScheduler enqueueBanner:testBanner];
NSLog(@"🧪 测试完成");
}
- (void)debugTouchAreaCache {
NSLog(@"🎯 触摸区域缓存调试信息:");
TouchAreaCacheManager *cacheManager = [TouchAreaCacheManager sharedManager];
[cacheManager debugPrintCache];
}
- (void)debugGestureOptimizer {
NSLog(@"🎯 手势优化器调试信息:");
GestureOptimizer *optimizer = [GestureOptimizer sharedOptimizer];
//
CGFloat containerWidth = self.bannerContainer.bounds.size.width;
CGPoint leftPoint = CGPointMake(containerWidth * 0.1, 40); //
CGPoint centerPoint = CGPointMake(containerWidth * 0.5, 40); //
CGPoint rightPoint = CGPointMake(containerWidth * 0.9, 40); //
NSLog(@"🎯 测试左侧区域点:");
[optimizer debugGestureAreaForPoint:leftPoint containerWidth:containerWidth];
NSLog(@"🎯 测试中央区域点:");
[optimizer debugGestureAreaForPoint:centerPoint containerWidth:containerWidth];
NSLog(@"🎯 测试右侧区域点:");
[optimizer debugGestureAreaForPoint:rightPoint containerWidth:containerWidth];
}
#pragma mark - Cleanup Methods

View File

@@ -1928,19 +1928,19 @@ XPCandyTreeInsufficientBalanceViewDelegate>
[self handleNIMNotificationTypeMessage:message];
} else if (message.messageType == NIMMessageTypeCustom) {
// first/second/size3
#if DEBUG
if ([message.messageObject isKindOfClass:[NIMCustomObject class]]) {
NIMCustomObject *obj = (NIMCustomObject *)message.messageObject;
if ([obj.attachment isKindOfClass:[AttachmentModel class]]) {
AttachmentModel *att = (AttachmentModel *)obj.attachment;
NSData *payloadJSON = nil;
@try { payloadJSON = [NSJSONSerialization dataWithJSONObject:att.data ?: @{} options:0 error:nil]; } @catch (__unused NSException *e) {}
NSLog(@"[Recv] 🎯 自定义消息 | first=%ld second=%ld | payload=%lub | sid=%@ | ts=%.3f",
(long)att.first, (long)att.second, (unsigned long)payloadJSON.length,
message.session.sessionId, [[NSDate date] timeIntervalSince1970]);
}
}
#endif
//#if DEBUG
// if ([message.messageObject isKindOfClass:[NIMCustomObject class]]) {
// NIMCustomObject *obj = (NIMCustomObject *)message.messageObject;
// if ([obj.attachment isKindOfClass:[AttachmentModel class]]) {
// AttachmentModel *att = (AttachmentModel *)obj.attachment;
// NSData *payloadJSON = nil;
// @try { payloadJSON = [NSJSONSerialization dataWithJSONObject:att.data ?: @{} options:0 error:nil]; } @catch (__unused NSException *e) {}
// NSLog(@"[Recv] 🎯 自定义消息 | first=%ld second=%ld | payload=%lub | sid=%@ | ts=%.3f",
// (long)att.first, (long)att.second, (unsigned long)payloadJSON.length,
// message.session.sessionId, [[NSDate date] timeIntervalSince1970]);
// }
// }
//#endif
[self handleNimCustomTypeMessage:message];
} else if(message.messageType == NIMMessageTypeText) {
[self.messageContainerView handleNIMTextMessage:message];