Compare commits

...

3 Commits

Author SHA1 Message Date
liyuhua
52e7d4ff7e 修复bug 2023-11-30 16:41:28 +08:00
liyuhua
566d8a3672 房间踢人逻辑优化 2023-11-28 16:50:45 +08:00
liyuhua
8dffff8492 修复贵族页无法充值钻石bug 2023-11-28 11:48:00 +08:00
19 changed files with 107 additions and 98 deletions

View File

@@ -12197,7 +12197,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 20.20.2;
MARKETING_VERSION = 20.20.3;
PRODUCT_BUNDLE_IDENTIFIER = com.peko.enterprise.ios;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -12232,7 +12232,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 20.20.2;
MARKETING_VERSION = 20.20.3;
PRODUCT_BUNDLE_IDENTIFIER = com.peko.enterprise.ios;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";

View File

@@ -31,7 +31,7 @@
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"

View File

@@ -49,7 +49,7 @@ isPhoneXSeries = [[UIApplication sharedApplication] delegate].window.safeAreaIns
///内置版本号
#define PI_App_Version @"2.3.0"
#define PI_App_Version @"2.3.1"
///渠道
#define PI_App_Source @"appstore"
//#define PI_App_Source @"pi_tf"

View File

@@ -201,6 +201,7 @@
[TTPopup alertWithConfig:config showBorder:NO confirmHandler:^{
XPIAPRechargeViewController * webVC =[[XPIAPRechargeViewController alloc] init];
webVC.type = @"4";
[self.navigationController pushViewController:webVC animated:YES];
} cancelHandler:^{

View File

@@ -364,16 +364,18 @@
///
- (void)rechargeNewProcessStatus:(StoreConditionResult)status {
if (status == StoreConditionResultPay || status == StoreConditionResultStart || status == StoreConditionResultVerifiedServer) {
}else if (status == StoreConditionResultUnowned) {
[XNDJTDDLoadingTool hideHUDInView:kWindow];
[self showErrorToast:YMLocalizedString(@"XPIAPRechargeViewController1")];
}else{
[XNDJTDDLoadingTool hideHUDInView:kWindow];
[self showErrorToast:YMLocalizedString(@"XPIAPRechargeViewController0")];
}
dispatch_async(dispatch_get_main_queue(), ^{
if (status == StoreConditionResultPay || status == StoreConditionResultStart || status == StoreConditionResultVerifiedServer) {
}else if (status == StoreConditionResultUnowned) {
[XNDJTDDLoadingTool hideHUDInView:kWindow];
[self showErrorToast:YMLocalizedString(@"XPIAPRechargeViewController1")];
}else{
[XNDJTDDLoadingTool hideHUDInView:kWindow];
[self showErrorToast:YMLocalizedString(@"XPIAPRechargeViewController0")];
}
});
}
///id

View File

@@ -223,6 +223,10 @@ NS_ASSUME_NONNULL_BEGIN
/// @param completion 完成
/// @param roomUid 房间id
+(void)getUnlockRoomAlbumPhotoList:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid;
///获取踢人列表
/// @param completion 完成
/// @param roomUid 房间id
+(void)getKickUserList:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid;
@end
NS_ASSUME_NONNULL_END

View File

@@ -310,4 +310,11 @@
+(void)getUnlockRoomAlbumPhotoList:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid{
[self makeRequest:@"roomAlbum/listUnlockPhoto" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__,roomUid,nil];
}
///
/// @param completion
/// @param roomUid id
+(void)getKickUserList:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid{
[self makeRequest:@"room/kick/" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__,roomUid,nil];
}
@end

View File

@@ -26,11 +26,11 @@ NS_ASSUME_NONNULL_BEGIN
/// @param backPic 房间背景
/// @param mgId 小游戏的id
- (void)openRoom:(NSString *)title
type:(RoomType)type
roomPwd:(NSString *)roomPwd
roomDesc:(NSString *)roomDesc
backPic:(NSString *)backPic
mgId:(NSString *)mgId;
type:(RoomType)type
roomPwd:(NSString *)roomPwd
roomDesc:(NSString *)roomDesc
backPic:(NSString *)backPic
mgId:(NSString *)mgId;
///福袋礼物爆出的礼物的bug
///进入房间的时候需要获取一次礼物信息 因为如果有人送礼物的话 如果是福袋礼物的话 爆出的礼物需要从礼物列表中获取 会导致公屏不显示那个礼物
@@ -73,6 +73,9 @@ NS_ASSUME_NONNULL_BEGIN
/// 获取已解锁照片id列表
/// @param roomUid 房间id
-(void)getUnlockRoomAlbumPhotoListWithRoomUid:(NSString *)roomUid;
///得到踢人名单
/// @param roomUid 房间id
-(void)getKickUserListWithRoomUid:(NSString *)roomUid;
@end
NS_ASSUME_NONNULL_END

View File

@@ -297,4 +297,13 @@
[[self getView]getUnlockRoomAlbumPhotoListSuccessWithList:data.data];
} showLoading:NO errorToast:NO] roomUid:roomUid];
}
///
/// @param roomUid id
-(void)getKickUserListWithRoomUid:(NSString *)roomUid{
[Api getKickUserList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getView]getKickUserListSuccessWithList:data.data];
} fail:^(NSInteger code, NSString * _Nullable msg) {
} showLoading:NO errorToast:NO] roomUid:roomUid];
}
@end

