private static void ProcessEmotionRequest(string client, string emotion) { var hubContext = GlobalHost.ConnectionManager.GetHubContext <ReportHub>(); var emotionStatus = Enum.GetNames(typeof(EmotionStatus)).Any(x => x.ToLowerInvariant() == emotion.ToLowerInvariant()) ? (EmotionStatus)Enum.Parse(typeof(EmotionStatus), emotion, true) : EmotionStatus.None; hubContext.Clients.All.printLog($"{DateTime.UtcNow:O} '{client}' post: {emotion} - {emotionStatus}"); if (emotionStatus == EmotionStatus.None || emotionStatus == EmotionStatus.Freezed) { return; } hubContext.Clients.All.addMessage(GenerateMessage(client, emotionStatus), GetMessageType(emotionStatus)); hubContext.Clients.All.updateFocusIndex(ComputeFocusIndex(emotionStatus)); if (emotionStatus == EmotionStatus.HandUp) { hubContext.Clients.All.raiseHand(); hubContext.Clients.All.updateHandupCount(StatusCollection.CountHandUp(client)); } else { hubContext.Clients.All.putHandDown(); } }