@sanctumterra/raknet 1.3.79 → 1.4.0

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.
Files changed (286) hide show
  1. package/README.md +1 -1
  2. package/dist/client/client.d.ts +19 -24
  3. package/dist/client/client.d.ts.map +1 -1
  4. package/dist/client/client.js +135 -278
  5. package/dist/client/index.d.ts +1 -2
  6. package/dist/client/index.d.ts.map +1 -1
  7. package/dist/client/index.js +1 -2
  8. package/dist/client/types/client-events.d.ts +8 -0
  9. package/dist/client/types/client-events.d.ts.map +1 -0
  10. package/dist/client/types/client-options.d.ts +12 -0
  11. package/dist/client/types/client-options.d.ts.map +1 -0
  12. package/dist/client/types/client-options.js +14 -0
  13. package/dist/client/types/index.d.ts +3 -0
  14. package/dist/client/types/index.d.ts.map +1 -0
  15. package/dist/{proto/decorators → client/types}/index.js +2 -2
  16. package/dist/index.d.ts +1 -3
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +1 -3
  19. package/dist/server/connection.d.ts +20 -59
  20. package/dist/server/connection.d.ts.map +1 -1
  21. package/dist/server/connection.js +53 -365
  22. package/dist/server/index.d.ts +2 -3
  23. package/dist/server/index.d.ts.map +1 -1
  24. package/dist/server/index.js +2 -3
  25. package/dist/server/server.d.ts +11 -18
  26. package/dist/server/server.d.ts.map +1 -1
  27. package/dist/server/server.js +98 -137
  28. package/dist/{proto → server}/types/advertisement.d.ts +1 -1
  29. package/dist/server/types/advertisement.d.ts.map +1 -0
  30. package/dist/{proto → server}/types/advertisement.js +14 -10
  31. package/dist/server/types/connection-events.d.ts +4 -0
  32. package/dist/server/types/connection-events.d.ts.map +1 -0
  33. package/dist/server/types/index.d.ts +5 -0
  34. package/dist/server/types/index.d.ts.map +1 -0
  35. package/dist/{proto → server}/types/index.js +3 -1
  36. package/dist/server/types/server-events.d.ts +7 -0
  37. package/dist/server/types/server-events.d.ts.map +1 -0
  38. package/dist/server/types/server-options.d.ts +12 -0
  39. package/dist/server/types/server-options.d.ts.map +1 -0
  40. package/dist/server/types/server-options.js +14 -0
  41. package/dist/shared/emitter.d.ts +28 -0
  42. package/dist/shared/emitter.d.ts.map +1 -0
  43. package/dist/shared/emitter.js +71 -0
  44. package/dist/shared/index.d.ts +5 -0
  45. package/dist/shared/index.d.ts.map +1 -0
  46. package/dist/{utils → shared}/index.js +4 -1
  47. package/dist/{utils/Logger.d.ts → shared/logger.d.ts} +1 -1
  48. package/dist/shared/logger.d.ts.map +1 -0
  49. package/dist/shared/network_session.d.ts +34 -0
  50. package/dist/shared/network_session.d.ts.map +1 -0
  51. package/dist/shared/network_session.js +247 -0
  52. package/dist/shared/proto/enums/connectionStatus.d.ts +8 -0
  53. package/dist/shared/proto/enums/connectionStatus.d.ts.map +1 -0
  54. package/dist/shared/proto/enums/connectionStatus.js +11 -0
  55. package/dist/shared/proto/enums/index.d.ts +5 -0
  56. package/dist/shared/proto/enums/index.d.ts.map +1 -0
  57. package/dist/{proto → shared/proto}/enums/index.js +2 -3
  58. package/dist/shared/proto/enums/packets.d.ts +19 -0
  59. package/dist/shared/proto/enums/packets.d.ts.map +1 -0
  60. package/dist/shared/proto/enums/packets.js +23 -0
  61. package/dist/shared/proto/enums/priority.d.ts +6 -0
  62. package/dist/shared/proto/enums/priority.d.ts.map +1 -0
  63. package/dist/shared/proto/enums/priority.js +4 -0
  64. package/dist/shared/proto/enums/reliability.d.ts.map +1 -0
  65. package/dist/shared/proto/index.d.ts +5 -0
  66. package/dist/shared/proto/index.d.ts.map +1 -0
  67. package/dist/{proto → shared/proto}/index.js +3 -3
  68. package/dist/shared/proto/offline/index.d.ts +7 -0
  69. package/dist/shared/proto/offline/index.d.ts.map +1 -0
  70. package/dist/shared/proto/offline/index.js +22 -0
  71. package/dist/shared/proto/offline/open-connection-reply-one.d.ts +9 -0
  72. package/dist/shared/proto/offline/open-connection-reply-one.d.ts.map +1 -0
  73. package/dist/shared/proto/offline/open-connection-reply-one.js +28 -0
  74. package/dist/shared/proto/offline/open-connection-reply-two.d.ts +11 -0
  75. package/dist/shared/proto/offline/open-connection-reply-two.d.ts.map +1 -0
  76. package/dist/shared/proto/offline/open-connection-reply-two.js +31 -0
  77. package/dist/shared/proto/offline/open-connection-request-one.d.ts +8 -0
  78. package/dist/shared/proto/offline/open-connection-request-one.d.ts.map +1 -0
  79. package/dist/shared/proto/offline/open-connection-request-one.js +25 -0
  80. package/dist/shared/proto/offline/open-connection-request-two.d.ts +10 -0
  81. package/dist/shared/proto/offline/open-connection-request-two.d.ts.map +1 -0
  82. package/dist/shared/proto/offline/open-connection-request-two.js +28 -0
  83. package/dist/shared/proto/offline/unconnected-ping.d.ts +8 -0
  84. package/dist/shared/proto/offline/unconnected-ping.d.ts.map +1 -0
  85. package/dist/shared/proto/offline/unconnected-ping.js +25 -0
  86. package/dist/shared/proto/offline/unconnected-pong.d.ts +9 -0
  87. package/dist/shared/proto/offline/unconnected-pong.d.ts.map +1 -0
  88. package/dist/shared/proto/offline/unconnected-pong.js +28 -0
  89. package/dist/shared/proto/online/ack.d.ts +7 -0
  90. package/dist/shared/proto/online/ack.d.ts.map +1 -0
  91. package/dist/{proto/packets → shared/proto/online}/ack.js +16 -31
  92. package/dist/shared/proto/online/connected-ping.d.ts +7 -0
  93. package/dist/shared/proto/online/connected-ping.d.ts.map +1 -0
  94. package/dist/shared/proto/online/connected-ping.js +19 -0
  95. package/dist/shared/proto/online/connected-pong.d.ts +8 -0
  96. package/dist/shared/proto/online/connected-pong.d.ts.map +1 -0
  97. package/dist/shared/proto/online/connected-pong.js +22 -0
  98. package/dist/shared/proto/online/connection-request-accepted.d.ts +12 -0
  99. package/dist/shared/proto/online/connection-request-accepted.d.ts.map +1 -0
  100. package/dist/shared/proto/online/connection-request-accepted.js +37 -0
  101. package/dist/shared/proto/online/connection-request.d.ts +9 -0
  102. package/dist/shared/proto/online/connection-request.d.ts.map +1 -0
  103. package/dist/shared/proto/online/connection-request.js +25 -0
  104. package/dist/shared/proto/online/disconnect-message.d.ts +6 -0
  105. package/dist/shared/proto/online/disconnect-message.d.ts.map +1 -0
  106. package/dist/shared/proto/online/disconnect-message.js +15 -0
  107. package/dist/shared/proto/online/frame-set.d.ts +9 -0
  108. package/dist/shared/proto/online/frame-set.d.ts.map +1 -0
  109. package/dist/shared/proto/online/frame-set.js +23 -0
  110. package/dist/shared/proto/online/index.d.ts +9 -0
  111. package/dist/shared/proto/online/index.d.ts.map +1 -0
  112. package/dist/shared/proto/online/index.js +24 -0
  113. package/dist/shared/proto/online/new-incomming-connection.d.ts +11 -0
  114. package/dist/shared/proto/online/new-incomming-connection.d.ts.map +1 -0
  115. package/dist/shared/proto/online/new-incomming-connection.js +33 -0
  116. package/dist/shared/proto/types/address.d.ts +12 -0
  117. package/dist/shared/proto/types/address.d.ts.map +1 -0
  118. package/dist/shared/proto/types/address.js +61 -0
  119. package/dist/shared/proto/types/frame.d.ts +23 -0
  120. package/dist/shared/proto/types/frame.d.ts.map +1 -0
  121. package/dist/shared/proto/types/frame.js +119 -0
  122. package/dist/{proto/packets → shared/proto}/types/index.d.ts +0 -2
  123. package/dist/shared/proto/types/index.d.ts.map +1 -0
  124. package/dist/{proto/packets → shared/proto}/types/index.js +0 -2
  125. package/dist/shared/proto/types/magic.d.ts +7 -0
  126. package/dist/shared/proto/types/magic.d.ts.map +1 -0
  127. package/dist/shared/proto/types/magic.js +15 -0
  128. package/dist/shared/proto/types/mtu.d.ts +7 -0
  129. package/dist/shared/proto/types/mtu.d.ts.map +1 -0
  130. package/dist/shared/proto/types/mtu.js +13 -0
  131. package/dist/tests/client-connect.d.ts +2 -0
  132. package/dist/tests/client-connect.d.ts.map +1 -0
  133. package/dist/tests/client-connect.js +32 -0
  134. package/dist/tests/client-once.d.ts +2 -0
  135. package/dist/tests/client-once.d.ts.map +1 -0
  136. package/dist/tests/client-once.js +11 -0
  137. package/dist/tests/server-listen.d.ts +2 -0
  138. package/dist/tests/server-listen.d.ts.map +1 -0
  139. package/dist/tests/server-listen.js +5 -0
  140. package/package.json +8 -8
  141. package/bun.lock +0 -67
  142. package/dist/client/client-events.d.ts +0 -23
  143. package/dist/client/client-events.d.ts.map +0 -1
  144. package/dist/client/client-options.d.ts +0 -13
  145. package/dist/client/client-options.d.ts.map +0 -1
  146. package/dist/client/client-options.js +0 -14
  147. package/dist/client/client_options.d.ts +0 -10
  148. package/dist/client/client_options.d.ts.map +0 -1
  149. package/dist/client/client_options.js +0 -11
  150. package/dist/client/framer.d.ts +0 -56
  151. package/dist/client/framer.d.ts.map +0 -1
  152. package/dist/client/framer.js +0 -467
  153. package/dist/proto/decorators/create.d.ts +0 -8
  154. package/dist/proto/decorators/create.d.ts.map +0 -1
  155. package/dist/proto/decorators/create.js +0 -77
  156. package/dist/proto/decorators/index.d.ts +0 -3
  157. package/dist/proto/decorators/index.d.ts.map +0 -1
  158. package/dist/proto/decorators/serialize.d.ts +0 -4
  159. package/dist/proto/decorators/serialize.d.ts.map +0 -1
  160. package/dist/proto/decorators/serialize.js +0 -12
  161. package/dist/proto/enums/flags.d.ts +0 -7
  162. package/dist/proto/enums/flags.d.ts.map +0 -1
  163. package/dist/proto/enums/flags.js +0 -10
  164. package/dist/proto/enums/index.d.ts +0 -6
  165. package/dist/proto/enums/index.d.ts.map +0 -1
  166. package/dist/proto/enums/packet.d.ts +0 -122
  167. package/dist/proto/enums/packet.d.ts.map +0 -1
  168. package/dist/proto/enums/packet.js +0 -125
  169. package/dist/proto/enums/priority.d.ts +0 -5
  170. package/dist/proto/enums/priority.d.ts.map +0 -1
  171. package/dist/proto/enums/priority.js +0 -8
  172. package/dist/proto/enums/reliability.d.ts.map +0 -1
  173. package/dist/proto/enums/status.d.ts +0 -7
  174. package/dist/proto/enums/status.d.ts.map +0 -1
  175. package/dist/proto/enums/status.js +0 -10
  176. package/dist/proto/index.d.ts +0 -5
  177. package/dist/proto/index.d.ts.map +0 -1
  178. package/dist/proto/packets/ack.d.ts +0 -10
  179. package/dist/proto/packets/ack.d.ts.map +0 -1
  180. package/dist/proto/packets/base-packet.d.ts +0 -26
  181. package/dist/proto/packets/base-packet.d.ts.map +0 -1
  182. package/dist/proto/packets/base-packet.js +0 -37
  183. package/dist/proto/packets/connected-ping.d.ts +0 -5
  184. package/dist/proto/packets/connected-ping.d.ts.map +0 -1
  185. package/dist/proto/packets/connected-ping.js +0 -27
  186. package/dist/proto/packets/connected-pong.d.ts +0 -6
  187. package/dist/proto/packets/connected-pong.d.ts.map +0 -1
  188. package/dist/proto/packets/connected-pong.js +0 -32
  189. package/dist/proto/packets/connection-request-accepted.d.ts +0 -10
  190. package/dist/proto/packets/connection-request-accepted.d.ts.map +0 -1
  191. package/dist/proto/packets/connection-request-accepted.js +0 -48
  192. package/dist/proto/packets/connection-request.d.ts +0 -7
  193. package/dist/proto/packets/connection-request.d.ts.map +0 -1
  194. package/dist/proto/packets/connection-request.js +0 -37
  195. package/dist/proto/packets/disconnect.d.ts +0 -5
  196. package/dist/proto/packets/disconnect.d.ts.map +0 -1
  197. package/dist/proto/packets/disconnect.js +0 -17
  198. package/dist/proto/packets/frame.d.ts +0 -1
  199. package/dist/proto/packets/frame.d.ts.map +0 -1
  200. package/dist/proto/packets/frame.js +0 -1
  201. package/dist/proto/packets/frameset.d.ts +0 -11
  202. package/dist/proto/packets/frameset.d.ts.map +0 -1
  203. package/dist/proto/packets/frameset.js +0 -37
  204. package/dist/proto/packets/incompatible-protocol-version.d.ts +0 -8
  205. package/dist/proto/packets/incompatible-protocol-version.d.ts.map +0 -1
  206. package/dist/proto/packets/incompatible-protocol-version.js +0 -38
  207. package/dist/proto/packets/index.d.ts +0 -19
  208. package/dist/proto/packets/index.d.ts.map +0 -1
  209. package/dist/proto/packets/index.js +0 -34
  210. package/dist/proto/packets/nack.d.ts +0 -8
  211. package/dist/proto/packets/nack.d.ts.map +0 -1
  212. package/dist/proto/packets/nack.js +0 -88
  213. package/dist/proto/packets/new-incoming-connection.d.ts +0 -9
  214. package/dist/proto/packets/new-incoming-connection.d.ts.map +0 -1
  215. package/dist/proto/packets/new-incoming-connection.js +0 -43
  216. package/dist/proto/packets/open-connection-reply-one.d.ts +0 -8
  217. package/dist/proto/packets/open-connection-reply-one.d.ts.map +0 -1
  218. package/dist/proto/packets/open-connection-reply-one.js +0 -43
  219. package/dist/proto/packets/open-connection-reply-two.d.ts +0 -10
  220. package/dist/proto/packets/open-connection-reply-two.d.ts.map +0 -1
  221. package/dist/proto/packets/open-connection-reply-two.js +0 -48
  222. package/dist/proto/packets/open-connection-request-one.d.ts +0 -7
  223. package/dist/proto/packets/open-connection-request-one.d.ts.map +0 -1
  224. package/dist/proto/packets/open-connection-request-one.js +0 -38
  225. package/dist/proto/packets/open-connection-request-two.d.ts +0 -9
  226. package/dist/proto/packets/open-connection-request-two.d.ts.map +0 -1
  227. package/dist/proto/packets/open-connection-request-two.js +0 -43
  228. package/dist/proto/packets/types/address.d.ts +0 -48
  229. package/dist/proto/packets/types/address.d.ts.map +0 -1
  230. package/dist/proto/packets/types/address.js +0 -99
  231. package/dist/proto/packets/types/data-type.d.ts +0 -21
  232. package/dist/proto/packets/types/data-type.d.ts.map +0 -1
  233. package/dist/proto/packets/types/data-type.js +0 -29
  234. package/dist/proto/packets/types/frame.d.ts +0 -23
  235. package/dist/proto/packets/types/frame.d.ts.map +0 -1
  236. package/dist/proto/packets/types/frame.js +0 -94
  237. package/dist/proto/packets/types/index.d.ts.map +0 -1
  238. package/dist/proto/packets/types/magic.d.ts +0 -7
  239. package/dist/proto/packets/types/magic.d.ts.map +0 -1
  240. package/dist/proto/packets/types/magic.js +0 -14
  241. package/dist/proto/packets/types/mtu.d.ts +0 -9
  242. package/dist/proto/packets/types/mtu.d.ts.map +0 -1
  243. package/dist/proto/packets/types/mtu.js +0 -18
  244. package/dist/proto/packets/types/sys-address.d.ts +0 -11
  245. package/dist/proto/packets/types/sys-address.d.ts.map +0 -1
  246. package/dist/proto/packets/types/sys-address.js +0 -32
  247. package/dist/proto/packets/unconnected-ping.d.ts +0 -7
  248. package/dist/proto/packets/unconnected-ping.d.ts.map +0 -1
  249. package/dist/proto/packets/unconnected-ping.js +0 -38
  250. package/dist/proto/packets/unconnected-pong.d.ts +0 -8
  251. package/dist/proto/packets/unconnected-pong.d.ts.map +0 -1
  252. package/dist/proto/packets/unconnected-pong.js +0 -43
  253. package/dist/proto/types/advertisement.d.ts.map +0 -1
  254. package/dist/proto/types/index.d.ts +0 -3
  255. package/dist/proto/types/index.d.ts.map +0 -1
  256. package/dist/proto/types/valid.d.ts +0 -4
  257. package/dist/proto/types/valid.d.ts.map +0 -1
  258. package/dist/server/server-events.d.ts +0 -9
  259. package/dist/server/server-events.d.ts.map +0 -1
  260. package/dist/server/server-options.d.ts +0 -26
  261. package/dist/server/server-options.d.ts.map +0 -1
  262. package/dist/server/server-options.js +0 -20
  263. package/dist/tests/client.d.ts +0 -2
  264. package/dist/tests/client.d.ts.map +0 -1
  265. package/dist/tests/client.js +0 -15
  266. package/dist/tests/localhost.d.ts +0 -2
  267. package/dist/tests/localhost.d.ts.map +0 -1
  268. package/dist/tests/localhost.js +0 -34
  269. package/dist/tests/server.d.ts +0 -2
  270. package/dist/tests/server.d.ts.map +0 -1
  271. package/dist/tests/server.js +0 -32
  272. package/dist/tests/test.d.ts +0 -2
  273. package/dist/tests/test.d.ts.map +0 -1
  274. package/dist/tests/test.js +0 -49
  275. package/dist/utils/Logger.d.ts.map +0 -1
  276. package/dist/utils/decorators.d.ts +0 -2
  277. package/dist/utils/decorators.d.ts.map +0 -1
  278. package/dist/utils/decorators.js +0 -17
  279. package/dist/utils/index.d.ts +0 -2
  280. package/dist/utils/index.d.ts.map +0 -1
  281. /package/dist/client/{client-events.js → types/client-events.js} +0 -0
  282. /package/dist/{proto/types/valid.js → server/types/connection-events.js} +0 -0
  283. /package/dist/server/{server-events.js → types/server-events.js} +0 -0
  284. /package/dist/{utils/Logger.js → shared/logger.js} +0 -0
  285. /package/dist/{proto → shared/proto}/enums/reliability.d.ts +0 -0
  286. /package/dist/{proto → shared/proto}/enums/reliability.js +0 -0
