public async Task ClientSendOutput(ClientSendOutputArguments args) { await HubOperation(nameof(ClientSendCommand), args, async() => { ProcessSession session = sessionManager.GetSession(args.SessionId); var user = Context.User; if (session.CanSendCommands(user.GetUserId())) { await Clients.GroupExcept(session.GroupName, Context.ConnectionId).SendAsync("AddMessage", args.Output); } }); }
public async Task ClientSendCommand(ExecuteProcessCommandArguments args) { await HubOperation(nameof(ClientSendCommand), args, async() => { ProcessSession session = sessionManager.GetSession(args.SessionId); var user = Context.User; if (session.CanSendCommands(user.GetUserId())) { await Clients.GroupExcept(session.GroupName, Context.ConnectionId).SendAsync("AddMessage", args.Command); var workerContext = GetWorkerContext(session.WorkerConnection); await workerContext.ExecuteProcessCommand(args); } }); }