Merge pull request #193 from roblabla/master

Bump MINOR, UUIDs are now represented as dashed string
This commit is contained in:
Robin Lambertz 2015-07-18 19:52:51 +02:00
commit 216625d750
3 changed files with 5 additions and 12 deletions

View file

@ -1,6 +1,6 @@
{
"name": "minecraft-protocol",
"version": "0.14.1-GH",
"version": "0.15.0-GH",
"description": "Parse and serialize minecraft packets, plus authentication and encryption.",
"main": "index.js",
"repository": {

View file

@ -1,6 +1,7 @@
var nbt = require('prismarine-nbt');
var utils = require("./utils");
var numeric = require("./numeric");
var uuid = require('node-uuid');
// TODO : remove type-specific, replace with generic containers and arrays.
module.exports = {
@ -14,21 +15,13 @@ module.exports = {
function readUUID(buffer, offset) {
return {
value: [
buffer.readUInt32BE(offset),
buffer.readUInt32BE(offset + 4),
buffer.readUInt32BE(offset + 8),
buffer.readUInt32BE(offset + 12),
],
value: uuid.unparse(buffer, offset),
size: 16,
};
}
function writeUUID(value, buffer, offset) {
buffer.writeUInt32BE(value[0], offset);
buffer.writeUInt32BE(value[1], offset + 4);
buffer.writeUInt32BE(value[2], offset + 8);
buffer.writeUInt32BE(value[3], offset + 12);
uuid.parse(value, buffer, offset);
return offset + 16;
}

View file

@ -118,7 +118,7 @@ var values = {
velocityY: 2,
velocityZ: 3,
},
'UUID': [42, 42, 42, 42],
'UUID': "00112233-4455-6677-8899-aabbccddeeff",
'position': {x: 12, y: 332, z: 4382821},
'restBuffer': new Buffer(0),
'condition': function(typeArgs) {