bedrock-api
Version:
A Node.js library to retrieve information about a Minecraft Bedrock Edition server using its IP address and port.
21 lines (16 loc) • 410 B
JavaScript
const ByteBuffer = require('bytebuffer');
const { QUERY } = require('../../config');
class Challenge {
constructor(buf) {
this.bb = new ByteBuffer();
}
encode() {
this.bb
.append(QUERY.MAGIC, 'hex')
.writeByte(QUERY.HANDSHAKE)
.writeInt32(1)
.flip()
.compact();
}
}
module.exports = Challenge;