From e76d2743e115d26be8f8ee0c347bf65f0c9602f2 Mon Sep 17 00:00:00 2001 From: roblabla Date: Fri, 5 Sep 2014 12:49:39 +0200 Subject: [PATCH] Patch UUID processing (Fixes #92) --- index.js | 5 ++++- lib/protocol.js | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index f48a9c9..5796a9e 100644 --- a/index.js +++ b/index.js @@ -178,13 +178,16 @@ function createServer(options) { return; } client.uuid = uuid; + // Convert to a valid UUID until the session server updates and does + // it automatically + client.uuid = client.uuid.replace(/(\w{8})(\w{4})(\w{4})(\w{4})(\w{12})/, "$1-$2-$3-$4-$5"); loginClient(); }); } } function loginClient() { - client.write(0x02, {uuid: (client.uuid | 0).toString(10), username: client.username}); + client.write(0x02, {uuid: (client.uuid || 0).toString(10), username: client.username}); client.state = states.PLAY; loggedIn = true; startKeepAlive(); diff --git a/lib/protocol.js b/lib/protocol.js index 13e43ac..3d7756d 100644 --- a/lib/protocol.js +++ b/lib/protocol.js @@ -1355,7 +1355,7 @@ function parsePacket(buffer, state, isServer, packetsToParse) { module.exports = { version: 5, - minecraftVersion: '1.7.6', + minecraftVersion: '1.7.10', sessionVersion: 13, parsePacket: parsePacket, createPacketBuffer: createPacketBuffer,