@quake2ts/shared 0.0.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.
Files changed (209) hide show
  1. package/dist/browser/index.global.js +2 -0
  2. package/dist/browser/index.global.js.map +1 -0
  3. package/dist/cjs/index.cjs +6569 -0
  4. package/dist/cjs/index.cjs.map +1 -0
  5. package/dist/esm/index.js +6200 -0
  6. package/dist/esm/index.js.map +1 -0
  7. package/dist/tsconfig.tsbuildinfo +1 -0
  8. package/dist/types/audio/constants.d.ts +24 -0
  9. package/dist/types/audio/constants.d.ts.map +1 -0
  10. package/dist/types/bsp/collision.d.ts +201 -0
  11. package/dist/types/bsp/collision.d.ts.map +1 -0
  12. package/dist/types/bsp/contents.d.ts +72 -0
  13. package/dist/types/bsp/contents.d.ts.map +1 -0
  14. package/dist/types/bsp/spatial.d.ts +13 -0
  15. package/dist/types/bsp/spatial.d.ts.map +1 -0
  16. package/dist/types/index.d.ts +38 -0
  17. package/dist/types/index.d.ts.map +1 -0
  18. package/dist/types/inventory-helpers.d.ts +19 -0
  19. package/dist/types/inventory-helpers.d.ts.map +1 -0
  20. package/dist/types/io/binaryStream.d.ts +38 -0
  21. package/dist/types/io/binaryStream.d.ts.map +1 -0
  22. package/dist/types/io/binaryWriter.d.ts +26 -0
  23. package/dist/types/io/binaryWriter.d.ts.map +1 -0
  24. package/dist/types/io/index.d.ts +4 -0
  25. package/dist/types/io/index.d.ts.map +1 -0
  26. package/dist/types/io/messageBuilder.d.ts +21 -0
  27. package/dist/types/io/messageBuilder.d.ts.map +1 -0
  28. package/dist/types/items/ammo.d.ts +40 -0
  29. package/dist/types/items/ammo.d.ts.map +1 -0
  30. package/dist/types/items/index.d.ts +8 -0
  31. package/dist/types/items/index.d.ts.map +1 -0
  32. package/dist/types/items/powerups.d.ts +31 -0
  33. package/dist/types/items/powerups.d.ts.map +1 -0
  34. package/dist/types/items/weaponInfo.d.ts +5 -0
  35. package/dist/types/items/weaponInfo.d.ts.map +1 -0
  36. package/dist/types/items/weapons.d.ts +27 -0
  37. package/dist/types/items/weapons.d.ts.map +1 -0
  38. package/dist/types/math/angles.d.ts +19 -0
  39. package/dist/types/math/angles.d.ts.map +1 -0
  40. package/dist/types/math/anorms.d.ts +2 -0
  41. package/dist/types/math/anorms.d.ts.map +1 -0
  42. package/dist/types/math/color.d.ts +12 -0
  43. package/dist/types/math/color.d.ts.map +1 -0
  44. package/dist/types/math/mat4.d.ts +7 -0
  45. package/dist/types/math/mat4.d.ts.map +1 -0
  46. package/dist/types/math/random.d.ts +60 -0
  47. package/dist/types/math/random.d.ts.map +1 -0
  48. package/dist/types/math/vec3.d.ts +79 -0
  49. package/dist/types/math/vec3.d.ts.map +1 -0
  50. package/dist/types/net/driver.d.ts +10 -0
  51. package/dist/types/net/driver.d.ts.map +1 -0
  52. package/dist/types/net/index.d.ts +3 -0
  53. package/dist/types/net/index.d.ts.map +1 -0
  54. package/dist/types/net/netchan.d.ts +85 -0
  55. package/dist/types/net/netchan.d.ts.map +1 -0
  56. package/dist/types/pmove/apply.d.ts +5 -0
  57. package/dist/types/pmove/apply.d.ts.map +1 -0
  58. package/dist/types/pmove/categorize.d.ts +36 -0
  59. package/dist/types/pmove/categorize.d.ts.map +1 -0
  60. package/dist/types/pmove/config.d.ts +5 -0
  61. package/dist/types/pmove/config.d.ts.map +1 -0
  62. package/dist/types/pmove/constants.d.ts +76 -0
  63. package/dist/types/pmove/constants.d.ts.map +1 -0
  64. package/dist/types/pmove/currents.d.ts +58 -0
  65. package/dist/types/pmove/currents.d.ts.map +1 -0
  66. package/dist/types/pmove/dimensions.d.ts +14 -0
  67. package/dist/types/pmove/dimensions.d.ts.map +1 -0
  68. package/dist/types/pmove/duck.d.ts +39 -0
  69. package/dist/types/pmove/duck.d.ts.map +1 -0
  70. package/dist/types/pmove/fly.d.ts +34 -0
  71. package/dist/types/pmove/fly.d.ts.map +1 -0
  72. package/dist/types/pmove/index.d.ts +18 -0
  73. package/dist/types/pmove/index.d.ts.map +1 -0
  74. package/dist/types/pmove/jump.d.ts +28 -0
  75. package/dist/types/pmove/jump.d.ts.map +1 -0
  76. package/dist/types/pmove/move.d.ts +78 -0
  77. package/dist/types/pmove/move.d.ts.map +1 -0
  78. package/dist/types/pmove/pmove.d.ts +40 -0
  79. package/dist/types/pmove/pmove.d.ts.map +1 -0
  80. package/dist/types/pmove/slide.d.ts +63 -0
  81. package/dist/types/pmove/slide.d.ts.map +1 -0
  82. package/dist/types/pmove/snap.d.ts +40 -0
  83. package/dist/types/pmove/snap.d.ts.map +1 -0
  84. package/dist/types/pmove/special.d.ts +39 -0
  85. package/dist/types/pmove/special.d.ts.map +1 -0
  86. package/dist/types/pmove/stuck.d.ts +21 -0
  87. package/dist/types/pmove/stuck.d.ts.map +1 -0
  88. package/dist/types/pmove/types.d.ts +72 -0
  89. package/dist/types/pmove/types.d.ts.map +1 -0
  90. package/dist/types/pmove/view.d.ts +19 -0
  91. package/dist/types/pmove/view.d.ts.map +1 -0
  92. package/dist/types/pmove/water.d.ts +21 -0
  93. package/dist/types/pmove/water.d.ts.map +1 -0
  94. package/dist/types/protocol/bitpack.d.ts +17 -0
  95. package/dist/types/protocol/bitpack.d.ts.map +1 -0
  96. package/dist/types/protocol/configstrings.d.ts +73 -0
  97. package/dist/types/protocol/configstrings.d.ts.map +1 -0
  98. package/dist/types/protocol/constants.d.ts +36 -0
  99. package/dist/types/protocol/constants.d.ts.map +1 -0
  100. package/dist/types/protocol/contracts.d.ts +17 -0
  101. package/dist/types/protocol/contracts.d.ts.map +1 -0
  102. package/dist/types/protocol/crc.d.ts +5 -0
  103. package/dist/types/protocol/crc.d.ts.map +1 -0
  104. package/dist/types/protocol/cvar.d.ts +15 -0
  105. package/dist/types/protocol/cvar.d.ts.map +1 -0
  106. package/dist/types/protocol/effects.d.ts +33 -0
  107. package/dist/types/protocol/effects.d.ts.map +1 -0
  108. package/dist/types/protocol/entity.d.ts +46 -0
  109. package/dist/types/protocol/entity.d.ts.map +1 -0
  110. package/dist/types/protocol/entityEvent.d.ts +13 -0
  111. package/dist/types/protocol/entityEvent.d.ts.map +1 -0
  112. package/dist/types/protocol/entityState.d.ts +26 -0
  113. package/dist/types/protocol/entityState.d.ts.map +1 -0
  114. package/dist/types/protocol/index.d.ts +19 -0
  115. package/dist/types/protocol/index.d.ts.map +1 -0
  116. package/dist/types/protocol/layout.d.ts +9 -0
  117. package/dist/types/protocol/layout.d.ts.map +1 -0
  118. package/dist/types/protocol/ops.d.ts +44 -0
  119. package/dist/types/protocol/ops.d.ts.map +1 -0
  120. package/dist/types/protocol/player-state.d.ts +40 -0
  121. package/dist/types/protocol/player-state.d.ts.map +1 -0
  122. package/dist/types/protocol/player.d.ts +28 -0
  123. package/dist/types/protocol/player.d.ts.map +1 -0
  124. package/dist/types/protocol/renderFx.d.ts +23 -0
  125. package/dist/types/protocol/renderFx.d.ts.map +1 -0
  126. package/dist/types/protocol/stats.d.ts +61 -0
  127. package/dist/types/protocol/stats.d.ts.map +1 -0
  128. package/dist/types/protocol/tempEntity.d.ts +67 -0
  129. package/dist/types/protocol/tempEntity.d.ts.map +1 -0
  130. package/dist/types/protocol/usercmd.d.ts +33 -0
  131. package/dist/types/protocol/usercmd.d.ts.map +1 -0
  132. package/dist/types/protocol/writeUserCmd.d.ts +4 -0
  133. package/dist/types/protocol/writeUserCmd.d.ts.map +1 -0
  134. package/dist/types/replay/index.d.ts +3 -0
  135. package/dist/types/replay/index.d.ts.map +1 -0
  136. package/dist/types/replay/io.d.ts +7 -0
  137. package/dist/types/replay/io.d.ts.map +1 -0
  138. package/dist/types/replay/schema.d.ts +41 -0
  139. package/dist/types/replay/schema.d.ts.map +1 -0
  140. package/dist/types/testing.d.ts +6 -0
  141. package/dist/types/testing.d.ts.map +1 -0
  142. package/package.json +43 -0
  143. package/src/audio/constants.ts +35 -0
  144. package/src/bsp/collision.ts +1075 -0
  145. package/src/bsp/contents.ts +108 -0
  146. package/src/bsp/spatial.ts +116 -0
  147. package/src/index.ts +37 -0
  148. package/src/inventory-helpers.ts +81 -0
  149. package/src/io/binaryStream.ts +159 -0
  150. package/src/io/binaryWriter.ts +146 -0
  151. package/src/io/index.ts +3 -0
  152. package/src/io/messageBuilder.ts +117 -0
  153. package/src/items/ammo.ts +47 -0
  154. package/src/items/index.ts +8 -0
  155. package/src/items/powerups.ts +32 -0
  156. package/src/items/weaponInfo.ts +45 -0
  157. package/src/items/weapons.ts +28 -0
  158. package/src/math/angles.ts +135 -0
  159. package/src/math/anorms.ts +165 -0
  160. package/src/math/color.ts +42 -0
  161. package/src/math/mat4.ts +58 -0
  162. package/src/math/random.ts +182 -0
  163. package/src/math/vec3.ts +379 -0
  164. package/src/net/driver.ts +9 -0
  165. package/src/net/index.ts +2 -0
  166. package/src/net/netchan.ts +451 -0
  167. package/src/pmove/apply.ts +151 -0
  168. package/src/pmove/categorize.ts +162 -0
  169. package/src/pmove/config.ts +5 -0
  170. package/src/pmove/constants.ts +94 -0
  171. package/src/pmove/currents.ts +287 -0
  172. package/src/pmove/dimensions.ts +40 -0
  173. package/src/pmove/duck.ts +154 -0
  174. package/src/pmove/fly.ts +197 -0
  175. package/src/pmove/index.ts +18 -0
  176. package/src/pmove/jump.ts +92 -0
  177. package/src/pmove/move.ts +527 -0
  178. package/src/pmove/pmove.ts +446 -0
  179. package/src/pmove/slide.ts +267 -0
  180. package/src/pmove/snap.ts +89 -0
  181. package/src/pmove/special.ts +207 -0
  182. package/src/pmove/stuck.ts +258 -0
  183. package/src/pmove/types.ts +82 -0
  184. package/src/pmove/view.ts +57 -0
  185. package/src/pmove/water.ts +56 -0
  186. package/src/protocol/bitpack.ts +139 -0
  187. package/src/protocol/configstrings.ts +104 -0
  188. package/src/protocol/constants.ts +40 -0
  189. package/src/protocol/contracts.ts +149 -0
  190. package/src/protocol/crc.ts +32 -0
  191. package/src/protocol/cvar.ts +15 -0
  192. package/src/protocol/effects.ts +33 -0
  193. package/src/protocol/entity.ts +304 -0
  194. package/src/protocol/entityEvent.ts +14 -0
  195. package/src/protocol/entityState.ts +28 -0
  196. package/src/protocol/index.ts +19 -0
  197. package/src/protocol/layout.ts +9 -0
  198. package/src/protocol/ops.ts +49 -0
  199. package/src/protocol/player-state.ts +51 -0
  200. package/src/protocol/player.ts +165 -0
  201. package/src/protocol/renderFx.ts +22 -0
  202. package/src/protocol/stats.ts +161 -0
  203. package/src/protocol/tempEntity.ts +69 -0
  204. package/src/protocol/usercmd.ts +63 -0
  205. package/src/protocol/writeUserCmd.ts +30 -0
  206. package/src/replay/index.ts +2 -0
  207. package/src/replay/io.ts +37 -0
  208. package/src/replay/schema.ts +42 -0
  209. package/src/testing.ts +200 -0
