internal async Task MinecraftStateNotification(MinecraftStateNotification notification) { if (StateChanged != null) { await StateChanged?.Invoke(notification); } }
public async Task Minecraft_StateChanged(MinecraftStateNotification notification) { await Application.Current.Dispatcher.InvokeAsync(delegate { PlayerListLabel.Content = $"Players online {notification.CurrentState.CurrentPlayerCount}/{notification.CurrentState.MaxPlayerCount}"; if (notification.CurrentState.Running) { StartButton.Content = "Stop"; } else { StartButton.Content = "Start"; } }); }
public async Task Handle(MinecraftStateNotification notification, CancellationToken cancellationToken) { await _wonderlandClient.SetCurrentPlayerCountAsync(notification.CurrentState.CurrentPlayerCount, notification.CurrentState.MaxPlayerCount); }
public async Task Handle(MinecraftStateNotification notification, CancellationToken cancellationToken) { await _relayEventHandler.MinecraftStateNotification(notification); }