Commit 51a4c3d5 by suolong

Merge branch 'feature/v57版本pk迁移' of http://git.yabolive.net:88/pidan/FuSiLive…

Merge branch 'feature/v57版本pk迁移' of http://git.yabolive.net:88/pidan/FuSiLive into feature/v57版本pk迁移
parents 3455844c 3a7cd110
......@@ -60,4 +60,7 @@
*/
+ (void)fus_addSocketMessageWithModel:(FUSSocketMessageModel *)messageModel;
/// 重设心跳时间
+ (void)fus_setSocketHeartbeatInterval:(NSTimeInterval)interval;
@end
......@@ -35,6 +35,8 @@ typedef void(^ConnectBlock)(BOOL isSuccess); // 连接回调
FUSPublicSocketMessageDBOperate *mSockeDBOperate; // 数据库操作助手
ConnectBlock mConnectBlock; // Socket连接回调
NSTimeInterval mHeartbeatInterval;
}
......@@ -89,6 +91,11 @@ typedef void(^ConnectBlock)(BOOL isSuccess); // 连接回调
[[FUSSocketMessageCenter shareInstance] fus_monitorSocketStatus:block];
}
+ (void)fus_setSocketHeartbeatInterval:(NSTimeInterval)interval
{
[[FUSSocketMessageCenter shareInstance] fus_setSocketHeartbeatInterval:interval];
}
/**
* 切断Socket
......@@ -143,6 +150,8 @@ typedef void(^ConnectBlock)(BOOL isSuccess); // 连接回调
mSockeDBOperate = [FUSRouter.chatRouter createSocketMessageDBOperate];
// 监测Socket连接状态
[self fus_monitorSocketStatus:nil];
// 默认心跳30
mHeartbeatInterval = 30;
}
return self;
}
......@@ -222,7 +231,7 @@ typedef void(^ConnectBlock)(BOOL isSuccess); // 连接回调
// 每隔30s像服务器发送心跳包
[mConnectTimer invalidate];
mConnectTimer = [NSTimer scheduledTimerWithTimeInterval:30 target:[YYWeakProxy proxyWithTarget:self] selector:@selector(sendHeartbeatPacket) userInfo:nil repeats:YES];
mConnectTimer = [NSTimer scheduledTimerWithTimeInterval:[self heartbeatIntervalValue] target:[YYWeakProxy proxyWithTarget:self] selector:@selector(sendHeartbeatPacket) userInfo:nil repeats:YES];
[mConnectTimer fire];
if (mConnectBlock) mConnectBlock(YES);
......@@ -352,6 +361,27 @@ typedef void(^ConnectBlock)(BOOL isSuccess); // 连接回调
[FUSSocketMessageHelper fus_sendSocketHeartbeatMessage];
}
- (void)fus_setSocketHeartbeatInterval:(NSTimeInterval)interval
{
if (interval > 0) {
mHeartbeatInterval = interval;
if ([self isConnected]) {
[mConnectTimer invalidate];
mConnectTimer = [NSTimer scheduledTimerWithTimeInterval:[self heartbeatIntervalValue] target:[YYWeakProxy proxyWithTarget:self] selector:@selector(sendHeartbeatPacket) userInfo:nil repeats:YES];
[mConnectTimer fire];
// 先发送一次
[self sendHeartbeatPacket];
}
}
}
- (NSTimeInterval)heartbeatIntervalValue
{
if (mHeartbeatInterval > 0) return mHeartbeatInterval;
return 30;
}
#pragma mark -- 接收消息处理
......
......@@ -40,6 +40,10 @@
*/
+ (void)fus_sendSocketHeartbeatMessage;
/// 重设心跳时间
+ (void)fus_setSocketHeartbeatInterval:(NSTimeInterval)interval;
/**
* 发送文本消息
*
......
......@@ -46,6 +46,12 @@ typedef void(^VerifyBlock)(NSDictionary *dataDict); // Socket验证回调
[[FUSSocketMessageHelper shareInstance] fus_sendSocketHeartbeatMessage];
}
+ (void)fus_setSocketHeartbeatInterval:(NSTimeInterval)interval {
if (interval > 0) {
[FUSSocketMessageCenter fus_setSocketHeartbeatInterval:interval];
}
}
/**
* 发送文本消息
......
......@@ -673,7 +673,7 @@
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CODE_SIGN_ENTITLEMENTS = FuSiLive/FuSiLive.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 202506260030;
CURRENT_PROJECT_VERSION = 202506260031;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 6GG26BHUMC;
ENABLE_ON_DEMAND_RESOURCES = NO;
......@@ -938,7 +938,7 @@
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CODE_SIGN_ENTITLEMENTS = FuSiLive/FuSiLive.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 202506260030;
CURRENT_PROJECT_VERSION = 202506260031;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 6GG26BHUMC;
ENABLE_ON_DEMAND_RESOURCES = NO;
......
......@@ -2779,10 +2779,14 @@
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-FUSChatCenterModule/Pods-FUSChatCenterModule-resources-${CONFIGURATION}-input-files.xcfilelist",
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-FUSChatCenterModule/Pods-FUSChatCenterModule-resources-${CONFIGURATION}-output-files.xcfilelist",
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-FUSChatCenterModule/Pods-FUSChatCenterModule-resources.sh\"\n";
......
......@@ -239,38 +239,41 @@ class FUSSwiftAgoraSession: NSObject {
return
}
FUSLog.info("------执行加入频道:\(channelId) uid:\(uid)")
let code = rtcEngine?.joinChannel(byToken: self.rtcData.rtcToken, channelId: channelId, info: nil, uid: uid.uintValue, rtcSuccess: nil) { [weak self] channelid, uid, elapsed in
FUSLog.info("------加入频道成功:\(channelId) uid:\(uid)")
completion?(true, channelId)
self?.state.accept(.joinedChannel)
FUSLog.info("------执行加入频道: rtcToken:\(self.rtcData.rtcToken) channelId:\(channelId) uid:\(uid)")
if rtcEngine is FUSSingleChatAgoraRTC {
switch type {
case .none:
break
case .audio:
// self.videoEnable = false
self?.audioEnable = true
case .video:
self?.videoEnable = true
self?.audioEnable = true
break
default:
break
let code = rtcEngine?.joinChannel(byToken: self.rtcData.rtcToken, channelId: channelId, info: nil, uid: uid.uintValue, rtcSuccess: nil) { [weak self] channelid, uid, elapsed in
FUSLog.info("------加入频道成功:\(channelId) uid:\(uid)")
completion?(true, channelId)
self?.state.accept(.joinedChannel)
switch type {
case .none:
break
case .audio:
// self.videoEnable = false
self?.audioEnable = true
case .video:
self?.videoEnable = true
self?.audioEnable = true
break
default:
break
}
}
}
if code != 0 {
if FUSConfig.sharedInstanced().devConfigs.devLevel == .developer{
FUSDialogView.fus_showDialog("加入频道失败:\(channelId) uid:\(uid) code:\(String(describing: code))")
if code != 0 {
if FUSConfig.sharedInstanced().devConfigs.devLevel == .developer{
FUSDialogView.fus_showDialog("加入频道失败:\(channelId) uid:\(uid) code:\(String(describing: code))")
}
sessionType.accept(.none)
completion?(false, "")
}
sessionType.accept(.none)
completion?(false, "")
}
if rtcEngine is FUSSingleChatByteRTC {
else if rtcEngine is FUSSingleChatByteRTC {
rtcEngine?.joinChannel(byToken: self.rtcData.rtcToken, channelId: channelId, info: nil, uid: uid.uintValue, rtcSuccess: {[weak self] code in
FUSLog.info("------RTC test 加入频道成功:\(channelId) uid:\(uid)")
......
......@@ -142,7 +142,7 @@ import SwiftyJSON
self.otherFriendInfoIsReady.distinctUntilChanged()
.timeout(.seconds(10), scheduler: MainScheduler.instance)
.subscribe(onNext: {[weak self] model in
print(model?.uid)
FUSLog.info("FUSChatCallHelper---监听获取到对方的信息:\(model?.uid ?? "")")
guard let model = model else { return }
if model.uid == fid{
FUSLoadingView.fus_dismissProgressView()
......@@ -713,6 +713,19 @@ import SwiftyJSON
setupCMDMessage()
setupSocketListener()
self.callType
.map({ $0 != .none })
.distinctUntilChanged()
.skip(1)
.subscribe(onNext: { isCall in
if isCall {
FUSSocketMessageHelper.fus_setSocketHeartbeatInterval(10.0)
}else {
FUSSocketMessageHelper.fus_setSocketHeartbeatInterval(30.0)
}
})
.disposed(by: disposeBag)
// 通话计时
state.distinctUntilChanged().subscribe(onNext: {[weak self] state in
......@@ -1177,6 +1190,7 @@ extension FUSChatCallHelper {
// 其他情况统一为通话失败
self!.endCall(reason: .failedNeedNotice)
FUSDialogView.fus_showDialog(msg)
FUSLoadingView.fus_dismissProgressView()
}
}
......
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