MCPcopy Create free account
hub / github.com/PrismarineJS/node-minecraft-protocol / validateMessageChain

Function validateMessageChain

src/server/chat.js:47–58  ·  view source on GitHub ↗
(packet)

Source from the content-addressed store, hash-verified

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 {

Callers 1

chat.jsFile · 0.85

Calls 2

validateLastMessagesFunction · 0.85
raiseFunction · 0.70

Tested by

no test coverage detected