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;
......@@ -37,6 +38,7 @@ typedef void(^StatusBlock) (SocketStatus status); // 状态回调
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相关类方法
......@@ -229,12 +263,22 @@ 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);
......@@ -253,16 +297,6 @@ typedef void(^StatusBlock) (SocketStatus status); // 状态回调
// Socket状态回调
if (mStatusBlock) mStatusBlock(SocketOfflineByServer);
}
}else if(userDataValue == SocketOfflineByUser){
// 用户主动断开
FUSLogInfo(@"--->socket断开连接, 用户主动断开");
mReconnectCount = 0; // 重连次数归0
// Socket状态回调
if (mStatusBlock) mStatusBlock(SocketOfflineByUser);
} else {
FUSLogInfo(@"--->socket断开连接, 其他原因断开断开 %zd",userDataValue);
}
}
......
......@@ -20,6 +20,9 @@
typedef void(^ConnectBlock)(BOOL isSuccess); // 连接回调
static const NSInteger kFUSSocketMaxMissedHeartbeatCount = 2;
static const NSTimeInterval kFUSSocketMinHeartbeatTimeout = 60;
@interface FUSSocketMessageCenter() <FUSSocketDelegate>
@end
......@@ -37,6 +40,9 @@ typedef void(^ConnectBlock)(BOOL isSuccess); // 连接回调
ConnectBlock mConnectBlock; // Socket连接回调
NSTimeInterval mHeartbeatInterval;
NSInteger mMissedHeartbeatCount;
NSTimeInterval mLastSocketReceiveTime;
BOOL mIsReconnectingForHeartbeat;
}
......@@ -205,6 +211,7 @@ typedef void(^ConnectBlock)(BOOL isSuccess); // 连接回调
*/
- (void)fus_socketReconnectWithBlock:(void (^)(BOOL isSuccess))block
{
mMissedHeartbeatCount = 0;
[mSocketManager fus_socketReconnectWithBlock:block];
}
......@@ -226,6 +233,9 @@ typedef void(^ConnectBlock)(BOOL isSuccess); // 连接回调
int code = [[dataDict objectForKey:@"code"] intValue];
if (code == 1 || code == 5) {
mMissedHeartbeatCount = 0;
mLastSocketReceiveTime = CFAbsoluteTimeGetCurrent();
mIsReconnectingForHeartbeat = NO;
// 发送消息队列中的离线消息
[self sendMessageFromMessageQueue];
......@@ -283,6 +293,9 @@ typedef void(^ConnectBlock)(BOOL isSuccess); // 连接回调
{
// 取消心跳定时器
[mConnectTimer invalidate];
mMissedHeartbeatCount = 0;
mLastSocketReceiveTime = 0;
mIsReconnectingForHeartbeat = NO;
[mSocketManager fus_cutOffSocket];
}
......@@ -357,6 +370,26 @@ typedef void(^ConnectBlock)(BOOL isSuccess); // 连接回调
return;
}
mMissedHeartbeatCount++;
NSTimeInterval now = CFAbsoluteTimeGetCurrent();
NSTimeInterval heartbeatTimeout = MAX([self heartbeatIntervalValue] * (kFUSSocketMaxMissedHeartbeatCount + 1), kFUSSocketMinHeartbeatTimeout);
BOOL hasReceiveTimeout = mLastSocketReceiveTime > 0 && now - mLastSocketReceiveTime >= heartbeatTimeout;
if (mMissedHeartbeatCount > kFUSSocketMaxMissedHeartbeatCount && hasReceiveTimeout) {
if (mIsReconnectingForHeartbeat) {
return;
}
mIsReconnectingForHeartbeat = YES;
FUSLogInfo(@"--->Socket心跳超时,主动重连");
[mConnectTimer invalidate];
[self fus_socketReconnectWithBlock:^(BOOL isSuccess) {
mIsReconnectingForHeartbeat = NO;
if (!isSuccess) {
FUSLogInfo(@"--->Socket心跳超时重连失败");
}
}];
return;
}
// 发送心跳包
[FUSSocketMessageHelper fus_sendSocketHeartbeatMessage];
}
......@@ -394,6 +427,8 @@ typedef void(^ConnectBlock)(BOOL isSuccess); // 连接回调
*/
- (void)socketAcceptMessageWithData:(NSData *)data tag:(long)tag
{
mMissedHeartbeatCount = 0;
mLastSocketReceiveTime = CFAbsoluteTimeGetCurrent();
// 将消息添加到消息队列
[mSocketQueue fus_addAcceptMessageWithData:data];
if ([FUSConfig sharedInstanced].devConfigs.enableSocketDebug) FUSLogInfo(@"--->收到消息:socketAcceptMessageWithData\n");
......
......@@ -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