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);
|
}, 1000);
|
||||||
|
|
||||||
const client = new Socket();
|
const client = new Socket();
|
||||||
client.on("open", () => {
|
client.on("connect", () => {
|
||||||
// Send off auth as soon as we 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.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
|
// @ts-ignore
|
||||||
const packetData = createReader(Endian.LE, data);
|
const packetData = createReader(Endian.LE, data);
|
||||||
const packetId = packetData.readUByte();
|
const packetId = packetData.readUByte();
|
||||||
|
|
|
@ -25,11 +25,7 @@ export default class Server {
|
||||||
socket.end(Constants.KEEPALIVE_PACKET);
|
socket.end(Constants.KEEPALIVE_PACKET);
|
||||||
}, 5000);
|
}, 5000);
|
||||||
|
|
||||||
socket.on("message", (data, isBinary) => {
|
socket.on("data", (data) => {
|
||||||
if (!isBinary) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// NOTE: The types declarations for ws are really messed up >:(
|
// NOTE: The types declarations for ws are really messed up >:(
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const packetData = createReader(Endian.LE, data);
|
const packetData = createReader(Endian.LE, data);
|
||||||
|
|
Loading…
Reference in a new issue