fix(runtime): isolate Campaign LA7b delete state
This commit is contained in:
parent
1b9e7e41f9
commit
ff40656293
2 changed files with 139 additions and 4 deletions
|
|
@ -466,7 +466,8 @@ public sealed class RuntimeCharacterSelectionState : IDisposable
|
|||
_restoreResponseArmed = false;
|
||||
_restoreCorrelationStartedTimestamp = 0;
|
||||
_flagOnlyRestoreResponseAmbiguous = true;
|
||||
_operation = RuntimeCharacterSelectionOperation.None;
|
||||
if (!HasConfirmedDelete())
|
||||
_operation = RuntimeCharacterSelectionOperation.None;
|
||||
_revision++;
|
||||
}
|
||||
Publish(
|
||||
|
|
@ -533,6 +534,7 @@ public sealed class RuntimeCharacterSelectionState : IDisposable
|
|||
{
|
||||
uint characterId;
|
||||
uint errorCode = 0u;
|
||||
bool deleteInFlight;
|
||||
lock (_gate)
|
||||
{
|
||||
if (_disposed
|
||||
|
|
@ -553,6 +555,7 @@ public sealed class RuntimeCharacterSelectionState : IDisposable
|
|||
_restoreCorrelationStartedTimestamp = 0;
|
||||
characterId = response.Guid
|
||||
?? _lastRestoreRequestedCharacterId;
|
||||
deleteInFlight = HasConfirmedDelete();
|
||||
|
||||
if (response.IsOk
|
||||
&& response.Guid is { } guid
|
||||
|
|
@ -573,13 +576,21 @@ public sealed class RuntimeCharacterSelectionState : IDisposable
|
|||
string.CompareOrdinal(left.Name, right.Name));
|
||||
_entries = StablePartitionGreyedToTail(_entries);
|
||||
}
|
||||
_operation = RuntimeCharacterSelectionOperation.RestoreSucceeded;
|
||||
if (!deleteInFlight)
|
||||
{
|
||||
_operation =
|
||||
RuntimeCharacterSelectionOperation.RestoreSucceeded;
|
||||
}
|
||||
_error = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
errorCode = response.VerificationFlag;
|
||||
_operation = RuntimeCharacterSelectionOperation.RestoreRejected;
|
||||
if (!deleteInFlight)
|
||||
{
|
||||
_operation =
|
||||
RuntimeCharacterSelectionOperation.RestoreRejected;
|
||||
}
|
||||
_error = new RuntimeCharacterSelectionError(
|
||||
response.VerificationFlag,
|
||||
CharacterError.Code.Undefined,
|
||||
|
|
@ -804,7 +815,10 @@ public sealed class RuntimeCharacterSelectionState : IDisposable
|
|||
|
||||
private bool HasDeleteModalOrRequest() =>
|
||||
_pendingDeleteCharacterId != 0u
|
||||
|| _operation is RuntimeCharacterSelectionOperation.DeleteRequested
|
||||
|| HasConfirmedDelete();
|
||||
|
||||
private bool HasConfirmedDelete() =>
|
||||
_operation is RuntimeCharacterSelectionOperation.DeleteRequested
|
||||
or RuntimeCharacterSelectionOperation.DeleteAcknowledged;
|
||||
|
||||
private static RuntimeCharacterSelectionEntry[] StablePartitionGreyedToTail(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue