mirror of
https://github.com/unmojang/node-minecraft-protocol.git
synced 2025-09-29 14:13:45 -04:00
Patch UUID processing (Fixes #92)
This commit is contained in:
parent
f80b2aa1b3
commit
e76d2743e1
5
index.js
5
index.js
@ -178,13 +178,16 @@ function createServer(options) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
client.uuid = uuid;
|
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();
|
loginClient();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function 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;
|
client.state = states.PLAY;
|
||||||
loggedIn = true;
|
loggedIn = true;
|
||||||
startKeepAlive();
|
startKeepAlive();
|
||||||
|
@ -1355,7 +1355,7 @@ function parsePacket(buffer, state, isServer, packetsToParse) {
|
|||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
version: 5,
|
version: 5,
|
||||||
minecraftVersion: '1.7.6',
|
minecraftVersion: '1.7.10',
|
||||||
sessionVersion: 13,
|
sessionVersion: 13,
|
||||||
parsePacket: parsePacket,
|
parsePacket: parsePacket,
|
||||||
createPacketBuffer: createPacketBuffer,
|
createPacketBuffer: createPacketBuffer,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user