Skip to content

Align matrix map serialization with the OpenRGB protocol - #2

Merged
septicwolf818 merged 1 commit into
masterfrom
fix/zone-type-desync
Aug 18, 2026
Merged

septicwolf818 merged 1 commit into
masterfrom
fix/zone-type-desync

Conversation

@septicwolf818

Copy link
Copy Markdown
Owner

ZoneData.pack wrote the element count in the matrix size field instead of the byte length the protocol defines (8 + wh4), and struct.pack used native alignment which inserted 2 phantom bytes after the size field, shifting height/width and desyncing any packed matrix zone. Also crashed on None values (0xFFFFFFFF map holes converted by unpack) and on zones with no map (mat_height/mat_width None), breaking save_profile(local=True).

Use a packed layout with the correct byte length, map None back to 0xFFFFFFFF, and skip empty maps like the server does.

ZoneData.pack wrote the element count in the matrix size field instead of
the byte length the protocol defines (8 + w*h*4), and struct.pack used
native alignment which inserted 2 phantom bytes after the size field,
shifting height/width and desyncing any packed matrix zone. Also crashed
on None values (0xFFFFFFFF map holes converted by unpack) and on zones
with no map (mat_height/mat_width None), breaking save_profile(local=True).

Use a packed layout with the correct byte length, map None back to
0xFFFFFFFF, and skip empty maps like the server does.
@septicwolf818
septicwolf818 merged commit 0fff91a into master Aug 18, 2026
@septicwolf818
septicwolf818 deleted the fix/zone-type-desync branch August 18, 2026 08:59
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