예제 #1
0
        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();
        }
예제 #2
0
    public void NotifyCountdown(ulong time, int type)
    {
        var e = new ShowCountdownEvent(Extension.FromServerBinary((long)time), (eCountdownType)type);

        EventDispatcher.Instance.DispatchEvent(e);
    }