Skip to content

Commit

Permalink
Merge pull request planetarium#2388 from planetarium/rc-v100361-3
Browse files Browse the repository at this point in the history
fix mailbox serialize bug about local mail
  • Loading branch information
sonohoshi authored Feb 23, 2023
2 parents 423c220 + ce87651 commit cd057ea
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ jobs:
- 2021.3.5f1
targetPlatform:
- Windows
- macOS
- Linux
steps:
- name: Set environment variables
Expand Down Expand Up @@ -95,7 +94,6 @@ jobs:
matrix:
targetPlatform:
- Windows
- macOS
- Linux
needs: build-unity
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/development' || startsWith(github.ref, 'refs/heads/rc-') || github.ref == 'refs/heads/previewnet' || github.ref == 'refs/heads/2022q2' }}
Expand Down
11 changes: 10 additions & 1 deletion nekoyume/Assets/_Scripts/BlockChain/ActionRenderHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1258,8 +1258,17 @@ await Task.WhenAll(
skillsOnWaveStart.Add(skill);
}

var tempPlayer = (AvatarState)States.Instance.CurrentAvatarState.Clone();
if (LocalMailHelper.Instance.TryGetAllLocalMail(tempPlayer.address, out var mails))
{
foreach (var mail in mails)
{
tempPlayer.mailBox.Remove(mail);
}
}

var resultModel = eval.GetHackAndSlashReward(
new AvatarState((Dictionary)States.Instance.CurrentAvatarState.Serialize()),
new AvatarState((Dictionary)tempPlayer.Serialize()),
States.Instance.GetEquippedRuneStates(BattleType.Adventure),
skillsOnWaveStart,
tableSheets,
Expand Down
3 changes: 3 additions & 0 deletions nekoyume/Assets/_Scripts/Helper/LocalMailHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,8 @@ public void CleanupAndDispose(Address address)
_localMailDictionary[address].Clear();
_disposables.DisposeAllAndClear();
}

public bool TryGetAllLocalMail(Address address, out List<Mail> localMails) =>
_localMailDictionary.TryGetValue(address, out localMails);
}
}

0 comments on commit cd057ea

Please sign in to comment.