Example #1
0
        public async Task SendChatMessage(int messageId)
        {
            var gameProcess = await gameProcessService.GetGameProcess();

            if (gameProcess.IsSuccess)
            {
                var message = gameProcessService.GetChatMessage(messageId);
                if (message.IsSuccess)
                {
                    await hubContext.Clients.Clients(gameProcess.Data.ConnectionIds).SendEvent("SendChatMessage", new ServiceResult <ChatMessageViewModel>
                    {
                        IsSuccess = true,
                        Data      = new ChatMessageViewModel(message.Data)
                    });
                }
            }
        }