From 4560c1948f59662fa735b7e686d2c0df2957805d Mon Sep 17 00:00:00 2001 From: plexigras Date: Sun, 3 Jun 2018 17:57:03 +0200 Subject: [PATCH 1/2] added session data to session even --- src/client/auth.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/auth.js b/src/client/auth.js index 69fcb9c..c618ad8 100644 --- a/src/client/auth.js +++ b/src/client/auth.js @@ -15,7 +15,7 @@ module.exports = function (client, options) { client.session = session client.username = session.selectedProfile.name options.accessToken = session.accessToken - client.emit('session') + client.emit('session', session) options.connect(client) } } From 069d95366c48428568533fc017ef13804b9e087b Mon Sep 17 00:00:00 2001 From: plexigras Date: Sun, 3 Jun 2018 18:31:54 +0200 Subject: [PATCH 2/2] added session event to docs --- doc/README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/README.md b/doc/README.md index 1b28c24..77c37bd 100644 --- a/doc/README.md +++ b/doc/README.md @@ -66,6 +66,7 @@ Called when a client connects, but before any login has happened. Takes a Called when a client is logged in against server. Takes a `Client` parameter. + ## mc.createClient(options) Returns a `Client` instance and perform login. @@ -146,6 +147,10 @@ and the packet metadata (name, state) Called when the protocol changes state. Takes the new state and old state as parameters. +### `session` event + +Called when user authentication is resolved. Takes session data as parameter. + ### per-packet events Check out the [minecraft-data docs](https://prismarinejs.github.io/minecraft-data/?v=1.8&d=protocol) to know the event names and data field names.