mc-beta-server/server/Packets/Packet2Handshake.js

26 lines
474 B
JavaScript
Raw Normal View History

2021-08-24 15:29:46 +01:00
/*
=========- Packet2Handshake.js -========
Created by Holly (tgpethan) (c) 2021
Licenced under MIT
========================================
*/
2021-08-12 04:58:56 +01:00
const Packet = require("./Packet.js");
class Packet2Handshake extends Packet {
constructor(username = "") {
super(0x02);
this.username = username;
}
2021-08-20 22:42:00 +01:00
writePacket() {
2021-08-12 04:58:56 +01:00
super.writePacket();
this.writer.writeString("-"); // "-" == Offline mode
return this.toBuffer();
}
}
module.exports = Packet2Handshake;