Skip to content

feat(wired): array variable metadata + array inspection packets - #147

Draft
DennisObject wants to merge 3 commits into
Devfrom
feature/wired-arrays-protocol
Draft

feat(wired): array variable metadata + array inspection packets#147
DennisObject wants to merge 3 commits into
Devfrom
feature/wired-arrays-protocol

Conversation

@DennisObject

Copy link
Copy Markdown
Collaborator

Protocol support for array-typed wired variables. Needs duckietm/Polaris-Emulator#534; consumed by duckietm/Octane#353.

Incoming

  • WiredArrayInspectionDataEvent / WiredArrayInspectionDataParser (header 5111) — paginated array contents for Creator Tools
  • WiredUserVariablesDataParser — reads the optional trailing array-metadata block (value shape, format, mode, max entries, fields, permanent flag) and flags schemas the server could not parse

Outgoing

  • WiredArrayInspectionRequestComposer (10034)
  • WiredArrayInspectionUpdateComposer (10035)

Both registered in NitroMessages.

Testing in-game

1 — metadata reaches the editors
Enter a room, open any wired variable box. The client's array pickers are populated from WiredUserVariablesDataParser — if a wf_var_room box is set to Array with fields, those fields appear in Modify Array / Check Array. Empty pickers mean the trailing block didn't parse.

2 — legacy server
Point the client at an emulator without the array branch. The variables packet has no trailing metadata block; every definition still loads with valueShape undefined and the boxes behave as before. Same for a truncated or malformed block — the base packet stays valid.

3 — array inspection
Creator Tools → Inspection tab → select a furni or user holding an array. WiredArrayInspectionRequestComposer goes out, the browser fills from the response. Page through a >25-entry array to exercise page / pageCount / startIndex / endIndex. Edit a cell → WiredArrayInspectionUpdateComposer goes out and the value comes back changed.

4 — unusable schema
When the server reports array_unavailable, the parser sets unavailable and clears hasValue instead of flattening the definition to a scalar, so the editors keep it out of every picker.

5 — composer registration
getComposerId() must not return -1 for either composer. If the Creator Tools array panel is silently dead, check both _events and _composers in NitroMessages.

WiredUserVariablesDataParser mapped the server's "array_unavailable"
value shape to 'single', which reads downstream as a usable scalar. It
now sets `unavailable` and clears hasValue so the editors can keep the
definition out of every picker.
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