rojo-rbx / rbx-dom

Roblox DOM and (de)serialization implementation in Rust
MIT License
113 stars 45 forks source link

Small Inconsistency with float & double in Attributes encoding #421

Open phoriah opened 3 months ago

phoriah commented 3 months ago

In your documentation it's mentioned that Studio isn't capable of producing float-type attributes. This is mostly true. https://github.com/rojo-rbx/rbx-dom/blob/f6007d561bcde2d120922cec818c0765a00ec460/docs/attributes.md?plain=1#L78 However, it seems that if you were to add an Attribute using the Studio properties menu: image And then save the file as xml (for example), you'd notice that the string encodes as AQAAAAYAAABudW1iZXIFAAAAAA== which, when decoded, show that it has a Type ID of 0x05 and has a size of a float. Though, if you were to touch the value in any way, it would convert to a 0x06 and use double's format.

I'm not sure if this breaks any of your code but it's an interesting exception and might be worth taking into count. Correct me if I'm wrong.

Dekkonot commented 3 months ago

...I'll verify this Monday but if this is actually the case, I'll be confused.

Does this happen for binary files do you know?

phoriah commented 3 months ago

...I'll verify this Monday but if this is actually the case, I'll be confused.

Does this happen for binary files do you know?

Yes, just tested.