package/README.md CHANGED
@@ -41,6 +41,6 @@ server.start();
41
41
  debug: false,
42
42
  });
43
43
  client.connect().then((ad) => {
44
- console.log(ad);
44
+ if(ad) console.log(ad);
45
45
  });
46
46
  ```
@@ -1,28 +1,23 @@
1
- import { Emitter } from "@serenityjs/emitter";
2
- import type { ClientEvents } from "./client-events";
3
- import { type Socket } from "node:dgram";
4
- import { Framer } from "./framer";
5
- import { type Address, type Advertisement, Frame, type Priority, Status } from "../proto";
6
- import { type ClientOptions } from "./client-options";
7
- export declare class Client extends Emitter<ClientEvents> {
8
- socket: Socket | null;
9
- framer: Framer | null;
1
+ import { EventEmitter, Priority, type Frame } from "../shared";
2
+ import type { ClientEvents } from "./types";
3
+ import { type ClientOptions } from "./types/client-options";
4
+ import { type RemoteInfo } from "node:dgram";
5
+ export declare class Client extends EventEmitter<ClientEvents> {
10
6
  options: ClientOptions;
11
- private tickTimer?;
12
- private connectionTimeout?;
13
- private requestInterval?;
14
- serverAddress: Address | null;
15
- status: Status;
7
+ private socket;
8
+ private interval;
9
+ private status;
10
+ tick: number;
11
+ private session;
16
12
  constructor(options?: Partial<ClientOptions>);
17
- initSocket(): void;
18
- ping(): Promise<Advertisement>;
19
- connect(): Promise<Advertisement>;
20
- sendFrame(frame: Frame, priority: Priority): void;
21
- frameAndSend(payload: Buffer, priority: Priority): void;
22
- send(buffer: Buffer): void;
23
- private cleanupSocket;
24
- private cleanupFramer;
25
- cleanup(): void;
26
- disconnect(): Promise<void>;
13
+ connect(): Promise<void>;
14
+ onTick(): void;
15
+ onMessage(data: Buffer, rinfo: RemoteInfo): void;
16
+ handleOnline(data: Buffer): void;
17
+ sendFrame(frame: Frame, priority?: Priority): void;
18
+ frameAndSend(data: Buffer, priority?: Priority): void;
19
+ ping(): void;
20
+ send(data: Buffer): void;
21
+ disconnect(): void;
27
22
  }
28
23
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAmB,KAAK,MAAM,EAAgB,MAAM,YAAY,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAEN,KAAK,OAAO,EACZ,KAAK,aAAa,EAClB,KAAK,EAIL,KAAK,QAAQ,EACb,MAAM,EAGN,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,KAAK,aAAa,EAAwB,MAAM,kBAAkB,CAAC;AAO5E,qBAAa,MAAO,SAAQ,OAAO,CAAC,YAAY,CAAC;IACzC,MAAM,EAAG,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,EAAG,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,aAAa,CAAC;IAC9B,OAAO,CAAC,SAAS,CAAC,CAAiB;IACnC,OAAO,CAAC,iBAAiB,CAAC,CAAiB;IAC3C,OAAO,CAAC,eAAe,CAAC,CAAiB;IAClC,aAAa,EAAG,OAAO,GAAG,IAAI,CAAC;IAE/B,MAAM,SAAuB;gBAExB,OAAO,GAAE,OAAO,CAAC,aAAa,CAAwB;IAM3D,UAAU;IAuBJ,IAAI,IAAI,OAAO,CAAC,aAAa,CAAC;IAkB9B,OAAO,IAAI,OAAO,CAAC,aAAa,CAAC;IA4GvC,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAYjD,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAOvD,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAiCjC,OAAO,CAAC,aAAa;IAgDrB,OAAO,CAAC,aAAa;IAOd,OAAO,IAAI,IAAI;IAqCf,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CAkClC"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,YAAY,EAWZ,QAAQ,EAIR,KAAK,KAAK,EAIV,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EACN,KAAK,aAAa,EAElB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAgB,KAAK,UAAU,EAAe,MAAM,YAAY,CAAC;AAGxE,qBAAa,MAAO,SAAQ,YAAY,CAAC,YAAY,CAAC;IAC9C,OAAO,EAAE,aAAa,CAAC;IAC9B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,QAAQ,CAAwB;IACxC,OAAO,CAAC,MAAM,CAAmB;IAC1B,IAAI,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,OAAO,CAAiB;gBAEpB,OAAO,GAAE,OAAO,CAAC,aAAa,CAAM;IAmBzC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAkBxB,MAAM,IAAI,IAAI;IAYd,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,IAAI;IAqDhD,YAAY,CAAC,IAAI,EAAE,MAAM;IAwCzB,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,GAAE,QAA0B;IAI5D,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,GAAE,QAA0B;IAI/D,IAAI,IAAI,IAAI;IAQZ,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAIxB,UAAU,IAAI,IAAI;CAIzB"}
@@ -1,308 +1,165 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.Client = void 0;
7
- const emitter_1 = require("@serenityjs/emitter");
4
+ const shared_1 = require("../shared");
5
+ const client_options_1 = require("./types/client-options");
8
6
  const node_dgram_1 = require("node:dgram");
9
- const framer_1 = require("./framer");
10
- const proto_1 = require("../proto");
11
- const disconnect_1 = __importDefault(require("../proto/packets/disconnect"));
12
- const client_options_1 = require("./client-options");
13
- const utils_1 = require("../utils");
14
- const TICK_INTERVAL = 50;
15
- const REQUEST_INTERVAL = 500;
16
- class Client extends emitter_1.Emitter {
17
- socket;
18
- framer;
7
+ const shared_2 = require("../shared");
8
+ class Client extends shared_1.EventEmitter {
19
9
  options;
20
- tickTimer;
21
- connectionTimeout;
22
- requestInterval;
23
- serverAddress;
24
- status = proto_1.Status.Disconnected;
25
- constructor(options = client_options_1.defaultClientOptions) {
10
+ socket;
11
+ interval;
12
+ status;
13
+ tick;
14
+ session;
15
+ constructor(options = {}) {
26
16
  super();
27
17
  this.options = { ...client_options_1.defaultClientOptions, ...options };
28
- this.maxListeners = 60;
18
+ this.status = shared_1.ConnectionStatus.Disconnected;
19
+ this.tick = 0;
20
+ this.socket = (0, node_dgram_1.createSocket)("udp4");
21
+ this.socket.bind();
22
+ this.interval = setInterval(this.onTick.bind(this), 1000 / this.options.tickRate);
23
+ this.socket.on("message", this.onMessage.bind(this));
24
+ this.session = new shared_1.NetworkSession(this.options.mtu);
25
+ this.session.send = this.send.bind(this);
26
+ this.session.handle = (data) => {
27
+ this.handleOnline(data);
28
+ };
29
29
  }
30
- initSocket() {
31
- try {
32
- this.socket = (0, node_dgram_1.createSocket)("udp4");
33
- this.framer = new framer_1.Framer(this);
34
- this.remove("tick", () => this.framer?.tick());
35
- this.on("tick", () => this.framer?.tick());
36
- this.socket.removeAllListeners();
37
- this.socket.on("message", (payload, rinfo) => {
38
- this.framer?.incomingMessage(payload, rinfo);
39
- });
40
- this.socket.on("error", (err) => {
41
- utils_1.Logger.error(`[Client] Socket error: ${err}`);
42
- });
43
- utils_1.Logger.disabled = this.options.loggerDisabled;
44
- }
45
- catch (error) {
46
- utils_1.Logger.error(`Failed to create socket: ${error}`);
47
- }
48
- }
49
- async ping() {
30
+ connect() {
50
31
  return new Promise((resolve, reject) => {
32
+ this.status = shared_1.ConnectionStatus.Connecting;
33
+ const request = new shared_1.OpenConnectionRequestOne();
34
+ request.mtu = this.options.mtu;
35
+ request.protocol = 11; // Only 11 is supported
36
+ const serialized = request.serialize();
37
+ this.send(serialized);
51
38
  const timeout = setTimeout(() => {
52
- reject(new Error("Failed to ping, timed out."));
39
+ reject(new Error("Connection timed out"));
53
40
  }, this.options.timeout);
54
- this.once("unconnected-pong", (packet) => {
41
+ this.once("connect", () => {
55
42
  clearTimeout(timeout);
56
- resolve((0, proto_1.fromString)(packet.message));
43
+ resolve();
57
44
  });
58
- const unconnectedPing = new proto_1.UnconnectedPing();
59
- unconnectedPing.guid = this.options.clientId;
60
- unconnectedPing.clientTimestamp = BigInt(Date.now());
61
- this.send(unconnectedPing.serialize());
62
45
  });
63
46
  }
64
- async connect() {
65
- if (this.status === proto_1.Status.Connecting) {
66
- throw new Error("Connection attempt already in progress");
67
- }
68
- if (this.status === proto_1.Status.Connected) {
69
- throw new Error("Already connected");
70
- }
71
- this.status = proto_1.Status.Connecting;
72
- this.initSocket();
73
- this.tickTimer = setInterval(() => this.emit("tick"), TICK_INTERVAL);
74
- try {
75
- const advertisement = await this.ping();
76
- if (!advertisement)
77
- throw new Error("Failed to get server advertisement");
78
- return new Promise((resolve, reject) => {
79
- let isResolved = false;
80
- let currentStage = "request-one"; // Track connection stage
81
- const cleanup = () => {
82
- if (this.connectionTimeout) {
83
- clearTimeout(this.connectionTimeout);
84
- this.connectionTimeout = undefined;
85
- }
86
- if (this.requestInterval) {
87
- clearInterval(this.requestInterval);
88
- this.requestInterval = undefined;
89
- }
90
- if (!isResolved) {
91
- utils_1.Logger.error("Could not resolve connection.");
92
- this.cleanup();
93
- }
94
- };
95
- // Setup connection timeout
96
- this.connectionTimeout = setTimeout(() => {
97
- cleanup();
98
- reject(new Error("Connection timed out"));
99
- }, this.options.timeout);
100
- // Prepare connection request one
101
- const requestOne = new proto_1.OpenConnectionRequestOne();
102
- requestOne.mtu = this.options.mtuSize;
103
- requestOne.protocol = this.options.protocolVersion;
104
- // Handle open-connection-reply-one event
105
- this.once("open-connection-reply-one", () => {
106
- currentStage = "request-two";
107
- utils_1.Logger.debug("[Client] Received OpenConnectionReplyOne, sending OpenConnectionRequestTwo");
108
- // Move to next connection stage
109
- if (this.requestInterval) {
110
- clearInterval(this.requestInterval);
111
- }
112
- // Here we would send OpenConnectionRequestTwo
113
- // The framer handles this transition
114
- });
115
- // Handle open-connection-reply-two event
116
- this.once("open-connection-reply-two", (packet) => {
117
- const mtu = packet.mtu;
118
- if (mtu > 400 && mtu < 1500) {
119
- currentStage = "completed";
120
- utils_1.Logger.debug(`[Client] Received OpenConnectionReplyTwo with MTU: ${mtu}`);
121
- }
122
- else {
123
- cleanup();
124
- reject(new Error(`Invalid MTU size: ${mtu}`));
125
- }
126
- });
127
- // Send initial request
128
- this.emit("open-connection-request-one", requestOne);
129
- this.send(requestOne.serialize());
130
- // Set up interval to resend requests
131
- this.requestInterval = setInterval(() => {
132
- if (!isResolved && currentStage === "request-one") {
133
- utils_1.Logger.debug("[Client] Resending OpenConnectionRequestOne");
134
- this.send(requestOne.serialize());
135
- }
136
- }, REQUEST_INTERVAL);
137
- // Handle successful connection
138
- this.once("new-incoming-connection", () => {
139
- if (!isResolved) {
140
- isResolved = true;
141
- this.emit("connect", advertisement);
142
- this.status = proto_1.Status.Connected;
143
- cleanup();
144
- resolve(advertisement);
145
- }
146
- });
147
- // Handle connection errors
148
- this.once("error", (error) => {
149
- cleanup();
150
- reject(error);
151
- });
152
- });
153
- }
154
- catch (error) {
155
- this.status = proto_1.Status.Disconnected;
156
- throw error;
157
- }
47
+ onTick() {
48
+ const isDisconnected = this.status === shared_1.ConnectionStatus.Disconnected;
49
+ const isDisconnecting = this.status === shared_1.ConnectionStatus.Disconnecting;
50
+ const canPing = isDisconnected && this.tick % this.options.pingRate === 0;
51
+ if (canPing)
52
+ this.ping();
53
+ if (!isDisconnecting || !isDisconnected) {
54
+ this.session.onTick(this.tick);
55
+ }
56
+ this.tick++;
158
57
  }
159
- sendFrame(frame, priority) {
160
- try {
161
- if (!this.framer) {
162
- utils_1.Logger.error("[Client] Cannot send frame: framer is null");
163
- return;
58
+ onMessage(data, rinfo) {
59
+ let id = data[0];
60
+ const isOnline = (id & 0xf0) === 0x80;
61
+ if (isOnline)
62
+ id = 0x80;
63
+ switch (id) {
64
+ case shared_1.Packets.UnconnectedPong: {
65
+ const pong = new shared_1.UnconnectedPong(data).deserialize();
66
+ this.emit("unconnectedPong", pong);
67
+ break;
68
+ }
69
+ case shared_1.Packets.OpenConnectionReply1: {
70
+ const reply = new shared_1.OpenConnectionReplyOne(data).deserialize();
71
+ const request = new shared_1.OpenConnectionRequestTwo();
72
+ request.address = shared_1.Address.fromIdentifier(rinfo);
73
+ request.mtu = reply.mtu;
74
+ request.guid = this.options.guid;
75
+ this.send(request.serialize());
76
+ break;
77
+ }
78
+ case shared_1.Packets.OpenConnectionReply2: {
79
+ const reply = new shared_1.OpenConnectionReplyTwo(data).deserialize();
80
+ const request = new shared_1.ConnectionRequest();
81
+ request.guid = this.options.guid;
82
+ request.timestamp = BigInt(Date.now());
83
+ const serialized = request.serialize();
84
+ this.frameAndSend(serialized, shared_1.Priority.High);
85
+ break;
86
+ }
87
+ case shared_1.Packets.FrameSet: {
88
+ const frameSet = new shared_1.FrameSet(data).deserialize();
89
+ this.session.onFrameSet(frameSet);
90
+ break;
91
+ }
92
+ case shared_1.Packets.Ack: {
93
+ const ack = new shared_1.Ack(data).deserialize();
94
+ this.session.onAck(ack);
95
+ break;
96
+ }
97
+ case shared_1.Packets.Nack: {
98
+ const nack = new shared_1.Ack(data).deserialize();
99
+ this.session.onNack(nack);
100
+ break;
101
+ }
102
+ default: {
103
+ shared_2.Logger.warn(`Unknown packet type: ${id}`);
104
+ break;
164
105
  }
165
- this.framer.sendFrame(frame, priority);
166
- }
167
- catch (error) {
168
- utils_1.Logger.error("[Client] Failed to send frame", error);
169
- }
170
- }
171
- frameAndSend(payload, priority) {
172
- const frame = new proto_1.Frame();
173
- frame.payload = payload;
174
- frame.orderChannel = 0;
175
- this.sendFrame(frame, priority);
176
- }
177
- send(buffer) {
178
- if (this.status === proto_1.Status.Disconnected) {
179
- utils_1.Logger.warn("[Client] Attempting to send packet while disconnected");
180
- return;
181
- }
182
- if (!this.socket) {
183
- utils_1.Logger.error("[Client] Cannot send packet: socket is null");
184
- return;
185
- }
186
- utils_1.Logger.debug(`[Client] Sending packet ${buffer[0]}, ${buffer.length} bytes to ${this.options.address}:${this.options.port}`);
187
- try {
188
- this.socket.send(buffer, 0, buffer.length, this.options.port, this.options.address, (err) => {
189
- if (err) {
190
- utils_1.Logger.error("[Client] Failed to send packet", err);
191
- }
192
- });
193
- }
194
- catch (error) {
195
- utils_1.Logger.error("[Client] Failed to send packet", error);
196
106
  }
197
107
  }
198
- cleanupSocket() {
199
- if (!this.socket)
200
- return;
201
- try {
202
- this.socket.removeAllListeners();
203
- if (this.status === proto_1.Status.Connected) {
204
- const disconnect = new disconnect_1.default();
205
- this.socket.send(disconnect.serialize(), 0, disconnect.serialize().length, this.options.port, this.options.address);
108
+ handleOnline(data) {
109
+ const id = data[0];
110
+ switch (id) {
111
+ case 254: {
112
+ this.emit("encapsulated", data);
113
+ break;
206
114
  }
207
- const stateSymbol = Symbol.for("state symbol");
208
- const socketWithState = this.socket;
209
- const state = socketWithState[stateSymbol];
210
- if (state?.handle) {
211
- state.handle.close();
212
- state.handle = null;
115
+ case shared_1.Packets.ConnectedPong: {
116
+ break;
213
117
  }
214
- this.socket.close(() => {
215
- utils_1.Logger.info("[Client] Socket closed");
216
- this.socket?.removeAllListeners();
217
- });
218
- // (this.socket as { _handle?: unknown })._handle = undefined;
219
- }
220
- catch (err) {
221
- utils_1.Logger.error("[Client] Error during socket cleanup", err);
222
- try {
223
- const stateSymbol = Symbol.for("state symbol");
224
- const socketWithState = this.socket;
225
- const state = socketWithState[stateSymbol];
226
- if (state?.handle) {
227
- state.handle.close();
228
- state.handle = null;
229
- }
118
+ case shared_1.Packets.ConnectedPing: {
119
+ const ping = new shared_1.ConnectedPing(data).deserialize();
120
+ const pong = new shared_1.ConnectedPong();
121
+ pong.pingTimestamp = ping.timestamp;
122
+ pong.pongTimestamp = BigInt(Date.now());
123
+ this.frameAndSend(ping.serialize(), shared_1.Priority.High);
124
+ break;
125
+ }
126
+ case shared_1.Packets.ConnectionRequestAccepted: {
127
+ const accepted = new shared_1.ConnectionRequestAccepted(data).deserialize();
128
+ const nic = new shared_1.NewIncomingConnection();
129
+ nic.address = new shared_1.Address(this.socket.address().address, this.socket.address().port, this.socket.address().family === "IPv4" ? 4 : 6);
130
+ nic.internalAddress = new shared_1.Address("127.0.0.1", 0, 4);
131
+ nic.incomingTimestamp = BigInt(Date.now());
132
+ nic.serverTimestamp = accepted.timestamp;
133
+ this.frameAndSend(nic.serialize(), shared_1.Priority.High);
134
+ this.emit("connect");
135
+ break;
136
+ }
137
+ default: {
138
+ shared_2.Logger.warn(`Unknown packet type: ${id}`);
139
+ break;
230
140
  }
231
- catch (_) { }
232
- this.socket = null;
233
141
  }
234
142
  }
235
- cleanupFramer() {
236
- if (!this.framer)
237
- return;
238
- this.framer._events = undefined;
239
- this.framer._eventsCount = undefined;
240
- this.framer = null;
143
+ sendFrame(frame, priority = shared_1.Priority.Medium) {
144
+ this.session.sendFrame(frame, priority);
241
145
  }
242
- cleanup() {
243
- if (this.status === proto_1.Status.Disconnected)
244
- return;
245
- utils_1.Logger.debug("[Client] Cleaning up connection and resources");
246
- const wasConnected = this.status === proto_1.Status.Connected;
247
- this.status = proto_1.Status.Disconnecting;
248
- this.remove("tick", () => this.framer?.tick());
249
- if (this.tickTimer) {
250
- clearInterval(this.tickTimer);
251
- this.tickTimer = undefined;
252
- }
253
- if (this.connectionTimeout) {
254
- clearTimeout(this.connectionTimeout);
255
- this.connectionTimeout = undefined;
256
- }
257
- if (this.requestInterval) {
258
- clearInterval(this.requestInterval);
259
- this.requestInterval = undefined;
260
- }
261
- this.removeAll();
262
- this.removeAllAfter();
263
- this.removeAllBefore();
264
- this.cleanupSocket();
265
- this.cleanupFramer();
266
- this.serverAddress = null;
267
- this._events = undefined;
268
- this._eventsCount = undefined;
269
- this.status = proto_1.Status.Disconnected;
270
- utils_1.Logger.debug("[Client] Cleanup complete");
146
+ frameAndSend(data, priority = shared_1.Priority.Medium) {
147
+ this.session.frameAndSend(data, priority);
148
+ }
149
+ ping() {
150
+ const ping = new shared_1.UnconnectedPing();
151
+ ping.guid = this.options.guid;
152
+ ping.timestamp = BigInt(Date.now());
153
+ const serialized = ping.serialize();
154
+ this.send(serialized);
155
+ }
156
+ send(data) {
157
+ this.socket.send(data, this.options.port, this.options.address);
271
158
  }
272
159
  disconnect() {
273
- return new Promise((resolve, reject) => {
274
- if (this.status === proto_1.Status.Disconnected) {
275
- resolve();
276
- return;
277
- }
278
- const cleanupTimeout = setTimeout(() => {
279
- utils_1.Logger.warn("[Client] Disconnect timeout reached, forcing cleanup");
280
- try {
281
- this.cleanup();
282
- resolve();
283
- }
284
- catch (error) {
285
- reject(error);
286
- }
287
- }, 5000);
288
- try {
289
- setImmediate(() => {
290
- try {
291
- this.cleanup();
292
- clearTimeout(cleanupTimeout);
293
- resolve();
294
- }
295
- catch (error) {
296
- clearTimeout(cleanupTimeout);
297
- reject(error);
298
- }
299
- });
300
- }
301
- catch (error) {
302
- clearTimeout(cleanupTimeout);
303
- reject(error);
304
- }
305
- });
160
+ this.socket.close();
161
+ if (this.interval)
162
+ clearInterval(this.interval);
306
163
  }
307
164
  }
308
165
  exports.Client = Client;
@@ -1,4 +1,3 @@
1
- export * from "./client-events";
2
1
  export * from "./client";
3
- export * from "./client-options";
2
+ export * from "./types";
4
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
@@ -14,6 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./client-events"), exports);
18
17
  __exportStar(require("./client"), exports);
19
- __exportStar(require("./client-options"), exports);
18
+ __exportStar(require("./types"), exports);
@@ -0,0 +1,8 @@
1
+ import type { UnconnectedPong } from "../../shared";
2
+ export interface ClientEvents {
3
+ unconnectedPong: UnconnectedPong;
4
+ error: Error;
5
+ connect: undefined;
6
+ encapsulated: Buffer;
7
+ }
8
+ //# sourceMappingURL=client-events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client-events.d.ts","sourceRoot":"","sources":["../../../src/client/types/client-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,MAAM,WAAW,YAAY;IAC5B,eAAe,EAAE,eAAe,CAAC;IACjC,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,SAAS,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACrB"}
@@ -0,0 +1,12 @@
1
+ export type ClientOptions = {
2
+ mtu: number;
3
+ address: string;
4
+ port: number;
5
+ guid: bigint;
6
+ tickRate: number;
7
+ pingRate: number;
8
+ timeout: number;
9
+ };
10
+ export declare const getRandomGuid: () => bigint;
11
+ export declare const defaultClientOptions: ClientOptions;
12
+ //# sourceMappingURL=client-options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client-options.d.ts","sourceRoot":"","sources":["../../../src/client/types/client-options.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,aAAa,GAAG;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CAChB,CAAC;AACF,eAAO,MAAM,aAAa,cACgC,CAAC;AAE3D,eAAO,MAAM,oBAAoB,EAAE,aAQlC,CAAC"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.defaultClientOptions = exports.getRandomGuid = void 0;
4
+ const getRandomGuid = () => BigInt(Math.floor(Date.now() + Math.random() * 10000000));
5
+ exports.getRandomGuid = getRandomGuid;
6
+ exports.defaultClientOptions = {
7
+ mtu: 1492,
8
+ address: "127.0.0.1",
9
+ port: 19132,
10
+ guid: (0, exports.getRandomGuid)(),
11
+ tickRate: 20,
12
+ pingRate: 40,
13
+ timeout: 30000,
14
+ };
@@ -0,0 +1,3 @@
1
+ export * from "./client-options";
2
+ export * from "./client-events";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC"}
@@ -14,5 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./create"), exports);
18
- __exportStar(require("./serialize"), exports);
17
+ __exportStar(require("./client-options"), exports);
18
+ __exportStar(require("./client-events"), exports);
package/dist/index.d.ts CHANGED
@@ -1,6 +1,4 @@
1
- import "reflect-metadata";
2
- export * from "./proto";
3
- export * from "./utils";
4
1
  export * from "./client";
2
+ export * from "./shared";
5
3
  export * from "./server";
6
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC"}
package/dist/index.js CHANGED
@@ -14,8 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- require("reflect-metadata");
18
- __exportStar(require("./proto"), exports);
19
- __exportStar(require("./utils"), exports);
20
17
  __exportStar(require("./client"), exports);
18
+ __exportStar(require("./shared"), exports);
21
19
  __exportStar(require("./server"), exports);