修改部分方法名
This commit is contained in:
@@ -190,7 +190,6 @@
|
||||
8C9C84902B0D439800A601BC /* YMRoomMessageFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C9C848F2B0D439800A601BC /* YMRoomMessageFilter.m */; };
|
||||
8C9C84942B0D65C300A601BC /* YMRoomAnimationHitView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C9C84932B0D65C300A601BC /* YMRoomAnimationHitView.m */; };
|
||||
8C9C84972B0D65E200A601BC /* YMRoomAnimationView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C9C84962B0D65E200A601BC /* YMRoomAnimationView.m */; };
|
||||
8C9C849A2B0D675600A601BC /* YMRoomGiftAnimationParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C9C84992B0D675600A601BC /* YMRoomGiftAnimationParser.m */; };
|
||||
8C9C849E2B0D6A5C00A601BC /* YMGiftStorage.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C9C849D2B0D6A5C00A601BC /* YMGiftStorage.m */; };
|
||||
8C9C84AD2B0D9AB900A601BC /* CHRoomMessageHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C9C84AC2B0D9AB900A601BC /* CHRoomMessageHeaderView.m */; };
|
||||
8C9C84B12B0DEAE100A601BC /* YMIButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C9C84B02B0DEAE100A601BC /* YMIButton.m */; };
|
||||
@@ -592,8 +591,6 @@
|
||||
8C9C84932B0D65C300A601BC /* YMRoomAnimationHitView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = YMRoomAnimationHitView.m; sourceTree = "<group>"; };
|
||||
8C9C84952B0D65E200A601BC /* YMRoomAnimationView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = YMRoomAnimationView.h; sourceTree = "<group>"; };
|
||||
8C9C84962B0D65E200A601BC /* YMRoomAnimationView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = YMRoomAnimationView.m; sourceTree = "<group>"; };
|
||||
8C9C84982B0D675600A601BC /* YMRoomGiftAnimationParser.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = YMRoomGiftAnimationParser.h; sourceTree = "<group>"; };
|
||||
8C9C84992B0D675600A601BC /* YMRoomGiftAnimationParser.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = YMRoomGiftAnimationParser.m; sourceTree = "<group>"; };
|
||||
8C9C849C2B0D6A5C00A601BC /* YMGiftStorage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = YMGiftStorage.h; sourceTree = "<group>"; };
|
||||
8C9C849D2B0D6A5C00A601BC /* YMGiftStorage.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = YMGiftStorage.m; sourceTree = "<group>"; };
|
||||
8C9C849F2B0D6BCF00A601BC /* CHRoomAnimationProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CHRoomAnimationProtocol.h; sourceTree = "<group>"; };
|
||||
@@ -2152,8 +2149,6 @@
|
||||
8C9C84932B0D65C300A601BC /* YMRoomAnimationHitView.m */,
|
||||
8C9C84952B0D65E200A601BC /* YMRoomAnimationView.h */,
|
||||
8C9C84962B0D65E200A601BC /* YMRoomAnimationView.m */,
|
||||
8C9C84982B0D675600A601BC /* YMRoomGiftAnimationParser.h */,
|
||||
8C9C84992B0D675600A601BC /* YMRoomGiftAnimationParser.m */,
|
||||
8CAB96F32B1AB15200ED8639 /* CHRoomAnimationGroup.h */,
|
||||
8CAB96F42B1AB15200ED8639 /* CHRoomAnimationGroup.m */,
|
||||
);
|
||||
@@ -2457,7 +2452,6 @@
|
||||
8C9C845A2B0C697A00A601BC /* ClientDataModel.m in Sources */,
|
||||
8C9C84972B0D65E200A601BC /* YMRoomAnimationView.m in Sources */,
|
||||
8C9C82D52B0C695600A601BC /* YMHUDTool.m in Sources */,
|
||||
8C9C849A2B0D675600A601BC /* YMRoomGiftAnimationParser.m in Sources */,
|
||||
8C9C82202B0C694900A601BC /* AppDelegate+ThirdConfig.m in Sources */,
|
||||
8C9C84202B0C697A00A601BC /* MicroView.m in Sources */,
|
||||
8C9C84522B0C697A00A601BC /* ThirdUserInfo.m in Sources */,
|
||||
|
@@ -83,7 +83,7 @@
|
||||
self.emojiArrays = @[@"mew_room_emoji_deyi",@"mew_room_emoji_happy",@"mew_room_emoji_sex",@"mew_room_emoji_suprise"];
|
||||
self.playEmojiArrays = [NSMutableArray array];
|
||||
self.isPlayEmojiAnimation = NO;
|
||||
[self.presenter initEnterRoom:self.roomUid user:[AccountInfoStorage instance].getUid];
|
||||
[self.presenter initEnterCurrentRoom:self.roomUid user:[AccountInfoStorage instance].getUid];
|
||||
|
||||
//监听云信消息
|
||||
[[NIMSDK sharedSDK].chatroomManager addDelegate:self];
|
||||
@@ -132,7 +132,7 @@
|
||||
{
|
||||
NSMutableDictionary *lastRoomInfoDic = [NSMutableDictionary dictionaryWithDictionary:[self.roomInfo model2dictionary]];
|
||||
[lastRoomInfoDic addEntriesFromDictionary: ((NSString *)data[@"roomInfo"]).toJSONObject];
|
||||
[self.roomStageView onRoomUpdate];
|
||||
[self.roomStageView onRoomInfoUpdate];
|
||||
// [self.roomMessageView onRoomUpdate];
|
||||
}
|
||||
break;
|
||||
@@ -238,9 +238,9 @@
|
||||
/// 退出房间
|
||||
- (void)exitCurrentRoom {
|
||||
//其他模式下
|
||||
[self.roomAnimationView resumeTimer];
|
||||
[self.roomAnimationView resumeAnimationTimer];
|
||||
// 默认模式下
|
||||
[self.presenter exitNIMRoom:[NSString stringWithFormat:@"%ld", self.roomInfo.roomId]];
|
||||
[self.presenter exitNIMCurrentRoom:[NSString stringWithFormat:@"%ld", self.roomInfo.roomId]];
|
||||
[[RtcManager instance] exitRoom];
|
||||
[self.presenter reportUserOutRoom:[NSString stringWithFormat:@"%ld",self.roomInfo.uid]];
|
||||
[self dismissViewControllerAnimated:YES completion:nil];
|
||||
@@ -266,42 +266,42 @@
|
||||
}
|
||||
#pragma mark - YMRoomProtocol
|
||||
/// 进入房间成功
|
||||
- (void)initEnterRoomSuccess:(RoomInfoModel *)roomInfo user:(UserInfoModel *)userInfo {
|
||||
- (void)initEnterCurrentRoomSuccess:(RoomInfoModel *)roomInfo user:(UserInfoModel *)userInfo {
|
||||
[YMHUDTool hideHUDInView:self.navigationController.view];
|
||||
self.userInfo = userInfo;
|
||||
self.roomInfo = roomInfo;
|
||||
if (roomInfo.valid) {
|
||||
[self.roomHeaderView onRoomEntered];
|
||||
[self.presenter enterNIMRoom:[NSString stringWithFormat:@"%ld",self.roomInfo.roomId] user:self.userInfo];
|
||||
[self.presenter enterNIMCurrentRoom:[NSString stringWithFormat:@"%ld",self.roomInfo.roomId] user:self.userInfo];
|
||||
} else {
|
||||
if ([self.roomUid isEqualToString:[NSString stringWithFormat:@"%ld", userInfo.uid]]) {
|
||||
//用户进入自己的房间
|
||||
if (roomInfo.roomId > 0) {
|
||||
[self.presenter openRoom:roomInfo.title type:roomInfo.type roomPwd:@"" roomDesc:roomInfo.roomDesc backPic:@"" mgId:@""];
|
||||
[self.presenter openUserRoom:roomInfo.title type:roomInfo.type roomPwd:@"" roomDesc:roomInfo.roomDesc backPic:@"" mgId:@""];
|
||||
|
||||
} else {
|
||||
NSString *title = [NSString stringWithFormat:@"%@的房间",userInfo.nick];
|
||||
RoomType type = RoomType_Game;
|
||||
|
||||
[self.presenter openRoom:title type:type roomPwd:@"" roomDesc:@"" backPic:@"" mgId:@""];
|
||||
[self.presenter openUserRoom:title type:type roomPwd:@"" roomDesc:@"" backPic:@"" mgId:@""];
|
||||
}
|
||||
} else {
|
||||
[self showSuccessToast:@"房主已下线"];
|
||||
[self enterRoomFail:-1];
|
||||
[self enterCurrentRoomFail:-1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 开房成功
|
||||
- (void)openRoomSuccess:(RoomInfoModel *)roomInfo {
|
||||
- (void)openCurrentRoomSuccess:(RoomInfoModel *)roomInfo {
|
||||
self.roomInfo = roomInfo;
|
||||
[self.roomHeaderView onRoomEntered];
|
||||
[self.presenter enterNIMRoom:[NSString stringWithFormat:@"%ld", self.roomInfo.roomId] user:self.userInfo];
|
||||
[self.presenter enterNIMCurrentRoom:[NSString stringWithFormat:@"%ld", self.roomInfo.roomId] user:self.userInfo];
|
||||
|
||||
}
|
||||
|
||||
// IM进房成功
|
||||
- (void)enterRoomSuccess:(NIMChatroom *)chatRoom {
|
||||
- (void)enterCurrentRoomSuccess:(NIMChatroom *)chatRoom {
|
||||
[YMHUDTool hideHUDInView:self.navigationController.view];
|
||||
[self.roomStageView onRoomEntered];
|
||||
if (self.roomInfo != nil) {
|
||||
@@ -313,7 +313,7 @@
|
||||
}
|
||||
|
||||
// 进房失败
|
||||
- (void)enterRoomFail:(NSInteger)code {
|
||||
- (void)enterCurrentRoomFail:(NSInteger)code {
|
||||
[YMHUDTool hideHUDInView:self.navigationController.view];
|
||||
[self hideHUD];
|
||||
if (code == 13003) {
|
||||
|
@@ -17,17 +17,17 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// - Parameters:
|
||||
/// - roomUid: 房间Uid
|
||||
/// - uid: 用户Uid
|
||||
- (void)initEnterRoom:(NSString *)roomUid user:(NSString *)uid;
|
||||
- (void)initEnterCurrentRoom:(NSString *)roomUid user:(NSString *)uid;
|
||||
|
||||
/// 云信进房
|
||||
/// - Parameters:
|
||||
/// - roomUid: 房间Uid
|
||||
/// - userInfo: 用户Uid
|
||||
- (void)enterNIMRoom:(NSString *)roomUid user:(UserInfoModel *)userInfo;
|
||||
- (void)enterNIMCurrentRoom:(NSString *)roomUid user:(UserInfoModel *)userInfo;
|
||||
|
||||
/// 云信退房
|
||||
/// - Parameter roomUid: 房间Uid
|
||||
- (void)exitNIMRoom:(NSString *)roomUid;
|
||||
- (void)exitNIMCurrentRoom:(NSString *)roomUid;
|
||||
|
||||
/// 开启用户自己的房间
|
||||
/// @param title 房间标题
|
||||
@@ -36,7 +36,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// @param roomDesc 房间介绍
|
||||
/// @param backPic 房间背景
|
||||
/// @param mgId 小游戏的id
|
||||
- (void)openRoom:(NSString *)title
|
||||
- (void)openUserRoom:(NSString *)title
|
||||
type:(RoomType)type
|
||||
roomPwd:(NSString *)roomPwd
|
||||
roomDesc:(NSString *)roomDesc
|
||||
|
@@ -24,16 +24,16 @@
|
||||
@implementation YMRoomPresenter
|
||||
|
||||
#pragma mark - Public Method
|
||||
- (void)initEnterRoom:(NSString *)roomUid user:(NSString *)uid {
|
||||
- (void)initEnterCurrentRoom:(NSString *)roomUid user:(NSString *)uid {
|
||||
RACSubject *room = [RACSubject subject];
|
||||
RACSubject *user = [RACSubject subject];
|
||||
|
||||
/// RAC监听用户和房间值的改变
|
||||
[[RACSignal combineLatest:@[room, user] reduce:^id(RoomInfoModel *room, UserInfoModel *user){
|
||||
[[self getView] initEnterRoomSuccess:room user:user];
|
||||
[[self getView] initEnterCurrentRoomSuccess:room user:user];
|
||||
return nil;
|
||||
}] subscribeError:^(NSError * _Nullable error) {
|
||||
[[self getView] enterRoomFail:error.code];
|
||||
[[self getView] enterCurrentRoomFail:error.code];
|
||||
}];
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
|
||||
}
|
||||
/// 云信进房
|
||||
- (void)enterNIMRoom:(NSString *)roomUid user:(UserInfoModel *)userInfo {
|
||||
- (void)enterNIMCurrentRoom:(NSString *)roomUid user:(UserInfoModel *)userInfo {
|
||||
NIMChatroomEnterRequest *request = [[NIMChatroomEnterRequest alloc] init];
|
||||
request.roomId = roomUid;
|
||||
YMMessageRemoteExtModel *extModel = [[YMMessageRemoteExtModel alloc] init];
|
||||
@@ -69,15 +69,15 @@
|
||||
/// 云信进房
|
||||
[[NIMSDK sharedSDK].chatroomManager enterChatroom:request completion:^(NSError * _Nullable error, NIMChatroom * _Nullable chatroom, NIMChatroomMember * _Nullable me) {
|
||||
if (error) {
|
||||
[[self getView] enterRoomFail:error.code];
|
||||
[[self getView] enterCurrentRoomFail:error.code];
|
||||
} else {
|
||||
[[self getView] enterRoomSuccess:chatroom];
|
||||
[[self getView] enterCurrentRoomSuccess:chatroom];
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
/// 云信退房
|
||||
- (void)exitNIMRoom:(NSString *)roomUid {
|
||||
- (void)exitNIMCurrentRoom:(NSString *)roomUid {
|
||||
[[NIMSDK sharedSDK].chatroomManager exitChatroom:roomUid completion:nil];
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
/// @param roomDesc 房间介绍
|
||||
/// @param backPic 房间背景
|
||||
/// @param mgId 小游戏的id
|
||||
- (void)openRoom:(NSString *)title
|
||||
- (void)openUserRoom:(NSString *)title
|
||||
type:(RoomType)type
|
||||
roomPwd:(NSString *)roomPwd
|
||||
roomDesc:(NSString *)roomDesc
|
||||
@@ -119,9 +119,9 @@
|
||||
|
||||
[Api openRoom:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
RoomInfoModel *roomInfo = [RoomInfoModel modelWithJSON:data.data];
|
||||
[[self getView] openRoomSuccess:roomInfo];
|
||||
[[self getView] openCurrentRoomSuccess:roomInfo];
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
[[self getView] enterRoomFail:code];
|
||||
[[self getView] enterCurrentRoomFail:code];
|
||||
}] title:title type:type roomPwd:roomPwd roomDesc:roomDesc backPic:backPic uid:uid ticket:ticket mgId:mgId];
|
||||
}
|
||||
|
||||
|
@@ -12,13 +12,13 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol YMRoomProtocol <NSObject>
|
||||
/// 进入房间成功
|
||||
- (void)initEnterRoomSuccess:(RoomInfoModel *)roomInfo user:(UserInfoModel *)userInfo;
|
||||
- (void)initEnterCurrentRoomSuccess:(RoomInfoModel *)roomInfo user:(UserInfoModel *)userInfo;
|
||||
///开启房间成功
|
||||
- (void)openRoomSuccess:(RoomInfoModel *)roomInfo;
|
||||
- (void)openCurrentRoomSuccess:(RoomInfoModel *)roomInfo;
|
||||
///进入房间成功
|
||||
- (void)enterRoomSuccess:(NIMChatroom *)chatRoom;
|
||||
- (void)enterCurrentRoomSuccess:(NIMChatroom *)chatRoom;
|
||||
///进入房间失败(当前获取用户信息、获取房间信息、开启房间、进入云信房间失败,均会导致进房失败)
|
||||
- (void)enterRoomFail:(NSInteger)code;
|
||||
- (void)enterCurrentRoomFail:(NSInteger)code;
|
||||
///获取当前房间的信息,个播房
|
||||
//- (void)getCurrentRoomInfoSuccess:(RoomInfoModel *_Nullable)roomInfo;
|
||||
|
||||
|
@@ -13,7 +13,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface YMRoomAnimationView : YMRoomAnimationHitView<CHRoomGuestDelegate>
|
||||
|
||||
-(void)resumeTimer;
|
||||
-(void)resumeAnimationTimer;
|
||||
- (instancetype)initWithDelegate:(id<CHRoomHostDelegate>)delegate;
|
||||
|
||||
@end
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#import "YMRoomAnimationView.h"
|
||||
#import "YMRoomAnimationHitView.h"
|
||||
#import "YMRoomGiftAnimationParser.h"
|
||||
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
#import <SVGA.h>
|
||||
@@ -53,7 +53,7 @@
|
||||
[[NIMSDK sharedSDK].broadcastManager removeDelegate:self];
|
||||
|
||||
}
|
||||
-(void)resumeTimer{
|
||||
-(void)resumeAnimationTimer{
|
||||
if(self.giftEffectTimer != nil){
|
||||
dispatch_cancel(self.giftEffectTimer);
|
||||
self.giftEffectTimer = nil;
|
||||
|
@@ -1,18 +0,0 @@
|
||||
//
|
||||
// YMRoomGiftAnimationParser.h
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/21.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface YMRoomGiftAnimationParser : NSObject
|
||||
- (void)parseWithURL:(nonnull NSString *)URL
|
||||
completionBlock:(void ( ^ _Nonnull )(NSString * _Nullable videoUrl))completionBlock
|
||||
failureBlock:(void ( ^ _Nullable)(NSError * _Nullable error))failureBlock;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,97 +0,0 @@
|
||||
//
|
||||
// YMRoomGiftAnimationParser.m
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/21.
|
||||
//
|
||||
|
||||
#import "YMRoomGiftAnimationParser.h"
|
||||
#import <AFNetworking/AFNetworking.h>
|
||||
#import <SSZipArchive/SSZipArchive.h>
|
||||
#import <CommonCrypto/CommonDigest.h>
|
||||
#import "GCDHelper.h"
|
||||
|
||||
@implementation YMRoomGiftAnimationParser
|
||||
|
||||
static NSOperationQueue *parseQueue;
|
||||
|
||||
+ (void)load {
|
||||
parseQueue = [NSOperationQueue new];
|
||||
parseQueue.maxConcurrentOperationCount = 8;
|
||||
}
|
||||
|
||||
- (void)parseWithURL:(nonnull NSString *)URL
|
||||
completionBlock:(void ( ^ _Nonnull )(NSString * _Nullable videoUrl))completionBlock
|
||||
failureBlock:(void ( ^ _Nullable)(NSError * _Nullable error))failureBlock {
|
||||
[self parseWithURLRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:URL] cachePolicy:NSURLRequestReturnCacheDataElseLoad timeoutInterval:20.0]
|
||||
completionBlock:completionBlock
|
||||
failureBlock:failureBlock];
|
||||
}
|
||||
|
||||
- (void)parseWithURLRequest:(NSURLRequest *)URLRequest completionBlock:(void (^)(NSString * _Nullable))completionBlock failureBlock:(void (^)(NSError * _Nullable))failureBlock {
|
||||
if (URLRequest.URL == nil) {
|
||||
if (failureBlock) {
|
||||
[[NSOperationQueue mainQueue] addOperationWithBlock:^{
|
||||
failureBlock([NSError errorWithDomain:@"vapParser" code:411 userInfo:@{NSLocalizedDescriptionKey: @"URL cannot be nil."}]);
|
||||
}];
|
||||
}
|
||||
return;
|
||||
}
|
||||
if ([[NSFileManager defaultManager] fileExistsAtPath:[self cacheDirectory:[self cacheKey:URLRequest.URL]]]) {
|
||||
if (completionBlock) {
|
||||
[[NSOperationQueue mainQueue] addOperationWithBlock:^{
|
||||
completionBlock([self cacheDirectory:[self cacheKey:URLRequest.URL]]);
|
||||
}];
|
||||
}
|
||||
return;
|
||||
}
|
||||
[[[AFHTTPSessionManager manager] downloadTaskWithRequest:URLRequest progress:^(NSProgress * _Nonnull downloadProgress) {
|
||||
} destination:^NSURL * _Nonnull(NSURL * _Nonnull targetPath, NSURLResponse * _Nonnull response) {
|
||||
return [NSURL fileURLWithPath:[self cacheDirectory:[self cacheKey:URLRequest.URL]]];
|
||||
} completionHandler:^(NSURLResponse * _Nonnull response, NSURL * _Nullable filePath, NSError * _Nullable error) {
|
||||
if (!error) {
|
||||
[[NSOperationQueue mainQueue] addOperationWithBlock:^{
|
||||
NSString *str;
|
||||
if ([filePath.absoluteString hasPrefix:@"file:///"]) {
|
||||
str = [filePath.absoluteString stringByReplacingOccurrencesOfString:@"file://" withString:@""];
|
||||
} else {
|
||||
str = filePath.absoluteString;
|
||||
}
|
||||
completionBlock(str);
|
||||
}];
|
||||
} else {
|
||||
[[NSOperationQueue mainQueue] addOperationWithBlock:^{
|
||||
completionBlock(nil);
|
||||
}];
|
||||
}
|
||||
}] resume];
|
||||
}
|
||||
|
||||
- (void)clearCache:(nonnull NSString *)cacheKey {
|
||||
NSString *cacheDir = [self cacheDirectory:cacheKey];
|
||||
[[NSFileManager defaultManager] removeItemAtPath:cacheDir error:NULL];
|
||||
}
|
||||
|
||||
- (nonnull NSString *)cacheKey:(NSURL *)URL {
|
||||
return [self MD5String:URL.absoluteString];
|
||||
}
|
||||
|
||||
- (nullable NSString *)cacheDirectory:(NSString *)cacheKey {
|
||||
NSString *cacheDir = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject];
|
||||
return [cacheDir stringByAppendingFormat:@"/%@.mp4", cacheKey];
|
||||
}
|
||||
|
||||
- (NSString *)MD5String:(NSString *)str {
|
||||
const char *cstr = [str UTF8String];
|
||||
unsigned char result[16];
|
||||
CC_MD5(cstr, (CC_LONG)strlen(cstr), result);
|
||||
return [NSString stringWithFormat:
|
||||
@"%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X",
|
||||
result[0], result[1], result[2], result[3],
|
||||
result[4], result[5], result[6], result[7],
|
||||
result[8], result[9], result[10], result[11],
|
||||
result[12], result[13], result[14], result[15]
|
||||
];
|
||||
}
|
||||
|
||||
@end
|
@@ -25,8 +25,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@optional
|
||||
|
||||
- (void)onRoomUpdate;
|
||||
- (void)onUserUpdate;
|
||||
- (void)onRoomInfoUpdate;
|
||||
- (void)onUserInfoUpdate;
|
||||
- (void)onRoomEntered;
|
||||
|
||||
/// NIM 事件监听
|
||||
|
@@ -145,7 +145,7 @@
|
||||
return self.micQueue;
|
||||
}
|
||||
|
||||
- (void)onRoomUpdate {
|
||||
- (void)onRoomInfoUpdate {
|
||||
// self.isMiniEnter = NO;
|
||||
RoomInfoModel * roomInfo = self.hostDelegate.getRoomInformation;
|
||||
// for (int i = 0; i < self.countOfMircoView; i++) {
|
||||
@@ -362,12 +362,6 @@
|
||||
return;
|
||||
}
|
||||
|
||||
if (roomInfo.leaveMode && roomInfo.uid == [AccountInfoStorage instance].getUid.integerValue) {
|
||||
[YMHUDTool showErrorWithMessage:@"请先关闭离开模式"];
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// 2. 空麦位,上麦逻辑
|
||||
NIMChatroomMembersByIdsRequest *request = [[NIMChatroomMembersByIdsRequest alloc]init];
|
||||
request.roomId = roomId;
|
||||
@@ -394,9 +388,6 @@
|
||||
if (isFromDownMic) {
|
||||
self.isUpingMic = NO;
|
||||
}
|
||||
if (error) {
|
||||
|
||||
}
|
||||
}];
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user