Skip to content

Commit 5ef7814

Browse files
committed
:D
1 parent 8c4abf1 commit 5ef7814

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sanctumterra/raknet",
3-
"version": "1.3.58",
3+
"version": "1.3.59",
44
"description": "",
55
"main": "dist/index.js",
66
"scripts": {

src/client/client.ts

+9-5
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,23 @@ export class Client extends Emitter<ClientEvents> {
3232
this.rakSocket = new RakSocket(
3333
this.options.address,
3434
this.options.port,
35-
this.options.mtuSize,
36-
this.options.debug,
35+
// this.options.mtuSize, forgor
36+
// this.options.debug,
3737
);
3838
}
3939

4040
public async connect(): Promise<Advertisement> {
41-
this.rakSocket.connect();
4241
this.ticker = setInterval(() => {
42+
// this.rakSocket.receive();
4343
this.rakSocket.tick();
44-
this.handleData(this.rakSocket.receive());
44+
const data = this.rakSocket.onEvent();
45+
if (data) {
46+
this.handleData(Buffer.from(data.data));
47+
}
4548
this.tick++;
46-
}, 50);
49+
}, 20);
4750
await this.ping();
51+
this.rakSocket.connect();
4852
return new Promise((resolve, reject) => {
4953
this.once("ack", () => {
5054
this.emit("connect");

src/client/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export * from "./client";
22
export * from "./client-events";
3-
export * from "./client_options";
3+
export * from "./client_options";

src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import "reflect-metadata";
22
import { Client } from "./client";
33
export * from "./client";
4-
export * from "./proto";
4+
export * from "./proto";

src/proto/types/valid.ts

-1
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,3 @@ export type ValidTypes =
5858
| typeof VarString
5959
| typeof ZigZag
6060
| typeof ZigZong;
61-

0 commit comments

Comments
 (0)