Skip to content

add builtin serializer library#2

Open
hardlyardi wants to merge 4 commits intojackhexed:mainfrom
hardlyardi:builtin-serializer
Open

add builtin serializer library#2
hardlyardi wants to merge 4 commits intojackhexed:mainfrom
hardlyardi:builtin-serializer

Conversation

@hardlyardi
Copy link
Copy Markdown

No description provided.

Comment thread .vscode/settings.json Outdated
Comment thread drop/serializer.luau Outdated
Comment thread drop/serializer.luau
Comment on lines +154 to +160
writeid(idcolor3)
buffer.writeu8(writebuf, offset, data.r)
offset += 1
buffer.writeu8(writebuf, offset, data.g)
offset += 1
buffer.writeu8(writebuf, offset, data.b)
offset += 1
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to do ToRGB here

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops

Comment thread drop/serializer.luau
offset += 1
local b = buffer.readu8(readbuf, offset)
offset += 1
output = Color3.new(r, g, b)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Color3.fromRGB

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops

Comment thread drop/serializer.luau
Comment on lines +88 to +95
for index = 1, #data do
local value = data[index]
if value == nil then
nilindex = index
break
end
writedata(data)
end
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not just increment index by one? why use #data

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that was just how i wrote it - i believe my thinking was:

let's encode the array portion
the value might be nil
can fix this

Comment thread drop/serializer.luau
Comment on lines +54 to +57
if num == 0 then
writeid(idzero)
return
end
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be at the top level of the function

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true

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.

2 participants