@sanctumterra/raknet 1.3.80 → 1.4.1
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/README.md +1 -1
- package/dist/client/client.d.ts +19 -20
- package/dist/client/client.d.ts.map +1 -1
- package/dist/client/client.js +139 -184
- package/dist/client/types/client-events.d.ts +5 -20
- package/dist/client/types/client-events.d.ts.map +1 -1
- package/dist/client/types/client-options.d.ts +7 -8
- package/dist/client/types/client-options.d.ts.map +1 -1
- package/dist/client/types/client-options.js +9 -9
- package/dist/client/types/index.d.ts +1 -1
- package/dist/client/types/index.d.ts.map +1 -1
- package/dist/client/types/index.js +1 -1
- package/dist/index.d.ts +1 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -3
- package/dist/server/connection.d.ts +20 -59
- package/dist/server/connection.d.ts.map +1 -1
- package/dist/server/connection.js +53 -365
- package/dist/server/index.d.ts +2 -3
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +2 -3
- package/dist/server/server.d.ts +11 -18
- package/dist/server/server.d.ts.map +1 -1
- package/dist/server/server.js +98 -137
- package/dist/{proto → server}/types/advertisement.d.ts +1 -1
- package/dist/server/types/advertisement.d.ts.map +1 -0
- package/dist/{proto → server}/types/advertisement.js +14 -10
- package/dist/server/types/connection-events.d.ts +4 -0
- package/dist/server/types/connection-events.d.ts.map +1 -0
- package/dist/server/types/index.d.ts +5 -0
- package/dist/server/types/index.d.ts.map +1 -0
- package/dist/{proto → server}/types/index.js +3 -1
- package/dist/server/types/server-events.d.ts +7 -0
- package/dist/server/types/server-events.d.ts.map +1 -0
- package/dist/server/types/server-options.d.ts +12 -0
- package/dist/server/types/server-options.d.ts.map +1 -0
- package/dist/server/types/server-options.js +14 -0
- package/dist/shared/emitter.d.ts +28 -0
- package/dist/shared/emitter.d.ts.map +1 -0
- package/dist/shared/emitter.js +71 -0
- package/dist/shared/index.d.ts +5 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/{proto/decorators → shared}/index.js +4 -2
- package/dist/{utils/Logger.d.ts → shared/logger.d.ts} +1 -1
- package/dist/shared/logger.d.ts.map +1 -0
- package/dist/shared/network_session.d.ts +34 -0
- package/dist/shared/network_session.d.ts.map +1 -0
- package/dist/shared/network_session.js +247 -0
- package/dist/shared/proto/enums/connectionStatus.d.ts +8 -0
- package/dist/shared/proto/enums/connectionStatus.d.ts.map +1 -0
- package/dist/shared/proto/enums/connectionStatus.js +11 -0
- package/dist/shared/proto/enums/index.d.ts +5 -0
- package/dist/shared/proto/enums/index.d.ts.map +1 -0
- package/dist/{proto → shared/proto}/enums/index.js +2 -3
- package/dist/shared/proto/enums/packets.d.ts +19 -0
- package/dist/shared/proto/enums/packets.d.ts.map +1 -0
- package/dist/shared/proto/enums/packets.js +23 -0
- package/dist/shared/proto/enums/priority.d.ts +6 -0
- package/dist/shared/proto/enums/priority.d.ts.map +1 -0
- package/dist/shared/proto/enums/priority.js +4 -0
- package/dist/shared/proto/enums/reliability.d.ts.map +1 -0
- package/dist/shared/proto/index.d.ts +5 -0
- package/dist/shared/proto/index.d.ts.map +1 -0
- package/dist/{proto → shared/proto}/index.js +3 -3
- package/dist/shared/proto/offline/index.d.ts +7 -0
- package/dist/shared/proto/offline/index.d.ts.map +1 -0
- package/dist/shared/proto/offline/index.js +22 -0
- package/dist/shared/proto/offline/open-connection-reply-one.d.ts +9 -0
- package/dist/shared/proto/offline/open-connection-reply-one.d.ts.map +1 -0
- package/dist/shared/proto/offline/open-connection-reply-one.js +28 -0
- package/dist/shared/proto/offline/open-connection-reply-two.d.ts +11 -0
- package/dist/shared/proto/offline/open-connection-reply-two.d.ts.map +1 -0
- package/dist/shared/proto/offline/open-connection-reply-two.js +31 -0
- package/dist/shared/proto/offline/open-connection-request-one.d.ts +8 -0
- package/dist/shared/proto/offline/open-connection-request-one.d.ts.map +1 -0
- package/dist/shared/proto/offline/open-connection-request-one.js +25 -0
- package/dist/shared/proto/offline/open-connection-request-two.d.ts +10 -0
- package/dist/shared/proto/offline/open-connection-request-two.d.ts.map +1 -0
- package/dist/shared/proto/offline/open-connection-request-two.js +28 -0
- package/dist/shared/proto/offline/unconnected-ping.d.ts +8 -0
- package/dist/shared/proto/offline/unconnected-ping.d.ts.map +1 -0
- package/dist/shared/proto/offline/unconnected-ping.js +25 -0
- package/dist/shared/proto/offline/unconnected-pong.d.ts +9 -0
- package/dist/shared/proto/offline/unconnected-pong.d.ts.map +1 -0
- package/dist/shared/proto/offline/unconnected-pong.js +28 -0
- package/dist/shared/proto/online/ack.d.ts +7 -0
- package/dist/shared/proto/online/ack.d.ts.map +1 -0
- package/dist/{proto/packets → shared/proto/online}/ack.js +16 -31
- package/dist/shared/proto/online/connected-ping.d.ts +7 -0
- package/dist/shared/proto/online/connected-ping.d.ts.map +1 -0
- package/dist/shared/proto/online/connected-ping.js +19 -0
- package/dist/shared/proto/online/connected-pong.d.ts +8 -0
- package/dist/shared/proto/online/connected-pong.d.ts.map +1 -0
- package/dist/shared/proto/online/connected-pong.js +22 -0
- package/dist/shared/proto/online/connection-request-accepted.d.ts +12 -0
- package/dist/shared/proto/online/connection-request-accepted.d.ts.map +1 -0
- package/dist/shared/proto/online/connection-request-accepted.js +37 -0
- package/dist/shared/proto/online/connection-request.d.ts +9 -0
- package/dist/shared/proto/online/connection-request.d.ts.map +1 -0
- package/dist/shared/proto/online/connection-request.js +25 -0
- package/dist/shared/proto/online/disconnect-message.d.ts +6 -0
- package/dist/shared/proto/online/disconnect-message.d.ts.map +1 -0
- package/dist/shared/proto/online/disconnect-message.js +15 -0
- package/dist/shared/proto/online/frame-set.d.ts +9 -0
- package/dist/shared/proto/online/frame-set.d.ts.map +1 -0
- package/dist/shared/proto/online/frame-set.js +23 -0
- package/dist/shared/proto/online/index.d.ts +9 -0
- package/dist/shared/proto/online/index.d.ts.map +1 -0
- package/dist/shared/proto/online/index.js +24 -0
- package/dist/shared/proto/online/new-incomming-connection.d.ts +11 -0
- package/dist/shared/proto/online/new-incomming-connection.d.ts.map +1 -0
- package/dist/shared/proto/online/new-incomming-connection.js +33 -0
- package/dist/shared/proto/types/address.d.ts +12 -0
- package/dist/shared/proto/types/address.d.ts.map +1 -0
- package/dist/shared/proto/types/address.js +61 -0
- package/dist/shared/proto/types/frame.d.ts +23 -0
- package/dist/shared/proto/types/frame.d.ts.map +1 -0
- package/dist/shared/proto/types/frame.js +119 -0
- package/dist/{proto/packets → shared/proto}/types/index.d.ts +0 -2
- package/dist/shared/proto/types/index.d.ts.map +1 -0
- package/dist/{proto/packets → shared/proto}/types/index.js +0 -2
- package/dist/shared/proto/types/magic.d.ts +7 -0
- package/dist/shared/proto/types/magic.d.ts.map +1 -0
- package/dist/shared/proto/types/magic.js +15 -0
- package/dist/shared/proto/types/mtu.d.ts +7 -0
- package/dist/shared/proto/types/mtu.d.ts.map +1 -0
- package/dist/shared/proto/types/mtu.js +13 -0
- package/dist/tests/client-connect.d.ts +2 -0
- package/dist/tests/client-connect.d.ts.map +1 -0
- package/dist/tests/client-connect.js +32 -0
- package/dist/tests/client-once.d.ts +2 -0
- package/dist/tests/client-once.d.ts.map +1 -0
- package/dist/tests/client-once.js +11 -0
- package/dist/tests/server-listen.d.ts +2 -0
- package/dist/tests/server-listen.d.ts.map +1 -0
- package/dist/tests/server-listen.js +5 -0
- package/package.json +12 -6
- package/bun.lock +0 -67
- package/dist/client/framer.d.ts +0 -55
- package/dist/client/framer.d.ts.map +0 -1
- package/dist/client/framer.js +0 -458
- package/dist/proto/decorators/create.d.ts +0 -8
- package/dist/proto/decorators/create.d.ts.map +0 -1
- package/dist/proto/decorators/create.js +0 -77
- package/dist/proto/decorators/index.d.ts +0 -3
- package/dist/proto/decorators/index.d.ts.map +0 -1
- package/dist/proto/decorators/serialize.d.ts +0 -4
- package/dist/proto/decorators/serialize.d.ts.map +0 -1
- package/dist/proto/decorators/serialize.js +0 -12
- package/dist/proto/enums/flags.d.ts +0 -7
- package/dist/proto/enums/flags.d.ts.map +0 -1
- package/dist/proto/enums/flags.js +0 -10
- package/dist/proto/enums/index.d.ts +0 -6
- package/dist/proto/enums/index.d.ts.map +0 -1
- package/dist/proto/enums/packet.d.ts +0 -122
- package/dist/proto/enums/packet.d.ts.map +0 -1
- package/dist/proto/enums/packet.js +0 -125
- package/dist/proto/enums/priority.d.ts +0 -5
- package/dist/proto/enums/priority.d.ts.map +0 -1
- package/dist/proto/enums/priority.js +0 -8
- package/dist/proto/enums/reliability.d.ts.map +0 -1
- package/dist/proto/enums/status.d.ts +0 -7
- package/dist/proto/enums/status.d.ts.map +0 -1
- package/dist/proto/enums/status.js +0 -10
- package/dist/proto/index.d.ts +0 -5
- package/dist/proto/index.d.ts.map +0 -1
- package/dist/proto/packets/ack.d.ts +0 -10
- package/dist/proto/packets/ack.d.ts.map +0 -1
- package/dist/proto/packets/base-packet.d.ts +0 -26
- package/dist/proto/packets/base-packet.d.ts.map +0 -1
- package/dist/proto/packets/base-packet.js +0 -37
- package/dist/proto/packets/connected-ping.d.ts +0 -5
- package/dist/proto/packets/connected-ping.d.ts.map +0 -1
- package/dist/proto/packets/connected-ping.js +0 -27
- package/dist/proto/packets/connected-pong.d.ts +0 -6
- package/dist/proto/packets/connected-pong.d.ts.map +0 -1
- package/dist/proto/packets/connected-pong.js +0 -32
- package/dist/proto/packets/connection-request-accepted.d.ts +0 -10
- package/dist/proto/packets/connection-request-accepted.d.ts.map +0 -1
- package/dist/proto/packets/connection-request-accepted.js +0 -48
- package/dist/proto/packets/connection-request.d.ts +0 -7
- package/dist/proto/packets/connection-request.d.ts.map +0 -1
- package/dist/proto/packets/connection-request.js +0 -37
- package/dist/proto/packets/disconnect.d.ts +0 -5
- package/dist/proto/packets/disconnect.d.ts.map +0 -1
- package/dist/proto/packets/disconnect.js +0 -17
- package/dist/proto/packets/frame.d.ts +0 -1
- package/dist/proto/packets/frame.d.ts.map +0 -1
- package/dist/proto/packets/frame.js +0 -1
- package/dist/proto/packets/frameset.d.ts +0 -11
- package/dist/proto/packets/frameset.d.ts.map +0 -1
- package/dist/proto/packets/frameset.js +0 -37
- package/dist/proto/packets/incompatible-protocol-version.d.ts +0 -8
- package/dist/proto/packets/incompatible-protocol-version.d.ts.map +0 -1
- package/dist/proto/packets/incompatible-protocol-version.js +0 -38
- package/dist/proto/packets/index.d.ts +0 -19
- package/dist/proto/packets/index.d.ts.map +0 -1
- package/dist/proto/packets/index.js +0 -34
- package/dist/proto/packets/nack.d.ts +0 -8
- package/dist/proto/packets/nack.d.ts.map +0 -1
- package/dist/proto/packets/nack.js +0 -88
- package/dist/proto/packets/new-incoming-connection.d.ts +0 -9
- package/dist/proto/packets/new-incoming-connection.d.ts.map +0 -1
- package/dist/proto/packets/new-incoming-connection.js +0 -43
- package/dist/proto/packets/open-connection-reply-one.d.ts +0 -8
- package/dist/proto/packets/open-connection-reply-one.d.ts.map +0 -1
- package/dist/proto/packets/open-connection-reply-one.js +0 -43
- package/dist/proto/packets/open-connection-reply-two.d.ts +0 -10
- package/dist/proto/packets/open-connection-reply-two.d.ts.map +0 -1
- package/dist/proto/packets/open-connection-reply-two.js +0 -48
- package/dist/proto/packets/open-connection-request-one.d.ts +0 -7
- package/dist/proto/packets/open-connection-request-one.d.ts.map +0 -1
- package/dist/proto/packets/open-connection-request-one.js +0 -38
- package/dist/proto/packets/open-connection-request-two.d.ts +0 -9
- package/dist/proto/packets/open-connection-request-two.d.ts.map +0 -1
- package/dist/proto/packets/open-connection-request-two.js +0 -43
- package/dist/proto/packets/types/address.d.ts +0 -48
- package/dist/proto/packets/types/address.d.ts.map +0 -1
- package/dist/proto/packets/types/address.js +0 -99
- package/dist/proto/packets/types/data-type.d.ts +0 -21
- package/dist/proto/packets/types/data-type.d.ts.map +0 -1
- package/dist/proto/packets/types/data-type.js +0 -29
- package/dist/proto/packets/types/frame.d.ts +0 -23
- package/dist/proto/packets/types/frame.d.ts.map +0 -1
- package/dist/proto/packets/types/frame.js +0 -94
- package/dist/proto/packets/types/index.d.ts.map +0 -1
- package/dist/proto/packets/types/magic.d.ts +0 -7
- package/dist/proto/packets/types/magic.d.ts.map +0 -1
- package/dist/proto/packets/types/magic.js +0 -14
- package/dist/proto/packets/types/mtu.d.ts +0 -9
- package/dist/proto/packets/types/mtu.d.ts.map +0 -1
- package/dist/proto/packets/types/mtu.js +0 -18
- package/dist/proto/packets/types/sys-address.d.ts +0 -11
- package/dist/proto/packets/types/sys-address.d.ts.map +0 -1
- package/dist/proto/packets/types/sys-address.js +0 -32
- package/dist/proto/packets/unconnected-ping.d.ts +0 -7
- package/dist/proto/packets/unconnected-ping.d.ts.map +0 -1
- package/dist/proto/packets/unconnected-ping.js +0 -38
- package/dist/proto/packets/unconnected-pong.d.ts +0 -8
- package/dist/proto/packets/unconnected-pong.d.ts.map +0 -1
- package/dist/proto/packets/unconnected-pong.js +0 -43
- package/dist/proto/types/advertisement.d.ts.map +0 -1
- package/dist/proto/types/index.d.ts +0 -3
- package/dist/proto/types/index.d.ts.map +0 -1
- package/dist/proto/types/valid.d.ts +0 -4
- package/dist/proto/types/valid.d.ts.map +0 -1
- package/dist/server/server-events.d.ts +0 -9
- package/dist/server/server-events.d.ts.map +0 -1
- package/dist/server/server-options.d.ts +0 -26
- package/dist/server/server-options.d.ts.map +0 -1
- package/dist/server/server-options.js +0 -20
- package/dist/tests/client.d.ts +0 -2
- package/dist/tests/client.d.ts.map +0 -1
- package/dist/tests/client.js +0 -15
- package/dist/tests/localhost.d.ts +0 -2
- package/dist/tests/localhost.d.ts.map +0 -1
- package/dist/tests/localhost.js +0 -34
- package/dist/tests/server.d.ts +0 -2
- package/dist/tests/server.d.ts.map +0 -1
- package/dist/tests/server.js +0 -32
- package/dist/tests/test.d.ts +0 -2
- package/dist/tests/test.d.ts.map +0 -1
- package/dist/tests/test.js +0 -49
- package/dist/utils/Logger.d.ts.map +0 -1
- package/dist/utils/decorators.d.ts +0 -2
- package/dist/utils/decorators.d.ts.map +0 -1
- package/dist/utils/decorators.js +0 -17
- package/dist/utils/index.d.ts +0 -3
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js +0 -18
- package/tsconfig.single.json +0 -9
- /package/dist/{proto/types/valid.js → server/types/connection-events.js} +0 -0
- /package/dist/server/{server-events.js → types/server-events.js} +0 -0
- /package/dist/{utils/Logger.js → shared/logger.js} +0 -0
- /package/dist/{proto → shared/proto}/enums/reliability.d.ts +0 -0
- /package/dist/{proto → shared/proto}/enums/reliability.js +0 -0
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Address = void 0;
|
|
4
|
-
const data_type_1 = require("./data-type");
|
|
5
|
-
/**
|
|
6
|
-
* Represents an address data type.
|
|
7
|
-
* Address is used when establishing a connection in RakNet.
|
|
8
|
-
*/
|
|
9
|
-
class Address extends data_type_1.DataType {
|
|
10
|
-
/**
|
|
11
|
-
* The address of the data type.
|
|
12
|
-
*/
|
|
13
|
-
address;
|
|
14
|
-
/**
|
|
15
|
-
* The port of the data type.
|
|
16
|
-
*/
|
|
17
|
-
port;
|
|
18
|
-
/**
|
|
19
|
-
* The version of the data type.
|
|
20
|
-
*/
|
|
21
|
-
version;
|
|
22
|
-
/**
|
|
23
|
-
* Initializes a new instance of the Address data type.
|
|
24
|
-
* @param address The address of the data type.
|
|
25
|
-
* @param port The port of the data type.
|
|
26
|
-
* @param version The version of the data type.
|
|
27
|
-
*/
|
|
28
|
-
constructor(address, port, version) {
|
|
29
|
-
super();
|
|
30
|
-
this.address = address;
|
|
31
|
-
this.port = port;
|
|
32
|
-
this.version = version;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Converts the Address data type to a NetworkIdentifier.
|
|
36
|
-
*
|
|
37
|
-
* @param identifier The NetworkIdentifier.
|
|
38
|
-
* @returns The NetworkIdentifier.
|
|
39
|
-
*/
|
|
40
|
-
static fromIdentifier(identifier) {
|
|
41
|
-
return new Address(identifier.address, identifier.port, identifier.family === "IPv4" ? 4 : 6);
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Writes the Address data type to a binary stream.
|
|
45
|
-
* @param stream The binary stream to write to.
|
|
46
|
-
* @param value The value to write.
|
|
47
|
-
*/
|
|
48
|
-
static write(stream, value) {
|
|
49
|
-
stream.writeUint8(value.version);
|
|
50
|
-
if (value.version === 4) {
|
|
51
|
-
const addressBits = value.address.split(".", 4);
|
|
52
|
-
for (const bit of addressBits) {
|
|
53
|
-
stream.writeUint8(Number.parseInt(bit, 10) ^ 0xff);
|
|
54
|
-
}
|
|
55
|
-
stream.writeUShort(value.port);
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
stream.writeUShort(23);
|
|
59
|
-
stream.writeUShort(value.port);
|
|
60
|
-
stream.writeUint32(0);
|
|
61
|
-
const addressParts = value.address.split(":");
|
|
62
|
-
for (const part of addressParts) {
|
|
63
|
-
const num = Number.parseInt(part, 16);
|
|
64
|
-
stream.writeUShort(num ^ 0xffff);
|
|
65
|
-
}
|
|
66
|
-
stream.writeUint32(0);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Reads the Address data type from a binary stream.
|
|
71
|
-
* @param stream The binary stream to read from.
|
|
72
|
-
* @returns The Address data type.
|
|
73
|
-
*/
|
|
74
|
-
static read(stream) {
|
|
75
|
-
const version = stream.readUint8();
|
|
76
|
-
if (version === 4) {
|
|
77
|
-
const bytes = stream.read(4);
|
|
78
|
-
const address = bytes.map((byte) => (byte ^ 0xff).toString()).join(".");
|
|
79
|
-
const port = stream.readUShort();
|
|
80
|
-
return new Address(address, port, version);
|
|
81
|
-
// biome-ignore lint/style/noUselessElse: <explanation>
|
|
82
|
-
}
|
|
83
|
-
else if (version === 6) {
|
|
84
|
-
stream.skip(2);
|
|
85
|
-
const port = stream.readUShort();
|
|
86
|
-
stream.skip(4);
|
|
87
|
-
const addressParts = [];
|
|
88
|
-
for (let i = 0; i < 8; i++) {
|
|
89
|
-
const part = stream.readUShort() ^ 0xffff;
|
|
90
|
-
addressParts.push(part.toString(16).padStart(4, "0"));
|
|
91
|
-
}
|
|
92
|
-
const address = addressParts.join(":");
|
|
93
|
-
stream.skip(4);
|
|
94
|
-
return new Address(address, port, version);
|
|
95
|
-
}
|
|
96
|
-
return new Address("0.0.0.0", 0, 0);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
exports.Address = Address;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { type BinaryStream, Endianness } from "@serenityjs/binarystream";
|
|
2
|
-
export declare class DataType {
|
|
3
|
-
constructor(..._arguments_: Array<unknown>);
|
|
4
|
-
/**
|
|
5
|
-
* Reads the data type from the stream.
|
|
6
|
-
* @param _stream - The stream to read from.
|
|
7
|
-
* @param _endian - The endianness of the data.
|
|
8
|
-
* @param _parameter - The parameter to read.
|
|
9
|
-
* @returns The read data.
|
|
10
|
-
*/
|
|
11
|
-
static read(_stream: BinaryStream, _endian?: Endianness, _parameter?: unknown): unknown;
|
|
12
|
-
/**
|
|
13
|
-
* Writes the data type to the stream.
|
|
14
|
-
* @param _stream - The stream to write to.
|
|
15
|
-
* @param _value - The value to write.
|
|
16
|
-
* @param _endian - The endianness of the data.
|
|
17
|
-
* @param _parameter - The parameter to write.
|
|
18
|
-
*/
|
|
19
|
-
static write(_stream: BinaryStream, _value: unknown, _endian?: Endianness, _parameter?: unknown): void;
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=data-type.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data-type.d.ts","sourceRoot":"","sources":["../../../../src/proto/packets/types/data-type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEzE,qBAAa,QAAQ;gBAGD,GAAG,WAAW,EAAE,KAAK,CAAC,OAAO,CAAC;IAEjD;;;;;;OAMG;WACW,IAAI,CACjB,OAAO,EAAE,YAAY,EACrB,OAAO,aAAiB,EACxB,UAAU,CAAC,EAAE,OAAO,GAClB,OAAO;IAIV;;;;;;OAMG;WACW,KAAK,CAClB,OAAO,EAAE,YAAY,EACrB,MAAM,EAAE,OAAO,EACf,OAAO,aAAiB,EACxB,UAAU,CAAC,EAAE,OAAO,GAClB,IAAI;CAGP"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DataType = void 0;
|
|
4
|
-
class DataType {
|
|
5
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
6
|
-
// biome-ignore lint/complexity/noUselessConstructor: <explanation>
|
|
7
|
-
constructor(..._arguments_) { }
|
|
8
|
-
/**
|
|
9
|
-
* Reads the data type from the stream.
|
|
10
|
-
* @param _stream - The stream to read from.
|
|
11
|
-
* @param _endian - The endianness of the data.
|
|
12
|
-
* @param _parameter - The parameter to read.
|
|
13
|
-
* @returns The read data.
|
|
14
|
-
*/
|
|
15
|
-
static read(_stream, _endian = 0 /* Endianness.Big */, _parameter) {
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Writes the data type to the stream.
|
|
20
|
-
* @param _stream - The stream to write to.
|
|
21
|
-
* @param _value - The value to write.
|
|
22
|
-
* @param _endian - The endianness of the data.
|
|
23
|
-
* @param _parameter - The parameter to write.
|
|
24
|
-
*/
|
|
25
|
-
static write(_stream, _value, _endian = 0 /* Endianness.Big */, _parameter) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
exports.DataType = DataType;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { type BinaryStream } from "@serenityjs/binarystream";
|
|
2
|
-
import { Reliability } from "../../enums/reliability";
|
|
3
|
-
import { DataType } from "./data-type";
|
|
4
|
-
export declare class Frame extends DataType {
|
|
5
|
-
reliability: Reliability;
|
|
6
|
-
reliableFrameIndex: number;
|
|
7
|
-
sequenceFrameIndex: number;
|
|
8
|
-
orderedFrameIndex: number;
|
|
9
|
-
orderChannel: number;
|
|
10
|
-
splitFrameIndex: number;
|
|
11
|
-
splitCount: number;
|
|
12
|
-
splitId: number;
|
|
13
|
-
payload: Buffer;
|
|
14
|
-
static read(stream: BinaryStream): Frame[];
|
|
15
|
-
static write(stream: BinaryStream, value: Array<Frame>): void;
|
|
16
|
-
getByteLength(): number;
|
|
17
|
-
get isReliable(): boolean;
|
|
18
|
-
get isSequenced(): boolean;
|
|
19
|
-
get isOrdered(): boolean;
|
|
20
|
-
get isOrderedExclusive(): boolean;
|
|
21
|
-
get isSplit(): boolean;
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=frame.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"frame.d.ts","sourceRoot":"","sources":["../../../../src/proto/packets/types/frame.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAc,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGvC,qBAAa,KAAM,SAAQ,QAAQ;IAC3B,WAAW,EAAG,WAAW,CAAC;IAC1B,kBAAkB,EAAG,MAAM,CAAC;IAC5B,kBAAkB,EAAG,MAAM,CAAC;IAC5B,iBAAiB,EAAG,MAAM,CAAC;IAC3B,YAAY,EAAG,MAAM,CAAC;IACtB,eAAe,EAAG,MAAM,CAAC;IACzB,UAAU,EAAG,MAAM,CAAC;IACpB,OAAO,EAAG,MAAM,CAAC;IACjB,OAAO,EAAG,MAAM,CAAC;WAEV,IAAI,CAAC,MAAM,EAAE,YAAY,GAAG,KAAK,EAAE;WA6BnC,KAAK,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,IAAI;IAuB7D,aAAa,IAAI,MAAM;IAW9B,IAAI,UAAU,IAAI,OAAO,CAQxB;IAED,IAAI,WAAW,IAAI,OAAO,CAKzB;IAED,IAAI,SAAS,IAAI,OAAO,CAKvB;IAED,IAAI,kBAAkB,IAAI,OAAO,CAKhC;IAED,IAAI,OAAO,IAAI,OAAO,CAErB;CACD"}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Frame = void 0;
|
|
4
|
-
const reliability_1 = require("../../enums/reliability");
|
|
5
|
-
const data_type_1 = require("./data-type");
|
|
6
|
-
const enums_1 = require("../../enums");
|
|
7
|
-
class Frame extends data_type_1.DataType {
|
|
8
|
-
reliability;
|
|
9
|
-
reliableFrameIndex;
|
|
10
|
-
sequenceFrameIndex;
|
|
11
|
-
orderedFrameIndex;
|
|
12
|
-
orderChannel;
|
|
13
|
-
splitFrameIndex;
|
|
14
|
-
splitCount;
|
|
15
|
-
splitId;
|
|
16
|
-
payload;
|
|
17
|
-
static read(stream) {
|
|
18
|
-
const frames = [];
|
|
19
|
-
while (!stream.cursorAtEnd()) {
|
|
20
|
-
const frame = new Frame();
|
|
21
|
-
const flags = stream.readUint8();
|
|
22
|
-
frame.reliability = (flags & 0xe0) >> 5;
|
|
23
|
-
const split = (flags & enums_1.Flags.Split) !== 0;
|
|
24
|
-
const length = Math.ceil(stream.readUint16() / 8);
|
|
25
|
-
if (frame.isReliable)
|
|
26
|
-
frame.reliableFrameIndex = stream.readUint24(1 /* Endianness.Little */);
|
|
27
|
-
if (frame.isSequenced)
|
|
28
|
-
frame.sequenceFrameIndex = stream.readUint24(1 /* Endianness.Little */);
|
|
29
|
-
if (frame.isOrdered) {
|
|
30
|
-
frame.orderedFrameIndex = stream.readUint24(1 /* Endianness.Little */);
|
|
31
|
-
frame.orderChannel = stream.readUint8();
|
|
32
|
-
}
|
|
33
|
-
if (split) {
|
|
34
|
-
frame.splitCount = stream.readUint32();
|
|
35
|
-
frame.splitId = stream.readUint16();
|
|
36
|
-
frame.splitFrameIndex = stream.readUint32();
|
|
37
|
-
}
|
|
38
|
-
frame.payload = stream.readBuffer(length);
|
|
39
|
-
frames.push(frame);
|
|
40
|
-
}
|
|
41
|
-
return frames;
|
|
42
|
-
}
|
|
43
|
-
static write(stream, value) {
|
|
44
|
-
for (const frame of value) {
|
|
45
|
-
stream.writeUint8((frame.reliability << 5) | (frame.isSplit ? enums_1.Flags.Split : 0));
|
|
46
|
-
stream.writeUint16(frame.payload.byteLength << 3);
|
|
47
|
-
if (frame.isReliable)
|
|
48
|
-
stream.writeUint24(frame.reliableFrameIndex, 1 /* Endianness.Little */);
|
|
49
|
-
if (frame.isSequenced)
|
|
50
|
-
stream.writeUint24(frame.sequenceFrameIndex, 1 /* Endianness.Little */);
|
|
51
|
-
if (frame.isOrdered) {
|
|
52
|
-
stream.writeUint24(frame.orderedFrameIndex, 1 /* Endianness.Little */);
|
|
53
|
-
stream.writeUint8(frame.orderChannel);
|
|
54
|
-
}
|
|
55
|
-
if (frame.isSplit) {
|
|
56
|
-
stream.writeUint32(frame.splitCount);
|
|
57
|
-
stream.writeUint16(frame.splitId);
|
|
58
|
-
stream.writeUint32(frame.splitFrameIndex);
|
|
59
|
-
}
|
|
60
|
-
stream.writeBuffer(frame.payload);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
getByteLength() {
|
|
64
|
-
return (3 +
|
|
65
|
-
this.payload.byteLength +
|
|
66
|
-
(this.isSplit ? 10 : 0) +
|
|
67
|
-
(this.isReliable ? 3 : 0) +
|
|
68
|
-
(this.isSequenced ? 3 : 0) +
|
|
69
|
-
(this.isOrdered ? 4 : 0));
|
|
70
|
-
}
|
|
71
|
-
get isReliable() {
|
|
72
|
-
return (this.reliability === reliability_1.Reliability.Reliable ||
|
|
73
|
-
this.reliability === reliability_1.Reliability.ReliableOrdered ||
|
|
74
|
-
this.reliability === reliability_1.Reliability.ReliableSequenced ||
|
|
75
|
-
this.reliability === reliability_1.Reliability.ReliableWithAckReceipt ||
|
|
76
|
-
this.reliability === reliability_1.Reliability.ReliableOrderedWithAckReceipt);
|
|
77
|
-
}
|
|
78
|
-
get isSequenced() {
|
|
79
|
-
return (this.reliability === reliability_1.Reliability.UnreliableSequenced ||
|
|
80
|
-
this.reliability === reliability_1.Reliability.ReliableSequenced);
|
|
81
|
-
}
|
|
82
|
-
get isOrdered() {
|
|
83
|
-
return (this.reliability === reliability_1.Reliability.ReliableOrdered ||
|
|
84
|
-
this.reliability === reliability_1.Reliability.ReliableOrderedWithAckReceipt);
|
|
85
|
-
}
|
|
86
|
-
get isOrderedExclusive() {
|
|
87
|
-
return (this.reliability === reliability_1.Reliability.ReliableOrdered ||
|
|
88
|
-
this.reliability === reliability_1.Reliability.ReliableOrderedWithAckReceipt);
|
|
89
|
-
}
|
|
90
|
-
get isSplit() {
|
|
91
|
-
return this.splitCount > 0;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
exports.Frame = Frame;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/proto/packets/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type BinaryStream } from "@serenityjs/binarystream";
|
|
2
|
-
import { DataType } from "./data-type";
|
|
3
|
-
export declare class Magic extends DataType {
|
|
4
|
-
static read(stream: BinaryStream): Buffer;
|
|
5
|
-
static write(stream: BinaryStream): void;
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=magic.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"magic.d.ts","sourceRoot":"","sources":["../../../../src/proto/packets/types/magic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAc,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAIvC,qBAAa,KAAM,SAAQ,QAAQ;WACpB,IAAI,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM;WAIlC,KAAK,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI;CAG/C"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Magic = void 0;
|
|
4
|
-
const data_type_1 = require("./data-type");
|
|
5
|
-
const buff = Buffer.from("00ffff00fefefefefdfdfdfd12345678", "hex");
|
|
6
|
-
class Magic extends data_type_1.DataType {
|
|
7
|
-
static read(stream) {
|
|
8
|
-
return stream.readBuffer(buff.length);
|
|
9
|
-
}
|
|
10
|
-
static write(stream) {
|
|
11
|
-
stream.writeBuffer(buff);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
exports.Magic = Magic;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { BinaryStream } from "@serenityjs/binarystream";
|
|
2
|
-
import { DataType } from "./data-type";
|
|
3
|
-
export declare class MTU extends DataType {
|
|
4
|
-
private static readonly UDP_HEADER_SIZE;
|
|
5
|
-
private static readonly MTU_SIZES;
|
|
6
|
-
static read(stream: BinaryStream): number;
|
|
7
|
-
static write(stream: BinaryStream, mtu: number): void;
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=mtu.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mtu.d.ts","sourceRoot":"","sources":["../../../../src/proto/packets/types/mtu.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,qBAAa,GAAI,SAAQ,QAAQ;IAChC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAM;IAC7C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAqB;WAExC,IAAI,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM;WAIlC,KAAK,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI;CAO5D"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MTU = void 0;
|
|
4
|
-
const data_type_1 = require("./data-type");
|
|
5
|
-
class MTU extends data_type_1.DataType {
|
|
6
|
-
static UDP_HEADER_SIZE = 28;
|
|
7
|
-
static MTU_SIZES = [1492, 1200, 576];
|
|
8
|
-
static read(stream) {
|
|
9
|
-
return stream.readUint16();
|
|
10
|
-
}
|
|
11
|
-
static write(stream, mtu) {
|
|
12
|
-
const mtuPaddingSize = mtu - stream.getBuffer().length - MTU.UDP_HEADER_SIZE;
|
|
13
|
-
if (mtuPaddingSize > 0) {
|
|
14
|
-
stream.writeBuffer(Buffer.alloc(mtuPaddingSize, 0x00));
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
exports.MTU = MTU;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { RemoteInfo } from "node:dgram";
|
|
2
|
-
import { Address } from "./address";
|
|
3
|
-
import { DataType } from "./data-type";
|
|
4
|
-
import type { BinaryStream } from "@serenityjs/binarystream";
|
|
5
|
-
export declare class SystemAddress extends DataType {
|
|
6
|
-
static count: number;
|
|
7
|
-
static fromIdentifier(identifier: RemoteInfo): Address;
|
|
8
|
-
static read(stream: BinaryStream): Array<Address>;
|
|
9
|
-
static write(stream: BinaryStream): void;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=sys-address.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sys-address.d.ts","sourceRoot":"","sources":["../../../../src/proto/packets/types/sys-address.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAE7D,qBAAa,aAAc,SAAQ,QAAQ;IAC1C,MAAM,CAAC,KAAK,SAAK;WAEH,cAAc,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO;WAI/C,IAAI,CAAC,MAAM,EAAE,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC;WAa1C,KAAK,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI;CAQ/C"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SystemAddress = void 0;
|
|
4
|
-
const address_1 = require("./address");
|
|
5
|
-
const data_type_1 = require("./data-type");
|
|
6
|
-
class SystemAddress extends data_type_1.DataType {
|
|
7
|
-
static count = 0;
|
|
8
|
-
static fromIdentifier(identifier) {
|
|
9
|
-
return new address_1.Address(identifier.address, identifier.port, 4);
|
|
10
|
-
}
|
|
11
|
-
static read(stream) {
|
|
12
|
-
const addresses = [];
|
|
13
|
-
try {
|
|
14
|
-
for (let index = 0; index < 10; index++) {
|
|
15
|
-
const address = address_1.Address.read(stream);
|
|
16
|
-
addresses.push(address);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
catch (error) {
|
|
20
|
-
console.error("Error reading system addresses:", error);
|
|
21
|
-
}
|
|
22
|
-
return addresses;
|
|
23
|
-
}
|
|
24
|
-
static write(stream) {
|
|
25
|
-
const addresses = [new address_1.Address("127.0.0.1", 0, 4)];
|
|
26
|
-
const count = SystemAddress.count === 0 ? 10 : SystemAddress.count;
|
|
27
|
-
for (let index = 0; index < count; index++) {
|
|
28
|
-
address_1.Address.write(stream, addresses[index] || new address_1.Address("0.0.0.0", 0, 4));
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
exports.SystemAddress = SystemAddress;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unconnected-ping.d.ts","sourceRoot":"","sources":["../../../src/proto/packets/unconnected-ping.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,qBACa,eAAgB,SAAQ,UAAU;IACpB,eAAe,EAAG,MAAM,CAAC;IAC1B,KAAK,EAAG,MAAM,CAAC;IACd,IAAI,EAAG,MAAM,CAAC;CACxC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.UnconnectedPing = void 0;
|
|
13
|
-
const binarystream_1 = require("@serenityjs/binarystream");
|
|
14
|
-
const decorators_1 = require("../decorators");
|
|
15
|
-
const enums_1 = require("../enums");
|
|
16
|
-
const base_packet_1 = require("./base-packet");
|
|
17
|
-
const types_1 = require("./types");
|
|
18
|
-
let UnconnectedPing = class UnconnectedPing extends base_packet_1.BasePacket {
|
|
19
|
-
clientTimestamp;
|
|
20
|
-
magic;
|
|
21
|
-
guid;
|
|
22
|
-
};
|
|
23
|
-
exports.UnconnectedPing = UnconnectedPing;
|
|
24
|
-
__decorate([
|
|
25
|
-
(0, decorators_1.Serialize)(binarystream_1.Uint64),
|
|
26
|
-
__metadata("design:type", BigInt)
|
|
27
|
-
], UnconnectedPing.prototype, "clientTimestamp", void 0);
|
|
28
|
-
__decorate([
|
|
29
|
-
(0, decorators_1.Serialize)(types_1.Magic),
|
|
30
|
-
__metadata("design:type", Buffer)
|
|
31
|
-
], UnconnectedPing.prototype, "magic", void 0);
|
|
32
|
-
__decorate([
|
|
33
|
-
(0, decorators_1.Serialize)(binarystream_1.Uint64),
|
|
34
|
-
__metadata("design:type", BigInt)
|
|
35
|
-
], UnconnectedPing.prototype, "guid", void 0);
|
|
36
|
-
exports.UnconnectedPing = UnconnectedPing = __decorate([
|
|
37
|
-
(0, decorators_1.Create)(enums_1.Packet.UnconnectedPing)
|
|
38
|
-
], UnconnectedPing);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unconnected-pong.d.ts","sourceRoot":"","sources":["../../../src/proto/packets/unconnected-pong.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,qBACa,eAAgB,SAAQ,UAAU;IACpB,eAAe,EAAG,MAAM,CAAC;IACzB,UAAU,EAAG,MAAM,CAAC;IACrB,KAAK,EAAG,MAAM,CAAC;IACZ,OAAO,EAAG,MAAM,CAAC;CAC7C"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.UnconnectedPong = void 0;
|
|
13
|
-
const binarystream_1 = require("@serenityjs/binarystream");
|
|
14
|
-
const decorators_1 = require("../decorators");
|
|
15
|
-
const enums_1 = require("../enums");
|
|
16
|
-
const base_packet_1 = require("./base-packet");
|
|
17
|
-
const types_1 = require("./types");
|
|
18
|
-
let UnconnectedPong = class UnconnectedPong extends base_packet_1.BasePacket {
|
|
19
|
-
serverTimestamp;
|
|
20
|
-
serverGuid;
|
|
21
|
-
magic;
|
|
22
|
-
message;
|
|
23
|
-
};
|
|
24
|
-
exports.UnconnectedPong = UnconnectedPong;
|
|
25
|
-
__decorate([
|
|
26
|
-
(0, decorators_1.Serialize)(binarystream_1.Uint64),
|
|
27
|
-
__metadata("design:type", BigInt)
|
|
28
|
-
], UnconnectedPong.prototype, "serverTimestamp", void 0);
|
|
29
|
-
__decorate([
|
|
30
|
-
(0, decorators_1.Serialize)(binarystream_1.Uint64),
|
|
31
|
-
__metadata("design:type", BigInt)
|
|
32
|
-
], UnconnectedPong.prototype, "serverGuid", void 0);
|
|
33
|
-
__decorate([
|
|
34
|
-
(0, decorators_1.Serialize)(types_1.Magic),
|
|
35
|
-
__metadata("design:type", Buffer)
|
|
36
|
-
], UnconnectedPong.prototype, "magic", void 0);
|
|
37
|
-
__decorate([
|
|
38
|
-
(0, decorators_1.Serialize)(binarystream_1.String16),
|
|
39
|
-
__metadata("design:type", String)
|
|
40
|
-
], UnconnectedPong.prototype, "message", void 0);
|
|
41
|
-
exports.UnconnectedPong = UnconnectedPong = __decorate([
|
|
42
|
-
(0, decorators_1.Create)(enums_1.Packet.UnconnectedPong)
|
|
43
|
-
], UnconnectedPong);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"advertisement.d.ts","sourceRoot":"","sources":["../../../src/proto/types/advertisement.ts"],"names":[],"mappings":"AAAA,KAAK,iBAAiB,GAAG,MAAM,GAAG,MAAM,CAAC;AAEzC,UAAU,aAAa;IACtB,IAAI,EAAE,iBAAiB,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CACjB;AAED,iBAAS,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa,CAuBlD;AAED,iBAAS,qBAAqB,CAAC,aAAa,EAAE,aAAa,GAAG,MAAM,CAYnE;AAED,OAAO,EAAE,KAAK,aAAa,EAAE,UAAU,EAAE,qBAAqB,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/proto/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { Byte, Bool, Uint8, Uint16, Uint24, Uint32, Uint64, Int8, Int16, Int24, Int32, Int64, Short, UShort, Long, ULong, VarInt, ZigZag, VarLong, ZigZong, Float32, Float64, String16, String32, VarString, Uuid } from "@serenityjs/binarystream";
|
|
2
|
-
import type { DataType } from "../packets/types/data-type";
|
|
3
|
-
export type ValidTypes = typeof DataType | typeof Bool | typeof Byte | typeof Float32 | typeof Float64 | typeof Int8 | typeof Int16 | typeof Int24 | typeof Int32 | typeof Int64 | typeof Long | typeof Short | typeof String16 | typeof String32 | typeof Uint8 | typeof Uint16 | typeof Uint24 | typeof Uint32 | typeof Uint64 | typeof ULong | typeof UShort | typeof Uuid | typeof VarInt | typeof VarLong | typeof VarString | typeof ZigZag | typeof ZigZong;
|
|
4
|
-
//# sourceMappingURL=valid.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"valid.d.ts","sourceRoot":"","sources":["../../../src/proto/types/valid.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,EACN,IAAI,EACJ,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,MAAM,EACN,IAAI,EACJ,KAAK,EACL,MAAM,EACN,MAAM,EACN,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAE3D,MAAM,MAAM,UAAU,GACnB,OAAO,QAAQ,GACf,OAAO,IAAI,GACX,OAAO,IAAI,GACX,OAAO,OAAO,GACd,OAAO,OAAO,GACd,OAAO,IAAI,GACX,OAAO,KAAK,GACZ,OAAO,KAAK,GACZ,OAAO,KAAK,GACZ,OAAO,KAAK,GACZ,OAAO,IAAI,GACX,OAAO,KAAK,GACZ,OAAO,QAAQ,GACf,OAAO,QAAQ,GACf,OAAO,KAAK,GACZ,OAAO,MAAM,GACb,OAAO,MAAM,GACb,OAAO,MAAM,GACb,OAAO,MAAM,GACb,OAAO,KAAK,GACZ,OAAO,MAAM,GACb,OAAO,IAAI,GACX,OAAO,MAAM,GACb,OAAO,OAAO,GACd,OAAO,SAAS,GAChB,OAAO,MAAM,GACb,OAAO,OAAO,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Connection } from "./connection";
|
|
2
|
-
type ServerEvents = {
|
|
3
|
-
close: [];
|
|
4
|
-
connect: [connection: Connection];
|
|
5
|
-
encapsulated: [frameset: Buffer, connection: Connection];
|
|
6
|
-
closeConnection: [connection: Connection];
|
|
7
|
-
};
|
|
8
|
-
export type { ServerEvents };
|
|
9
|
-
//# sourceMappingURL=server-events.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server-events.d.ts","sourceRoot":"","sources":["../../src/server/server-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,KAAK,YAAY,GAAG;IACnB,KAAK,EAAE,EAAE,CAAC;IACV,OAAO,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IAClC,YAAY,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IACzD,eAAe,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;CAC1C,CAAC;AAEF,YAAY,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export type Gamemode = "Survival" | "Creative" | "Adventure" | "Spectator";
|
|
2
|
-
type ServerOptions = {
|
|
3
|
-
port: number;
|
|
4
|
-
host: string;
|
|
5
|
-
guid: bigint;
|
|
6
|
-
motd: string;
|
|
7
|
-
protocol: number;
|
|
8
|
-
version: string;
|
|
9
|
-
maxConnections: number;
|
|
10
|
-
levelName: string;
|
|
11
|
-
mtu: number;
|
|
12
|
-
connectionTimeout: number;
|
|
13
|
-
blockTime: number;
|
|
14
|
-
/**
|
|
15
|
-
* How many ticks per second the server runs
|
|
16
|
-
*/
|
|
17
|
-
tickRate: number;
|
|
18
|
-
/**
|
|
19
|
-
* How many packets per second the server can handle from a specific address (does not include the port)
|
|
20
|
-
*/
|
|
21
|
-
maxPacketsPerSecond: number;
|
|
22
|
-
loggerDisabled: boolean;
|
|
23
|
-
};
|
|
24
|
-
declare const defaultOptions: ServerOptions;
|
|
25
|
-
export { type ServerOptions, defaultOptions };
|
|
26
|
-
//# sourceMappingURL=server-options.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server-options.d.ts","sourceRoot":"","sources":["../../src/server/server-options.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,UAAU,GAAG,UAAU,GAAG,WAAW,GAAG,WAAW,CAAC;AAE3E,KAAK,aAAa,GAAG;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,mBAAmB,EAAE,MAAM,CAAC;IAC5B,cAAc,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,QAAA,MAAM,cAAc,EAAE,aAerB,CAAC;AAEF,OAAO,EAAE,KAAK,aAAa,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.defaultOptions = void 0;
|
|
4
|
-
const defaultOptions = {
|
|
5
|
-
port: 19132,
|
|
6
|
-
host: "0.0.0.0",
|
|
7
|
-
guid: BigInt(Math.floor(Math.random() * 0xffffffffffffffff)),
|
|
8
|
-
motd: "§rSanctumTerra Server§r",
|
|
9
|
-
levelName: "World§r",
|
|
10
|
-
protocol: 11,
|
|
11
|
-
version: "1.21.50",
|
|
12
|
-
maxConnections: 60,
|
|
13
|
-
mtu: 1492,
|
|
14
|
-
connectionTimeout: 12000, // 12 seconds
|
|
15
|
-
tickRate: 20,
|
|
16
|
-
blockTime: 30000, // 30 seconds
|
|
17
|
-
maxPacketsPerSecond: 500,
|
|
18
|
-
loggerDisabled: false,
|
|
19
|
-
};
|
|
20
|
-
exports.defaultOptions = defaultOptions;
|
package/dist/tests/client.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/tests/client.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC"}
|
package/dist/tests/client.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
require("reflect-metadata");
|
|
4
|
-
const client_1 = require("../client");
|
|
5
|
-
console.time("connect");
|
|
6
|
-
const client = new client_1.Client({
|
|
7
|
-
address: "127.0.0.1",
|
|
8
|
-
port: 19132,
|
|
9
|
-
protocolVersion: 11,
|
|
10
|
-
debug: false,
|
|
11
|
-
});
|
|
12
|
-
client.connect().then(() => {
|
|
13
|
-
console.timeEnd("connect");
|
|
14
|
-
client.disconnect();
|
|
15
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"localhost.d.ts","sourceRoot":"","sources":["../../src/tests/localhost.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC"}
|