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

Use countType in array to reduce field count #28

Closed
roblabla opened this issue Aug 13, 2015 · 2 comments
Closed

Use countType in array to reduce field count #28

roblabla opened this issue Aug 13, 2015 · 2 comments

Comments

@roblabla
Copy link
Member

Example :

{
  "name": "chunkDataLength",
  "type": "count",
  "typeArgs": {
    "type": "varint",
    "countFor": "chunkData"
  }
},
{
  "name": "chunkData",
  "type": "buffer",
  "typeArgs": {
    "count": "chunkDataLength"
  }
}

should become

{
  "name": "chunkData",
  "type": "buffer",
  "typeArgs": {
    "countType": "varint"
  }
}

This greatly simplifies the protocol.json file, and makes it more obvious that count fields should not be supplied on write. I went over the 1.8 protocol, there are no instances where the count field is far away from the data it counts.

@rom1504
Copy link
Member

rom1504 commented Aug 13, 2015

Sounds good, doing the .json transformation itself should be fairly easy, I think I'll do it and put it in a minecraft-data branch so we can see how to implement this in node-minecraft-protocol.

@rom1504
Copy link
Member

rom1504 commented Aug 21, 2015

done

@rom1504 rom1504 closed this as completed Aug 21, 2015
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