Skip to content

Null-guard AreaInstance in 6 more BVM appearance / movement broadcasts#184

Merged
CoreyRDean merged 1 commit into
developfrom
harden/bvm-appearance-broadcasts
May 25, 2026
Merged

Null-guard AreaInstance in 6 more BVM appearance / movement broadcasts#184
CoreyRDean merged 1 commit into
developfrom
harden/bvm-appearance-broadcasts

Conversation

@CoreyRDean
Copy link
Copy Markdown
Collaborator

Summary

Same broadcast-loop pattern as #183, more sites in ScriptingCommands.bb:

BVM Packet Trigger
BVM_SETACTORGENDER P_AppearanceUpdate "G" Script changes actor gender
BVM_SETACTORBEARD P_AppearanceUpdate "D" Script changes actor beard
BVM_SETACTORHAIR P_AppearanceUpdate "D" Script changes actor hair
BVM_ROTATEACTOR P_RepositionActor "R" Script rotates actor
BVM_MOVEACTOR P_RepositionActor "M" Script repositions actor
BVM_CREATEFLOATINGNUMBER P_FloatingNumber Script pops a damage/XP number above actor

All six share the same AInstance = Object.AreaInstance(Actor\ServerArea) then immediate A2 = AInstance\FirstInZone shape. A stale ServerArea (mid-warp, freed zone) crashed each on the next deref.

Skip the broadcast on Null; the script-side state change still applies in-memory.

Continues the AInstance-Null sweep from PRs #154 / #155 / #176 / #182 / #183.

Test plan

  • compile.bat -t builds Server / Client / GUE / Project Manager cleanly.
  • Trigger any of the six BVMs on an actor mid-warp — state change applies, no broadcast crash.
  • Sanity: in-zone actors still receive each of the six packets correctly.

🤖 Generated with Claude Code

Same broadcast-loop pattern as PR #183, more sites in
ScriptingCommands.bb:

  - BVM_SETACTORGENDER   (broadcasts "G" appearance update)
  - BVM_SETACTORBEARD    (broadcasts "D" appearance update)
  - BVM_SETACTORHAIR     (broadcasts "D" appearance update)
  - BVM_ROTATEACTOR      (broadcasts "R" repos update)
  - BVM_MOVEACTOR        (broadcasts "M" repos update)
  - BVM_CREATEFLOATINGNUMBER (broadcasts floating-number to zone)

All six share the AInstance.AreaInstance = Object.AreaInstance(
Actor\ServerArea) then immediate A2.ActorInstance = AInstance\FirstInZone
shape. A stale ServerArea (mid-warp, freed zone) crashed each on
the next deref. Skip the broadcast on Null; the script-side state
change still applies in-memory.

Continues the AInstance-Null sweep from PRs #154 / #155 / #176 / #182 /
#183.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@CoreyRDean CoreyRDean requested a review from a team as a code owner May 25, 2026 19:02
@CoreyRDean CoreyRDean merged commit b0f7583 into develop May 25, 2026
1 check passed
@CoreyRDean CoreyRDean deleted the harden/bvm-appearance-broadcasts branch May 25, 2026 19:03
CoreyRDean added a commit that referenced this pull request May 25, 2026
Closes the AInstance-Null sweep for ScriptingCommands.bb. Three sites
remained unguarded after PR #184:

  - BVM_SETACTORCLOTHES   (P_AppearanceUpdate "B")
  - BVM_SETACTORFACE      (P_AppearanceUpdate "F")
  - BVM_SETACTORLEVEL     (P_XPUpdate "L" level-up broadcast)

Same pattern, same fix. With this PR, every
`AInstance = Object.AreaInstance(...)` immediately followed by
`A2 = AInstance\FirstInZone` is guarded across ScriptingCommands.bb.

Verified by `grep -A 1 "AInstance.AreaInstance = Object" |
grep -B 1 "A2 = AInstance"` returning no unguarded matches.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
CoreyRDean added a commit that referenced this pull request May 25, 2026
Closes the AInstance-Null sweep for ServerNet.bb. Sites:

  - /me chat broadcast        (line ~284, "* AI\Name$ Params$")
  - /players zone count       (line ~399, "PlayersInZone N")
  - General chat broadcast    (line ~555, "<Name$> message")
  - P_Jump broadcast          (line ~930)
  - P_InventoryUpdate "P"     (line ~1409, pickup-removal)
  - P_InventoryUpdate "D"     (line ~1450, drop-broadcast)
  - SendEquippedUpdate        (line ~2645, gear-change broadcast)

Each was the same AInstance = Object.AreaInstance(...) /
A2 = AInstance\FirstInZone shape. A stale ServerArea (mid-warp,
freed zone) crashed the server on the next deref.

Same recovery: skip the broadcast on Null. The state change
already applies in-memory.

Continues the AInstance-Null sweep across rcce2 (PRs #154 / #155 /
#176 / #182 / #183 / #184 / #185 / #186).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant