@sanctumterra/raknet 1.3.50 → 1.3.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client/client.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import Emitter from "@serenityjs/emitter";
|
|
2
2
|
import { type ClientOptions } from "./client_options";
|
|
3
3
|
import type { ClientEvents } from "./client-events";
|
|
4
|
+
import { type Advertisement } from "../proto";
|
|
4
5
|
export declare class Client extends Emitter<ClientEvents> {
|
|
5
6
|
private rakSocket;
|
|
6
7
|
options: ClientOptions;
|
|
@@ -8,8 +9,8 @@ export declare class Client extends Emitter<ClientEvents> {
|
|
|
8
9
|
tick: number;
|
|
9
10
|
private advertisement;
|
|
10
11
|
constructor(options: Partial<ClientOptions>);
|
|
11
|
-
connect(): Promise<
|
|
12
|
-
ping(): Promise<
|
|
12
|
+
connect(): Promise<Advertisement>;
|
|
13
|
+
ping(): Promise<Advertisement>;
|
|
13
14
|
frameAndSend(buffer: Buffer): void;
|
|
14
15
|
private handleData;
|
|
15
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAAE,KAAK,aAAa,EAAwB,MAAM,kBAAkB,CAAC;AAC5E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAAE,KAAK,aAAa,EAAwB,MAAM,kBAAkB,CAAC;AAC5E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,EAaN,KAAK,aAAa,EAClB,MAAM,UAAU,CAAC;AAElB,qBAAa,MAAO,SAAQ,OAAO,CAAC,YAAY,CAAC;IAChD,OAAO,CAAC,SAAS,CAAY;IAEtB,OAAO,EAAE,aAAa,CAAC;IACvB,MAAM,EAAG,MAAM,CAAC,OAAO,CAAC;IACxB,IAAI,SAAK;IAChB,OAAO,CAAC,aAAa,CAAiB;gBAE1B,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC;IAU9B,OAAO,IAAI,OAAO,CAAC,aAAa,CAAC;IAejC,IAAI,IAAI,OAAO,CAAC,aAAa,CAAC;IAwBpC,YAAY,CAAC,MAAM,EAAE,MAAM;IAIlC,OAAO,CAAC,UAAU;CAkElB"}
|
package/dist/client/client.js
CHANGED
|
@@ -40,9 +40,9 @@ class Client extends emitter_1.default {
|
|
|
40
40
|
reject(new Error("Ping timeout"));
|
|
41
41
|
}, 5000);
|
|
42
42
|
const pongHandler = (pong) => {
|
|
43
|
-
this.advertisement = pong.message;
|
|
43
|
+
this.advertisement = (0, proto_1.fromString)(pong.message);
|
|
44
44
|
cleanup();
|
|
45
|
-
resolve(pong.message);
|
|
45
|
+
resolve((0, proto_1.fromString)(pong.message));
|
|
46
46
|
};
|
|
47
47
|
const cleanup = () => {
|
|
48
48
|
clearTimeout(timeout);
|
package/dist/index.js
CHANGED
|
@@ -15,16 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
require("reflect-metadata");
|
|
18
|
-
const client_1 = require("./client");
|
|
19
18
|
__exportStar(require("./client"), exports);
|
|
20
19
|
__exportStar(require("./proto"), exports);
|
|
21
|
-
const client = new client_1.Client({
|
|
22
|
-
address: "127.0.0.1",
|
|
23
|
-
port: 19132,
|
|
24
|
-
mtuSize: 1492,
|
|
25
|
-
});
|
|
26
|
-
console.time("connect");
|
|
27
|
-
client.connect().then((ad) => {
|
|
28
|
-
console.timeEnd("connect");
|
|
29
|
-
console.log(ad);
|
|
30
|
-
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"localhost.d.ts","sourceRoot":"","sources":["../../src/tests/localhost.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
require("reflect-metadata");
|
|
4
|
+
const client_1 = require("../client");
|
|
5
|
+
const client = new client_1.Client({
|
|
6
|
+
address: "127.0.0.1",
|
|
7
|
+
port: 19132,
|
|
8
|
+
mtuSize: 1492,
|
|
9
|
+
});
|
|
10
|
+
client.connect().then((ad) => {
|
|
11
|
+
console.log(ad);
|
|
12
|
+
});
|