View File

@@ -39,6 +39,8 @@ NS_ASSUME_NONNULL_BEGIN
-(void)getFreeGiftDataSuccess:(XPFreeGiftModel *)freeModel;
///获取已解锁照片id列表
-(void)getUnlockRoomAlbumPhotoListSuccessWithList:(NSArray *)list;
///获取踢人房间列表
-(void)getKickUserListSuccessWithList:(NSArray *)list;
@end
NS_ASSUME_NONNULL_END

View File

@@ -498,10 +498,8 @@
///
RoomInfoModel * roomInfo =self.hostDelegate.getRoomInfo;
NSString * roomId = [NSString stringWithFormat:@"%ld", roomInfo.uid];
BOOL isInMic = NO;
for (MicroQueueModel *sequence in self.micQueue.allValues) {
if ([AccountInfoStorage instance].getUid.integerValue == sequence.userInfo.uid) {
isInMic = YES;
NIMChatroomQueueUpdateRequest *request = [[NIMChatroomQueueUpdateRequest alloc]init];
request.key = @(sequence.microState.position).stringValue;
request.value = [sequence.userInfo toJSONString];
@@ -509,7 +507,7 @@
request.transient = YES;
[[NIMSDK sharedSDK].chatroomManager updateChatroomQueueObject:request completion:^(NSError * _Nullable error) {
}];
break;
}
}
}

View File

@@ -54,6 +54,12 @@ NS_ASSUME_NONNULL_BEGIN
/// @param opt 1: 设置为管理员;2:设置普通等级用户;-1:设为黑名单用户;-2:设为禁言用户
/// @param isSet true 设置false 取消设置
+ (void)superAdminHandleUser:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid targetUid:(NSString *)targetUid opt:(NSString *)opt isSet:(NSNumber *)isSet;
/// 记录踢人名单列表
/// @param completion 完成
/// @param roomUid 房间id
/// @param uid 用户id
+(void)recordskickUserList:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid uid:(NSString *)uid;
@end
NS_ASSUME_NONNULL_END

View File

@@ -62,5 +62,11 @@
NSString * fang = [NSString stringFromBase64String:@"c3VwZXIvc2V0L2NoYXRyb29tL3JvbGU="];///super/set/chatroom/role
[self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, roomUid, targetUid, opt,isSet, nil];
}
///
/// @param completion
/// @param roomUid id
/// @param uid id
+(void)recordskickUserList:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid uid:(NSString *)uid{
[self makeRequest:@"room/kick/" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, roomUid, uid, nil];
}
@end

