test/proxy: extra debug logging

This commit is contained in:
extremeheat 2021-05-29 23:56:33 -04:00
commit e9098aa744
4 changed files with 11 additions and 6 deletions

View file

@ -7114,7 +7114,7 @@
"type": "lu64"
},
{
"name": "unknown_flag",
"name": "needs_response",
"type": "u8"
}
]

View file

@ -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

View file

@ -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)

View file

@ -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 !')