private async void ShowCountdown(object timeout) { await playersMapShownSemaphore.WaitAsync(); if (PlayersMapShownLocked) { playersMapShownSemaphore.Release(); return; } PlayersMapShownLocked = true; if ((bool)timeout) { Game.Log("Map from all players have been shown."); } else { Game.Log("Map from all players not yet shown, starting countdown..."); } // Stop timer if (mapShownTimer != null) { mapShownTimer.Dispose(); } // Update UI await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.High, () => { ShowCountdownEvent?.Invoke(null); }); playersMapShownSemaphore.Release(); }
public void NotifyCountdown(ulong time, int type) { var e = new ShowCountdownEvent(Extension.FromServerBinary((long)time), (eCountdownType)type); EventDispatcher.Instance.DispatchEvent(e); }