/// <summary> /// Publish a participant event to all participants in conference to those connected to the HubContext /// </summary> /// <param name="participantState">Participant status event to publish</param> /// <returns></returns> protected async Task PublishParticipantStatusMessage(ParticipantState participantState) { foreach (var participant in SourceConference.Participants) { await HubContext.Clients.Group(participant.Username.ToLowerInvariant()) .ParticipantStatusMessage(SourceParticipant.Id, SourceParticipant.Username, SourceConference.Id, participantState); Logger.LogTrace($"Participant Status: Participant Id: { participant.Id } | " + $"Role: { participant.Role } | Participant State: { participantState } | Timestamp: { (DateTime.Now).ToString("yyyy-MM-dd HH:mm:ss.fffffff") } "); } await HubContext.Clients.Group(Hub.EventHub.VhOfficersGroupName) .ParticipantStatusMessage(SourceParticipant.Id, SourceParticipant.Username, SourceConference.Id, participantState); Logger.LogTrace($"Participant Status: Participant Id: { SourceParticipant.Id } | " + $"Role: { SourceParticipant.Role } | Participant State: { participantState } | Timestamp: { (DateTime.Now).ToString("yyyy-MM-dd HH:mm:ss.fffffff") } "); }
/// <summary> /// Publish a participant event to all participants in conference to those connected to the HubContext /// </summary> /// <param name="participantState">Participant status event to publish</param> /// <returns></returns> protected async Task PublishParticipantStatusMessage(ParticipantState participantState) { foreach (var participant in SourceConference.Participants) { await HubContext.Clients.Group(participant.Username.ToLowerInvariant()) .ParticipantStatusMessage(SourceParticipant.Id, SourceParticipant.Username, SourceConference.Id, participantState); Logger.LogTrace( "Informing {Username} in conference {ConferenceId} Participant Status: Participant Id: {ParticipantId} | Role: {ParticipantRole} | Participant State: {ParticipantState}", participant.Username.ToLowerInvariant(), SourceConference.Id, SourceParticipant.Id, SourceParticipant.Role, participantState); } await HubContext.Clients.Group(Hub.EventHub.VhOfficersGroupName) .ParticipantStatusMessage(SourceParticipant.Id, SourceParticipant.Username, SourceConference.Id, participantState); Logger.LogTrace( "Informing Admin for conference {ConferenceId} Participant Status: Participant Id: {ParticipantId} | Role: {ParticipantRole} | Participant State: {ParticipantState}", SourceConference.Id, SourceParticipant.Id, SourceParticipant.Role, participantState); }