Ejemplo n.º 1
0
        public static string GetDescription(this FailReason reason)
        {
            switch (reason)
            {
            case FailReason.DataError:
                return(LocalizedStrings.Str2580);

            case FailReason.Disabled:
                return(LocalizedStrings.Str2581);

            case FailReason.DisconnectedByOwner:
                return(LocalizedStrings.Str2582);

            case FailReason.Expired:
                return(LocalizedStrings.Str2583);

            case FailReason.InvalidClientVersion:
                return(LocalizedStrings.Str2584);

            case FailReason.InvalidUserOrPassword:
                return(LocalizedStrings.Str2585);

            case FailReason.Locked:
                return(LocalizedStrings.Str2586);

            case FailReason.SoftwareNotPermitted:
                return(LocalizedStrings.Str2587);

            case FailReason.UserAlreadyConnected:
                return(LocalizedStrings.Str2588);
            }

            return(reason.ToString());
        }
Ejemplo n.º 2
0
        /// <summary>
        /// asynchronously wait for GameEvent to be processed
        /// </summary>
        /// <returns>waitable task </returns>
        public async Task <GameEvent> WaitAsync(TimeSpan timeSpan, CancellationToken token)
        {
            bool processed = false;

#if DEBUG
            Owner?.Logger.WriteDebug($"Begin wait for event {Id}");
#endif

            try
            {
                processed = await Task.Run(() => _eventFinishedWaiter.WaitOne(timeSpan), token);
            }

            catch (TaskCanceledException)
            {
                processed = true;
            }

            if (!processed)
            {
                Owner?.Logger.WriteError("Waiting for event to complete timed out");
                Owner?.Logger.WriteDebug($"{Id}, {Type}, {Data}, {Extra}, {FailReason.ToString()}, {Message}, {Origin}, {Target}");
#if DEBUG
                //throw new Exception();
#endif
            }


            // this lets us know if the the action timed out
            FailReason = FailReason == EventFailReason.None && !processed ? EventFailReason.Timeout : FailReason;
            return(this);
        }
Ejemplo n.º 3
0
        public override string ToString()
        {
            if (Success)
            {
                return("Successfully attached.");
            }

            string message = "Failed. Reason was: " + FailReason.ToString();

            var exception       = Exception;
            int exceptionNumber = 1;

            while (exception != null)
            {
                message  += Environment.NewLine + exceptionNumber++ + ") " + GetStringFromException(exception);
                exception = exception.InnerException;
            }

            return(message);
        }
Ejemplo n.º 4
0
 private TreeNode GetGroupChildNode(SnapShotStatData snapShotResult, FailReason failReason, TreeNode snapShotNode)
 {
     TreeNode node = new TreeNode(failReason.ToString());
     node.ImageKey = "user";
     node.SelectedImageKey = "user";
     node.StateImageIndex = 1;
     node.Tag = this.BindingNodeState(snapShotResult, failReason, snapShotNode, failReason.ToString());
     return node;
 }
Ejemplo n.º 5
0
 private void OnBatchRestoreFailed(FailReason reason)
 {
     Debug.Log("OnBatchRestoreFailed: " + reason.ToString());
 }