增加RoomGuestDelegate和RoomHostDelegate
This commit is contained in:
@@ -20,23 +20,23 @@
|
||||
#import "XPRoomBackContainerView.h"
|
||||
#import "XPRoomMenuContainerView.h"
|
||||
#import "XPRoomMessageContainerView.h"
|
||||
#import "XPRoomInfoContainerView.h"
|
||||
#import "RoomHeaderView.h"
|
||||
#import "SocialStageView.h"
|
||||
///P
|
||||
#import "XPRoomPresenter.h"
|
||||
#import "XPRoomProtocol.h"
|
||||
#import "XPIMRoomDelegate.h"
|
||||
#import "RoomDelegate.h"
|
||||
///Category
|
||||
#import "XPRoomViewController+RoomInfoContainerView.h"
|
||||
|
||||
#import "RoomHostDelegate.h"
|
||||
#import "RoomGuestDelegate.h"
|
||||
|
||||
#import "XPIMManager.h"
|
||||
|
||||
@interface XPRoomViewController ()<XPRoomProtocol, XPIMRoomDelegate, RoomDelegate>
|
||||
@interface XPRoomViewController ()<XPRoomProtocol, XPIMRoomDelegate, RoomHostDelegate>
|
||||
///背景
|
||||
@property (nonatomic,strong) XPRoomBackContainerView *backContainerView;
|
||||
///房间信息
|
||||
@property (nonatomic,strong) XPRoomInfoContainerView *roomInfoContainerView;
|
||||
@property (nonatomic,strong) RoomHeaderView *roomHeaderView;
|
||||
///坑位信息
|
||||
@property (nonatomic,strong) SocialStageView *stageView;
|
||||
///公屏
|
||||
@@ -88,7 +88,7 @@
|
||||
|
||||
- (void)initSubViews {
|
||||
[self.view addSubview:self.backContainerView];
|
||||
[self.view addSubview:self.roomInfoContainerView];
|
||||
[self.view addSubview:self.roomHeaderView];
|
||||
[self.view addSubview:self.stageView];
|
||||
[self.view addSubview:self.messageContainerView];
|
||||
[self.view addSubview:self.menuContainerView];
|
||||
@@ -100,14 +100,14 @@
|
||||
make.edges.mas_equalTo(self.view);
|
||||
}];
|
||||
|
||||
[self.roomInfoContainerView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
[self.roomHeaderView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.mas_equalTo(self.view);
|
||||
make.height.mas_equalTo(kNavigationHeight);
|
||||
}];
|
||||
|
||||
[self.stageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.mas_equalTo(self.view);
|
||||
make.top.mas_equalTo(self.roomInfoContainerView.mas_bottom);
|
||||
make.top.mas_equalTo(self.roomHeaderView.mas_bottom);
|
||||
}];
|
||||
|
||||
[self.messageContainerView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
@@ -138,7 +138,7 @@
|
||||
[[XPIMManager shareManager].chatRoomManager setCurrentRoomInfo:roomInfo];
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
if (roomInfo.valid) {
|
||||
[self configRoomInfoContainerViewWithRoomInfo:roomInfo]; // S1 没有考虑进房密码的情况
|
||||
[self.roomHeaderView onRoomUpdate]; // S1 没有考虑进房密码的情况
|
||||
[self.presenter getUserInfoWithUid:uid];
|
||||
} else {
|
||||
if ([self.roomUid isEqualToString:uid]) {
|
||||
@@ -160,28 +160,18 @@
|
||||
|
||||
- (void)openRoomSuccess:(RoomInfoModel *)roomInfo {
|
||||
self.roomInfo = roomInfo;
|
||||
[self configRoomInfoContainerViewWithRoomInfo:roomInfo];
|
||||
[self.roomHeaderView onRoomUpdate];
|
||||
[self.presenter enterNIMRoom:[NSString stringWithFormat:@"%ld", self.roomInfo.roomId] user:self.userInfo];
|
||||
}
|
||||
|
||||
- (void)enterRoomSuccess {
|
||||
[self.stageView setHostDelegate:self];
|
||||
[self.stageView onRoomEntered];
|
||||
}
|
||||
|
||||
- (void)enterRoomFail {
|
||||
[self dismissViewControllerAnimated:YES completion:nil];
|
||||
}
|
||||
|
||||
- (void)onExitChatRoomSuccess {
|
||||
///停止声网
|
||||
[[RtcManager instance] exitRoom];
|
||||
[[RtcManager instance] destory];
|
||||
///重置一下用户 信息
|
||||
// [[XPIMManager shareManager].microQueueManager setCurrentUserInfo:nil];
|
||||
[[XPIMManager shareManager].chatRoomManager removeDelegate:self];
|
||||
[self enterRoomFail];
|
||||
}
|
||||
|
||||
#pragma mark - RoomDelegate
|
||||
- (RoomInfoModel *)getRoomInfo {
|
||||
return self.roomInfo;
|
||||
@@ -191,6 +181,13 @@
|
||||
return self.userInfo;
|
||||
}
|
||||
|
||||
- (void)exitRoom {
|
||||
[self.presenter exitNIMRoom:[NSString stringWithFormat:@"%ld", self.roomInfo.roomId]];
|
||||
[[RtcManager instance] exitRoom];
|
||||
[[RtcManager instance] destory];
|
||||
[self dismissViewControllerAnimated:YES completion:nil];
|
||||
}
|
||||
|
||||
- (XPRoomBackContainerView *)backContainerView {
|
||||
if (!_backContainerView) {
|
||||
_backContainerView = [[XPRoomBackContainerView alloc] init];
|
||||
@@ -198,17 +195,16 @@
|
||||
return _backContainerView;
|
||||
}
|
||||
|
||||
- (XPRoomInfoContainerView *)roomInfoContainerView {
|
||||
if (!_roomInfoContainerView) {
|
||||
_roomInfoContainerView = [[XPRoomInfoContainerView alloc] init];
|
||||
_roomInfoContainerView.delegate = self;
|
||||
- (RoomHeaderView *)roomHeaderView {
|
||||
if (!_roomHeaderView) {
|
||||
_roomHeaderView = [[RoomHeaderView alloc] initWithDelegate:self];
|
||||
}
|
||||
return _roomInfoContainerView;
|
||||
return _roomHeaderView;
|
||||
}
|
||||
|
||||
- (SocialStageView *)stageView {
|
||||
if (!_stageView) {
|
||||
_stageView = [[SocialStageView alloc] init];
|
||||
_stageView = [[SocialStageView alloc] initWithDelegate:self];
|
||||
}
|
||||
return _stageView;
|
||||
}
|
||||
|
Reference in New Issue
Block a user