fix(server/game): replace the old session on a new login

This commit is contained in:
capyb2222 committed 2026-09-12 20:30:03 -07:00
1 parent 59e7471014
commit c16c95db94
6 files changed
+38

No files matched your search

+13
View File
@@ -1073,5 +1073,18 @@ void runFlowTests() {
check(!client.await(cmd::ChessRogueQueryScRsp, packet, 600),
"a silenced module gets no reply");
// The same account logging in from a new port replaces the old session, instead of
// leaving it to write its stale copy over the new login's save when it times out.
{
TestClient second;
check(second.connect(kTestPort), "a second client connects");
proto::PlayerGetTokenCsReq again;
again.account_uid = "capybara";
second.send(cmd::PlayerGetTokenCsReq, again);
net::Packet secondPacket;
check(second.await(cmd::PlayerGetTokenScRsp, secondPacket), "and logs in");
check(gateway.sessions().size() == 1, "leaving one session for the account");
}
gateway.stop();
}