|
@@ -22,11 +22,11 @@ namespace WingLiveConsultationService
|
|
|
private int _leaveRoomTimes => EnvironmentConfigManager.GetParammeter<IntParameter>("LiveConsultation", "LeaveRoomTimes").Value;//10次间隔无心跳,离开房间
|
|
|
private ConcurrentDictionary<string, LiveConsultationHeartRateDTO> _clientTokens = new ConcurrentDictionary<string, LiveConsultationHeartRateDTO>();
|
|
|
|
|
|
- private Action<string, string, string> OnClientJoined;
|
|
|
+ private Action<string, string, string, bool> OnClientJoined;
|
|
|
private Action<string, string, string> OnClientNetworkErr;
|
|
|
private Action<string, string, string> OnClientLeave;
|
|
|
|
|
|
- public LiveConsultationHeartRateManager(Action<string, string, string> handleClientJoined, Action<string, string, string> handleClientNetworkErr, Action<string, string, string> handleClientLeave)
|
|
|
+ public LiveConsultationHeartRateManager(Action<string, string, string, bool> handleClientJoined, Action<string, string, string> handleClientNetworkErr, Action<string, string, string> handleClientLeave)
|
|
|
{
|
|
|
OnClientJoined = handleClientJoined;
|
|
|
OnClientNetworkErr = handleClientNetworkErr;
|
|
@@ -47,12 +47,13 @@ namespace WingLiveConsultationService
|
|
|
_clientTokens.AddOrUpdate(uniqueId, (k) =>
|
|
|
{
|
|
|
var v = new LiveConsultationHeartRateDTO(token, clientId, name, consultationCode);
|
|
|
- OnClientJoined.Invoke(consultationCode, v.ClientId, name);
|
|
|
+ OnClientJoined.Invoke(consultationCode, v.ClientId, name, false);
|
|
|
return v;
|
|
|
}, (k, v) =>
|
|
|
{
|
|
|
+ var sendMessage = v.LivingTimes >= _networkErrTimes;
|
|
|
v.Activate();
|
|
|
- OnClientJoined.Invoke(consultationCode, v.ClientId, name);
|
|
|
+ OnClientJoined.Invoke(consultationCode, v.ClientId, name, sendMessage);
|
|
|
return v;
|
|
|
});
|
|
|
}
|