refactor(net): converge live session state reset
This commit is contained in:
parent
78a9223b65
commit
4f31a5085f
35 changed files with 1460 additions and 83 deletions
|
|
@ -53,4 +53,27 @@ public sealed class ChatLogLocalGuidTests
|
|||
Assert.Equal("You", log.Snapshot()[0].Sender);
|
||||
Assert.Equal(ChatKind.RangedSpeech, log.Snapshot()[0].Kind);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ResetSessionIdentity_RetainsTranscriptButClearsGuidAndDedupeWindow()
|
||||
{
|
||||
var log = new ChatLog();
|
||||
const uint oldGuid = 0x50000001u;
|
||||
const uint newGuid = 0x50000002u;
|
||||
log.SetLocalPlayerGuid(oldGuid);
|
||||
log.OnSystemMessage("session boundary", 1u);
|
||||
log.OnLocalSpeech("Old", "before", oldGuid, isRanged: false);
|
||||
|
||||
log.ResetSessionIdentity();
|
||||
log.OnSystemMessage("session boundary", 1u);
|
||||
log.OnLocalSpeech("Old", "after", oldGuid, isRanged: false);
|
||||
log.SetLocalPlayerGuid(newGuid);
|
||||
log.OnLocalSpeech("New", "new", newGuid, isRanged: false);
|
||||
|
||||
ChatEntry[] entries = log.Snapshot();
|
||||
Assert.Equal(5, entries.Length);
|
||||
Assert.Equal("You", entries[1].Sender);
|
||||
Assert.Equal("Old", entries[3].Sender);
|
||||
Assert.Equal("You", entries[4].Sender);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue