temp save
This commit is contained in:
@@ -22,7 +22,6 @@
|
||||
#import "StatisticsServiceHelper.h"
|
||||
#import "NSArray+Safe.h"
|
||||
#import "NSMutableDictionary+Saft.h"
|
||||
#import "XPSkillCardPlayerManager.h"
|
||||
#import "XCCurrentVCStackManager.h"
|
||||
#import "CountDownHelper.h"
|
||||
///Model
|
||||
@@ -64,7 +63,6 @@
|
||||
#import "XPWebViewController.h"
|
||||
#import "SessionViewController.h"
|
||||
#import "XPFreeGiftsObtainView.h"
|
||||
#import "MSRoomMenuGameVC.h"
|
||||
|
||||
///P
|
||||
#import "XPRoomPresenter.h"
|
||||
@@ -86,6 +84,11 @@
|
||||
#import "GiftComboManager.h"
|
||||
#import "LuckyGiftWinningFlagView.h"
|
||||
|
||||
#import "RoomBoomResultView.h"
|
||||
#import "RoomBoomManager.h"
|
||||
#import "RoomBoomExplosionView.h"
|
||||
#import "RoomBoomResultView.h"
|
||||
|
||||
UIKIT_EXTERN NSString * const kRoomGiftEffectUpdateNotificationKey;
|
||||
UIKIT_EXTERN NSString * const kRoomMiniNotificationKey;
|
||||
UIKIT_EXTERN NSString * kNewUserRechargeKey;
|
||||
@@ -94,7 +97,22 @@ UIKIT_EXTERN NSString * const kFreeGiftCountdownNotification;
|
||||
NSString * const kHadShowAnchorRoomTipKey = @"kHadShowAnchorRoomTipKey";//是否展示过个播房上划用户引导
|
||||
NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出过非自己房间
|
||||
|
||||
@interface XPRoomViewController ()<XPRoomProtocol, RoomHostDelegate, NIMChatroomManagerDelegate, NIMChatManagerDelegate, NIMConversationManagerDelegate, NIMLoginManagerDelegate, XPRoomSettingInputViewDelegate, AnchorRoomScrollViewDelegate, XPFirstRechargeViewDelegate,NIMBroadcastManagerDelegate,XPRoomLittleGameContainerViewDelegate,CountDownHelperDelegate,PIRoomEnterRedPacketViewDelegate,XPReceiveRedPacketViewDelegate, XPCandyTreeInsufficientBalanceViewDelegate>
|
||||
@interface XPRoomViewController ()<
|
||||
XPRoomProtocol,
|
||||
RoomHostDelegate,
|
||||
NIMChatroomManagerDelegate,
|
||||
NIMChatManagerDelegate,
|
||||
NIMConversationManagerDelegate,
|
||||
NIMLoginManagerDelegate,
|
||||
XPRoomSettingInputViewDelegate,
|
||||
AnchorRoomScrollViewDelegate,
|
||||
XPFirstRechargeViewDelegate,
|
||||
NIMBroadcastManagerDelegate,
|
||||
XPRoomLittleGameContainerViewDelegate,
|
||||
CountDownHelperDelegate,
|
||||
PIRoomEnterRedPacketViewDelegate,
|
||||
XPReceiveRedPacketViewDelegate,
|
||||
XPCandyTreeInsufficientBalanceViewDelegate>
|
||||
{
|
||||
NSTimer * timer;
|
||||
}
|
||||
@@ -191,7 +209,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
||||
[viewController presentViewController:baseNav animated:YES completion:nil];
|
||||
return YES;
|
||||
}
|
||||
+ (BOOL) openRoom:(NSString*)roomUid fromNick:(NSString * __nullable)fromNick fromType:(UserEnterRoomFromType)fromType fromUid:(NSString * __nullable)fromUid viewController:(UIViewController*)viewController {
|
||||
+ (BOOL)openRoom:(NSString*)roomUid fromNick:(NSString * __nullable)fromNick fromType:(UserEnterRoomFromType)fromType fromUid:(NSString * __nullable)fromUid viewController:(UIViewController*)viewController {
|
||||
XPRoomViewController * roomVC = [[self alloc] init];
|
||||
roomVC.roomUid = roomUid;
|
||||
roomVC.fromUid = fromUid;
|
||||
@@ -267,15 +285,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
||||
[timer fire];
|
||||
timer = nil;
|
||||
}
|
||||
|
||||
[XPSkillCardPlayerManager shareInstance].photoIdList = nil;
|
||||
[XPSkillCardPlayerManager shareInstance].isInRoomVC = NO;
|
||||
[XPSkillCardPlayerManager shareInstance].isInRoomFirstRecharge = NO;
|
||||
[XPSkillCardPlayerManager shareInstance].isInRoom = NO;
|
||||
[XPSkillCardPlayerManager shareInstance].roomUid = @"";
|
||||
if([[XPRoomMiniManager shareManager] getRoomInfo]==nil){
|
||||
[XPSkillCardPlayerManager shareInstance].isMineInMic = NO;
|
||||
}
|
||||
|
||||
[[CountDownHelper shareHelper] stopCountDown];
|
||||
[CountDownHelper shareHelper].delegate = nil;
|
||||
[[NIMSDK sharedSDK].chatroomManager removeDelegate:self];
|
||||
@@ -284,6 +294,8 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
||||
[[NIMSDK sharedSDK].conversationManager removeDelegate:self];
|
||||
[[NIMSDK sharedSDK].broadcastManager removeDelegate:self];
|
||||
|
||||
[[RoomBoomManager sharedManager] removeEventListenerForTarget:self];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
}
|
||||
|
||||
@@ -298,10 +310,10 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
|
||||
[self preLoadGifts];
|
||||
|
||||
[self exitOldRoom];
|
||||
|
||||
[self preLoadGifts];
|
||||
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
|
||||
@@ -319,14 +331,59 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
||||
[self startCheckOnlineCountTimer];
|
||||
|
||||
[CountDownHelper shareHelper].delegate = self;
|
||||
[XPSkillCardPlayerManager shareInstance].isInRoom = YES;
|
||||
|
||||
[self setupFroBoom];
|
||||
|
||||
|
||||
//#if DEBUG
|
||||
// UIButton *b = [UIButton buttonWithType:UIButtonTypeInfoLight];
|
||||
// b.frame = CGRectMake(100, 100, 100, 100);
|
||||
// [self.view addSubview:b];
|
||||
// [b addTarget:self action:@selector(test) forControlEvents:UIControlEventTouchUpInside];
|
||||
//#endif
|
||||
}
|
||||
|
||||
- (void)setupFroBoom {
|
||||
@kWeakify(self);
|
||||
[[RoomBoomManager sharedManager] registerBoomExplosion:^(id _Nonnull sth) {
|
||||
@kStrongify(self);
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[RoomBoomExplosionView display:self.view with:sth complete:^{
|
||||
|
||||
}];
|
||||
});
|
||||
} target:self];
|
||||
|
||||
[[RoomBoomManager sharedManager] registerBoomGiftDisplay:^(id _Nonnull sth) {
|
||||
@kStrongify(self);
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[RoomBoomResultView displayEmptyView:self.view];
|
||||
});
|
||||
} target:self];
|
||||
|
||||
[[RoomBoomManager sharedManager] registerBoomEnterRoomExplosion:^(id _Nonnull sth) {
|
||||
@kStrongify(self);
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[RoomBoomExplosionView display:self.view with:sth complete:^{
|
||||
|
||||
}];
|
||||
});
|
||||
} target:self];
|
||||
}
|
||||
|
||||
//- (void)test {
|
||||
//
|
||||
//}
|
||||
|
||||
- (void)loadRoomDataAndUsers {
|
||||
[XNDJTDDLoadingTool showAnchorLoading:self.navigationController.view];
|
||||
[self.presenter initEnterRoom:self.roomUid user:[AccountInfoStorage instance].getUid];
|
||||
}
|
||||
|
||||
- (void)loadRoomBoom {
|
||||
// [self.presenter getBoomInfo:s];
|
||||
}
|
||||
|
||||
- (void)setupNotifications {
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(myGiftEffectUpdate:) name:kRoomGiftEffectUpdateNotificationKey object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(showRoomFirstChargeWindowFormNot:) name:kShowFirstRechargeView object:nil];
|
||||
@@ -424,13 +481,11 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
||||
- (void)viewDidDisappear:(BOOL)animated{
|
||||
[super viewDidDisappear:animated];
|
||||
self.navigationController.interactivePopGestureRecognizer.enabled = YES;
|
||||
[XPSkillCardPlayerManager shareInstance].isInRoomVC = NO;
|
||||
}
|
||||
- (void)viewDidAppear:(BOOL)animated {
|
||||
[super viewDidAppear:animated];
|
||||
self.freeView.hidden = NO;
|
||||
self.navigationController.interactivePopGestureRecognizer.enabled = NO;
|
||||
[XPSkillCardPlayerManager shareInstance].isInRoomVC = YES;
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
@@ -1220,8 +1275,6 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
||||
- (void)initEnterRoomSuccess:(RoomInfoModel *)roomInfo user:(UserInfoModel *)userInfo {
|
||||
[XNDJTDDLoadingTool hideHUDInView:self.navigationController.view];
|
||||
|
||||
[XPSkillCardPlayerManager shareInstance].roomUid = @(roomInfo.uid).stringValue;
|
||||
|
||||
userInfo.fromUid = self.fromUid;
|
||||
userInfo.fromType = self.fromType;
|
||||
userInfo.fromNick = self.fromNick;
|
||||
@@ -1230,6 +1283,8 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
||||
self.roomInfo = roomInfo;
|
||||
self.userInfo = userInfo;
|
||||
|
||||
[self.presenter getBoomRocketAnimationInfo:@(roomInfo.uid).stringValue];
|
||||
[self.presenter getBoomDetail:@(roomInfo.uid).stringValue];
|
||||
|
||||
@kWeakify(self);
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_global_queue(0, 0), ^{
|
||||
@@ -1625,7 +1680,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
||||
continue;
|
||||
}
|
||||
|
||||
NSLog(@" --- Message Raw Attach Content: %@", message.rawAttachContent);
|
||||
NSLog(@" --- Message Raw Attach Content: %@, %ld", message.rawAttachContent, (long)message.messageType);
|
||||
|
||||
if (message.messageType == NIMMessageTypeNotification) {
|
||||
NIMNotificationObject *notiMsg = (NIMNotificationObject *)message.messageObject;
|
||||
@@ -1763,13 +1818,11 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
||||
[self.menuContainerView handleNIMNotificationMessage:message];
|
||||
[self.functionView handleNIMNotificationMessage:message];
|
||||
[self.littleGameView handleNIMNotificationMessage:message];
|
||||
if([self.stageView findMicroViewByUid:@(self.userInfo.uid).stringValue] != nil){
|
||||
[XPSkillCardPlayerManager shareInstance].isMineInMic = YES;
|
||||
}else{
|
||||
[XPSkillCardPlayerManager shareInstance].isMineInMic = NO;
|
||||
};
|
||||
} else if (message.messageType == NIMMessageTypeCustom) {
|
||||
NIMCustomObject *obj = (NIMCustomObject *)message.messageObject;
|
||||
|
||||
633 attachment 為 nil ,確認 data 內的數據格式是否符合?
|
||||
|
||||
if (obj.attachment != nil && [obj.attachment isKindOfClass:[AttachmentModel class]]) {
|
||||
AttachmentModel * attachment = (AttachmentModel *)obj.attachment;
|
||||
[self.stageView handleNIMCustomMessage:message];
|
||||
@@ -1778,6 +1831,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
||||
[self.activityContainerView handleNIMCustomMessage:message];
|
||||
[self.functionView handleNIMCustomMessage:message];
|
||||
[self.littleGameView handleNIMCustomMessage:message];
|
||||
|
||||
if (attachment.first == CustomMessageType_First_Recharge_Reward && attachment.second == Custom_Message_Sub_Room_First_Recharge_Reward) {
|
||||
self.userInfo.isFirstCharge = NO;
|
||||
[self.menuContainerView onRoomUpdate];
|
||||
@@ -1881,9 +1935,14 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
||||
[self.presenter getFreeGiftData];
|
||||
[[NSNotificationCenter defaultCenter]postNotificationName:kFreeGiftCountdownNotification object:nil userInfo:@{@"updateGiftInfo":attachment.data ?: @""}];
|
||||
}
|
||||
|
||||
} else if (attachment.first == CustomMessageType_RoomBoom) {
|
||||
if (attachment.second == 631) {
|
||||
[[RoomBoomManager sharedManager] receiveNIMResponse:attachment];
|
||||
} else if (attachment.second == 633) {
|
||||
[[RoomBoomManager sharedManager] receiveNIMResponse:attachment];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[self.messageContainerView handleNIMCustomMessage:message];
|
||||
}
|
||||
} else if(message.messageType == NIMMessageTypeText) {
|
||||
@@ -2287,6 +2346,15 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
||||
return [self.stageView animationPointAtStageViewByUid:uid];
|
||||
}
|
||||
|
||||
- (void)getRoomBoomInfoSuccess:(NSArray <BoomDetailModel*> *)models {
|
||||
[[RoomBoomManager sharedManager] updateBoomDetailArray:models];
|
||||
[self.activityContainerView updateForBoomDetailArray:models];
|
||||
}
|
||||
|
||||
- (void)getRoomBoomExplosionSuccess:(BoomInfoModel *)model {
|
||||
// [[RoomBoomManager sharedManager] updateBoomDetailArray:models];
|
||||
}
|
||||
|
||||
#pragma mark - 首次退出非自己的房间,处理是否需要弹新用户充值优惠
|
||||
- (void)handleFirstOutRoom {
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
|
Reference in New Issue
Block a user