mirror of
https://github.com/unmojang/node-minecraft-protocol.git
synced 2025-09-29 14:13:45 -04:00
Store yggdrasil login results, some use-cases need it
This commit is contained in:
parent
9c35951d15
commit
ff95752e45
@ -169,7 +169,7 @@ function createServer(options) {
|
||||
|
||||
function verifyUsername() {
|
||||
var digest = mcHexDigest(hash);
|
||||
validateSession(client.username, digest, function(err, uuid) {
|
||||
validateSession(client.username, digest, function(err, uuid, profile) {
|
||||
if(err) {
|
||||
client.end("Failed to verify username!");
|
||||
return;
|
||||
@ -178,6 +178,7 @@ function createServer(options) {
|
||||
// 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");
|
||||
client.profile = profile;
|
||||
loginClient();
|
||||
});
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ function validateSession(username, serverId, cb) {
|
||||
.end(function(resp) {
|
||||
if(resp.ok) {
|
||||
if("id" in resp.body) {
|
||||
cb(null, resp.body.id);
|
||||
cb(null, resp.body.id, resp.body);
|
||||
} else {
|
||||
var myErr = new Error("Failed to verify username!");
|
||||
cb(myErr);
|
||||
|
Loading…
x
Reference in New Issue
Block a user