fix: improve minigame reconnect flow

This commit is contained in:
ud18010
2026-07-29 19:30:50 +08:00
parent 6a5e534d00
commit 42c3874d82
21 changed files with 979 additions and 52 deletions
+17
View File
@@ -74,6 +74,23 @@ namespace XWorld.Server.Host.Tests
() => host.CreateRoom("dup", "rps", 1, Cfg(), Players, new Capture()));
}
[Fact]
public void EndRoom_ReleasesRoomImmediately()
{
var host = NewHost();
var cap = new Capture();
host.CreateRoom("manual", "rps", 1, Cfg(), Players, cap);
Assert.True(host.EndRoom("manual"));
Assert.Equal(0, host.ActiveRoomCount);
int broadcasts = cap.Broadcasts.Count;
host.DeliverTo("manual", 1, new NetMessage(1, new byte[] { (byte)Choice.Rock }));
host.TickAll(0.1f);
Assert.Equal(broadcasts, cap.Broadcasts.Count);
}
[Fact]
public void TickAll_ReturnsEndedRoomIds()
{