From d9dee03e260cc48c91c2e72632cfe3ef2886713e Mon Sep 17 00:00:00 2001 From: Rutherther Date: Fri, 20 Jan 2023 11:00:38 +0100 Subject: [PATCH] fix(core): remove a contract after timeout --- Core/NosSmooth.Core/Contracts/Contractor.cs | 3 ++- Core/NosSmooth.Game/Contracts/UseSkillErrors.cs | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Core/NosSmooth.Core/Contracts/Contractor.cs b/Core/NosSmooth.Core/Contracts/Contractor.cs index 014dfee..e1027b1 100644 --- a/Core/NosSmooth.Core/Contracts/Contractor.cs +++ b/Core/NosSmooth.Core/Contracts/Contractor.cs @@ -114,6 +114,7 @@ public class Contractor : IEnumerable $"A contract {info.contract} has been registered for too long and was unregistered automatically." ) ); + toRemove.Add(info); continue; } @@ -148,7 +149,7 @@ public class Contractor : IEnumerable return errors.Count switch { 0 => Result.FromSuccess(), - 1 => (Result)errors[0], + 1 => Result.FromError((Result)errors[0]), _ => new AggregateError(errors) }; } diff --git a/Core/NosSmooth.Game/Contracts/UseSkillErrors.cs b/Core/NosSmooth.Game/Contracts/UseSkillErrors.cs index aacb2a9..f4da2b6 100644 --- a/Core/NosSmooth.Game/Contracts/UseSkillErrors.cs +++ b/Core/NosSmooth.Game/Contracts/UseSkillErrors.cs @@ -24,5 +24,10 @@ public enum UseSkillErrors /// /// The character does not have enough mana. /// - NoMana + NoMana, + + /// + /// There was no response from the server. + /// + NoResponse } \ No newline at end of file -- 2.49.0