private async Task UpdateAccountInfoToBotProcess(AccountInfoMessage info) { var process = WorkerManager.GetAllProcesses().Where(p => p.Account == info.Username).FirstOrDefault(); if (process != null) { process.Status = info.Status; process.CharacterName = info.CharacterName; process.TotalLevel = info.TotalLevel; process.QuestPoints = info.QuestPoints; var processes = WorkerManager.GetAllProcesses(); await Clients.All.SendAsync("Dashboard_ActiveBots", processes); } }
public async Task BotStopped(BotProcess process) { var worker = WorkerManager.Workers.Where(w => w.WorkerId == process.WorkerId).FirstOrDefault(); if (worker == null) { return; } var proc = worker.Processes.Where(p => p.ProcessId == process.ProcessId).FirstOrDefault(); worker.Processes.Remove(proc); await Clients.All.SendAsync("Dashboard_BotStopped", WorkerManager.GetAllProcesses()); }