mirror of
https://github.com/unmojang/node-minecraft-protocol.git
synced 2025-09-28 21:52:17 -04:00
Fix createServer
This commit is contained in:
parent
36d75fd3b6
commit
1efc14be78
@ -68,7 +68,7 @@ function createClient(options) {
|
||||
if (options.session) {
|
||||
yggdrasil.validate(options.session.accessToken, function(ok) {
|
||||
if (ok)
|
||||
cb(null, options.sesson);
|
||||
cb(null, options.session);
|
||||
else
|
||||
yggdrasil.refresh(options.session.accessToken, options.session.clientToken, function(err, _, data) {
|
||||
cb(err, data);
|
||||
|
@ -181,15 +181,14 @@ function createServer(options) {
|
||||
nextStep();
|
||||
|
||||
function verifyUsername() {
|
||||
yggserver.hasJoined(client.username, serverId, sharedSecret, client.publicKey, function(err, uuid, profile) {
|
||||
yggserver.hasJoined(client.username, serverId, sharedSecret, client.publicKey, function(err, profile) {
|
||||
if(err) {
|
||||
client.end("Failed to verify username!");
|
||||
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");
|
||||
client.uuid = profile.id.replace(/(\w{8})(\w{4})(\w{4})(\w{4})(\w{12})/, "$1-$2-$3-$4-$5");
|
||||
client.profile = profile;
|
||||
loginClient();
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user