1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165 |
- //
- // XYChatRoomInfoManager.m
- // Starbuds
- //
- // Created by 翟玉磊 on 2020/7/8.
- // Copyright © 2020 翟玉磊. All rights reserved.
- //
- #import "XYChatRoomInfoManager.h"
- #import "XYChatRoomMenuItemModel.h"
- #import "XYChatRoomDiamondRankModel.h"
- #import "XYLiveRoomAPIManager.h"
- #import "XYChatRoomListModel.h"
- #import "XYChatRoomPKTimeModel.h"
- #import "XYChatRoomAuctionRankItemModel.h"
- @implementation XYChatRoomInfoManager
- - (void)clear {
-
- }
- - (instancetype)init
- {
- self = [super init];
- if (self) {
-
- [self initValue];
- }
- return self;
- }
- - (void)initValue {
- self.enableSpeakerphone = YES;
- self.KFPkMatchNumber = 10;
- }
- #pragma mark — 更新管理菜单 根据角色生成对应的菜单数组
- - (NSArray *)updateMenuData {
- [self.menuItemModelArray removeAllObjects];
-
- NSMutableArray *oneSetionArray = [NSMutableArray array];
-
- if (self.role > XYVoiceRoomRoleAudience) {
- if (self.roomInfoModel.roomType != XYVoiceRoomTypeLove && self.roomInfoModel.roomType != XYVoiceRoomTypeAuction) {
- XYChatRoomMenuItemModel *heratModel = XYChatRoomMenuItemModel.new;
- heratModel.title = @"心动值";
- heratModel.imageName = @"xy-chatroom-menu-herat";
- heratModel.menuType = XYChatRoomMenuTypeCardiacValue;
- heratModel.typesWitch = self.roomInfoModel.roomScoreEnabled;
- [oneSetionArray addObject:heratModel];
-
- XYChatRoomMenuItemModel *freeMicrophoneModel = XYChatRoomMenuItemModel.new;
- freeMicrophoneModel.title = @"自由上麦";
- freeMicrophoneModel.imageName = @"xy-chatroom-menu-microphone";
- freeMicrophoneModel.menuType = XYChatRoomMenuTypeFreeMacphone;
- freeMicrophoneModel.typesWitch = self.roomInfoModel.roomMicFree;
- [oneSetionArray addObject:freeMicrophoneModel];
- }
-
- // XYChatRoomMenuItemModel *lockModel = XYChatRoomMenuItemModel.new;
- // lockModel.title = @"自动锁麦";
- // lockModel.imageName = @"xy-chatroom-menu-lock";
- // lockModel.menuType = XYChatRoomMenuTypeFreeLockMacphone;
- // lockModel.typesWitch = self.isFreeLockMacphone;
- // [oneSetionArray addObject:lockModel];
-
- XYChatRoomMenuItemModel *roomLockModel = XYChatRoomMenuItemModel.new;
- roomLockModel.title = @"房间上锁";
- roomLockModel.imageName = @"xy-chatroom-menu-lockHome";
- roomLockModel.menuType = XYChatRoomMenuTypeRoomLock;
- roomLockModel.typesWitch = self.roomInfoModel.needPass;
- [oneSetionArray addObject:roomLockModel];
-
- XYChatRoomMenuItemModel *closeBarrageModel = XYChatRoomMenuItemModel.new;
- closeBarrageModel.title = @"关闭公屏";
- closeBarrageModel.imageName = @"xy-chatroom-menu-closeBarrage";
- closeBarrageModel.menuType = XYChatRoomMenuTypeClearScreen;
- closeBarrageModel.typesWitch = !self.roomInfoModel.roomChatEnabled;
- [oneSetionArray addObject:closeBarrageModel];
-
- if (self.roomInfoModel.roomType != XYVoiceRoomTypeLove) {
- XYChatRoomMenuItemModel *incomeModel = XYChatRoomMenuItemModel.new;
- incomeModel.title = @"麦位收益";
- incomeModel.imageName = @"xy-chatroom-menu-income";
- incomeModel.menuType = XYChatRoomMenuTypeMcphoneSeatIncome;
- [oneSetionArray addObject:incomeModel];
- }
-
- }
-
- if (self.isCurrentOnMicrophone) {
- XYChatRoomMenuItemModel *recordModel = XYChatRoomMenuItemModel.new;
- recordModel.title = @"背景音乐";
- recordModel.imageName = @"xy-chatroom-menu-record";
- recordModel.menuType = XYChatRoomMenuTypeMcphoneBackgroundMusic;
- [oneSetionArray addObject:recordModel];
-
- // XYChatRoomMenuItemModel *soundModel = XYChatRoomMenuItemModel.new;
- // soundModel.title = @"混响音效";
- // soundModel.imageName = @"xy-chatroom-menu-sound";
- // soundModel.menuType = XYChatRoomMenuTypeRoomSound;
- // [oneSetionArray addObject:soundModel];
- }
-
- if (self.role > XYVoiceRoomRoleAudience) {
- XYChatRoomMenuItemModel *roomSetModel = XYChatRoomMenuItemModel.new;
- roomSetModel.title = @"房间管理";
- roomSetModel.imageName = @"xy-chatroom-menu-setting";
- roomSetModel.menuType = XYChatRoomMenuTypeRoomManage;
- [oneSetionArray addObject:roomSetModel];
-
- XYChatRoomMenuItemModel *seatModel = XYChatRoomMenuItemModel.new;
- seatModel.title = @"麦序管理";
- seatModel.imageName = @"xy-chatroom-menu-seat";
- seatModel.menuType = XYChatRoomMenuTypeMcphoneSeatManage;
- [oneSetionArray addObject:seatModel];
- }
-
- if (self.isCurrentOnMicrophone) {
- XYChatRoomMenuItemModel *speakerModel = XYChatRoomMenuItemModel.new;
- speakerModel.title = kLocalizedString(@"召集粉丝");
- speakerModel.imageName = @"xy-chatroom-menu-speaker";
- speakerModel.menuType = XYChatRoomMenuTypeRoomConveneFans;
- [oneSetionArray addObject:speakerModel];
- }
-
- if (self.role > XYVoiceRoomRoleAudience) {
- if (self.roomInfoModel.roomType != XYVoiceRoomTypeLove && self.roomInfoModel.roomType != XYVoiceRoomTypeAuction) {
- XYChatRoomMenuItemModel *heratValueListModel = XYChatRoomMenuItemModel.new;
- heratValueListModel.title = @"心动值列表";
- heratValueListModel.imageName = @"xy-chatroom-heartvalue-listbtn";
- heratValueListModel.menuType = XYChatRoomMenuTypeCardiacValueList;
- [oneSetionArray addObject:heratValueListModel];
- }
- }
-
- // 主持人才有转盘图标
- if (self.isCurrentHost) {
- XYChatRoomMenuItemModel *heratValueListModel = XYChatRoomMenuItemModel.new;
- heratValueListModel.title = @"大冒险";
- heratValueListModel.imageName = @"xy-chatroom-menu-rotaryTable";
- heratValueListModel.menuType = XYChatRoomMenuTypeRotaryTable;
- [oneSetionArray addObject:heratValueListModel];
- }
-
- if (self.battleEnabled) {
- if (self.isCurrentHost) {
- // PK玩法
- XYChatRoomMenuItemModel *pkModel = XYChatRoomMenuItemModel.new;
- pkModel.title = @"PK玩法";
- pkModel.imageName = @"xy-chatroom-menu-pk";
- pkModel.menuType = XYChatRoomMenuTypePK;
- [oneSetionArray addObject:pkModel];
- }
- }
-
- // 开关播
- if (self.role > XYVoiceRoomRoleMaster) {
- if (self.roomInfoModel.roomType != XYVoiceRoomTypeVoiceLive) {
- XYChatRoomMenuItemModel *liveModel = XYChatRoomMenuItemModel.new;
- if (self.isLive) {
- liveModel.title = @"关播";
- liveModel.imageName = @"xy-chatroom-menu-close";
- }else {
- liveModel.title = @"开播";
- liveModel.imageName = @"xy-chatroom-menu-start";
- }
- liveModel.menuType = XYChatRoomMenuTypeStartAndEnd;
- [oneSetionArray addObject:liveModel];
- }
- }
-
- if (oneSetionArray.count > 0) {
- [self.menuItemModelArray addObject:oneSetionArray];
- }
-
- // 常驻功能
- NSMutableArray *commonSectionArray = [NSMutableArray array];
- // XYChatRoomMenuItemModel *shareModel = XYChatRoomMenuItemModel.new;
- // shareModel.title = @"分享";
- // shareModel.imageName = @"xy-chatroom-menu-share";
- // shareModel.menuType = XYChatRoomMenuTypeRoomShare;
- // [commonSectionArray addObject:shareModel];
-
- XYChatRoomMenuItemModel *weModel = XYChatRoomMenuItemModel.new;
- weModel.title = @"在线用户";
- weModel.imageName = @"xy-chatroom-menu-we";
- weModel.menuType = XYChatRoomMenuTypeRoomOnlineUsers;
- [commonSectionArray addObject:weModel];
-
- XYChatRoomMenuItemModel *receiverModel = XYChatRoomMenuItemModel.new;
- receiverModel.title = @"使用听筒";
- receiverModel.imageName = @"xy-chatroom-menu-headset";
- receiverModel.menuType = XYChatRoomMenuTypeRoomReceiver;
- [commonSectionArray addObject:receiverModel];
- if (commonSectionArray.count > 0) {
- [self.menuItemModelArray addObject:commonSectionArray];
- }
- XYChatRoomMenuItemModel *effectModel = XYChatRoomMenuItemModel.new;
- effectModel.title = @"礼物动效";
- effectModel.imageName = @"xy-chatroom-menu-effect";
- effectModel.menuType = XYChatRoomMenuTypeRoomEffect;
- effectModel.typesWitch = ![XYUserSwitchManager sharedInstance].isEffectEnabled;
- [commonSectionArray addObject:effectModel];
-
- return self.menuItemModelArray;
- }
- #pragma mark — Public
- // 获取直播间信息
- - (void)getRoomInfoRequestCompleted:(void(^)(NSError *error))completed {
-
- dispatch_group_t group = dispatch_group_create();
- dispatch_queue_t queue = dispatch_queue_create("chat.room.info", DISPATCH_QUEUE_SERIAL);
- NSError *error = nil;
- if (!self.roomInfoModel.roomMicFree) {
- // 非自由上麦需要请求麦序队列当前上麦用户列表
- dispatch_group_enter(group);
- dispatch_async(queue, ^{
- [self getQueueUsersRequestCompleted:^(NSError *error) {
- error = error;
- dispatch_group_leave(group);
- }];
- });
- if (self.roomInfoModel.roomType == XYVoiceRoomTypeAuction) {
- dispatch_group_enter(group);
- dispatch_async(queue, ^{
- [self getAcutionQueueUsersRequestCompleted:^(NSError *error) {
- error = error;
- dispatch_group_leave(group);
- }];
- });
- }
- }
- // 获取房间周榜
- dispatch_group_enter(group);
- dispatch_async(queue, ^{
- [self getDiamondRankWeekCompleted:^(NSError *error) {
- dispatch_group_leave(group);
- }];
- });
- // 获取房间昨日MVP
- dispatch_group_enter(group);
- dispatch_async(queue, ^{
- [self getYesterdayDiamondRankMVPCompleted:^(NSError *error) {
- dispatch_group_leave(group);
- }];
- });
- // 获取语音房活动列表
- dispatch_group_enter(group);
- dispatch_async(queue, ^{
- [self getActivityRequestCompleted:^(NSError * _Nonnull error) {
- dispatch_group_leave(group);
- }];
- });
- // 小时榜排名
- dispatch_group_enter(group);
- dispatch_async(queue, ^{
- [self getRtcHourRankCompleted:^(NSError * _Nonnull error) {
- dispatch_group_leave(group);
- }];
- });
- // 房间内PK配置
- if ([AppDelegate sharedDelegate].appConfigModel.battleTimeConfigArray.count == 0) {
- dispatch_group_enter(group);
- dispatch_async(queue, ^{
- [[XYConfigAPIManager new] getBattleRoomInConfigSuccessHandler:^(ZYLResponseModel *responseModel) {
- NSMutableArray *temp = [NSMutableArray array];
- for (NSDictionary *dict in responseModel.data[@"list"]) {
- XYChatRoomPKTimeModel *model = XYChatRoomPKTimeModel.new;
- [model yy_modelSetWithDictionary:dict];
- [temp addObject:model];
- }
- [AppDelegate sharedDelegate].appConfigModel.battleTimeConfigArray = temp;
- dispatch_group_leave(group);
- } failureHandler:^(ZYLNetworkError *error) {
- dispatch_group_leave(group);
- }];
- });
- }
-
- dispatch_group_notify(group, queue, ^{
- dispatch_async(dispatch_get_main_queue(), ^{
- !completed?:completed(error);
- });
- });
- }
- /// 获取当前房间小时榜排名
- - (void)getRtcHourRankCompleted:(void(^)(NSError *error))completed {
- [[XYVoiceRoomAPIManager new] getRtcHourRankSuccessHandler:^(ZYLResponseModel *responseModel) {
-
- // 小时榜url
- NSString *hourRank = responseModel.data[@"hourRank"];
- self.hoursRankUrl = hourRank;
-
- NSMutableArray *temp = [NSMutableArray array];
- self.hoursRankIndex = -1;
- for (NSDictionary *dict in responseModel.data[@"list"]) {
- XYChatRoomListModel *model = XYChatRoomListModel.new;
- [model yy_modelSetWithDictionary:dict];
- [temp addObject:model];
- if ([self.roomInfoModel.roomId isEqualToString:model.roomId]) {
- self.hoursRankIndex = model.rankNo;
- }
- }
- self.hoursDataSource = [NSArray arrayWithArray:temp];
- !completed?:completed(nil);
- } failureHandler:^(ZYLNetworkError *error) {
- !completed?:completed(error);
- }];
- }
- // 获取昨日榜单MVP
- - (void)getYesterdayDiamondRankMVPCompleted:(void(^)(NSError *error))completed {
- [[XYVoiceRoomAPIManager new] getYesterdayDiamondRankMVPWithRoomId:self.roomInfoModel.roomId successHandler:^(ZYLResponseModel *responseModel) {
- if (responseModel.data) {
- self.roomYesterdayMVPModel = XYChatRoomMVPModel.new;
- [self.roomYesterdayMVPModel yy_modelSetWithDictionary:responseModel.data];
- }else {
- self->_roomYesterdayMVPModel = nil;
- }
- !completed?:completed(nil);
- } failureHandler:^(ZYLNetworkError *error) {
- !completed?:completed(error);
- }];
- }
- // 获取聊天室活动
- - (void)getActivityRequestCompleted:(void(^)(NSError *error))completed{
- [[XYLiveRoomAPIManager new] getChatRoomActivities:@{@"roomId":self.roomInfoModel.roomId} successHandler:^(ZYLResponseModel *responseModel) {
- [self.allActivityArrs removeAllObjects];
-
- for (NSDictionary *dict in responseModel.data[@"list"]) {
- XYLiveRoomActivityInfo *info = [[XYLiveRoomActivityInfo alloc] init];
- [info yy_modelSetWithDictionary:dict];
- [self.allActivityArrs addObject:info];
- }
-
- !completed?:completed(nil);
-
- } failureHandler:^(ZYLNetworkError *error) {
- !completed?:completed(error);
- }];
- }
- - (void)getDiamondRankWeekCompleted:(void(^)(NSError *error))completed {
- [[XYVoiceRoomAPIManager new] getDiamondRankWeekWithRoomId:self.roomInfoModel.roomId successHandler:^(ZYLResponseModel *responseModel) {
- [self.diamondRankArray removeAllObjects];
- for (NSDictionary *dict in responseModel.data[@"list"]) {
- XYChatRoomDiamondRankModel *modle = XYChatRoomDiamondRankModel.new;
- [modle yy_modelSetWithDictionary:dict];
- [self.diamondRankArray addObject:modle];
- }
- !completed?:completed(nil);
- } failureHandler:^(ZYLNetworkError *error) {
- !completed?:completed(error);
- }];
- }
- /// 获取麦序队列数量和判断出自己是否加入麦序队列
- - (void)getQueueUsersRequestCompleted:(void(^)(NSError *error))completed {
- if (self.roomInfoModel.roomType == XYVoiceRoomTypeAuction) {
- [[XYVoiceRoomAPIManager new] getQueueUsersInAuctionWithRoomId:self->_roomInfoModel.roomId type:2 successHandler:^(ZYLResponseModel *responseModel) {
- self.isJoinQueue = NO;
- // 获取当前麦序队列用户数量
- NSArray *list = responseModel.data[@"list"];
- self.queueUsersCount = [list count];
- for (NSDictionary *dict in list) {
- NSString *userId = dict[@"userId"];
- // 判断自己有没有在麦序里
- if ([userId isEqualToString:[XYUserInfoManager nowUser].userId]) {
- self.isJoinQueue = YES;
- break;
- }
- }
- !completed?:completed(nil);
- } failureHandler:^(ZYLNetworkError *error) {
- !completed?:completed(error);
- }];
- }else {
- [[XYVoiceRoomAPIManager new] getQueueUsersWithRoomId:self->_roomInfoModel.roomId successHandler:^(ZYLResponseModel *responseModel) {
- self.isJoinQueue = NO;
- // 获取当前麦序队列用户数量
- NSArray *list = responseModel.data[@"list"];
- self.queueUsersCount = [list count];
- for (NSDictionary *dict in list) {
- NSString *userId = dict[@"userId"];
- // 判断自己有没有在麦序里
- if ([userId isEqualToString:[XYUserInfoManager nowUser].userId]) {
- self.isJoinQueue = YES;
- break;
- }
- }
- !completed?:completed(nil);
- } failureHandler:^(ZYLNetworkError *error) {
- !completed?:completed(error);
- }];
- }
- }
- /// 获取拍卖麦序队列数量和判断出自己是否加入麦序队列
- - (void)getAcutionQueueUsersRequestCompleted:(void(^)(NSError *error))completed {
- [[XYVoiceRoomAPIManager new] getQueueUsersInAuctionWithRoomId:self->_roomInfoModel.roomId type:1 successHandler:^(ZYLResponseModel *responseModel) {
- self.isJoinAuctionQueue = NO;
- // 获取当前麦序队列用户数量
- NSArray *list = responseModel.data[@"list"];
- self.auctionQueueUsersCount = [list count];
- for (NSDictionary *dict in list) {
- NSString *userId = dict[@"userId"];
- // 判断自己有没有在麦序里
- if ([userId isEqualToString:[XYUserInfoManager nowUser].userId]) {
- self.isJoinAuctionQueue = YES;
- break;
- }
- }
- !completed?:completed(nil);
- } failureHandler:^(ZYLNetworkError *error) {
- !completed?:completed(error);
- }];
- }
- /// 获取麦序队列数量和判断出自己是否加入麦序队列
- - (void)getSeatsInfoRequestCompleted:(void(^)(NSError *error))completed {
-
- // 保留被选中接受礼物的用户
- NSMutableArray *tempArray = [NSMutableArray array];
- for (XYChatRoomSeatsModel *model in self.seatsArray) {
- if (model.user) {
- if (model.user.isSelected) {
- [tempArray addObject:model.user];
- }
- }
- }
-
- [[XYVoiceRoomAPIManager new] getSeatsWithRoomId:self.roomInfoModel.roomId successHandler:^(ZYLResponseModel *responseModel) {
- [self.seatsArray removeAllObjects];
- [self.seatUserArray removeAllObjects];
- NSMutableArray *seats = [NSMutableArray array];
- if (self.roomInfoModel.roomType == XYVoiceRoomTypeVoiceLive) {
- NSArray *tempSeats = responseModel.data[@"list"];
- if (tempSeats.count > 5) {
- [seats addObjectsFromArray:[tempSeats subarrayWithRange:NSMakeRange(0, 5)]];
- }else {
- [seats addObjectsFromArray:responseModel.data[@"list"]];
- }
- }else {
- [seats addObjectsFromArray:responseModel.data[@"list"]];
- }
-
- // 先重置用户的上麦状态
- self.isCurrentOnMicrophone = NO;
- self.isCurrentHost = NO;
- for (NSDictionary *dict in seats) {
- XYChatRoomSeatsModel *model = XYChatRoomSeatsModel.new;
- [model yy_modelSetWithDictionary:dict];
- model.isShowScore = self.roomInfoModel.roomScoreEnabled;
- [self.seatsArray addObject:model];
-
- if (model.user) {
- // 礼物选中状态更新
- for (XYChatRoomSeatsUserModel *giftModel in tempArray) {
- if ([model.user.userId isEqualToString:giftModel.userId]) {
- model.user.isSelected = giftModel.isSelected;
- }
- }
- // 麦位用户
- [self.seatUserArray addObject:model.user];
-
- // 获取当前用户的上麦的状态
- if ([model.user.userId isEqualToString:[XYUserInfoManager nowUser].userId]) {
- self.isCurrentOnMicrophone = YES;
- if (model.seatNo == 0) {
- self.isCurrentHost = YES;
- }
- }
- }
- }
- !completed?:completed(nil);
- } failureHandler:^(ZYLNetworkError *error) {
- !completed?:completed(error);
- }];
- }
- /// 更新心动值显示开关
- - (id)updateCardiacValueSwitch:(BOOL)scoreEnabled {
- // 更新状态
- self.roomInfoModel.roomScoreEnabled = scoreEnabled;
- XYChatRoomMenuItemModel *model = [self getMenuItemModelWithType:XYChatRoomMenuTypeCardiacValue];
- model.typesWitch = self.roomInfoModel.roomScoreEnabled;
- for (XYChatRoomSeatsModel *model in self.seatsArray) {
- model.isShowScore = self.roomInfoModel.roomScoreEnabled;
- }
- return model;
- }
- /// 更新自由上麦开关状态
- - (id)updateRoomMicFreeSwitch:(BOOL)roomMicFree {
- // 更新状态
- self.roomInfoModel.roomMicFree = roomMicFree;
- XYChatRoomMenuItemModel *model = [self getMenuItemModelWithType:XYChatRoomMenuTypeFreeMacphone];
- model.typesWitch = self.roomInfoModel.roomMicFree;
-
- return model;
- }
- /// 更新房间密码锁开关状态
- - (id)updateRoomLockSwitch:(BOOL)needPass {
- // 更新状态
- self.roomInfoModel.needPass = needPass;
- XYChatRoomMenuItemModel *model = [self getMenuItemModelWithType:XYChatRoomMenuTypeRoomLock];
- model.typesWitch = self.roomInfoModel.needPass;
-
- return model;
- }
- /// 更新公屏开关状态
- - (id)updateClearChatEnabledSwitch:(BOOL)chatEnabled {
- // 更新状态
- self.roomInfoModel.roomChatEnabled = chatEnabled;
- XYChatRoomMenuItemModel *model = [self getMenuItemModelWithType:XYChatRoomMenuTypeClearScreen];
- model.typesWitch = !self.roomInfoModel.roomChatEnabled;
-
- return model;
- }
- - (XYChatRoomSeatsUserModel *)auctionSeatUserModel {
- if (self.seatsArray.count > 2) {
- XYChatRoomSeatsModel *seatModel = self.seatsArray[1];
- if (seatModel.user && StringIsNotEmpty(seatModel.user.userId)) {
- return seatModel.user;
- }
- }
- return nil;
- }
- - (void)setIsCurrentHost:(BOOL)isCurrentHost {
- if (_isCurrentHost != isCurrentHost) {
- _isCurrentHost = isCurrentHost;
- !self.currentHostStateUpdateBlock?:self.currentHostStateUpdateBlock();
- }
- }
- #pragma mark — Method
- - (void)setRole:(XYVoiceRoomRole)role {
- _role = role;
- if (_profile) {
- [_profile setValue:@(role) forKey:@"userRole"];
- }
- }
- /// 获取空缺的普通麦位号 -1说明没有空缺的普通麦位
- - (NSInteger)getNoUserGeneralSeatNo {
- for (XYChatRoomSeatsModel *model in self.seatsArray) {
- if (model.seatNo != 0) {
- if (!model.user) {
- return model.seatNo;
- break;
- }
- }
- }
- return -1;
- }
- /// 找到指定菜单model
- - (XYChatRoomMenuItemModel *)getMenuItemModelWithType:(XYChatRoomMenuType)type {
- for (NSInteger i = 0; i < self.menuItemModelArray.count; i++) {
- NSArray *tempArray = self.menuItemModelArray[i];
- for (NSInteger y = 0; y < tempArray.count; y++) {
- XYChatRoomMenuItemModel *model = tempArray[y];
- if (model.menuType == type) {
- return model;
- break;
- }
- }
- }
- return nil;
- }
- /// 判断用户是否有权限
- - (BOOL)isLimitUser{
- if (self.role > XYVoiceRoomRoleAudience) {
- return YES;
- }
- return NO;
- }
- /// 获取指定用户资料的操作功能项
- - (NSArray *)getUserFunctionTitleWithUserId:(NSString *)userId andHideFunction:(BOOL )hideFunction{
-
- NSMutableArray *itemTitleArray = [NSMutableArray array];
- self.personDetailItemTitleArray = itemTitleArray;
-
- if (hideFunction) {//隐藏操作功能项,如点击全区礼物人时
- if (![[XYUserInfoManager nowUser].userId isEqualToString:userId]) {
- // 不是自己才会显示私信和关注
- [itemTitleArray addObject:kLocalizedString(@"关注")];
- [itemTitleArray addObject:kLocalizedString(@"私信")];
- [itemTitleArray addObject:kLocalizedString(@"@TA")];
- [itemTitleArray addObject:kLocalizedString(@"送礼物")];
- }
- return itemTitleArray;
- }
-
- if (self.roomInfoModel.roomType == XYVoiceRoomTypeVoiceLive) {
- // 个播模式下房主及以上权限才可以设置管理,不能设置主持人
- if (self.role > XYVoiceRoomRoleMaster && ![[XYUserInfoManager nowUser].userId isEqualToString:userId]) {
- [itemTitleArray addObject:kLocalizedString(@"管理")];
- }
- }else {
- if (self.role > XYVoiceRoomRoleHost && ![[XYUserInfoManager nowUser].userId isEqualToString:userId]) {
- [itemTitleArray addObject:kLocalizedString(@"管理")];
- }
- }
-
- //[itemTitleArray addObject:kLocalizedString(@"查看资料")];
- if (![[XYUserInfoManager nowUser].userId isEqualToString:userId]) {
- // 不是自己才会显示私信和关注
- [itemTitleArray addObject:kLocalizedString(@"关注")];
- [itemTitleArray addObject:kLocalizedString(@"私信")];
- [itemTitleArray addObject:kLocalizedString(@"@TA")];
- }
-
- // 常驻功能(除了自己都能送礼物)
- if (![[XYUserInfoManager nowUser].userId isEqualToString:userId]) {
- [itemTitleArray addObject:kLocalizedString(@"送礼物")];
- }
-
- // 权限功能
- // 上下麦
- // 判断这个用户有没有上麦
- BOOL isOnMicrophone = [self judgeUserIsOnMicrophoneWithUserId:userId];
- if (isOnMicrophone) {
- // 上麦中
- if (self.role > XYVoiceRoomRoleAudience || [userId isEqualToString:[XYUserInfoManager nowUser].userId]) {
- if (self.roomInfoModel.roomType == XYVoiceRoomTypeLove) {
- XYChatRoomSeatsModel *seatModel = [self getUserSeatModelWithUserId:userId];
- if (seatModel.seatNo != 9) {
- // 老板麦上下麦后台控制
- [itemTitleArray addObject:kLocalizedString(@"下麦")];
- }
- }
- else if (self.roomInfoModel.roomType == XYVoiceRoomTypeVoiceLive) {
- XYChatRoomSeatsModel *seatModel = [self getUserSeatModelWithUserId:userId];
- if (seatModel.seatNo != 0) {
- // 个播模式下主持人不显示下麦操作
- [itemTitleArray addObject:kLocalizedString(@"下麦")];
- }
- }
- else {
- // 当主持人或者自己触发弹出时才会出现下麦功能
- [itemTitleArray addObject:kLocalizedString(@"下麦")];
- }
- }
- }else {
- // 没上麦
- if (self.role > XYVoiceRoomRoleAudience || [userId isEqualToString:[XYUserInfoManager nowUser].userId]) {
- // 当主持人或者自己触发弹出时才会出现上麦功能
- [itemTitleArray addObject:kLocalizedString(@"上麦")];
- }
- }
- // 禁言
- if (self.role > XYVoiceRoomRoleAudience && ![[XYUserInfoManager nowUser].userId isEqualToString:userId]) {
- // 当前用户的权限大于观众就出现禁言功能
- XYChatRoomSeatsModel *seatModel = [self getUserSeatModelWithUserId:userId];
- if (seatModel==nil) {
- [itemTitleArray addObject:kLocalizedString(@"禁言")];
- }
- }
- // 清空心动值
- if (self.roomInfoModel.roomType != XYVoiceRoomTypeLove && self.roomInfoModel.roomType != XYVoiceRoomTypeAuction) {
- if (self.roomInfoModel.roomScoreEnabled && self.role > XYVoiceRoomRoleAudience) {
- // 房间开启了心动值开关且该用户在主持人麦
- [itemTitleArray addObject:kLocalizedString(@"清空心动值")];
- }
- }
- // 踢出房间
- if (self.role > XYVoiceRoomRoleAudience && ![[XYUserInfoManager nowUser].userId isEqualToString:userId]) {
- // 当前用户的权限大于观众就出现禁言功能
- [itemTitleArray addObject:kLocalizedString(@"踢出房间")];
- }
- // 倒计时、麦位开麦闭麦
- if (self.role > XYVoiceRoomRoleAudience) {
- XYChatRoomSeatsModel *seatModel = [self getUserSeatModelWithUserId:userId];
- if (seatModel) {
- if (self.roomInfoModel.roomType != XYVoiceRoomTypeLove) {
- // 设置倒计时
- if (seatModel.countDownSeconds <= 0) {
- [itemTitleArray addObject:kLocalizedString(@"开启倒计时")];
- }else {
- [itemTitleArray addObject:kLocalizedString(@"结束倒计时")];
- }
- }
-
- // 设置麦位
- if (![userId isEqualToString:[XYUserInfoManager nowUser].userId]) {
- if (seatModel.micDisabled) {
- [itemTitleArray addObject:kLocalizedString(@"开麦")];
- }else {
- [itemTitleArray addObject:kLocalizedString(@"闭麦")];
- }
- }
- }
- }
-
- if (![[XYUserInfoManager nowUser].userId isEqualToString:userId]) {
- if (([XYChatRoomManager sharedInstance].chatRoomController.infoManager.roomInfoModel.roomType == XYVoiceRoomTypeOrder) && (self.isCurrentHost == YES)) {
- [itemTitleArray addObject:kLocalizedString(@"派单")];
- }
- }
-
- return itemTitleArray;
- }
- /// 判断这个用户是否在麦上
- /// @param userId 指定的用户id
- - (BOOL)judgeUserIsOnMicrophoneWithUserId:(NSString *)userId {
- BOOL isOnMicrophone = NO;
- for (XYChatRoomSeatsUserModel *model in self.seatUserArray) {
- if ([model.userId isEqualToString:userId]) {
- isOnMicrophone = YES;
- break;
- }
- }
- return isOnMicrophone;
- }
- /// 根据uid获取麦位model 不在麦上则返回nil
- /// @param userId 指定的用户id
- - (XYChatRoomSeatsModel *)getUserSeatModelWithUserId:(NSString *)userId {
- for (XYChatRoomSeatsModel *model in self.seatsArray) {
- if ([model.user.userId isEqualToString:userId]) {
- return model;
- break;
- }
- }
- return nil;
- }
- /// 获取主持人麦位model
- - (XYChatRoomSeatsModel *)getHostSeatModel {
- if (self.seatsArray.count > 0) {
- XYChatRoomSeatsModel *model = [self.seatsArray firstObject];
- return model;
- }
- return nil;
- }
- /// 根据菜单类型获取指定类型的model
- /// @param type 需要的类型
- - (XYChatRoomMenuItemModel *)getMenuModelWithMenuType:(XYChatRoomMenuType)type {
- for (NSArray *tempArray in self.menuItemModelArray) {
- for (XYChatRoomMenuItemModel *model in tempArray) {
- if (model.menuType == type) {
- return model;
- break;
- }
- }
- }
- return nil;
- }
- - (NSArray *)getLoveLeftSeatArray {
-
- NSMutableArray *tempArray = [NSMutableArray array];
- [tempArray addObject:self.seatsArray[1]];
- [tempArray addObject:self.seatsArray[2]];
- [tempArray addObject:self.seatsArray[5]];
- [tempArray addObject:self.seatsArray[6]];
- return tempArray;
- }
- - (NSArray *)getLoveRightSeatArray {
-
- NSMutableArray *tempArray = [NSMutableArray array];
- [tempArray addObject:self.seatsArray[3]];
- [tempArray addObject:self.seatsArray[4]];
- [tempArray addObject:self.seatsArray[7]];
- [tempArray addObject:self.seatsArray[8]];
- return tempArray;
- }
- /// 获取左右边心动值最大的麦位 -1则是没有人
- /// @param isLeft YES左边 NO右边
- - (NSInteger)getLoveHatSeatNoWithLeft:(BOOL)isLeft {
- NSInteger seatNo = -1;
- NSArray *tempArray = [NSArray array];
- if (isLeft) {
- tempArray = [self getLoveLeftSeatArray];
- }else {
- tempArray = [self getLoveRightSeatArray];
- }
-
- NSInteger max_number = 0;
- for (NSInteger i = 0; i<tempArray.count; i++) {
-
- XYChatRoomSeatsModel *model = tempArray[i];
- //取最大值和最大值的对应麦位
- NSInteger a = model.seatScore;
- if (a > max_number) {
- seatNo = model.seatNo;
- }
- max_number = a>max_number?a:max_number;
- }
- return seatNo;
- }
- - (int )getMicIndex:(NSString *)userId{
- for (XYChatRoomSeatsModel *seatInfo in self.seatsArray) {
- if ([userId isEqualToString:seatInfo.user.userId]) {
- return (int )seatInfo.seatNo;
- }
- }
- return -1;
- }
- //根据麦为获取用户id
- - (NSString *)getUserIdByMicIndex:(NSInteger)micIndex{
- XYChatRoomSeatsModel *seatInfo = self.seatsArray[micIndex];
- return seatInfo.user.userId;
- }
- - (NSMutableArray *)getLeftCacheUserArr:(NSString *)userIdStrs{
- for (XYPKProceedInfo *info in [XYChatRoomManager sharedInstance].chatRoomController.infoManager.pkUserLeftCacheArrs) {
- if ([info.userId isEqualToString:userIdStrs]) {
- return info.dataArrs;
- }
- }
- return nil;
- }
- - (NSMutableArray *)getRightCacheUserArr:(NSString *)userIdStrs{
- for (XYPKProceedInfo *info in [XYChatRoomManager sharedInstance].chatRoomController.infoManager.pkUserRightCacheArrs) {
- if ([info.userId isEqualToString:userIdStrs]) {
- return info.dataArrs;
- }
- }
- return nil;
- }
- ///获取用户信息并缓存
- //- (void)getUserInfo:(NSArray *)userIdArrs andUserStr:(NSString *)userStr result1:(void(^)(NSString *result1))result1{
- //
- // dispatch_group_t group = dispatch_group_create();
- // dispatch_queue_t queue = dispatch_queue_create("getuserinfo.main.data", DISPATCH_QUEUE_SERIAL);
- //
- // for (NSString *userId in userIdArrs) {
- // dispatch_group_enter(group);
- // dispatch_async(queue, ^{
- //
- // BOOL isHave = NO;
- // for (XYPKProceedInfo *info in [XYChatRoomManager sharedInstance].chatRoomController.infoManager.pkUserLeftCacheArrs) {
- // if ([info.userId isEqualToString:userId]) {
- // isHave = YES;
- // dispatch_group_leave(group);
- // }
- // }
- //
- // if (!isHave) {
- // [[XYUserAPIManager new] getSimpleInfoWithUserIds:userId successHandler:^(ZYLResponseModel *responseModel) {
- // NSDictionary *dict = responseModel.data[@"map"];
- // NSDictionary *userDict = dict[userId];
- // XYPKProceedInfo *uerInfo = [[XYPKProceedInfo alloc] init];
- // [uerInfo yy_modelSetWithDictionary:userDict];
- // [[XYChatRoomManager sharedInstance].chatRoomController.infoManager.pkUserLeftCacheArrs addObject:uerInfo];
- // dispatch_group_leave(group);
- //
- // } failureHandler:^(ZYLNetworkError *error) {
- // XYPKProceedInfo *uerInfo = [[XYPKProceedInfo alloc] init];
- // uerInfo.userId = @"0";
- // [[XYChatRoomManager sharedInstance].chatRoomController.infoManager.pkUserLeftCacheArrs addObject:uerInfo];
- // dispatch_group_leave(group);
- // }];
- // }
- //
- // });
- // }
- //
- // dispatch_group_notify(group, queue, ^{
- // dispatch_async(dispatch_get_main_queue(), ^{
- // result1(userStr);
- // });
- // });
- //
- //}
- /// 解析获取用户完整信息
- /// @param dataDict 消息数据
- /// @param result 1左方 2右方
- - (void)parsePkRank:(NSDictionary *)dataDict result:(void (^)(int))result{
- // NSString *type = dataDict[@"msg"][@"type"];
-
- // pk左阵营主要贡献者
- // if ([type isEqualToString:LEFT_CAMP_VIP]) {
- // if ([dataDict[@"msg"][@"leftCampScore"] integerValue] > 0) {
-
- // NSString *userIdStr = dataDict[@"msg"][@"leftCampVip"];
- // userIdStr = [userIdStr stringByReplacingOccurrencesOfString:@"null" withString:@"0"];
- // NSArray *userIdArrs = [userIdStr componentsSeparatedByString:@","];
- // NSString *tempUserIdStr = [NSString stringWithFormat:@"%@",userIdStr];
- //
- // [self getUserInfo:userIdArrs andUserStr:userIdStr result1:^(NSString *result1) {
- //
- // if (![result1 isEqualToString:tempUserIdStr]) { return; }
- //
- // [[XYChatRoomManager sharedInstance].chatRoomController.infoManager.pkLeftVips removeAllObjects];
- // int index = 1;
- // for (NSString *userId in userIdArrs) {
- // for (XYPKProceedInfo *info in [XYChatRoomManager sharedInstance].chatRoomController.infoManager.pkUserCacheArrs) {
- // if ([userId isEqualToString:info.userId]) {
- // XYPKProceedInfo *rankInfo = [[XYPKProceedInfo alloc] init];
- // rankInfo = info;
- // rankInfo.rankRole = 1;
- // rankInfo.rankIndex = index++;
- // [[XYChatRoomManager sharedInstance].chatRoomController.infoManager.pkLeftVips addObject:rankInfo];
- // break;
- // }
- // }
- // }
- // result(1);
- // }];
-
-
- NSDictionary *leftUserDicts = [BaseMethod objectWithJsonString:dataDict[@"msg"][@"leftCampVipUsers"]];
- if (leftUserDicts.allValues) {
- [[XYChatRoomManager sharedInstance].chatRoomController.infoManager.pkLeftVips removeAllObjects];
-
- NSMutableArray *arr = [[NSMutableArray alloc] init];
- for (NSDictionary *dict in leftUserDicts.allValues) {
- XYPKProceedInfo *info = [[XYPKProceedInfo alloc] init];
- [info yy_modelSetWithDictionary:dict];
- info.rankRole = 1;
- [arr addObject:info];
- }
-
- NSArray *sortedScoreArray = [arr sortedArrayUsingComparator:^NSComparisonResult(XYPKProceedInfo *obj1, XYPKProceedInfo *obj2) {
- if (obj1.rank < obj2.rank) {
- return NSOrderedAscending;
- }else {
- return NSOrderedDescending;
- }
- }];
- int index = 1;
- for (XYPKProceedInfo *info in sortedScoreArray) {
- info.rankIndex = index++;
- [[XYChatRoomManager sharedInstance].chatRoomController.infoManager.pkLeftVips addObject:info];
- }
-
- result(1);
-
- }
- // else{//没有头像url时接口获取
- // NSString *leftUserIdStr = dataDict[@"msg"][@"leftCampVip"];
- // leftUserIdStr = [leftUserIdStr stringByReplacingOccurrencesOfString:@"null" withString:@"0"];
- // //NSArray *userIds = [userIdStr componentsSeparatedByString:@","];
- // if (leftUserIdStr.length) {
- //
- // NSMutableArray *userIdArrs = [self getLeftCacheUserArr:leftUserIdStr];
- // if (userIdArrs.count) {
- // [[XYChatRoomManager sharedInstance].chatRoomController.infoManager.pkLeftVips removeAllObjects];
- // for (XYPKProceedInfo *info in userIdArrs) {
- // XYPKProceedInfo *newInfo = [[XYPKProceedInfo alloc] init];
- // newInfo = info;
- // newInfo.rankRole = 1;
- // [[XYChatRoomManager sharedInstance].chatRoomController.infoManager.pkLeftVips addObject:newInfo];
- // }
- // result(1);
- //
- // }else{
- // [[XYUserAPIManager new] getSimpleInfoWithUserIds:leftUserIdStr successHandler:^(ZYLResponseModel *responseModel) {
- // NSDictionary *dataDict = responseModel.data[@"map"];
- // XYPKProceedInfo *cache = [[XYPKProceedInfo alloc] init];
- // cache.userId = leftUserIdStr;
- // [[XYChatRoomManager sharedInstance].chatRoomController.infoManager.pkUserLeftCacheArrs addObject:cache];
- //
- // [[XYChatRoomManager sharedInstance].chatRoomController.infoManager.pkLeftVips removeAllObjects];
- // int index = 1;
- // for (NSDictionary *dict in dataDict.allValues) {
- // XYPKProceedInfo *rankInfo = [[XYPKProceedInfo alloc] init];
- // [rankInfo yy_modelSetWithDictionary:dict];
- // rankInfo.rankRole = 1;
- // rankInfo.rankIndex = index++;
- // [[XYChatRoomManager sharedInstance].chatRoomController.infoManager.pkLeftVips addObject:rankInfo];
- //
- // [cache.dataArrs addObject:rankInfo];
- // }
- // result(1);
- //
- // } failureHandler:^(ZYLNetworkError *error) {
- // }];
- // }
- // }
- //
- // }
-
- // pk右阵营主要贡献者
- // if ([type isEqualToString:RIGHT_CAMP_VIP]) {
- // if ([dataDict[@"msg"][@"rightCampScore"] integerValue] > 0) {
-
- // NSString *userIdStr = dataDict[@"msg"][@"rightCampVip"];
- // userIdStr = [userIdStr stringByReplacingOccurrencesOfString:@"null" withString:@"0"];
- // NSArray *userIdArrs = [userIdStr componentsSeparatedByString:@","];
- // NSString *tempUserIdStr = [NSString stringWithFormat:@"%@",userIdStr];
- //
- // [self getUserInfo:userIdArrs andUserStr:userIdStr result1:^(NSString *result1) {
- // if (![result1 isEqualToString:tempUserIdStr]) { return; }
- //
- // [[XYChatRoomManager sharedInstance].chatRoomController.infoManager.pkRightVips removeAllObjects];
- // int index = 1;
- // for (NSString *userId in userIdArrs) {
- // for (XYPKProceedInfo *info in [XYChatRoomManager sharedInstance].chatRoomController.infoManager.pkUserCacheArrs) {
- // if ([userId isEqualToString:info.userId]) {
- // XYPKProceedInfo *rankInfo = [[XYPKProceedInfo alloc] init];
- // rankInfo = info;
- // rankInfo.rankRole = 1;
- // rankInfo.rankIndex = index++;
- // [[XYChatRoomManager sharedInstance].chatRoomController.infoManager.pkRightVips addObject:rankInfo];
- // break;
- // }
- // }
- // }
- // result(1);
- // }];
-
- NSDictionary *rightUserDicts = [BaseMethod objectWithJsonString:dataDict[@"msg"][@"rightCampVipUsers"]];
- if (rightUserDicts.allValues) {
- [[XYChatRoomManager sharedInstance].chatRoomController.infoManager.pkRightVips removeAllObjects];
-
- NSMutableArray *arr = [[NSMutableArray alloc] init];
- for (NSDictionary *dict in rightUserDicts.allValues) {
- XYPKProceedInfo *info = [[XYPKProceedInfo alloc] init];
- [info yy_modelSetWithDictionary:dict];
- info.rankRole = 2;
- [arr addObject:info];
- }
-
- NSArray *sortedScoreArray = [arr sortedArrayUsingComparator:^NSComparisonResult(XYPKProceedInfo *obj1, XYPKProceedInfo *obj2) {
- if (obj1.rank < obj2.rank) {
- return NSOrderedAscending;
- }else {
- return NSOrderedDescending;
- }
- }];
- int index = 1;
- for (XYPKProceedInfo *info in sortedScoreArray) {
- info.rankIndex = index++;
- [[XYChatRoomManager sharedInstance].chatRoomController.infoManager.pkRightVips addObject:info];
- }
-
- result(2);
-
- }
- // else{//没有头像url时接口获取
- // NSString *rightUserIdStr = dataDict[@"msg"][@"rightCampVip"];
- // rightUserIdStr = [rightUserIdStr stringByReplacingOccurrencesOfString:@"null" withString:@"0"];
- // if (rightUserIdStr.length) {
- // NSMutableArray *userIdArrs = [self getRightCacheUserArr:rightUserIdStr];
- // if (userIdArrs.count) {
- // [[XYChatRoomManager sharedInstance].chatRoomController.infoManager.pkRightVips removeAllObjects];
- // for (XYPKProceedInfo *info in userIdArrs) {
- // XYPKProceedInfo *newInfo = [[XYPKProceedInfo alloc] init];
- // newInfo = info;
- // newInfo.rankRole = 2;
- // [[XYChatRoomManager sharedInstance].chatRoomController.infoManager.pkRightVips addObject:newInfo];
- // }
- // result(2);
- //
- // }else{
- // [[XYUserAPIManager new] getSimpleInfoWithUserIds:rightUserIdStr successHandler:^(ZYLResponseModel *responseModel) {
- // NSDictionary *dataDict = responseModel.data[@"map"];
- // XYPKProceedInfo *cache = [[XYPKProceedInfo alloc] init];
- // cache.userId = rightUserIdStr;
- // [[XYChatRoomManager sharedInstance].chatRoomController.infoManager.pkUserRightCacheArrs addObject:cache];
- //
- // [[XYChatRoomManager sharedInstance].chatRoomController.infoManager.pkRightVips removeAllObjects];
- // int index = 1;
- // for (NSDictionary *dict in dataDict.allValues) {
- // XYPKProceedInfo *rankInfo = [[XYPKProceedInfo alloc] init];
- // [rankInfo yy_modelSetWithDictionary:dict];
- // rankInfo.rankRole = 2;
- // rankInfo.rankIndex = index++;
- // [[XYChatRoomManager sharedInstance].chatRoomController.infoManager.pkRightVips addObject:rankInfo];
- //
- // [cache.dataArrs addObject:rankInfo];
- // }
- // result(2);
- // } failureHandler:^(ZYLNetworkError *error) {
- // }];
- // }
- //
- // }
- // }
-
- }
- #pragma mark — Get
- - (NSMutableArray *)menuItemModelArray {
- if (!_menuItemModelArray) {
- _menuItemModelArray = [NSMutableArray array];
- }
- return _menuItemModelArray;
- }
- - (NSMutableArray *)seatUserArray {
- if (!_seatUserArray) {
- _seatUserArray = [NSMutableArray array];
- }
- return _seatUserArray;
- }
- - (NSMutableArray *)diamondRankArray {
- if (!_diamondRankArray) {
- _diamondRankArray = [NSMutableArray array];
- }
- return _diamondRankArray;
- }
- - (NSMutableArray <XYLiveRoomActivityInfo *>*)allActivityArrs {
- if (!_allActivityArrs) {
- _allActivityArrs = [NSMutableArray array];
- }
- return _allActivityArrs;
- }
- - (NSMutableArray <XYPKProceedInfo *>*)pkLeftVips {
- if (!_pkLeftVips) {
- _pkLeftVips = [NSMutableArray array];
- }
- return _pkLeftVips;
- }
- - (NSMutableArray <XYPKProceedInfo *>*)pkRightVips {
- if (!_pkRightVips) {
- _pkRightVips = [NSMutableArray array];
- }
- return _pkRightVips;
- }
- - (NSMutableArray <XYPKProceedInfo *>*)pkUserLeftCacheArrs {
- if (!_pkUserLeftCacheArrs) {
- _pkUserLeftCacheArrs = [NSMutableArray array];
- }
- return _pkUserLeftCacheArrs;
- }
- - (NSMutableArray <XYPKProceedInfo *>*)pkUserRightCacheArrs {
- if (!_pkUserRightCacheArrs) {
- _pkUserRightCacheArrs = [NSMutableArray array];
- }
- return _pkUserRightCacheArrs;
- }
- - (NSMutableArray <XYChatRoomAuctionRankItemModel *>*)auctionRankArray {
- if (!_auctionRankArray) {
- _auctionRankArray = [NSMutableArray array];
- }
- return _auctionRankArray;
- }
- @end
- @implementation XYChatRoomBattleRoomInModel
- @end
- @implementation XYChatRoomKFBattleRoomInModel
- @end
- @implementation XYChatRoomAuctionInfoModel
- @end
|