个播飘屏,结果弹窗,跨房连麦逻辑处理

This commit is contained in:
chenguilong
2022-04-13 20:24:26 +08:00
parent a84e844df5
commit ebd6a4aa1e
72 changed files with 1437 additions and 113 deletions

View File

@@ -24,6 +24,7 @@
#import "XCCurrentVCStackManager.h"
#import "XPConstant.h"
#import "Api+RoomSetting.h"
#import "RtcManager.h"
///Model
#import "RoomInfoModel.h"
#import "MicroQueueModel.h"
@@ -50,11 +51,15 @@
#import "XPAcrossRoomPKForceEndResultView.h"
#import "XPAnchorPKInviteView.h"
#import "XPAnchorPKRuleView.h"
#import "XPAnchorPKResultView.h"
#import "XPAnchorPKFinishView.h"
#import "XPSendGiftView.h"
#import "XPUserCardViewController.h"
#import "XPRoomViewController.h"
#import "XPLittleGameMiniStageView.h"
#import "XPLittleGameRoomListView.h"
#import "XPAcrossRoomPKPrizeView.h"
#import "AcrossRoomPKPrizeModel.h"
///PK
#import "XPAnchorFansTeamEntranceView.h"
#import "XPAnchorFansTeamViewController.h"
@@ -326,6 +331,7 @@
[Api getAcrossRoomPKDetail:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
if (code == 200) {
AcrossRoomPKPanelModel * acrossPKPanelInfo = [AcrossRoomPKPanelModel modelWithJSON:data.data];
self.delegate.getRoomInfo.roundId = acrossPKPanelInfo.roundId;
if (acrossPKPanelInfo.pkType == AcrossRoomPkTypeAnchor) {
if (acrossPKPanelInfo.aUid.integerValue > 0) {
if (!self.anchorPKPanelView.superview) {
@@ -350,9 +356,6 @@
self.acrossPKPanelView.pkPanelInfo = acrossPKPanelInfo;
}
}
// [Api requestEndAnchorRoomPk:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
// NSLog(@"%@", msg);
// } roundId:[NSString stringWithFormat:@"%ld", acrossPKPanelInfo.roundId]];
} else {
[XCHUDTool showErrorWithMessage:msg];
}
@@ -501,7 +504,7 @@
}
break;
///PK
case Custom_Message_Sub_AnchorPK_Invite:
case Custom_Message_Sub_AnchorPK_Invite://PK
{
NIMChatroomMembersByIdsRequest *request = [[NIMChatroomMembersByIdsRequest alloc]init];
request.roomId = [NSString stringWithFormat:@"%ld", self.delegate.getRoomInfo.roomId];
@@ -520,10 +523,9 @@
}
}
}];
}
break;
case Custom_Message_Sub_AnchorPK_Accept:
case Custom_Message_Sub_AnchorPK_Accept://PK
{
NIMChatroomMembersByIdsRequest *request = [[NIMChatroomMembersByIdsRequest alloc]init];
request.roomId = [NSString stringWithFormat:@"%ld", self.delegate.getRoomInfo.roomId];
@@ -543,12 +545,17 @@
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[inviteResutView removeFromSuperview];
});
NSNumber *aRoomId = (NSNumber *)attachment.data[@"aRoomId"];
NSNumber *aUid = (NSNumber *)attachment.data[@"aUid"];
NSString *otherRoomId = [NSString stringWithFormat:@"%@", aRoomId];
NSString *otherUid =[NSString stringWithFormat:@"%@", aUid];
[[RtcManager instance] connectOtherRoom:otherRoomId userId:otherUid];
}
}
}];
}
break;
case Custom_Message_Sub_AnchorPK_Reject:
case Custom_Message_Sub_AnchorPK_Reject://PK
{
NIMChatroomMembersByIdsRequest *request = [[NIMChatroomMembersByIdsRequest alloc]init];
request.roomId = [NSString stringWithFormat:@"%ld", self.delegate.getRoomInfo.roomId];
@@ -573,7 +580,7 @@
}];
}
break;
case Custom_Message_Sub_AnchorPK_Panel:
case Custom_Message_Sub_AnchorPK_Panel://PK
{
if (!self.anchorPKPanelView.superview) {
[self addSubview:self.anchorPKPanelView];
@@ -586,7 +593,7 @@
self.anchorPKPanelView.pkPanelInfo = acrossPKPanelInfo;
}
break;
case Custom_Message_Sub_AnchorPK_End:
case Custom_Message_Sub_AnchorPK_End://PK
{
if (!self.anchorPKPanelView.superview) {
[self addSubview:self.anchorPKPanelView];
@@ -597,22 +604,19 @@
}
AcrossRoomPKPanelModel * acrossPKPanelInfo = [AcrossRoomPKPanelModel modelWithJSON:attachment.data];
self.anchorPKPanelView.pkPanelInfo = acrossPKPanelInfo;
XPAnchorPKResultView *view = [[XPAnchorPKResultView alloc] initWithFrame:CGRectMake(0, 0, 300, 472)];
view.data = acrossPKPanelInfo;
[TTPopup popupView:view style:TTPopupStyleAlert];
}
break;
case Custom_Message_Sub_AnchorPK_Finish:
case Custom_Message_Sub_AnchorPK_Finish://PK
{
[self.anchorPKPanelView resetAcrossPKViewData];
[self.anchorPKPanelView removeFromSuperview];
AcrossRoomPKPanelModel * model = [AcrossRoomPKPanelModel modelWithJSON:attachment.data];
if (model.isForce) {
XPAcrossRoomPKForceEndResultView *view = [[XPAcrossRoomPKForceEndResultView alloc] initWithFrame:CGRectMake(0, 0, 281, 208)];
view.data = model;
[TTPopup popupView:view style:TTPopupStyleAlert];
} else {
XPAcrossRoomPKResultView *view = [[XPAcrossRoomPKResultView alloc] initWithFrame:CGRectMake(0, 0, 320, 453)];
view.data = model;
[TTPopup popupView:view style:TTPopupStyleAlert];
}
self.anchorPKPanelView = nil;
[[RtcManager instance] disconnectOtherRoom];
XPAnchorPKFinishView *view = [[XPAnchorPKFinishView alloc] init];
[TTPopup popupView:view style:TTPopupStyleAlert];
}
break;
default: