lowercasebtw :3
lowercasebtw :3
DDeno
Created by lowercasebtw :3 on 9/21/2024 in #help
Stupid Broken Pipe
alright
19 replies
DDeno
Created by lowercasebtw :3 on 9/21/2024 in #help
Stupid Broken Pipe
.
19 replies
DDeno
Created by lowercasebtw :3 on 9/21/2024 in #help
Stupid Broken Pipe
@lino-levan
19 replies
DDeno
Created by lowercasebtw :3 on 9/21/2024 in #help
Stupid Broken Pipe
19 replies
DDeno
Created by lowercasebtw :3 on 9/21/2024 in #help
Stupid Broken Pipe
the issue is with this lib
19 replies
DDeno
Created by lowercasebtw :3 on 9/21/2024 in #help
Stupid Broken Pipe
its enough to reproduce the error minus a few spots
19 replies
DDeno
Created by lowercasebtw :3 on 9/21/2024 in #help
Stupid Broken Pipe
async listen() {
this.server = new Server({
hostname: this.address,
port: this.port,
chunkSize: MAX_BYTES_ALLOWED
});

this.server.on("listen", () => Logger.log(Level.INFO, `Listening on ${this.address}:${this.port}`));

this.server.on("connect", (client: Client) => {
const connection = new ClientConnection(client);
this.connections.set(client, connection);
Logger.log(Level.INFO, `Client ${connection.id} connected!`);

client.addListener("receive", async (_, packet: Packet) => {
const reader = new ByteReader(packet.data);
reader.read(Type.VAR_INT) as number; // TODO: packet length?
const packet_id = reader.read(Type.VAR_INT) as number;
await connection.handle(this, reader, packet, packet_id);
});

client.addListener("close", async () => {
Logger.log(Level.INFO, `Client ${connection.id} disconnected!`);
// TODO: cleanup?
await connection.close();
this.connections.delete(client);
});
});

await this.server.listen();
}
async listen() {
this.server = new Server({
hostname: this.address,
port: this.port,
chunkSize: MAX_BYTES_ALLOWED
});

this.server.on("listen", () => Logger.log(Level.INFO, `Listening on ${this.address}:${this.port}`));

this.server.on("connect", (client: Client) => {
const connection = new ClientConnection(client);
this.connections.set(client, connection);
Logger.log(Level.INFO, `Client ${connection.id} connected!`);

client.addListener("receive", async (_, packet: Packet) => {
const reader = new ByteReader(packet.data);
reader.read(Type.VAR_INT) as number; // TODO: packet length?
const packet_id = reader.read(Type.VAR_INT) as number;
await connection.handle(this, reader, packet, packet_id);
});

client.addListener("close", async () => {
Logger.log(Level.INFO, `Client ${connection.id} disconnected!`);
// TODO: cleanup?
await connection.close();
this.connections.delete(client);
});
});

await this.server.listen();
}
19 replies
DDeno
Created by lowercasebtw :3 on 9/21/2024 in #help
Stupid Broken Pipe
No description
19 replies
DDeno
Created by lowercasebtw :3 on 9/21/2024 in #help
Stupid Broken Pipe
Ugh
19 replies
DDeno
Created by lowercasebtw :3 on 9/21/2024 in #help
Stupid Broken Pipe
Not at pc rn
19 replies
DDeno
Created by lowercasebtw :3 on 9/21/2024 in #help
Stupid Broken Pipe
Gimme a second (few mins)
19 replies
DDeno
Created by lowercasebtw :3 on 9/21/2024 in #help
Stupid Broken Pipe
i'm also supossidely/most definitely losing data/packets somehow and I can't have that happening
19 replies
DDeno
Created by lowercasebtw :3 on 9/21/2024 in #help
Stupid Broken Pipe
why is there no method to check if its writable at the time or whatever, ughhhh
19 replies
DDeno
Created by lowercasebtw :3 on 9/21/2024 in #help
Stupid Broken Pipe
its annoying
19 replies
DDeno
Created by lowercasebtw :3 on 9/21/2024 in #help
Stupid Broken Pipe
I need this to not quit on these kinds of errors
19 replies