(packet)
| 45 | if (!options.generatePreview) options.generatePreview = message => message |
| 46 | |
| 47 | function validateMessageChain (packet) { |
| 48 | try { |
| 49 | validateLastMessages(pending, packet.previousMessages, packet.lastRejectedMessage) |
| 50 | } catch (e) { |
| 51 | if (e instanceof VerificationError) { |
| 52 | raise('multiplayer.disconnect.chat_validation_failed') |
| 53 | if (!options.hideErrors) console.error(client.address, 'disconnected because', e) |
| 54 | } else { |
| 55 | client.emit('error', e) |
| 56 | } |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | function validateSession (packet) { |
| 61 | try { |
no test coverage detected