diff --git a/data/1.16.220/protocol.json b/data/1.16.220/protocol.json index 0fb610a..b9e00f0 100644 --- a/data/1.16.220/protocol.json +++ b/data/1.16.220/protocol.json @@ -7114,7 +7114,7 @@ "type": "lu64" }, { - "name": "unknown_flag", + "name": "needs_response", "type": "u8" } ] diff --git a/data/latest/types.yaml b/data/latest/types.yaml index 9410467..5e05b31 100644 --- a/data/latest/types.yaml +++ b/data/latest/types.yaml @@ -1015,8 +1015,9 @@ MapDecoration: # automatically, whereas others may be changed. color_abgr: varint -# Some arbitrary definitions from CBMC, Window IDs are normally -# unique + sequential +# List of Window IDs. When a new container is opened (container_open), a new sequential Window ID is created. +# Below window IDs are hard-coded and created when the game starts and the server does not +# send a `container_open` for them. WindowID: i8 => -100: drop_contents -24: beacon diff --git a/src/client.js b/src/client.js index 0f82802..e675367 100644 --- a/src/client.js +++ b/src/client.js @@ -43,7 +43,7 @@ class Client extends Connection { this.on('session', this._connect) if (this.options.offline) { - console.debug('offline mode, not authenticating', this.options) + debug('offline mode, not authenticating', this.options) auth.createOfflineSession(this, this.options) } else { auth.authenticateDeviceCode(this, this.options) @@ -122,7 +122,7 @@ class Client extends Connection { } onDisconnectRequest (packet) { - console.warn(`C Server requested ${packet.hide_disconnect_reason ? 'silent disconnect' : 'disconnect'}: ${packet.message}`) + console.warn(`Server requested ${packet.hide_disconnect_reason ? 'silent disconnect' : 'disconnect'}: ${packet.message}`) this.emit('kick', packet) this.close() } @@ -140,7 +140,7 @@ class Client extends Connection { close () { if (this.status !== ClientStatus.Disconnected) { this.emit('close') // Emit close once - console.log('Client closed!') + debug('Client closed!') } clearInterval(this.loop) clearTimeout(this.connectTimeout) diff --git a/test/proxy.js b/test/proxy.js index 5c98785..2ea17b9 100644 --- a/test/proxy.js +++ b/test/proxy.js @@ -11,7 +11,9 @@ function proxyTest (version, timeout = 1000 * 40) { }) server.on('connect', client => { + console.debug('Client has connected') client.on('join', () => { // The client has joined the server. + console.debug('Client has authenticated') setTimeout(() => { client.disconnect('Hello world !') }, 1000) // allow some time for client to connect @@ -41,6 +43,8 @@ function proxyTest (version, timeout = 1000 * 40) { console.debug('Client started') + client.on('packet', console.log) + client.on('disconnect', packet => { console.assert(packet.message === 'Hello world !')