waow
This commit is contained in:
parent
720ffdb8a1
commit
7e646efd28
2 changed files with 3 additions and 7 deletions
|
@ -28,12 +28,12 @@ export default class Client {
|
|||
}, 1000);
|
||||
|
||||
const client = new Socket();
|
||||
client.on("open", () => {
|
||||
client.on("connect", () => {
|
||||
// Send off auth as soon as we connect
|
||||
client.write(createWriter(Endian.LE, 2 + config.authKey.length).writeUByte(Packet.Auth).writeShortString(config.authKey).toBuffer());
|
||||
});
|
||||
|
||||
client.on("message", (data) => {
|
||||
client.on("data", (data) => {
|
||||
// @ts-ignore
|
||||
const packetData = createReader(Endian.LE, data);
|
||||
const packetId = packetData.readUByte();
|
||||
|
|
|
@ -25,11 +25,7 @@ export default class Server {
|
|||
socket.end(Constants.KEEPALIVE_PACKET);
|
||||
}, 5000);
|
||||
|
||||
socket.on("message", (data, isBinary) => {
|
||||
if (!isBinary) {
|
||||
return;
|
||||
}
|
||||
|
||||
socket.on("data", (data) => {
|
||||
// NOTE: The types declarations for ws are really messed up >:(
|
||||
// @ts-ignore
|
||||
const packetData = createReader(Endian.LE, data);
|
||||
|
|
Loading…
Reference in a new issue