예제 #1
0
        /// <summary>
        /// Posts the round timer current time event.
        /// </summary>
        /// <param name="currentClickTime">The current click time.</param>
        internal async Task PostRoundTimerCurrentTime(TimeSpan currentClockTime)
        {
            var args = new RoundTimerEventArgs(currentClockTime);

            RoundTimerClockPing?.Invoke(this, args);

            try
            {
                if (this.hubConnection != null)
                {
                    await this.hubConnection.InvokeAsync <object>("RoundTimerClockPing", args);
                }
                this.logger.LogTrace($"{nameof(PostRoundTimerCurrentTime)}: Sent round timer current time update command to host server.");
            }
            catch (Exception ex)
            {
                this.logger.LogException(ex);
            }
        }
예제 #2
0
        /// <summary>
        /// Posts the round timer started event.
        /// </summary>
        /// <param name="currentClockTime">The current clock time.</param>
        internal async Task PostRoundTimerStarted(TimeSpan currentClockTime)
        {
            var args = new RoundTimerEventArgs(currentClockTime);

            RoundTimerStarted?.Invoke(this, args);

            try
            {
                if (this.hubConnection != null)
                {
                    await this.hubConnection.InvokeAsync <RoundTimerEventArgs>("RoundTimerStarted", args);
                }
                this.logger.LogTrace($"{nameof(PostRoundTimerStarted)}: Sent round timer start command to host server.");
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }
        }
예제 #3
0
 /// <summary>
 /// Handles the RoundTimerClockPing event / message.
 /// </summary>
 /// <param name="args">The <see cref="RoundTimerEventArgs"/> instance containing the event data.</param>
 /// <returns></returns>
 public async Task RoundTimerClockPing(RoundTimerEventArgs args) => await Clients.AllExcept(GetCallerId()).InvokeAsync("RoundTimerClockPing", args);
예제 #4
0
 /// <summary>
 /// Handles the RoundTimerStopped event / message.
 /// </summary>
 /// <param name="args">The <see cref="RoundTimerEventArgs"/> instance containing the event data.</param>
 /// <returns></returns>
 public async Task RoundTimerStopped(RoundTimerEventArgs args) => await Clients.AllExcept(GetCallerId()).InvokeAsync("RoundTimerStopped", args);