private void TimerTick(object state) { try { UpdateCaches(); var overview = CreateOverview(); OnInfoUpdated?.Invoke(overview); _lastTickTime = DateTime.Now; } catch (Exception e) { _logger.Error("Unexpected exception in main timer", e); } }
public async Task StartAsync() { if (started) { return; } hub = new HubConnectionBuilder() .WithUrl(hubUrl) .Build(); hub.On <PlayerInfo>(Messages.UpdatePlayerInfo, info => { OnInfoUpdated?.Invoke(info); }); await hub.StartAsync(); started = true; await Register(); }