b262918082
refactor: 地图 MapLayer
2026-09-29 20:21:50 +08:00
122567b050
refactor: hero
2026-09-29 16:41:44 +08:00
3bc37b596d
docs: 修正 types.ts 中关于录像参数的描述
2026-09-23 19:36:10 +08:00
2198734f81
refactor: replay system
2026-09-23 18:25:31 +08:00
9247a8886c
feat: 调整录像参数类型的参数类型,10 ~ 31 留空,32 ~ 255 分配给短字符串
2026-09-23 16:26:17 +08:00
1fb92c3976
refactor: data-common/common
2026-09-23 16:04:50 +08:00
7743795948
refactor: Hero equipment system
2026-09-23 13:09:19 +08:00
d12790280a
feat: 完成数据端数据类型的构建
2026-09-20 19:11:43 +08:00
ae5a956492
chore: 删除 IDirectionMapper,全换成 IFaceHandler
2026-09-18 08:26:57 +08:00
4aaea68b65
refactor: 寻路系统改进
2026-09-17 21:21:08 +08:00
49116c0784
fix(07-15): reject an expand multiplier of exactly one
...
- both multiplier checks tighten from < 1 to <= 1, matching warning 149's own text (must be greater than 1)
- an exact multiplier of 1 now warns 149 and falls back to the existing factor 2, so buffer expansion always terminates
- add the multiplier-of-one regression case (two code 149 warnings, 15 appended steps all read back in order)
2026-09-17 20:52:20 +08:00
a7c9f97c94
fix(07-15): drop unencodable replay params instead of a zero-length record
...
- normalizeParam returns null for an unencodable param value, matching its own jsDoc and the documented discard semantics of normalizeParamList
- the command param count, the bytes actually written and the param cursor stay consistent so later commands keep their correct byte offsets
- add the discard-alignment regression case (count 0, later command bytes intact, read stream aligned)
2026-09-17 20:48:47 +08:00
e9e9939bd8
refactor: 删除 data-state 中的 legacy 文件夹
2026-09-17 19:37:30 +08:00
a2a8e6ec35
refactor: ReplaySystem.route -> ReplaySystem.array,修复 disabled 标记在 setReplayArray 中清零可能导致意外记录的问题
2026-09-17 19:18:30 +08:00
34ba9e873b
fix: 录像 onRecordCommand 钩子参数错误
2026-09-17 19:02:47 +08:00
94ceb50cfe
refactor: 存档系统挪至渲染端
2026-09-17 13:29:34 +08:00
0c6812fcda
test(07-10): 末步 set 用例改为断言 paramUsed 的外部可观测偏移
...
- paramUsed 为私有成员,其正确性只能通过下一条命令参数的写入偏移观测
- 增长与缩短两条末步用例补充参数缓冲区原始字节断言,使「末步起点回退」子缺陷在未修复时可直接失败
2026-09-17 12:59:24 +08:00
5b26539b00
docs(07-10): WR-03 录像参数格式改为类型码只增不改的追加式约定
...
- 按 Q6=B 不加格式版本字段:array.ts 的类型码表注释写明只增不改约定(新语义必须分配新码,禁止复用),并记录 5/6/7/8 与短字符串基址的一次性重新分配
- types.ts 的 IReplaySystemSave.paramArray 与 IReplayArray.getParamArray jsDoc 同步该约定,并写明不承诺读回旧格式录像
- array.test.ts 新增类型码映射锚定用例(5/6/7/8/9/短字符串基址 9)
- system.ts 无改动(未引入版本字段)
2026-09-17 12:55:50 +08:00
35d4ad6f1c
fix(07-10): 编解码自洽 —— bigint 长度字节守卫与参数计数取截断后长度
...
- WR-01:normalizeParam 的 bigint 分支按长度字节的真实容量(255 字节 = 2^2040)判定,|值| >= 2^2040 触发告警 152 并丢弃该参数;normalizeParamList 过滤被丢弃项,不保留占位
- WR-02:add/insert/set 写入的命令参数计数一律取标准化后的 normalizeParam.length,与 normalizeParamList 的 255 截断一致
- logger.json 的 warn 152 文案改为与真实可表示范围(2^2040 - 1)一致,并写明溢出参数会被忽略
- array.test.ts 新增 bigint 长度字节边界往返、超界丢弃后命令计数/读流对齐、256/300 参数截断计数回归
2026-09-17 12:53:27 +08:00
1f9fb18cf5
fix(07-10): 写入路径越界校验与读流跨读档过期
...
- insert/delete/set 在 disabled 早退后、任何缓冲读写前校验 index,越界不修改任何缓冲区并告警新码 179(携带操作名/索引/当前长度)
- insert(index === length) 判为合法追加,按 add 语义写入(paramUsed 起、indexArray[length] = paramUsed),insert 合法区间变为 [0, length]
- setReplayArray 在 rebuildIndexArray 后补 expireStreams(),活跃读流跨 ReplaySystem.loadState 标记过期(#06-17-3 / 审计 H)
- types.ts 的 insert/delete/set jsDoc 写明合法区间与越界契约
- logger.json 新增 warn 179(当前最大 warn 码 178 之后)
- array.test.ts 新增 5 条边界回归(含越界前后逐字节不变量);saveLoad.test.ts 新增活跃读流跨读档告警 156 回归
2026-09-17 12:50:45 +08:00
9ae28c68cc
fix(07-10): CR-01 ReplayArray.set 索引回退起点与末步终点对齐
...
- set() 改用 getParamRange(index) 取 [start, end),末步终点取 paramUsed,不再直读未初始化的 indexArray[index + 1]
- 索引回退循环起点由参数字节偏移 paramStart + 1 改为命令索引 index + 1,与 delete() 同口径
- types.ts 的 IReplayArray.set jsDoc 写明允许参数编码长度变化及其后步骤索引平移
- array.test.ts 新增 6 条 CR-01 回归:中间步增长/缩短、末步增长/缩短、读流遍历(IN-03 场景)
2026-09-17 12:42:48 +08:00
fe595b7983
refactor: 存档系统应处于渲染层
2026-09-16 21:54:12 +08:00
49aacb087a
refactor: 调整录像命名
2026-09-16 21:51:19 +08:00
0224c2e67e
docs(07): align replay param type table with the renumbered codes
2026-09-16 13:27:38 +08:00
9f058650c1
fix(07-06): #06-08-1 keep backward steps on the same axis
...
- Special 后退分支基准由 getCurrentDirection() 改为 this.faceDirection,避免被本步写入的反方向改写而在多步之间摆动
- 前进分支保持既有 getCurrentDirection() 语义不变
- 同步 IObjectMover.backward jsdoc 与 getCurrentDirection/prepareStep 注释措辞(D-11)
- 取消 mover.test.ts 多步后退用例的 it.skip,断言一字未改(D-10)
2026-09-15 20:57:13 +08:00
40824cc10b
fix(07-03): #06-04-4 shift replay params in the insert direction
...
- Move paramArray bytes to paramStart + length so later steps keep their data
- Move indexArray entries to index + 1 so get(i) sees the inserted step
- Un-skip both insert order cases
2026-09-15 18:50:30 +08:00
45dde1cb1c
fix(07-03): #06-04-3 shift param indexes from the command index on delete
...
- Add a private getParamRange helper using paramUsed as the last-step sentinel
- Roll back indexArray from the command index instead of the param byte offset
- Un-skip the middle-step delete cases
2026-09-15 18:45:31 +08:00
965e002476
fix(07-03): #06-04-2 round-trip multi-byte and negative bigint parameters
...
- Encode bigint bytes by bit-shift mask instead of the broken accumulator
- Decode the bigint length prefix and payload bytes unsigned
- Encode negative bigint as dedicated type 8 with magnitude payload
- Un-skip the multi-byte and heterogeneous bigint cases, add focused cases
2026-09-15 18:37:21 +08:00
528b8c91a5
fix(07-03): #06-04-1 round-trip negative int64 and renumber param type codes
...
- Correct the int64 decode multiplier to 2147483648
- Encode negative int64 as dedicated type 5 with magnitude payload
- Shift float/bigint/long-string/short-string type codes to 6/7/9/length+9
- Un-skip the int64 round-trip case and add negative int64 focused cases
2026-09-15 18:35:18 +08:00
83dc4fdaf6
test(06-14): register blocked delete/insert heterogeneous stream order (G-06-04-C) and map coverage
...
- add correct-expectation it.skip for the heterogeneous route after delete(1) (anchor #06-04-3)
- add correct-expectation it.skip for the heterogeneous route after insert(2, 9, [true, 5]) (anchor #06-04-4)
- add file-inline expectRouteStream helper (stream-only typed reads with index 1..N and terminal null)
- append the create-or-append 06-14 section to 06-COVERAGE-MAP.md; existing 5 skips unchanged
2026-09-15 11:50:30 +08:00
2cffe3ef6c
test(06-14): strengthen stream assertions with types, index progression and expiry (G-06-04-C/B)
...
- rewrite expectHeterogeneousRead to assert per-param typeof + value, stream index i+1, terminal null and stream.index === length
- add per-param typeof/value and stream.index progression to the sequence and expand stream cases
- add 'expires a read stream after the heterogeneous route is mutated': add() expires the old stream (warn 155) and a fresh stream reads the new 7-step order
2026-09-15 11:47:25 +08:00
8ae4588ba4
test(06-14): verify a heterogeneous route exclusively through a read stream (G-06-04-C/A)
...
- add file-inline expectParamTyped/expectStepTyped helpers asserting typeof + toBe per parameter
- add a 7-command complex route (param counts 1/2/0/1/4/2/3, boolean/int8/int32/float/bigint/string)
- read it only through createReadStream: per-step command, per-param type/value, index 1..7, terminal null
- add a middle-start variant (createReadStream(3) -> indexes 4..7, createReadStream(6) -> index 7)
2026-09-15 11:44:38 +08:00
573402592d
test(06-12): register blocked multi-byte bigint/int64 expectation (G-06-04-A)
2026-09-15 10:40:37 +08:00
0a7f25338f
test(06-12): cover heterogeneous replay sequence read-back (G-06-04-B)
2026-09-15 10:38:51 +08:00
c08f3f8484
fix(replay): enable recording guard; update tests for replay refactor
2026-09-14 20:14:01 +08:00
17d7c8f46a
refactor: refactor replay system record.
2026-09-14 19:55:20 +08:00
c707c87add
test(06-09): cover map, replay and flag save/load round trips
...
- add map/saveLoad.test.ts: StaticTile/DynamicTile/MapLayer/GameMap/MapState round trips, codes 55/122/124
- add replay/saveLoad.test.ts: ReplayArray and ReplaySystem same-instance round trips
- add flag/saveLoad.test.ts: FlagSystem round trip and separated snapshot
2026-09-14 18:57:51 +08:00
82205a9dc1
feat: 录像存储
2026-09-14 18:17:37 +08:00
cee843981f
feat: 录像记录 & CoreState 存储接口
2026-09-14 18:09:45 +08:00
6699df9eee
test(06-08): extend ObjectMover coverage across its public surface (stage 3)
...
- cover setPos/setFaceDir/setMoveDir/jump/stepFace/forward/backward/speed/face/animDir/push/clear/start
- add controller stop and start-while-moving contract checks with real timers and await onEnd
- mark the multi-step backward case as skipped suspected bug #06-08-1
2026-09-14 17:00:13 +08:00
2cb9bba3ce
test(06-08): cover FlagSystem, FaceManager handlers and RoleFaceBinder (stage 2)
...
- add system.test.ts covering the full FlagSystem public surface and warn code 111
- add faceManager.test.ts covering FaceManager registry plus Dir4/Dir8 handlers
- add face.test.ts covering RoleFaceBinder malloc/bind/query and error codes 43/44
2026-09-14 16:56:17 +08:00
7394a2591c
test(06-08): cover common direction utils and MapLocIndexer (stage 1)
...
- add utils.test.ts covering getFaceMovement/degradeFace/nextFaceDirection/fromDirectionString for all directions
- add indexer.test.ts covering MapLocIndexer coordinate/index round-trip and setWidth stride
2026-09-14 16:51:59 +08:00
cb9c90abc1
test(06-04): cover ReplaySystem and ReplaySandbox pipeline (stage 3)
...
- system.test.ts:registerCommand/getCommand、重复注册 163、record + onRecordCommand、沙箱创建/reset、释放与实例独立性
- sandbox.test.ts:step/onStep、失败即停 158、157、notExecuted 175、156、startIndex、play/pause/resume/stop、setSpeed
- 06-COVERAGE-MAP.md 追加 06-04 小节(148–163、175)
- 06-TEST-FINDINGS.md 登记 #06-04-1..4
2026-09-14 15:21:49 +08:00
8832159f8c
test(06-04): cover ReplayArray pipeline and replay safety decorators (stage 2)
...
- 读流/缓冲区组合:createReadStream / setReplayArray / rebuildIndexArray / 位宽切换
- 触发告警码 149 / 150 / 154 / 155
- func.ts 播放安全装饰器:begin/nested/end/detail、ignoreReplay、收集外 end
- 触发告警码 159 / 160 / 161 / 162
- insert 带参数组合按正确预期 it.skip(#06-04-4)
2026-09-14 15:15:14 +08:00
dfe14b12ec
test(06-04): add ReplayArray codec and single-operation tests (stage 1)
...
- 单类型编解码:boolean / 各整数位宽 + 浮点 / bigint / string / 多参数
- 单数组操作:add / insert / delete / set / get 单次读回
- 触发告警码 148 / 151 / 152 / 153
- int64、多字节 bigint、中间步 delete 按正确预期 it.skip(#06-04-1..3)
2026-09-14 15:11:36 +08:00
aa3c7296c7
chore: 将事件执行标记为 ignoreReplay
2026-09-13 20:52:42 +08:00
a66be585d1
feat(event): rework built-ins and centralize trigger collection
...
- rename deleteBlock -> removeBlock (dynamic tiles need dynamic:true),
moveHeroStep -> stepHero; touchFront steps forward and lets the mover bump
- GameEventSystem.collectEvent owns point/tile source collection; moverImpl
enter/leave/hit reuse it with OnEnter/OnLeave/OnTouch
- IBlockEventEnv gains required system field and nullable heroFloor
- MapLayer.removeBlock added and setBlock guarded by inMap; GameMap owns floorId
- IObjectMover.push accepts readonly steps
- update event/eventDispatch tests to the current implementation (fixtures
supply system, hero location snapshots, renamed registrations)
Verified: data type gate 0 in-scope; vitest 19 files / 112 tests pass; prettier
and eslint clean on touched files.
2026-09-13 20:37:32 +08:00
a701aa6da9
refactor(anon-tokyo): import embedded workspace package everywhere
...
- rename all anon-tokyo imports to @motajs/anon-tokyo in data-common,
data-system and data-state
- declare @motajs/anon-tokyo workspace dependency in data-common and
data-system; refresh pnpm-lock.yaml
2026-09-13 19:17:21 +08:00
b86a060759
feat: 移动器新增 push 方法
2026-09-13 19:01:57 +08:00
46a38fa0c6
refactor: 录像系统指令
2026-09-13 16:38:19 +08:00