refactor(gameserver): move placement + corpse-decay logic out of World (HARD GATE) #94

Merged
marco merged 1 commit from refactor/world-hard-gate into main 2026-07-19 13:26:12 +02:00
Owner

Code-review follow-up (STD-1, STD-2, part of STD-3). Two World methods held logic the HARD GATE forbids (a World method may only delegate or do trivial get/set):

  • AddPlayer/SpawnCreature computed the walkable-or-spawn start tile inline (a duplicated formula) → new MovementSystem.ResolveStart; both now delegate.
  • The corpse-decay deadline currentTick + corpseDecayTicks was computed in World in three places → CorpseRegistry now owns decayTicks and its Spawn/SpawnFor take only currentTick; World drops the _corpseDecayTicks field.

Also fixes the stale "serializes under its single lock" comments in the two touched components to the single-simulation-thread wording (#54 — no lock).

Behaviour unchanged — existing placement/decay tests cover it (157 GameServer green, zero warnings).

Definition of Done

  • World.cs contains no walkability formula and no corpse-decay arithmetic — both delegate to a component.
  • Suite green, whole solution builds, zero warnings.
Code-review follow-up (STD-1, STD-2, part of STD-3). Two `World` methods held logic the **HARD GATE** forbids (a World method may only delegate or do trivial get/set): - `AddPlayer`/`SpawnCreature` computed the walkable-or-spawn start tile inline (a **duplicated formula**) → new **`MovementSystem.ResolveStart`**; both now delegate. - The corpse-decay deadline `currentTick + corpseDecayTicks` was computed in `World` in **three** places → `CorpseRegistry` now owns `decayTicks` and its `Spawn`/`SpawnFor` take only `currentTick`; `World` drops the `_corpseDecayTicks` field. Also fixes the stale *"serializes under its single lock"* comments in the two touched components to the single-simulation-thread wording (#54 — no lock). **Behaviour unchanged** — existing placement/decay tests cover it (157 GameServer green, zero warnings). ## Definition of Done - [ ] `World.cs` contains no walkability formula and no corpse-decay arithmetic — both delegate to a component. - [ ] Suite green, whole solution builds, zero warnings.
refactor(gameserver): move placement + corpse-decay logic out of World (HARD GATE)
All checks were successful
ci / Lint & Test (pull_request) Successful in 1m46s
98102b2b07
Two World methods held real logic the HARD GATE forbids:
- AddPlayer/SpawnCreature computed the walkable-or-spawn start tile inline (a
  duplicated formula) -> new MovementSystem.ResolveStart; World delegates.
- The corpse-decay deadline (currentTick + corpseDecayTicks) was computed in
  World in three places -> CorpseRegistry now owns decayTicks and takes only
  currentTick; World drops the _corpseDecayTicks field.

Also correct the stale 'serializes under its single lock' comments in the two
touched components (MovementSystem, CorpseRegistry) to the single-simulation-thread
wording (#54, no lock). Behaviour unchanged; 157 GameServer tests green.
marco merged commit 18b6399f05 into main 2026-07-19 13:26:12 +02:00
marco deleted branch refactor/world-hard-gate 2026-07-19 13:26:13 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
marco/IsoMmo!94
No description provided.