个播PK规则、关注房主、连麦优化

This commit is contained in:
chenguilong
2022-04-14 19:34:48 +08:00
parent ebd6a4aa1e
commit e5dbdf8932
30 changed files with 411 additions and 184 deletions

View File

@@ -50,7 +50,6 @@
#import "XPAcrossRoomPKResultView.h"
#import "XPAcrossRoomPKForceEndResultView.h"
#import "XPAnchorPKInviteView.h"
#import "XPAnchorPKRuleView.h"
#import "XPAnchorPKResultView.h"
#import "XPAnchorPKFinishView.h"
#import "XPSendGiftView.h"
@@ -58,7 +57,6 @@
#import "XPRoomViewController.h"
#import "XPLittleGameMiniStageView.h"
#import "XPLittleGameRoomListView.h"
#import "XPAcrossRoomPKPrizeView.h"
#import "AcrossRoomPKPrizeModel.h"
///PK
#import "XPAnchorFansTeamEntranceView.h"
@@ -332,6 +330,8 @@
if (code == 200) {
AcrossRoomPKPanelModel * acrossPKPanelInfo = [AcrossRoomPKPanelModel modelWithJSON:data.data];
self.delegate.getRoomInfo.roundId = acrossPKPanelInfo.roundId;
self.delegate.getRoomInfo.pkUid = acrossPKPanelInfo.aUid;
self.delegate.getRoomInfo.pkRoomId = acrossPKPanelInfo.aRoomId;
if (acrossPKPanelInfo.pkType == AcrossRoomPkTypeAnchor) {
if (acrossPKPanelInfo.aUid.integerValue > 0) {
if (!self.anchorPKPanelView.superview) {
@@ -545,11 +545,8 @@
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];
AcrossRoomPKPanelModel * acrossPKPanelInfo = [AcrossRoomPKPanelModel modelWithJSON:attachment.data];
[[RtcManager instance] connectOtherRoom:acrossPKPanelInfo.aRoomId userId:acrossPKPanelInfo.aUid];
}
}
}];
@@ -615,7 +612,9 @@
[self.anchorPKPanelView removeFromSuperview];
self.anchorPKPanelView = nil;
[[RtcManager instance] disconnectOtherRoom];
AcrossRoomPKPanelModel * acrossPKPanelInfo = [AcrossRoomPKPanelModel modelWithJSON:attachment.data];
XPAnchorPKFinishView *view = [[XPAnchorPKFinishView alloc] init];
view.data = acrossPKPanelInfo;
[TTPopup popupView:view style:TTPopupStyleAlert];
}
break;
@@ -748,6 +747,15 @@
[self.delegate.getCurrentNav presentViewController:userCardVC animated:YES completion:nil];
}
///
- (void)xPAnchorPKPanelView:(XPAnchorPkPanelView *)view onlookRoom:(NSString *)roomUid {
[self.delegate exitRoom];
/// 退 dismiss
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[XPRoomViewController openRoom:roomUid viewController:[XCCurrentVCStackManager shareManager].getCurrentVC];
});
}
#pragma mark - Event Response
- (void)contributionButtonAction:(UIButton *)sender {
NSString * roomUid = [NSString stringWithFormat:@"%ld", self.delegate.getRoomInfo.uid];
@@ -863,7 +871,11 @@
}
- (void)updateRoomTopic {
self.topicStackView.hidden= ([ClientConfig shareConfig].configInfo.appStoreAuditNoticeVersion || self.delegate.getRoomInfo.type == RoomType_MiniGame) == YES;
if (self.delegate.getRoomInfo.type == RoomType_Anchor && self.delegate.getRoomInfo.roomModeType == RoomModeType_Open_AcrossRoomPK_mode) {
self.topicStackView.hidden = YES;
} else {
self.topicStackView.hidden = ([ClientConfig shareConfig].configInfo.appStoreAuditNoticeVersion || self.delegate.getRoomInfo.type == RoomType_MiniGame) == YES;
}
[self updateRoomTopicViewConstraint];
NIMChatroomMembersByIdsRequest *request = [[NIMChatroomMembersByIdsRequest alloc]init];
request.roomId = [NSString stringWithFormat:@"%ld", self.delegate.getRoomInfo.roomId];