@@ -0,0 +1,26 @@
1
+ import { Vec3 } from '../math/vec3.js';
2
+ export declare class BinaryWriter {
3
+ private buffer;
4
+ private view;
5
+ private offset;
6
+ private readonly fixed;
7
+ constructor(sizeOrBuffer?: number | Uint8Array);
8
+ private ensureSpace;
9
+ writeByte(value: number): void;
10
+ writeBytes(data: Uint8Array): void;
11
+ writeChar(value: number): void;
12
+ writeShort(value: number): void;
13
+ writeLong(value: number): void;
14
+ writeFloat(value: number): void;
15
+ writeString(value: string): void;
16
+ writeCoord(value: number): void;
17
+ writeAngle(value: number): void;
18
+ writeAngle16(value: number): void;
19
+ writePos(pos: Vec3): void;
20
+ writeDir(dir: Vec3): void;
21
+ getData(): Uint8Array;
22
+ getBuffer(): Uint8Array;
23
+ getOffset(): number;
24
+ reset(): void;
25
+ }
26
+ //# sourceMappingURL=binaryWriter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"binaryWriter.d.ts","sourceRoot":"","sources":["../../../src/io/binaryWriter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,IAAI,CAAW;IACvB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAU;gBAEpB,YAAY,GAAE,MAAM,GAAG,UAAiB;IAYpD,OAAO,CAAC,WAAW;IAcZ,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAM9B,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI;IAMlC,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAM9B,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAW/B,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAM9B,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAM/B,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAahC,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAI/B,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAI/B,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAIjC,QAAQ,CAAC,GAAG,EAAE,IAAI,GAAG,IAAI;IAMzB,QAAQ,CAAC,GAAG,EAAE,IAAI,GAAG,IAAI;IAuBzB,OAAO,IAAI,UAAU;IAIrB,SAAS,IAAI,UAAU;IAIvB,SAAS,IAAI,MAAM;IAInB,KAAK,IAAI,IAAI;CAGrB"}
@@ -0,0 +1,4 @@
1
+ export * from './binaryStream.js';
2
+ export * from './binaryWriter.js';
3
+ export * from './messageBuilder.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/io/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,21 @@
1
+ export declare class NetworkMessageBuilder {
2
+ private buffer;
3
+ private view;
4
+ private offset;
5
+ constructor(initialSize?: number);
6
+ private ensureCapacity;
7
+ getData(): Uint8Array;
8
+ writeByte(value: number): void;
9
+ writeChar(value: number): void;
10
+ writeShort(value: number): void;
11
+ writeUShort(value: number): void;
12
+ writeLong(value: number): void;
13
+ writeFloat(value: number): void;
14
+ writeString(value: string): void;
15
+ writeData(data: Uint8Array): void;
16
+ writeCoord(value: number): void;
17
+ writeAngle(value: number): void;
18
+ writeAngle16(value: number): void;
19
+ writeDir(x: number, y: number, z: number): void;
20
+ }
21
+ //# sourceMappingURL=messageBuilder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messageBuilder.d.ts","sourceRoot":"","sources":["../../../src/io/messageBuilder.ts"],"names":[],"mappings":"AAEA,qBAAa,qBAAqB;IAChC,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,IAAI,CAAW;IACvB,OAAO,CAAC,MAAM,CAAS;gBAEX,WAAW,GAAE,MAAa;IAMtC,OAAO,CAAC,cAAc;IAUf,OAAO,IAAI,UAAU;IAIrB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAM9B,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAM9B,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAM/B,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAMhC,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAM9B,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAM/B,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAUhC,SAAS,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI;IAMjC,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAI/B,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAI/B,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAIjC,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI;CAyBvD"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Ammo type identifiers shared across game and cgame.
3
+ * Reference: rerelease/g_items.cpp, game/src/inventory/ammo.ts
4
+ */
5
+ export declare enum AmmoType {
6
+ Bullets = 0,
7
+ Shells = 1,
8
+ Rockets = 2,
9
+ Grenades = 3,
10
+ Cells = 4,
11
+ Slugs = 5,
12
+ MagSlugs = 6,
13
+ Trap = 7,
14
+ Flechettes = 8,
15
+ Tesla = 9,
16
+ Disruptor = 10,// Was missing or named differently?
17
+ Prox = 11,
18
+ Nuke = 12,
19
+ Rounds = 13
20
+ }
21
+ export declare const AMMO_TYPE_COUNT: number;
22
+ /**
23
+ * Item classnames for ammo pickups.
24
+ * Used for spawning and identifying ammo items.
25
+ */
26
+ export declare enum AmmoItemId {
27
+ Shells = "ammo_shells",
28
+ Bullets = "ammo_bullets",
29
+ Rockets = "ammo_rockets",
30
+ Grenades = "ammo_grenades",
31
+ Cells = "ammo_cells",
32
+ Slugs = "ammo_slugs",
33
+ MagSlugs = "ammo_magslug",
34
+ Flechettes = "ammo_flechettes",
35
+ Disruptor = "ammo_disruptor",
36
+ Tesla = "ammo_tesla",
37
+ Trap = "ammo_trap",
38
+ Prox = "ammo_prox"
39
+ }
40
+ //# sourceMappingURL=ammo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ammo.d.ts","sourceRoot":"","sources":["../../../src/items/ammo.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,oBAAY,QAAQ;IAClB,OAAO,IAAI;IACX,MAAM,IAAA;IACN,OAAO,IAAA;IACP,QAAQ,IAAA;IACR,KAAK,IAAA;IACL,KAAK,IAAA;IAEL,QAAQ,IAAA;IACR,IAAI,IAAA;IAGJ,UAAU,IAAA;IACV,KAAK,IAAA;IACL,SAAS,KAAA,CAAE,oCAAoC;IAC/C,IAAI,KAAA;IAGJ,IAAI,KAAA;IACJ,MAAM,KAAA;CACP;AAED,eAAO,MAAM,eAAe,QAAmC,CAAC;AAEhE;;;GAGG;AACH,oBAAY,UAAU;IACpB,MAAM,gBAAgB;IACtB,OAAO,iBAAiB;IACxB,OAAO,iBAAiB;IACxB,QAAQ,kBAAkB;IAC1B,KAAK,eAAe;IACpB,KAAK,eAAe;IACpB,QAAQ,iBAAiB;IACzB,UAAU,oBAAoB;IAC9B,SAAS,mBAAmB;IAC5B,KAAK,eAAe;IACpB,IAAI,cAAc;IAClB,IAAI,cAAc;CACnB"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Item enumeration exports for shared use between game and cgame.
3
+ */
4
+ export * from './weapons.js';
5
+ export * from './ammo.js';
6
+ export * from './powerups.js';
7
+ export * from './weaponInfo.js';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/items/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Powerup identifiers shared across game and cgame.
3
+ * Reference: rerelease/g_items.cpp, game/src/inventory/playerInventory.ts
4
+ */
5
+ export declare enum PowerupId {
6
+ QuadDamage = "quad",
7
+ Invulnerability = "invulnerability",
8
+ EnviroSuit = "enviro_suit",
9
+ Rebreather = "rebreather",
10
+ Silencer = "silencer",
11
+ PowerScreen = "power_screen",
12
+ PowerShield = "power_shield",
13
+ QuadFire = "quad_fire",
14
+ Invisibility = "invisibility",
15
+ Bandolier = "bandolier",
16
+ AmmoPack = "ammo_pack",
17
+ IRGoggles = "ir_goggles",
18
+ DoubleDamage = "double_damage",
19
+ SphereVengeance = "sphere_vengeance",
20
+ SphereHunter = "sphere_hunter",
21
+ SphereDefender = "sphere_defender",
22
+ Doppelganger = "doppelganger",
23
+ TagToken = "tag_token",
24
+ TechResistance = "tech_resistance",
25
+ TechStrength = "tech_strength",
26
+ TechHaste = "tech_haste",
27
+ TechRegeneration = "tech_regeneration",
28
+ Flashlight = "flashlight",
29
+ Compass = "compass"
30
+ }
31
+ //# sourceMappingURL=powerups.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"powerups.d.ts","sourceRoot":"","sources":["../../../src/items/powerups.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,oBAAY,SAAS;IACnB,UAAU,SAAS;IACnB,eAAe,oBAAoB;IACnC,UAAU,gBAAgB;IAC1B,UAAU,eAAe;IACzB,QAAQ,aAAa;IAErB,WAAW,iBAAiB;IAC5B,WAAW,iBAAiB;IAC5B,QAAQ,cAAc;IACtB,YAAY,iBAAiB;IAC7B,SAAS,cAAc;IACvB,QAAQ,cAAc;IACtB,SAAS,eAAe;IACxB,YAAY,kBAAkB;IAC9B,eAAe,qBAAqB;IACpC,YAAY,kBAAkB;IAC9B,cAAc,oBAAoB;IAClC,YAAY,iBAAiB;IAC7B,QAAQ,cAAc;IACtB,cAAc,oBAAoB;IAClC,YAAY,kBAAkB;IAC9B,SAAS,eAAe;IACxB,gBAAgB,sBAAsB;IACtC,UAAU,eAAe;IACzB,OAAO,YAAY;CACpB"}
@@ -0,0 +1,5 @@
1
+ import { WeaponId } from './weapons.js';
2
+ import { AmmoType } from './ammo.js';
3
+ export declare const WEAPON_WHEEL_ORDER: WeaponId[];
4
+ export declare const WEAPON_AMMO_MAP: Record<WeaponId, AmmoType | null>;
5
+ //# sourceMappingURL=weaponInfo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"weaponInfo.d.ts","sourceRoot":"","sources":["../../../src/items/weaponInfo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAIrC,eAAO,MAAM,kBAAkB,EAAE,QAAQ,EAYxC,CAAC;AAIF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAuB7D,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Weapon identifiers shared across game and cgame.
3
+ * Reference: rerelease/g_items.cpp, game/src/inventory/playerInventory.ts
4
+ */
5
+ export declare enum WeaponId {
6
+ Blaster = "blaster",
7
+ Shotgun = "shotgun",
8
+ SuperShotgun = "supershotgun",// Matched to assets (w_supershotgun, weapon_supershotgun)
9
+ Machinegun = "machinegun",
10
+ Chaingun = "chaingun",
11
+ HandGrenade = "grenades",// Matched to assets (w_grenades, weapon_grenades)
12
+ GrenadeLauncher = "grenadelauncher",// Matched to assets (w_grenadelauncher)
13
+ RocketLauncher = "rocketlauncher",// Matched to assets (w_rocketlauncher)
14
+ HyperBlaster = "hyperblaster",
15
+ Railgun = "railgun",
16
+ BFG10K = "bfg10k",
17
+ Grapple = "grapple",
18
+ ChainFist = "chainfist",
19
+ EtfRifle = "etf_rifle",// Confirm asset?
20
+ ProxLauncher = "prox_launcher",// Confirm asset?
21
+ IonRipper = "ionripper",
22
+ PlasmaBeam = "plasmabeam",
23
+ Phalanx = "phalanx",
24
+ Disruptor = "disruptor",
25
+ Trap = "trap"
26
+ }
27
+ //# sourceMappingURL=weapons.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"weapons.d.ts","sourceRoot":"","sources":["../../../src/items/weapons.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,oBAAY,QAAQ;IAClB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,YAAY,iBAAiB,CAAE,0DAA0D;IACzF,UAAU,eAAe;IACzB,QAAQ,aAAa;IACrB,WAAW,aAAa,CAAE,kDAAkD;IAC5E,eAAe,oBAAoB,CAAE,wCAAwC;IAC7E,cAAc,mBAAmB,CAAE,uCAAuC;IAC1E,YAAY,iBAAiB;IAC7B,OAAO,YAAY;IACnB,MAAM,WAAW;IAEjB,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,QAAQ,cAAc,CAAE,iBAAiB;IACzC,YAAY,kBAAkB,CAAE,iBAAiB;IACjD,SAAS,cAAc;IACvB,UAAU,eAAe;IACzB,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,IAAI,SAAS;CACd"}
@@ -0,0 +1,19 @@
1
+ import { Vec3 } from './vec3.js';
2
+ export declare const PITCH = 0;
3
+ export declare const YAW = 1;
4
+ export declare const ROLL = 2;
5
+ export declare const DEG2RAD: number;
6
+ export declare const RAD2DEG: number;
7
+ export interface AngleVectorsResult {
8
+ readonly forward: Vec3;
9
+ readonly right: Vec3;
10
+ readonly up: Vec3;
11
+ }
12
+ export declare function degToRad(degrees: number): number;
13
+ export declare function radToDeg(radians: number): number;
14
+ export declare function lerpAngle(from: number, to: number, frac: number): number;
15
+ export declare function angleMod(angle: number): number;
16
+ export declare function angleVectors(angles: Vec3): AngleVectorsResult;
17
+ export declare function vectorToYaw(vec: Vec3): number;
18
+ export declare function vectorToAngles(vec: Vec3): Vec3;
19
+ //# sourceMappingURL=angles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"angles.d.ts","sourceRoot":"","sources":["../../../src/math/angles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,eAAO,MAAM,KAAK,IAAI,CAAC;AACvB,eAAO,MAAM,GAAG,IAAI,CAAC;AACrB,eAAO,MAAM,IAAI,IAAI,CAAC;AAMtB,eAAO,MAAM,OAAO,QAAiB,CAAC;AACtC,eAAO,MAAM,OAAO,QAAiB,CAAC;AActC,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;CACnB;AAED,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAUxE;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAG9C;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,IAAI,GAAG,kBAAkB,CA+B7D;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,IAAI,GAAG,MAAM,CAc7C;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,IAAI,GAAG,IAAI,CA6B9C"}
@@ -0,0 +1,2 @@
1
+ export declare const ANORMS: [number, number, number][];
2
+ //# sourceMappingURL=anorms.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anorms.d.ts","sourceRoot":"","sources":["../../../src/math/anorms.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAmK5C,CAAC"}
@@ -0,0 +1,12 @@
1
+ export type Color4 = [number, number, number, number];
2
+ /**
3
+ * TypeScript port of G_AddBlend from rerelease q_std.h.
4
+ *
5
+ * Given an incoming RGBA color and an existing blend color, computes the new
6
+ * blended color where alpha is accumulated and RGB is mixed proportionally
7
+ * to the previous vs. new alpha contribution.
8
+ *
9
+ * This function is pure and does not mutate its inputs.
10
+ */
11
+ export declare function addBlendColor(r: number, g: number, b: number, a: number, current: Color4): Color4;
12
+ //# sourceMappingURL=color.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../../src/math/color.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAEtD;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,OAAO,EAAE,MAAM,GACd,MAAM,CAuBR"}
@@ -0,0 +1,7 @@
1
+ import { Vec3 } from './vec3.js';
2
+ export type Mat4 = Float32Array;
3
+ export declare function createMat4Identity(): Mat4;
4
+ export declare function multiplyMat4(a: Float32Array, b: Float32Array): Mat4;
5
+ export declare function transformPointMat4(mat: Float32Array, point: Vec3): Vec3;
6
+ export declare function mat4FromBasis(origin: Vec3, axis: readonly [Vec3, Vec3, Vec3]): Mat4;
7
+ //# sourceMappingURL=mat4.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mat4.d.ts","sourceRoot":"","sources":["../../../src/math/mat4.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,MAAM,IAAI,GAAG,YAAY,CAAC;AAEhC,wBAAgB,kBAAkB,IAAI,IAAI,CAOzC;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,YAAY,GAAG,IAAI,CAYnE;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,GAAG,IAAI,CASvE;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,IAAI,CAmBnF"}
@@ -0,0 +1,60 @@
1
+ export interface MersenneTwisterState {
2
+ readonly index: number;
3
+ readonly state: readonly number[];
4
+ }
5
+ /**
6
+ * Minimal MT19937 implementation mirroring the rerelease's std::mt19937 usage in g_local.h.
7
+ * The generator outputs deterministic unsigned 32-bit integers which drive the
8
+ * higher-level helpers such as frandom/crandom/irandom.
9
+ */
10
+ export declare class MersenneTwister19937 {
11
+ private state;
12
+ private index;
13
+ constructor(seed?: number);
14
+ seed(seed: number): void;
15
+ nextUint32(): number;
16
+ private twist;
17
+ getState(): MersenneTwisterState;
18
+ setState(snapshot: MersenneTwisterState): void;
19
+ }
20
+ export interface RandomGeneratorOptions {
21
+ readonly seed?: number;
22
+ }
23
+ export interface RandomGeneratorState {
24
+ readonly mt: MersenneTwisterState;
25
+ }
26
+ /**
27
+ * Deterministic helper mirroring the random helpers defined in rerelease g_local.h.
28
+ */
29
+ export declare class RandomGenerator {
30
+ private readonly mt;
31
+ constructor(options?: RandomGeneratorOptions);
32
+ seed(seed: number): void;
33
+ /** Uniform float in [0, 1). */
34
+ frandom(): number;
35
+ /** Uniform float in [min, max). */
36
+ frandomRange(minInclusive: number, maxExclusive: number): number;
37
+ /** Uniform float in [0, max). */
38
+ frandomMax(maxExclusive: number): number;
39
+ /** Uniform float in [-1, 1). */
40
+ crandom(): number;
41
+ /** Uniform float in (-1, 1). */
42
+ crandomOpen(): number;
43
+ /** Raw uint32 sample. */
44
+ irandomUint32(): number;
45
+ /** Uniform integer in [min, max). */
46
+ irandomRange(minInclusive: number, maxExclusive: number): number;
47
+ /** Uniform integer in [0, max). */
48
+ irandom(maxExclusive: number): number;
49
+ /** Uniform time in milliseconds [min, max). */
50
+ randomTimeRange(minMs: number, maxMs: number): number;
51
+ /** Uniform time in milliseconds [0, max). */
52
+ randomTime(maxMs: number): number;
53
+ randomIndex<T extends {
54
+ length: number;
55
+ }>(container: T): number;
56
+ getState(): RandomGeneratorState;
57
+ setState(snapshot: RandomGeneratorState): void;
58
+ }
59
+ export declare function createRandomGenerator(options?: RandomGeneratorOptions): RandomGenerator;
60
+ //# sourceMappingURL=random.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"random.d.ts","sourceRoot":"","sources":["../../../src/math/random.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAED;;;;GAIG;AACH,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,KAAK,CAA+B;IAC5C,OAAO,CAAC,KAAK,CAAc;gBA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AM;IAI/D,QAAQ,IAAI,oBAAoB;IAIhC,QAAQ,CAAC,QAAQ,EAAE,oBAAoB,GAAG,IAAI;CAG/C;AAED,wBAAgB,qBAAqB,CAAC,OAAO,CAAC,EAAE,sBAAsB,GAAG,eAAe,CAEvF"}
@@ -0,0 +1,79 @@
1
+ export interface Vec3 {
2
+ readonly x: number;
3
+ readonly y: number;
4
+ readonly z: number;
5
+ readonly [index: number]: number;
6
+ }
7
+ export declare const ZERO_VEC3: Vec3;
8
+ export declare const STOP_EPSILON = 0.1;
9
+ export interface Bounds3 {
10
+ readonly mins: Vec3;
11
+ readonly maxs: Vec3;
12
+ }
13
+ export type Mat3Row = readonly [number, number, number];
14
+ export type Mat3 = readonly [Mat3Row, Mat3Row, Mat3Row];
15
+ export declare function copyVec3(a: Vec3): Vec3;
16
+ export declare function addVec3(a: Vec3, b: Vec3): Vec3;
17
+ export declare function subtractVec3(a: Vec3, b: Vec3): Vec3;
18
+ export declare function multiplyVec3(a: Vec3, b: Vec3): Vec3;
19
+ export declare function scaleVec3(a: Vec3, scalar: number): Vec3;
20
+ export declare function negateVec3(a: Vec3): Vec3;
21
+ export declare function dotVec3(a: Vec3, b: Vec3): number;
22
+ export declare function crossVec3(a: Vec3, b: Vec3): Vec3;
23
+ export declare function lengthSquaredVec3(a: Vec3): number;
24
+ export declare function lengthVec3(a: Vec3): number;
25
+ export declare function distance(a: Vec3, b: Vec3): number;
26
+ export declare function vec3Equals(a: Vec3, b: Vec3): boolean;
27
+ /**
28
+ * Returns the normalized vector. If the vector is zero-length, the
29
+ * input is returned to mirror the rerelease q_vec3 semantics.
30
+ */
31
+ export declare function normalizeVec3(a: Vec3): Vec3;
32
+ /**
33
+ * Projects a point onto a plane defined by the given normal.
34
+ * Based on ProjectPointOnPlane in the rerelease q_vec3 helpers.
35
+ */
36
+ export declare function projectPointOnPlane(point: Vec3, normal: Vec3): Vec3;
37
+ /**
38
+ * Computes a perpendicular vector to the provided direction using the
39
+ * smallest axial component heuristic used by the rerelease.
40
+ * Assumes the input is normalized.
41
+ */
42
+ export declare function perpendicularVec3(src: Vec3): Vec3;
43
+ export declare function closestPointToBox(point: Vec3, mins: Vec3, maxs: Vec3): Vec3;
44
+ export declare function distanceBetweenBoxesSquared(aMins: Vec3, aMaxs: Vec3, bMins: Vec3, bMaxs: Vec3): number;
45
+ export declare function createEmptyBounds3(): Bounds3;
46
+ export declare function addPointToBounds(point: Vec3, bounds: Bounds3): Bounds3;
47
+ export declare function boxesIntersect(a: Bounds3, b: Bounds3): boolean;
48
+ /**
49
+ * Mirrors PM_ClipVelocity from `rerelease/p_move.cpp`: slide the incoming velocity off
50
+ * a plane normal, applying an overbounce scale and zeroing tiny components so callers can
51
+ * detect blocked axes using STOP_EPSILON.
52
+ */
53
+ export declare function clipVelocityVec3(inVel: Vec3, normal: Vec3, overbounce: number): Vec3;
54
+ /**
55
+ * Slide a velocity across one or more clip planes using the same plane set resolution logic
56
+ * seen in the inner loop of `PM_StepSlideMove_Generic` (rerelease `p_move.cpp`). When a single
57
+ * plane is provided this devolves to PM_ClipVelocity; with two planes it projects onto the
58
+ * crease defined by their cross product; with more planes it zeroes the velocity to avoid
59
+ * oscillations.
60
+ */
61
+ export declare function clipVelocityAgainstPlanes(velocity: Vec3, planes: readonly Vec3[], overbounce: number, primalVelocity?: Vec3): Vec3;
62
+ /**
63
+ * Alias retained for ergonomics; mirrors PM_ClipVelocity semantics.
64
+ */
65
+ export declare function slideClipVelocityVec3(inVel: Vec3, normal: Vec3, overbounce: number): Vec3;
66
+ /**
67
+ * Project an offset from a point in forward/right(/up) space into world space.
68
+ * Mirrors G_ProjectSource and G_ProjectSource2 in rerelease q_vec3.
69
+ */
70
+ export declare function projectSourceVec3(point: Vec3, distance: Vec3, forward: Vec3, right: Vec3): Vec3;
71
+ export declare function projectSourceVec3WithUp(point: Vec3, distance: Vec3, forward: Vec3, right: Vec3, up: Vec3): Vec3;
72
+ /**
73
+ * Spherical linear interpolation between two vectors, mirroring q_vec3::slerp.
74
+ * This is intended for direction vectors; callers should pre-normalize if needed.
75
+ */
76
+ export declare function slerpVec3(from: Vec3, to: Vec3, t: number): Vec3;
77
+ export declare function concatRotationMatrices(a: Mat3, b: Mat3): Mat3;
78
+ export declare function rotatePointAroundVector(dir: Vec3, point: Vec3, degrees: number): Vec3;
79
+ //# sourceMappingURL=vec3.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vec3.d.ts","sourceRoot":"","sources":["../../../src/math/vec3.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,IAAI;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CAClC;AAED,eAAO,MAAM,SAAS,EAAE,IAA2B,CAAC;AAGpD,eAAO,MAAM,YAAY,MAAM,CAAC;AAIhC,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;CACrB;AAED,MAAM,MAAM,OAAO,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AACxD,MAAM,MAAM,IAAI,GAAG,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAExD,wBAAgB,QAAQ,CAAC,CAAC,EAAE,IAAI,GAAG,IAAI,CAEtC;AAED,wBAAgB,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,CAE9C;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,CAEnD;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,CAEnD;AAED,wBA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;
3
+ disconnect(): void;
4
+ send(data: Uint8Array): void;
5
+ onMessage(callback: (data: Uint8Array) => void): void;
6
+ onClose(callback: () => void): void;
7
+ onError(callback: (error: Error) => void): void;
8
+ isConnected(): boolean;
9
+ }
10
+ //# sourceMappingURL=driver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../../src/net/driver.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,UAAU,IAAI,IAAI,CAAC;IACnB,IAAI,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;IAC7B,SAAS,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,GAAG,IAAI,CAAC;IACtD,OAAO,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;IACpC,OAAO,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,IAAI,CAAC;IAChD,WAAW,IAAI,OAAO,CAAC;CACxB"}
@@ -0,0 +1,3 @@
1
+ export * from './driver.js';
2
+ export * from './netchan.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/net/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
@@ -0,0 +1,85 @@
1
+ import { BinaryWriter } from '../io/binaryWriter.js';
2
+ export interface NetAddress {
3
+ type: string;
4
+ port: number;
5
+ }
6
+ /**
7
+ * NetChan handles reliable message delivery over an unreliable channel (UDP/WebSocket).
8
+ * Fragmentation support is planned but not fully implemented.
9
+ *
10
+ * Ported from qcommon/net_chan.c
11
+ */
12
+ export declare class NetChan {
13
+ static readonly MAX_MSGLEN = 1400;
14
+ static readonly FRAGMENT_SIZE = 1024;
15
+ static readonly PACKET_HEADER = 10;
16
+ static readonly HEADER_OVERHEAD: number;
17
+ static readonly MAX_RELIABLE_BUFFER = 262144;
18
+ qport: number;
19
+ incomingSequence: number;
20
+ outgoingSequence: number;
21
+ incomingAcknowledged: number;
22
+ incomingReliableAcknowledged: boolean;
23
+ incomingReliableSequence: number;
24
+ outgoingReliableSequence: number;
25
+ reliableMessage: BinaryWriter;
26
+ reliableLength: number;
27
+ fragmentSendOffset: number;
28
+ fragmentBuffer: Uint8Array | null;
29
+ fragmentLength: number;
30
+ fragmentReceived: number;
31
+ lastReceived: number;
32
+ lastSent: number;
33
+ remoteAddress: NetAddress | null;
34
+ constructor();
35
+ /**
36
+ * Setup the netchan with specific settings
37
+ */
38
+ setup(qport: number, address?: NetAddress | null): void;
39
+ /**
40
+ * Reset the netchan state
41
+ */
42
+ reset(): void;
43
+ /**
44
+ * Transmits a packet containing reliable and unreliable data
45
+ */
46
+ transmit(unreliableData?: Uint8Array): Uint8Array;
47
+ /**
48
+ * Processes a received packet
49
+ * Returns the payload data (reliable + unreliable) to be processed, or null if discarded
50
+ */
51
+ process(packet: Uint8Array): Uint8Array | null;
52
+ /**
53
+ * Checks if reliable message buffer is empty and ready for new data
54
+ */
55
+ canSendReliable(): boolean;
56
+ /**
57
+ * Writes a byte to the reliable message buffer
58
+ */
59
+ writeReliableByte(value: number): void;
60
+ /**
61
+ * Writes a short to the reliable message buffer
62
+ */
63
+ writeReliableShort(value: number): void;
64
+ /**
65
+ * Writes a long to the reliable message buffer
66
+ */
67
+ writeReliableLong(value: number): void;
68
+ /**
69
+ * Writes a string to the reliable message buffer
70
+ */
71
+ writeReliableString(value: string): void;
72
+ /**
73
+ * Returns the current reliable data buffer
74
+ */
75
+ getReliableData(): Uint8Array;
76
+ /**
77
+ * Checks if we need to send a keepalive packet
78
+ */
79
+ needsKeepalive(currentTime: number): boolean;
80
+ /**
81
+ * Checks if the connection has timed out
82
+ */
83
+ isTimedOut(currentTime: number, timeoutM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I,OAAO;IAI1B;;OAEG;IACH,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAQtC;;OAEG;IACH,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAQvC;;OAEG;IACH,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAQtC;;OAEG;IACH,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IASxC;;OAEG;IACH,eAAe,IAAI,UAAU;IAQ7B;;OAEG;IACH,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO;IAI5C;;OAEG;IACH,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,GAAE,MAAc,GAAG,OAAO;CAGpE"}
@@ -0,0 +1,5 @@
1
+ import { PmoveCmd, PmoveTraceFn } from './types.js';
2
+ import { Vec3 } from '../math/vec3.js';
3
+ import { PlayerState } from '../protocol/player-state.js';
4
+ export declare const applyPmove: (state: PlayerState, cmd: PmoveCmd, trace: PmoveTraceFn, pointContents: (point: Vec3) => number) => PlayerState;
5
+ //# sourceMappingURL=apply.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../../src/pmove/apply.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAGvC,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAsE1D,eAAO,MAAM,UAAU,GACrB,OAAO,WAAW,EAClB,KAAK,QAAQ,EACb,OAAO,YAAY,EACnB,eAAe,CAAC,KAAK,EAAE,IAAI,KAAK,MAAM,KACrC,WAsEF,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { type ContentsFlag } from '../bsp/contents.js';
2
+ import { type Vec3 } from '../math/vec3.js';
3
+ import { type PmFlags, PmType } from './constants.js';
4
+ import type { PmovePointContentsFn, PmoveTraceFn, PmoveTraceResult } from './types.js';
5
+ export interface CategorizePositionParams {
6
+ readonly pmType: PmType;
7
+ readonly pmFlags: PmFlags;
8
+ readonly pmTime: number;
9
+ readonly n64Physics: boolean;
10
+ readonly velocity: Vec3;
11
+ readonly startVelocity: Vec3;
12
+ readonly origin: Vec3;
13
+ readonly mins: Vec3;
14
+ readonly maxs: Vec3;
15
+ readonly viewheight: number;
16
+ readonly trace: PmoveTraceFn;
17
+ readonly pointContents: PmovePointContentsFn;
18
+ }
19
+ export interface CategorizePositionResult {
20
+ readonly pmFlags: PmFlags;
21
+ readonly pmTime: number;
22
+ readonly onGround: boolean;
23
+ readonly groundTrace?: PmoveTraceResult;
24
+ readonly groundContents: ContentsFlag;
25
+ readonly waterlevel: number;
26
+ readonly watertype: ContentsFlag;
27
+ readonly impactDelta?: number;
28
+ }
29
+ /**
30
+ * Pure mirror of PM_CatagorizePosition from `rerelease/p_move.cpp`: traces a quarter-unit
31
+ * below the player bounds to determine whether they stand on solid ground, updates timers
32
+ * and pmflags accordingly, records the latest ground plane data, and recalculates waterlevel
33
+ * by probing feet/waist/viewheight samples.
34
+ */
35
+ export declare function categorizePosition(params: CategorizePositionParams): CategorizePositionResult;
36
+ //# sourceMappingURL=categorize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"categorize.d.ts","sourceRoot":"","sources":["../../../src/pmove/categorize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAA6B,KAAK,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAEL,KAAK,OAAO,EACZ,MAAM,EAIP,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAcvF,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC;IACxB,QAAQ,CAAC,aAAa,EAAE,IAAI,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B,QAAQ,CAAC,aAAa,EAAE,oBAAoB,CAAC;CAC9C;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,WAAW,CAAC,EAAE,gBAAgB,CAAC;IACxC,QAAQ,CAAC,cAAc,EAAE,YAAY,CAAC;IACtC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,YAAY,CAAC;IACjC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,wBAAwB,GAAG,wBAAwB,CAwG7F"}
@@ -0,0 +1,5 @@
1
+ export interface PmConfig {
2
+ airaccel: number;
3
+ n64_physics: boolean;
4
+ }
5
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/pmove/config.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,QAAQ;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;CACtB"}