Commit 9d01856a by suolong

提交下bug处理

parent fa916616
......@@ -78,12 +78,12 @@ static const NSString *FUSCidUDKey = @"FUSCidUDKey";
/// App Version
- (NSString *)appVersion {
return @"7850";
return @"7851";
}
/// App Dot Version
- (NSString *)appDotVersion {
return @"7.8.5.0";
return @"7.8.5.1";
}
/// App Id
......
......@@ -352,7 +352,9 @@ NSString * const kEVENT_RECHARGE_FIRST_RECHARGE_WINDOW_RECEIVE_OFFICIAL_RECAHARG
case FUSJsWebCidExchangDiamond:// CID 为 6,跳转兑换宝石界面
{
FUSExchangeDiamondViewController *exchangeDiamondViewCtrl = [[FUSExchangeDiamondViewController alloc] init];
[wkVC.navigationController pushViewController:exchangeDiamondViewCtrl animated:YES];
UIViewController *topViewController = [UIViewController fus_topViewController];
UINavigationController *navigationController = topViewController.navigationController ?: wkVC.navigationController;
[navigationController pushViewController:exchangeDiamondViewCtrl animated:YES];
break;
}
case FUSJsWebCidBindPhone:// CID 为 7,跳转手机绑定界面
......
......@@ -9,6 +9,7 @@
#import "FUSSocketManager.h"
#import "GCDAsyncSocket.h"
#import "FUSDataStatisticsManager.h"
#import <AFNetworking/AFNetworkReachabilityManager.h>
// socket 数据解析队列
static dispatch_queue_t socket_queue;
......@@ -29,15 +30,16 @@ typedef void(^StatusBlock) (SocketStatus status); // 状态回调
@implementation FUSSocketManager
{
GCDAsyncSocket *mSocket; // socket对象
NSArray<NSDictionary *> *mIPList;
NSInteger mIPIndex;
NSString *mHost; // 主机名(IP地址)
int mPort; // 端口号
int mReconnectCount; // 重连次数
AFNetworkReachabilityStatus mLastNetworkStatus;
ConnectBlock mConnectBlock; // Socket连接回调
StatusBlock mStatusBlock; // 连接状态回调
}
......@@ -50,6 +52,38 @@ typedef void(^StatusBlock) (SocketStatus status); // 状态回调
return [[self alloc] init];
}
- (instancetype)init
{
self = [super init];
if (self) {
mLastNetworkStatus = AFNetworkReachabilityStatusUnknown;
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(fus_networkReachabilityChanged:)
name:AFNetworkingReachabilityDidChangeNotification
object:nil];
}
return self;
}
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
- (void)fus_networkReachabilityChanged:(NSNotification *)notification
{
AFNetworkReachabilityStatus status = [notification.userInfo[AFNetworkingReachabilityNotificationStatusItem] integerValue];
BOOL wasOffline = mLastNetworkStatus == AFNetworkReachabilityStatusNotReachable;
mLastNetworkStatus = status;
// Reachability may recover before TCP reports a disconnect, leaving the socket
// half-open. Recreate it once when connectivity returns.
if (wasOffline && status > AFNetworkReachabilityStatusNotReachable && mHost.length > 0 && mPort > 0) {
FUSLogInfo(@"--->网络恢复,主动检查Socket连接");
[self fus_socketReconnectWithBlock:nil];
}
}
#pragma mark -- Socket相关类方法
......@@ -85,22 +119,22 @@ typedef void(^StatusBlock) (SocketStatus status); // 状态回调
FUSLogInfo(@"--->Socket连接失败, host或port为空");
return;
}
// 先切断Socket
[self fus_cutOffSocketWithState:SocketOfflineByConnecting];
[[NSNotificationCenter defaultCenter] postNotificationName:kFUSSocketReconnectingNotification object:@{@"host":host,@"port":@(port)}];
// 设置域名/端口号
mHost = host;
mPort = port;
// 设置回调
mConnectBlock = block;
// 上报统计
[FUSDataStatisticsManager fus_startSocketConnect];
mSocket = [[GCDAsyncSocket alloc] initWithDelegate:self delegateQueue:dispatch_get_main_queue()];
// 连接Socket, 打印错误消息
NSError *error = nil;
[mSocket connectToHost:host onPort:port withTimeout:10 error:&error];
......@@ -119,7 +153,7 @@ typedef void(^StatusBlock) (SocketStatus status); // 状态回调
if (mIPIndex >= mIPList.count) {
mIPIndex = 0;
}
NSDictionary *ipDict = mIPList[mIPIndex];
[self fus_socketConnectWithHost:ipDict[@"ip"] port:[ipDict[@"port"] intValue] block:block];
}
......@@ -136,7 +170,7 @@ typedef void(^StatusBlock) (SocketStatus status); // 状态回调
FUSLogInfo(@"--->发送Socket数据失败,data数据为空");
return;
}
// 发送Socket数据
if (mSocket) {
[mSocket writeData:data withTimeout:MSG_TIMEOU tag:tag];
......@@ -186,13 +220,13 @@ typedef void(^StatusBlock) (SocketStatus status); // 状态回调
FUSLogInfo(@"--->Socket 主动切断");
// 设置userData,标记为用户主动切断
mSocket.userData = @(socketStatus);
// 取消Socket代理
[mSocket setDelegate:nil];
// 断开Socket连接
[mSocket disconnect];
// 制空Socket
mSocket = nil;
}
......@@ -201,25 +235,25 @@ typedef void(^StatusBlock) (SocketStatus status); // 状态回调
#pragma mark -- AsyncSocketDelegate相关方法
- (void)socket:(GCDAsyncSocket *)sock didConnectToHost:(NSString *)host port:(uint16_t)port
{
[FUSDataStatisticsManager fus_socketConnectSucceedWithIp:mHost port:@(mPort).description];
FUSLogInfo(@"--->Socket 连接成功 host=%@,port=%d",host,port);
[[NSNotificationCenter defaultCenter] postNotificationName:kFUSSocketReconnectedNotification object:@{@"host":host,@"port":@(port)}];
// Socket连接成功回调
if (mConnectBlock) {
mConnectBlock(YES);
mConnectBlock = nil;
}
// Socket状态回调
if (mStatusBlock) {
mStatusBlock(SocketOnline);
}
// 重连次数归0
mReconnectCount = 0;
// 开始监听读取数据
[mSocket readDataWithTimeout:MSG_TIMEOU tag:MSG_TAG];
}
......@@ -228,41 +262,41 @@ typedef void(^StatusBlock) (SocketStatus status); // 状态回调
{
NSNumber *userData = sock.userData;
NSInteger userDataValue = userData.integerValue;
if (userDataValue == SocketOfflineByServer) {
if (userDataValue == SocketOfflineByUser) {
// 用户主动断开
FUSLogInfo(@"--->socket断开连接, 用户主动断开");
mReconnectCount = 0; // 重连次数归0
// Socket状态回调
if (mStatusBlock) mStatusBlock(SocketOfflineByUser);
} else if (userDataValue == SocketOfflineByConnecting) {
FUSLogInfo(@"--->socket断开连接, 正在重建连接");
} else {
[[NSNotificationCenter defaultCenter] postNotificationName:kFUSSocketDisReconnectNotification object:@{@"host":mHost,@"port":@(mPort)}];
// v6.1.0 只要连接不上,就发送统计
[FUSDataStatisticsManager fus_socketConnectFailed:[NSString stringWithFormat:@"%zd",userDataValue] ip:mHost port:@(mPort).description];
// 服务器掉线
// 服务器掉线或弱网异常断开
if (mReconnectCount < 100) {
// Socket状态回调
if (mStatusBlock) mStatusBlock(SocketWillOfflineByServer);
// Socket重连3次
mReconnectCount ++;
[self performSelector:@selector(fus_socketReconnectWithBlock:) withObject:nil afterDelay:mReconnectCount <= 60 ? mReconnectCount : 60];
FUSLogInfo(@"--->socket断开连接, 自动重连%d次", mReconnectCount);
}else{
// Socket连接失败
FUSLogInfo(@"--->socket断开连接, 自动重连失败");
mReconnectCount = 0; // 重连次数归0
// Socket状态回调
if (mStatusBlock) mStatusBlock(SocketOfflineByServer);
}
}else if(userDataValue == SocketOfflineByUser){
// 用户主动断开
FUSLogInfo(@"--->socket断开连接, 用户主动断开");
mReconnectCount = 0; // 重连次数归0
// Socket状态回调
if (mStatusBlock) mStatusBlock(SocketOfflineByUser);
} else {
FUSLogInfo(@"--->socket断开连接, 其他原因断开断开 %zd",userDataValue);
}
}
......@@ -273,12 +307,12 @@ typedef void(^StatusBlock) (SocketStatus status); // 状态回调
FUSLogInfo(@"-->接受Socket数据错误,接收到的Data为空");
return;
}
// 通过回调,将消息数据发送到消息中心
if ([self.delegate respondsToSelector:@selector(socketAcceptMessageWithData:tag:)]) {
[self.delegate socketAcceptMessageWithData:data tag:tag];
}
// 开始监听读取数据
[mSocket readDataWithTimeout:MSG_TIMEOU tag:MSG_TAG];
}
......
......@@ -123,11 +123,13 @@ NSString * const kEVENT_RECHARGE_OFFICIAL_PAGE_RETURN = @"officialrecharge_retur
isOfficial:(BOOL)isOfficial {
NSString *gotopage = isOfficial ? @"officialrecharge" : @"otherrecharge";
NSString *roomId = FUSConfig.sharedInstanced.liveConfigs.currentRoomId ?: @"";
NSString *userId = [FUSCacheDataShare shareStore].userDetailInfo.uid ?: @"";
if (from == FUSFromLiveRoom) {
if (rechargePageFrom == FUSRechargePageFromGEMsLack) {
[FUSTalkingData fus_trackEvent:FUSLiveEventTrackParams.fus_EVENT_ROOM_LACKGEM_RECHARGE label:@"" parameters:@{@"roomid":FUSConfig.sharedInstanced.liveConfigs.currentRoomId,@"userid":[FUSCacheDataShare shareStore].userDetailInfo.uid,@"gotopage":gotopage}];
[FUSTalkingData fus_trackEvent:FUSLiveEventTrackParams.fus_EVENT_ROOM_LACKGEM_RECHARGE label:@"" parameters:@{@"roomid":roomId,@"userid":userId,@"gotopage":gotopage}];
} else if (rechargePageFrom == FUSRechargePageFromRoomGiftGEMsLack) {
[FUSTalkingData fus_trackEvent:FUSLiveEventTrackParams.fus_EVENT_ROOM_GIFT_SEND_LACKGEM_OFFICAL_RECHARGE label:@"" parameters:@{@"roomid":FUSConfig.sharedInstanced.liveConfigs.currentRoomId,@"userid":[FUSCacheDataShare shareStore].userDetailInfo.uid,@"gotopage":gotopage}];
[FUSTalkingData fus_trackEvent:FUSLiveEventTrackParams.fus_EVENT_ROOM_GIFT_SEND_LACKGEM_OFFICAL_RECHARGE label:@"" parameters:@{@"roomid":roomId,@"userid":userId,@"gotopage":gotopage}];
}
}
......@@ -152,7 +154,8 @@ NSString * const kEVENT_RECHARGE_OFFICIAL_PAGE_RETURN = @"officialrecharge_retur
break;
}
[FUSTalkingData fus_trackEvent:kEVENT_RECHARGE_OFFICIAL_PAGE label:@"" parameters:@{@"userid":[FUSCacheDataShare shareStore].userDetailInfo.uid,@"PKG":FUSConfig.sharedInstanced.appConfigs.appPKG,@"source":source}];
NSString *appPKG = FUSConfig.sharedInstanced.appConfigs.appPKG ?: @"";
[FUSTalkingData fus_trackEvent:kEVENT_RECHARGE_OFFICIAL_PAGE label:@"" parameters:@{@"userid":userId,@"PKG":appPKG,@"source":source}];
NSString *firebaseSource = @"others";
switch (from) {
......@@ -174,7 +177,7 @@ NSString * const kEVENT_RECHARGE_OFFICIAL_PAGE_RETURN = @"officialrecharge_retur
}
// Firebase 统计
[FIRAnalytics logEventWithName:@"topuppage" parameters:@{@"useruid":[FUSCacheDataShare shareStore].userDetailInfo.uid,@"source":firebaseSource}];
[FIRAnalytics logEventWithName:@"topuppage" parameters:@{@"useruid":userId,@"source":firebaseSource}];
}
}
......
......@@ -102,7 +102,7 @@
/* End PBXFileReference section */
/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */
00E501FF2E0543A800579DB0 /* Exceptions for "NotificationService" folder in "NotificationService" target */ = {
00E501FF2E0543A800579DB0 /* PBXFileSystemSynchronizedBuildFileExceptionSet */ = {
isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
membershipExceptions = (
"NotificationService-Info.plist",
......@@ -112,18 +112,7 @@
/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */
/* Begin PBXFileSystemSynchronizedRootGroup section */
00E501F42E0543A800579DB0 /* NotificationService */ = {
isa = PBXFileSystemSynchronizedRootGroup;
exceptions = (
00E501FF2E0543A800579DB0 /* Exceptions for "NotificationService" folder in "NotificationService" target */,
);
explicitFileTypes = {
};
explicitFolders = (
);
path = NotificationService;
sourceTree = "<group>";
};
00E501F42E0543A800579DB0 /* NotificationService */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (00E501FF2E0543A800579DB0 /* PBXFileSystemSynchronizedBuildFileExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = NotificationService; sourceTree = "<group>"; };
/* End PBXFileSystemSynchronizedRootGroup section */
/* Begin PBXFrameworksBuildPhase section */
......@@ -444,10 +433,14 @@
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-FuSiLive/Pods-FuSiLive-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
inputPaths = (
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-FuSiLive/Pods-FuSiLive-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-FuSiLive/Pods-FuSiLive-frameworks.sh\"\n";
......@@ -461,10 +454,14 @@
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-FuSiLive/Pods-FuSiLive-resources-${CONFIGURATION}-input-files.xcfilelist",
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-FuSiLive/Pods-FuSiLive-resources-${CONFIGURATION}-output-files.xcfilelist",
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-FuSiLive/Pods-FuSiLive-resources.sh\"\n";
......@@ -694,7 +691,7 @@
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CODE_SIGN_ENTITLEMENTS = FuSiLive/FuSiLive.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 20260522;
CURRENT_PROJECT_VERSION = 20260523;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 6GG26BHUMC;
ENABLE_ON_DEMAND_RESOURCES = NO;
......@@ -729,7 +726,7 @@
"$(PROJECT_DIR)/FuSiLive/Classes/FUSModules/FUSLiveModule/NewLive/Main/View/StreamView/Beauty/ByteDanceBeauty",
);
LOCALIZATION_PREFERS_STRING_CATALOGS = NO;
MARKETING_VERSION = 10.0.1;
MARKETING_VERSION = 10.1.1;
OTHER_CFLAGS = (
"$(inherited)",
"-isystem",
......@@ -959,7 +956,7 @@
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CODE_SIGN_ENTITLEMENTS = FuSiLive/FuSiLive.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 20260522;
CURRENT_PROJECT_VERSION = 20260523;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 6GG26BHUMC;
ENABLE_ON_DEMAND_RESOURCES = NO;
......@@ -994,7 +991,7 @@
"$(PROJECT_DIR)/FuSiLive/Classes/FUSModules/FUSLiveModule/NewLive/Main/View/StreamView/Beauty/ByteDanceBeauty",
);
LOCALIZATION_PREFERS_STRING_CATALOGS = NO;
MARKETING_VERSION = 10.0.1;
MARKETING_VERSION = 10.1.1;
OTHER_CFLAGS = (
"$(inherited)",
"-isystem",
......
......@@ -100,7 +100,10 @@ class FUSPKPunishTypesView: FUSBaseView {
var typesBtnList: [UIButton] = .init()
/// 最大选择个数
let vsPunishMaxLimit: Int = FUSCacheDataShare.shareStore().settingInitDataModel.vsPunishMaxLimit
let vsPunishMaxLimit: Int = max(
FUSCacheDataShare.shareStore().settingInitDataModel?.vsPunishMaxLimit ?? 1,
1
)
override func makeUI() {
super.makeUI()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment