Stop disconnecting when upstream packet deserialization fails (#435)
* Remove disconnect on upstream packet deserialization error * Add disconnectOnParseError option * Rename disconnectOnParseError option to omitParseErrors * Update index.d.ts * Update index.d.ts --------- Co-authored-by: extremeheat <extreme@protonmail.ch>
This commit is contained in:
parent
010d57e78a
commit
1414420574
2 changed files with 8 additions and 1 deletions
3
index.d.ts
vendored
3
index.d.ts
vendored
|
|
@ -189,6 +189,9 @@ declare module 'bedrock-protocol' {
|
|||
// Only allow one client to connect at a time (default: false)
|
||||
forceSinge?: boolean
|
||||
|
||||
// Do not disconnect clients on server packet parsing errors and drop the packet instead (default: false)
|
||||
omitParseErrors?: boolean
|
||||
|
||||
// Dispatched when a new client has logged in, and we need authentication
|
||||
// tokens to join the backend server. Cached after the first login.
|
||||
// If this is not specified, the client will be disconnected with a login prompt.
|
||||
|
|
|
|||
|
|
@ -49,7 +49,11 @@ class RelayPlayer extends Player {
|
|||
} catch (e) {
|
||||
this.server.deserializer.dumpFailedBuffer(packet, this.connection.address)
|
||||
console.error(this.connection.address, e)
|
||||
this.disconnect('Server packet parse error')
|
||||
|
||||
if (!this.options.omitParseErrors) {
|
||||
this.disconnect('Server packet parse error')
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
const name = des.data.name
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue