mirror of
https://github.com/burrow-dev/burrow-server.git
synced 2026-11-18 17:27:50 -05:00
fix(world): replay active actions for late room joins
Remember a standing avatar's valid action and mirror marker, replay it after avatar creation for players entering or reloading a room, and clear it on movement or exit. Add an end-to-end regression test for late join animation sync.
This commit is contained in:
1 parent
08780d7e69
commit
8e7b193621
2 files changed
+40
No files matched your search
@@ -85,6 +85,21 @@ const run = async () => {
|
||||
await a.untilXt("ac");
|
||||
await a.nextXt("il");
|
||||
|
||||
// Actions are normally live type-3 chat packets. A player who enters after
|
||||
// one has started must receive the current action after the avatar itself,
|
||||
// including its mirror marker, rather than seeing an idle animal.
|
||||
say(a, roomId, ":dance:%3%m1");
|
||||
assert.deepStrictEqual((await b.untilXt("uc")).slice(2), [String(annLogin.params.userId), ":dance:", "3", "m1"]);
|
||||
const {client: c} = await arrive("Cat", "KettlePass01");
|
||||
assert.deepStrictEqual((await c.untilXt("uc")).slice(2), [String(annLogin.params.userId), ":dance:", "3", "m1"]);
|
||||
await a.untilXt("ac"); // Cat appearing in the room
|
||||
await a.nextXt("il");
|
||||
await b.untilXt("ac");
|
||||
await b.nextXt("il");
|
||||
c.socket.destroy();
|
||||
await a.untilXt("ar");
|
||||
await b.untilXt("ar");
|
||||
|
||||
// the shop's name and stalls come from its room file (lib/roominfo.js),
|
||||
// read the first time anyone goes in; until then the name is made from its
|
||||
// path. a scout goes in first and comes back until the file has been read,
|
||||
|
||||
Reference in new issue
Block a user