View File

@@ -89,6 +89,11 @@ NS_ASSUME_NONNULL_BEGIN
/// @param opt 1: 设置为管理员;2:设置普通等级用户;-1:设为黑名单用户;-2:设为禁言用户
/// @param roomUid 房主的uid
- (void)superAdminHandleUser:(NSString *)targetUid opt:(NSString *)opt roomUid:(NSString *)roomUid isSet:(BOOL)isSet;
/// 记录踢人名单列表
/// @param roomUid 房间id
/// @param uid 用户id
-(void)recordsKickUserListWithRoomUid:(NSString *)roomUid uid:(NSString *)uid;
@end
NS_ASSUME_NONNULL_END

View File

@@ -451,7 +451,7 @@
[[NIMSDK sharedSDK].chatroomManager kickMember:request completion:^(NSError * _Nullable error) {
[[self getView] makeKickUserFinish:error];
[[self getView] makeKickUserFinish:error uid:targetUid];
}];
}
@@ -602,7 +602,16 @@
return nil;
}];
}
///
/// @param roomUid id
/// @param uid id
-(void)recordsKickUserListWithRoomUid:(NSString *)roomUid uid:(NSString *)uid{
[Api recordskickUserList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
} fail:^(NSInteger code, NSString * _Nullable msg) {
} showLoading:NO errorToast:NO] roomUid:roomUid uid:uid ];
}
#pragma mark - Getters And Setters
- (NSMutableArray *)functionArray {
if (!_functionArray) {

View File

@@ -24,7 +24,7 @@ NS_ASSUME_NONNULL_BEGIN
///设置管理 取消管理员 成功
- (void)markUserManagerFinish:(XPUserCardItemModel *)item error:(NSError *)error;
/// 踢出房间
- (void)makeKickUserFinish:(NSError *)error;
- (void)makeKickUserFinish:(NSError *)error uid:(NSString *)uid;
///超管踢管理出房间
- (void)superAdminKickUserFinish:(NSError *)error;
///抱下麦成功

View File

@@ -643,10 +643,12 @@
[self.collectionView reloadData];
}
- (void)makeKickUserFinish:(NSError *)error {
- (void)makeKickUserFinish:(NSError *)error uid:(NSString *)uid{
if (error == nil && self.targetUserInfo) {
NSString * roomUid = [NSString stringWithFormat:@"%ld", self.cardInfo.roomInfo.uid];
[self dismissViewControllerAnimated:YES completion:nil];
[self sendCustomMessageKickOrBlackUser:CustomMessageType_Kick_User second:Custom_Message_Sub_Kick_BeKicked];
[self.presenter recordsKickUserListWithRoomUid:roomUid uid:uid];
} else if (error.code == 404) {
[self showErrorToast:YMLocalizedString(@"XPUserCardViewController0")];
}

View File

@@ -937,7 +937,6 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
[[XPRoomMiniManager shareManager] configCurrentMusic:nil isPlaying:NO];
}
}
///
- (void)showAnchorScrollTipView {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
@@ -948,35 +947,6 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
[window bringSubviewToFront:self.anchorScrollTipView];
}
}
///
- (BOOL)isKictOutLatest:(NSString *)key mainKey:(NSString *)mainKey{
NSMutableDictionary *kickedList = [[NSUserDefaults standardUserDefaults]valueForKey:mainKey];
if([kickedList isKindOfClass:[NSString class]]){
kickedList = nil;
}
if(kickedList == nil){
kickedList = [NSMutableDictionary dictionary];
}else{
kickedList = [[NSMutableDictionary alloc]initWithDictionary:kickedList];
}
NSString *kictOutTime = [kickedList valueForKey:key];
if (kictOutTime) {
NSDate* date = [NSDate dateWithTimeIntervalSinceNow:0];
NSTimeInterval time = [date timeIntervalSince1970];
NSString *currentTime = [NSString stringWithFormat:@"%.0f", time];
//5
if ([currentTime intValue] - [kictOutTime intValue] > 5 * 60) {
[[NSUserDefaults standardUserDefaults] removeObjectForKey:key];
[[NSUserDefaults standardUserDefaults] synchronize];
return NO;
} else {
return YES;
}
} else {
return NO;
}
}
-(void)requesstShieldingAction{
[self.presenter requesstShieldingWtihType:@"1" objId:[NSString stringWithFormat:@"%ld",self.roomInfo.uid]];
}
@@ -1001,7 +971,18 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
}
[[NSNotificationCenter defaultCenter]postNotificationName:@"kGetgetUnlockRoomAlbumPhotoListNot" object:nil];
}
///
-(void)getKickUserListSuccessWithList:(NSArray *)list{
NSString *uid = [[AccountInfoStorage instance]getUid];
for (id obj in list) {
if([obj integerValue] == [uid integerValue]){
[self exitRoom];
[XNDJTDDLoadingTool showErrorWithMessage:YMLocalizedString(@"XPRoomViewController0")];
break;
}
}
}
- (void)initEnterRoomSuccess:(RoomInfoModel *)roomInfo user:(UserInfoModel *)userInfo {
[XNDJTDDLoadingTool hideHUDInView:self.navigationController.view];
[XPSkillCardPlayerManager shareInstance].roomUid = @(roomInfo.uid).stringValue;
@@ -1019,14 +1000,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
});
//5
NSString *currentUid = [AccountInfoStorage instance].getUid;
NSString *key = [NSString stringWithFormat:@"kKickedOutRoom_%@_%ld", currentUid, roomInfo.uid];
if ([self isKictOutLatest:key mainKey:@"kKickedOutRoomList"] == YES) {
[XNDJTDDLoadingTool showErrorWithMessage:YMLocalizedString(@"XPRoomViewController0")];
[self dismissViewControllerAnimated:YES completion:nil];
return;
}
if (roomInfo.type == RoomType_Anchor) {//
[self handleInitAnchorRoom];
[self showAnchorScrollTipView];
@@ -1391,33 +1365,8 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
#pragma mark - NIMChatroomManagerDelegate
- (void)chatroomBeKicked:(NIMChatroomBeKickedResult *)result {
if (result.reason == 2) {
[self showErrorToast:YMLocalizedString(@"XPRoomViewController8")];
///
NSDate* date = [NSDate dateWithTimeIntervalSinceNow:0];//0
NSTimeInterval time = [date timeIntervalSince1970];
NSString *currentTime = [NSString stringWithFormat:@"%.0f", time];
NSString *key = [NSString stringWithFormat:@"kKickedOutRoom_%@_%ld", [AccountInfoStorage instance].getUid, self.roomInfo.uid];
NSMutableDictionary *kickedList = [[NSUserDefaults standardUserDefaults]valueForKey:@"kKickedOutRoomList"];
if([kickedList isKindOfClass:[NSString class]]){
kickedList = nil;
}
if(kickedList == nil){
kickedList = [NSMutableDictionary dictionary];
}else{
kickedList = [[NSMutableDictionary alloc]initWithDictionary:kickedList];
}
NSMutableDictionary *copyList = [[NSMutableDictionary alloc]initWithDictionary:kickedList];
for (NSString *timeKey in copyList.allKeys) {
if([self isKictOutLatest:timeKey mainKey:@"kKickedOutRoomList"] == NO){
[kickedList removeObjectForKey:timeKey];
}
}
[kickedList setValue:currentTime forKey:key];
[[NSUserDefaults standardUserDefaults] setObject:kickedList forKey:@"kKickedOutRoomList"];
[[NSUserDefaults standardUserDefaults] synchronize];
} else if (result.reason == 5) {
if (result.reason == 5) {
[self showErrorToast:YMLocalizedString(@"XPRoomViewController9")];
}
[self.presenter exitNIMRoom:[NSString stringWithFormat:@"%ld", self.roomInfo.roomId]];
@@ -1548,9 +1497,14 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
break;
case NIMChatroomEventTypeEnter:
{
if (content.source.userId.integerValue == [AccountInfoStorage instance].getUid.integerValue){
[self.presenter getKickUserListWithRoomUid:@(self.roomInfo.uid).stringValue];
}
if (content.source.userId.integerValue != [AccountInfoStorage instance].getUid.integerValue && self.userInfo.platformRole != 1) {
onLineNumber += 1;
}else {///
}else {
///
[self userEnterRoomSuccess];
///
[self.activityContainerView onRoomUpdate];

View File

@@ -66,7 +66,7 @@
NSLog(@"\nmethod:\n%@\nparameter:\n%@", method, params);
#endif
#ifdef DEBUG
NSString *url = API_HOST_URL;
NSString *url = [self getHostUrl];
NSString *urlPath = [NSString stringWithFormat:@"%@/%@", url ,method];
dispatch_async(dispatch_get_global_queue(0, 0), ^{
[BSNetListenModel addHttpReq:urlPath header:manager.requestSerializer.HTTPRequestHeaders param:[params copy] time:[NSDate getCurrentTimeWithFormat:@"yyyy-MM-dd HH:mm:ss"]];
@@ -112,7 +112,7 @@
#ifdef DEBUG
NSLog(@"\nmethod:\n%@\nparameter:\n%@", method, params);
NSString *url = API_HOST_URL;
NSString *url = [self getHostUrl];
NSString *urlPath = [NSString stringWithFormat:@"%@/%@", url ,method];
dispatch_async(dispatch_get_global_queue(0, 0), ^{
[BSNetListenModel addHttpReq:urlPath header:manager.requestSerializer.HTTPRequestHeaders param:[params copy] time:[NSDate getCurrentTimeWithFormat:@"yyyy-MM-dd HH:mm:ss"]];
@@ -155,7 +155,7 @@
AFHTTPSessionManager *manager = [HttpRequestHelper requestManager];
#ifdef DEBUG
NSLog(@"\nmethod:\n%@\nparameter:\n%@", method, params);
NSString *url = API_HOST_URL;
NSString *url = [self getHostUrl];
NSString *urlPath = [NSString stringWithFormat:@"%@/%@", url ,method];
dispatch_async(dispatch_get_global_queue(0, 0), ^{
[BSNetListenModel addHttpReq:urlPath header:manager.requestSerializer.HTTPRequestHeaders param:[params copy] time:[NSDate getCurrentTimeWithFormat:@"yyyy-MM-dd HH:mm:ss"]];
@@ -323,7 +323,7 @@
[self configHeaders];
NSDictionary *baseParams = [self configBaseParmars:nil];
AFHTTPSessionManager *manager = [HttpRequestHelper requestManager];
NSString *url = API_HOST_URL;
NSString *url = [self getHostUrl];
NSString *urlPath = [NSString stringWithFormat:@"%@/%@", url ,path];
#ifdef DEBUG
NSLog(@"\nmethod:\n%@\nparameter:\n%@", path, params);
@@ -340,7 +340,8 @@
}];
urlPath = [NSString stringWithFormat:@"%@?%@", urlPath, requestUrl];
urlPath = [urlPath stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
NSMutableURLRequest *request = [[AFJSONRequestSerializer serializer] requestWithMethod:@"POST" URLString:urlPath parameters:baseParams error:nil];
request.timeoutInterval= [[[NSUserDefaults standardUserDefaults] valueForKey:@"timeoutInterval"] longValue];