Skip to content

Commit

Permalink
Ignore duplicate IAmADie messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ChadNedzlek committed Jan 17, 2024
1 parent 4bdbd3a commit 8864e3d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion VaettirNet.PixelsDice.Net/PixelsDie.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,10 @@ private void HandleDieRoll(RollStateMessage msg)

private void HandleIAmADie(IAmADieMessage msg)
{
_idReceived.SetResult(msg);
if (!_idReceived.TrySetResult(msg))
{
Logger.Instance.Log(PixelsLogLevel.Info, "Received duplicate IAmADie messages, discarding");
}
}

public void Dispose()
Expand Down

0 comments on commit 8864e3d

Please sign in to comment.