mirror of
https://github.com/unmojang/node-minecraft-protocol.git
synced 2025-10-02 15:40:18 -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() {
|
function verifyUsername() {
|
||||||
var digest = mcHexDigest(hash);
|
var digest = mcHexDigest(hash);
|
||||||
validateSession(client.username, digest, function(err, uuid) {
|
validateSession(client.username, digest, function(err, uuid, profile) {
|
||||||
if(err) {
|
if(err) {
|
||||||
client.end("Failed to verify username!");
|
client.end("Failed to verify username!");
|
||||||
return;
|
return;
|
||||||
@ -178,6 +178,7 @@ function createServer(options) {
|
|||||||
// Convert to a valid UUID until the session server updates and does
|
// Convert to a valid UUID until the session server updates and does
|
||||||
// it automatically
|
// it automatically
|
||||||
client.uuid = client.uuid.replace(/(\w{8})(\w{4})(\w{4})(\w{4})(\w{12})/, "$1-$2-$3-$4-$5");
|
client.uuid = client.uuid.replace(/(\w{8})(\w{4})(\w{4})(\w{4})(\w{12})/, "$1-$2-$3-$4-$5");
|
||||||
|
client.profile = profile;
|
||||||
loginClient();
|
loginClient();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,7 @@ function validateSession(username, serverId, cb) {
|
|||||||
.end(function(resp) {
|
.end(function(resp) {
|
||||||
if(resp.ok) {
|
if(resp.ok) {
|
||||||
if("id" in resp.body) {
|
if("id" in resp.body) {
|
||||||
cb(null, resp.body.id);
|
cb(null, resp.body.id, resp.body);
|
||||||
} else {
|
} else {
|
||||||
var myErr = new Error("Failed to verify username!");
|
var myErr = new Error("Failed to verify username!");
|
||||||
cb(myErr);
|
cb(myErr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user