Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emit some kind of error for missing or additional fields in write #156

Closed
rom1504 opened this issue Apr 21, 2015 · 4 comments
Closed

Emit some kind of error for missing or additional fields in write #156

rom1504 opened this issue Apr 21, 2015 · 4 comments

Comments

@rom1504
Copy link
Member

rom1504 commented Apr 21, 2015

Additional fields are currently ignored (see https://github.com/PrismarineJS/node-minecraft-protocol/blob/master/src/protocol.js#L1503)
Missing fields are currenlty passed as undefined.

It would be better to emit some error.
Related to PrismarineJS/mineflayer#269

@rom1504
Copy link
Member Author

rom1504 commented May 23, 2015

same as #127

@roblabla
Copy link
Member

Missing is easy to do. Additional might have some non-acceptable overhead though.

@rom1504
Copy link
Member Author

rom1504 commented Nov 20, 2015

Missing is mostly about throwing an error if value[typeArg.name] is undefined there https://github.com/roblabla/ProtoDef/blob/master/src/datatypes/structures.js#L134

I'm not sure if checking for additional fields has any use. And yeah, it would mean going through the value object keys, which can be a little costly.

@rom1504
Copy link
Member Author

rom1504 commented Mar 1, 2016

moved tracking to ProtoDef-io/node-protodef#61

@rom1504 rom1504 closed this as completed Mar 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants