@sagl/server 0.0.0-stage → 0.1.0-next.49

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 (129) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +61 -2
  3. package/dist/actions.d.ts +46 -0
  4. package/dist/actions.js +80 -0
  5. package/dist/actions.js.map +1 -0
  6. package/dist/animations.d.ts +32 -0
  7. package/dist/animations.js +95 -0
  8. package/dist/animations.js.map +1 -0
  9. package/dist/audio.d.ts +180 -0
  10. package/dist/audio.js +353 -0
  11. package/dist/audio.js.map +1 -0
  12. package/dist/audio_effects.d.ts +219 -0
  13. package/dist/audio_effects.js +84 -0
  14. package/dist/audio_effects.js.map +1 -0
  15. package/dist/camera.d.ts +188 -0
  16. package/dist/camera.js +247 -0
  17. package/dist/camera.js.map +1 -0
  18. package/dist/claims.d.ts +27 -0
  19. package/dist/claims.js +48 -0
  20. package/dist/claims.js.map +1 -0
  21. package/dist/commands.d.ts +135 -0
  22. package/dist/commands.js +373 -0
  23. package/dist/commands.js.map +1 -0
  24. package/dist/console.d.ts +21 -0
  25. package/dist/console.js +100 -0
  26. package/dist/console.js.map +1 -0
  27. package/dist/constants.d.ts +654 -0
  28. package/dist/constants.js +657 -0
  29. package/dist/constants.js.map +1 -0
  30. package/dist/cutscene.d.ts +47 -0
  31. package/dist/cutscene.js +190 -0
  32. package/dist/cutscene.js.map +1 -0
  33. package/dist/draw.d.ts +106 -0
  34. package/dist/draw.js +132 -0
  35. package/dist/draw.js.map +1 -0
  36. package/dist/effects.d.ts +91 -0
  37. package/dist/effects.js +116 -0
  38. package/dist/effects.js.map +1 -0
  39. package/dist/gangzones.d.ts +47 -0
  40. package/dist/gangzones.js +122 -0
  41. package/dist/gangzones.js.map +1 -0
  42. package/dist/geo.d.ts +11 -0
  43. package/dist/geo.js +25 -0
  44. package/dist/geo.js.map +1 -0
  45. package/dist/hud.d.ts +159 -0
  46. package/dist/hud.js +247 -0
  47. package/dist/hud.js.map +1 -0
  48. package/dist/index.d.ts +40 -0
  49. package/dist/index.js +43 -0
  50. package/dist/index.js.map +1 -0
  51. package/dist/interaction.d.ts +81 -0
  52. package/dist/interaction.js +143 -0
  53. package/dist/interaction.js.map +1 -0
  54. package/dist/junctions.d.ts +1 -0
  55. package/dist/junctions.js +330 -0
  56. package/dist/junctions.js.map +1 -0
  57. package/dist/map.d.ts +55 -0
  58. package/dist/map.js +71 -0
  59. package/dist/map.js.map +1 -0
  60. package/dist/menu.d.ts +96 -0
  61. package/dist/menu.js +129 -0
  62. package/dist/menu.js.map +1 -0
  63. package/dist/mission.d.ts +482 -0
  64. package/dist/mission.js +1258 -0
  65. package/dist/mission.js.map +1 -0
  66. package/dist/models.d.ts +56 -0
  67. package/dist/models.js +71 -0
  68. package/dist/models.js.map +1 -0
  69. package/dist/modshop.d.ts +229 -0
  70. package/dist/modshop.js +904 -0
  71. package/dist/modshop.js.map +1 -0
  72. package/dist/modshop_data.d.ts +44 -0
  73. package/dist/modshop_data.js +287 -0
  74. package/dist/modshop_data.js.map +1 -0
  75. package/dist/native.d.ts +809 -0
  76. package/dist/native.js +27 -0
  77. package/dist/native.js.map +1 -0
  78. package/dist/objects.d.ts +249 -0
  79. package/dist/objects.js +455 -0
  80. package/dist/objects.js.map +1 -0
  81. package/dist/paint.d.ts +124 -0
  82. package/dist/paint.js +84 -0
  83. package/dist/paint.js.map +1 -0
  84. package/dist/paynspray.d.ts +44 -0
  85. package/dist/paynspray.js +177 -0
  86. package/dist/paynspray.js.map +1 -0
  87. package/dist/ped.d.ts +335 -0
  88. package/dist/ped.js +536 -0
  89. package/dist/ped.js.map +1 -0
  90. package/dist/player.d.ts +685 -0
  91. package/dist/player.js +1163 -0
  92. package/dist/player.js.map +1 -0
  93. package/dist/screeneffects.d.ts +99 -0
  94. package/dist/screeneffects.js +257 -0
  95. package/dist/screeneffects.js.map +1 -0
  96. package/dist/scripts.d.ts +69 -0
  97. package/dist/scripts.js +125 -0
  98. package/dist/scripts.js.map +1 -0
  99. package/dist/server.d.ts +713 -0
  100. package/dist/server.js +1080 -0
  101. package/dist/server.js.map +1 -0
  102. package/dist/shopblips.d.ts +9 -0
  103. package/dist/shopblips.js +30 -0
  104. package/dist/shopblips.js.map +1 -0
  105. package/dist/special.d.ts +33 -0
  106. package/dist/special.js +26 -0
  107. package/dist/special.js.map +1 -0
  108. package/dist/splash.d.ts +42 -0
  109. package/dist/splash.js +55 -0
  110. package/dist/splash.js.map +1 -0
  111. package/dist/text.d.ts +19 -0
  112. package/dist/text.js +25 -0
  113. package/dist/text.js.map +1 -0
  114. package/dist/ui.d.ts +141 -0
  115. package/dist/ui.js +243 -0
  116. package/dist/ui.js.map +1 -0
  117. package/dist/vehicle.d.ts +306 -0
  118. package/dist/vehicle.js +612 -0
  119. package/dist/vehicle.js.map +1 -0
  120. package/dist/vehiclecolors.d.ts +26 -0
  121. package/dist/vehiclecolors.js +49 -0
  122. package/dist/vehiclecolors.js.map +1 -0
  123. package/dist/world.d.ts +222 -0
  124. package/dist/world.js +227 -0
  125. package/dist/world.js.map +1 -0
  126. package/dist/zone.d.ts +89 -0
  127. package/dist/zone.js +140 -0
  128. package/dist/zone.js.map +1 -0
  129. package/package.json +33 -4
package/dist/hud.js ADDED
@@ -0,0 +1,247 @@
1
+ import { mapColor } from "./map.js";
2
+ import { Ped } from "./ped.js";
3
+ import { Vehicle } from "./vehicle.js";
4
+ const BLIP_COLORS = { red: 0, green: 1, blue: 2, white: 3, yellow: 4, purple: 5, cyan: 6, threat: 7, destination: 8 };
5
+ /** A blip on one player's radar (`player.hud.blip()`). */
6
+ export class Blip {
7
+ #hud;
8
+ #spec;
9
+ #options;
10
+ id;
11
+ #removed = false;
12
+ /** @internal */
13
+ constructor(hud, id, spec, options = {}) {
14
+ this.#hud = hud;
15
+ this.#options = { ...options };
16
+ this.id = id;
17
+ this.#spec = spec;
18
+ hud.send(id, spec);
19
+ }
20
+ /** Changes the options given; the others stay as they are. */
21
+ set(options) {
22
+ if (this.#removed || !this.#spec)
23
+ return this;
24
+ this.#options = { ...this.#options, ...options };
25
+ this.#spec = { ...this.#spec, ...encodeBlipOptions(this.#options, this.#spec.kind) };
26
+ this.#hud.send(this.id, this.#spec);
27
+ return this;
28
+ }
29
+ remove() {
30
+ if (this.#removed)
31
+ return;
32
+ this.#removed = true;
33
+ this.#hud.send(this.id, null);
34
+ }
35
+ }
36
+ function encodeBlipOptions(o, kind) {
37
+ const c = o.color ?? (kind === 0 ? "destination" : "blue");
38
+ return {
39
+ color: typeof c === "string" && c in BLIP_COLORS ? BLIP_COLORS[c] : mapColor(c, 0xffffffff),
40
+ display: o.display === "marker" ? 1 : o.display === "blip" ? 2 : 0,
41
+ scale: o.scale ?? 0,
42
+ pulse: o.pulse ?? false,
43
+ sprite: o.sprite ?? 0,
44
+ shortRange: o.shortRange ?? false,
45
+ };
46
+ }
47
+ /** A timer or counter on one player's HUD (`player.hud.counter()`, `.timer()`). */
48
+ export class HudCounter {
49
+ #native;
50
+ #player;
51
+ id;
52
+ #spec;
53
+ #removed = false;
54
+ /** @internal */
55
+ constructor(native, player, id, spec) {
56
+ this.#native = native;
57
+ this.#player = player;
58
+ this.id = id;
59
+ this.#spec = spec;
60
+ native.hudCounter(player, id, spec);
61
+ }
62
+ /** The number (a counter), the time left (a timer, ms), or how full (a bar). */
63
+ set value(value) {
64
+ if (this.#removed)
65
+ return;
66
+ this.#spec = { ...this.#spec, value: Math.round(value) };
67
+ this.#native.hudCounter(this.#player, this.id, this.#spec);
68
+ }
69
+ get value() {
70
+ return this.#spec.value ?? 0;
71
+ }
72
+ /**
73
+ * A timer held still (showing `value`, the time left) or counting again
74
+ * from it.
75
+ */
76
+ setPaused(paused, value) {
77
+ if (this.#removed)
78
+ return;
79
+ this.#spec = { ...this.#spec, value: Math.round(value), paused };
80
+ this.#native.hudCounter(this.#player, this.id, this.#spec);
81
+ }
82
+ /** Changes its label. */
83
+ set label(label) {
84
+ if (this.#removed)
85
+ return;
86
+ this.#spec = { ...this.#spec, label: label.slice(0, 47) };
87
+ this.#native.hudCounter(this.#player, this.id, this.#spec);
88
+ }
89
+ remove() {
90
+ if (this.#removed)
91
+ return;
92
+ this.#removed = true;
93
+ this.#native.hudCounter(this.#player, this.id, null);
94
+ }
95
+ }
96
+ const HUD_PARTS = { visible: 1, radar: 2, areaNames: 4, vehicleNames: 8, clock: 16, health: 32, armour: 64, chat: 128 };
97
+ export class PlayerHud {
98
+ #native;
99
+ #player;
100
+ #nextId = 1;
101
+ #hidden = 0;
102
+ /** @internal */
103
+ constructor(native, player) {
104
+ this.#native = native;
105
+ this.#player = player;
106
+ }
107
+ /**
108
+ * Shows or hides parts of the game's HUD for them; parts left out stay
109
+ * as they are. A client script can hide parts too (`sagl.hud.set`): a
110
+ * part shows only if neither hides it.
111
+ *
112
+ * ```ts
113
+ * player.hud.set({ visible: false }); // a login screen: nothing over the shot
114
+ * player.hud.set({ visible: true, clock: false }); // back, without the clock
115
+ * ```
116
+ */
117
+ set(parts) {
118
+ for (const [k, bit] of Object.entries(HUD_PARTS)) {
119
+ const on = parts[k];
120
+ if (on === undefined)
121
+ continue;
122
+ this.#hidden = on ? this.#hidden & ~bit : this.#hidden | bit;
123
+ }
124
+ this.#native.hudToggles(this.#player, this.#hidden);
125
+ }
126
+ /** Which parts show (as the server set them). */
127
+ get parts() {
128
+ const out = {};
129
+ for (const [k, bit] of Object.entries(HUD_PARTS))
130
+ out[k] = !(this.#hidden & bit);
131
+ return out;
132
+ }
133
+ /** @internal */
134
+ send(id, spec) {
135
+ this.#native.setBlip(this.#player, id, spec);
136
+ }
137
+ /**
138
+ * A blip on their radar: on a spot (with the game's cylinder marker), or
139
+ * on a ped, vehicle or player (an arrow over them), following it.
140
+ */
141
+ blip(target, options = {}) {
142
+ const id = this.#nextId++;
143
+ let kind = 0;
144
+ let at = { x: 0, y: 0, z: 0 };
145
+ let ref = 0;
146
+ if (target instanceof Ped) {
147
+ kind = 1;
148
+ ref = target.id;
149
+ }
150
+ else if (target instanceof Vehicle) {
151
+ kind = 2;
152
+ ref = target.id;
153
+ }
154
+ else if ("name" in target) {
155
+ kind = 3;
156
+ ref = target.id;
157
+ }
158
+ else {
159
+ at = { x: target.x, y: target.y, z: target.z };
160
+ }
161
+ return new Blip(this, id, { kind, ...at, target: ref, ...encodeBlipOptions(options, kind) }, options);
162
+ }
163
+ /**
164
+ * The objective, at the bottom of their screen in the game's mission text
165
+ * style, for `ms` (default: about as long as reading it takes; `Infinity`:
166
+ * until replaced or cleared).
167
+ */
168
+ objective(text, ms) {
169
+ this.#native.hudText(this.#player, 0, text.slice(0, 255), ms === Infinity ? 0xffffffff : Math.max(0, ms ?? 0));
170
+ }
171
+ /**
172
+ * The game's help box, top left (its hints: "Press F to ..."), for `ms`
173
+ * (default: about as long as reading it takes; `Infinity`: until replaced
174
+ * or cleared). Game codes and `gxt()` work. An interaction's prompt shows
175
+ * over it while one's in reach.
176
+ */
177
+ help(text, ms) {
178
+ this.#native.hudText(this.#player, 3, text.slice(0, 255), ms === Infinity ? 0xffffffff : Math.max(0, ms ?? 0));
179
+ }
180
+ /** Clears the help box. */
181
+ clearHelp() {
182
+ this.#native.hudText(this.#player, 3, "", 1);
183
+ }
184
+ /** Clears the objective. */
185
+ clearObjective() {
186
+ this.#native.hudText(this.#player, 0, "", 1);
187
+ }
188
+ /**
189
+ * A notice in the middle of their screen, as the game's garages and
190
+ * shops give ("New engine and paint job: $100"), for `ms` (default 4000).
191
+ * Game codes and `gxt()` work.
192
+ */
193
+ notice(text, ms = 4000) {
194
+ this.#native.notice(this.#player, text.slice(0, 255), Math.max(1, Math.min(60_000, Math.trunc(ms))));
195
+ }
196
+ /**
197
+ * The game's own big text, in one of its seven styles, as SA-MP's
198
+ * GameTextForPlayer (the same numbers): 0 big in the middle (mission
199
+ * passed), 1 bottom right (the time, money), 2 white in the middle,
200
+ * 3 smaller in the middle, 4 smaller, a bit higher, 5 small white in the
201
+ * middle, 6 light blue at the top. Game codes (`~r~`, `~n~`...) and
202
+ * `gxt()` work. `ms` default 3000.
203
+ *
204
+ * ```ts
205
+ * player.hud.gameText("~g~Welcome~n~~w~to Los Santos", 3000, GameTextStyle.Middle);
206
+ * ```
207
+ */
208
+ gameText(text, ms = 3000, style = 3) {
209
+ if (!Number.isInteger(style) || style < 0 || style > 6)
210
+ throw new RangeError(`not a game text style: ${style} (0-6)`);
211
+ this.#native.hudText(this.#player, 2, text.slice(0, 255), Math.max(1, Math.trunc(ms)), style);
212
+ }
213
+ /** Big text in the middle of their screen, for `ms`. */
214
+ bigText(text, ms) {
215
+ this.#native.hudText(this.#player, 1, text.slice(0, 255), Math.max(0, ms ?? 0));
216
+ }
217
+ /** A counter under their money: `label value` (`value/max` with `max`), or a bar. */
218
+ counter(label, options = {}) {
219
+ return new HudCounter(this.#native, this.#player, this.#nextId++, {
220
+ label: label.slice(0, 47), value: Math.round(options.value ?? 0), max: Math.round(options.max ?? 0),
221
+ bar: options.bar ?? false, color: options.color === undefined ? 0 : mapColor(options.color, 0),
222
+ });
223
+ }
224
+ /** A timer under their money, counting down from `ms` (or up from it, `countUp`). */
225
+ timer(label, ms, options = {}) {
226
+ return new HudCounter(this.#native, this.#player, this.#nextId++, {
227
+ label: label.slice(0, 47), timer: true, countUp: options.countUp ?? false, value: Math.round(ms),
228
+ color: options.color === undefined ? 0 : mapColor(options.color, 0),
229
+ });
230
+ }
231
+ /** "MISSION PASSED!" with the game's tune, and `subtitle` under it (the reward: "$2500"). */
232
+ missionPassed(subtitle = "") {
233
+ this.#result("passed", "", subtitle, true);
234
+ }
235
+ /** "MISSION FAILED!", and `subtitle` under it (why). */
236
+ missionFailed(subtitle = "") {
237
+ this.#result("failed", "", subtitle, false);
238
+ }
239
+ /** A result screen of your own: `title` ("1st place!"), and `subtitle` under it. */
240
+ missionResult(title, subtitle = "") {
241
+ this.#result("custom", title, subtitle, false);
242
+ }
243
+ #result(kind, title, subtitle, sound) {
244
+ this.#native.missionResult(this.#player, kind, title.slice(0, 63), subtit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AE,OAAO,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;SACpE,CAAC,CAAC;IACL,CAAC;IAED,6FAA6F;IAC7F,aAAa,CAAC,QAAQ,GAAG,EAAE;QACzB,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;IAC7C,CAAC;IAED,wDAAwD;IACxD,aAAa,CAAC,QAAQ,GAAG,EAAE;QACzB,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;IAC9C,CAAC;IAED,oFAAoF;IACpF,aAAa,CAAC,KAAa,EAAE,QAAQ,GAAG,EAAE;QACxC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;IACjD,CAAC;IAED,OAAO,CAAC,IAAY,EAAE,KAAa,EAAE,QAAgB,EAAE,KAAc;QACnE,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IACvG,CAAC;CACF"}
@@ -0,0 +1,40 @@
1
+ export { Server, type ServerOptions, type Branding, type VehicleOptions, type ServerEvents, type Hit, type VehicleHit, type Shot, type Explosion, type PedOptions, type AmbientSpawn, type QuitReason, type NameTagOptions } from "./server.js";
2
+ export type { WeaponViolationReason } from "./native.js";
3
+ export { type SpecialAction } from "./special.js";
4
+ export { GangZone, type GangZoneArea } from "./gangzones.js";
5
+ export { Player, type Vector3, type DialogOptions, type DialogAnswer, type NameTagSettings, type WorldBounds } from "./player.js";
6
+ export { Vehicle, DoorDamage, TyreDamage, PanelDamage, componentSlot, componentFits, type VehicleDamage, type Indicators } from "./vehicle.js";
7
+ export { Zone, Garage, GarageType } from "./zone.js";
8
+ export { World, Weather, CullZone, ZoneAttribute, AudioZone, TrafficLights, type Population, type TrafficLight, type TrafficLightStates, type TrafficLightTiming, } from "./world.js";
9
+ export { Console, type CommandHandler } from "./console.js";
10
+ export { Weapon, Stat, BodyPart, Color, RadioStation, VoiceContext, GameSound, GameTextStyle, ComponentSlot, Bone, ExplosionType, FightingStyle, MaterialSize, MaterialTextAlign, Key, keyPressed, keyReleased, Crime } from "./constants.js";
11
+ export { Ped, type PedStep, type PedTarget, type Pace, type OrderResult, type PedEvents, type PedSettings } from "./ped.js";
12
+ export { ClientScripts, Channel, type ChannelData, type ClientScriptError } from "./scripts.js";
13
+ export { GameMap, type MapMarkerOptions, type MapOverlayOptions, type MapColor } from "./map.js";
14
+ export { PlayerHud, Blip, HudCounter, type BlipOptions, type BlipColor, type HudParts } from "./hud.js";
15
+ export { defineMission, Mission, Missions, MissionBlip, MissionCounter, MissionMarker, MissionEnded, MissionRefused, type MissionDefinition, type MissionOutcome, type MissionEvent, type MissionEndReason, type WaitOptions, type ReachOptions, type SectionOptions, type MarkerOptions, type MissionStep, type OnEnd, type EndOptions, } from "./mission.js";
16
+ export { gxt } from "./text.js";
17
+ export { distance, distance2d, headingVector, headingTo, along } from "./geo.js";
18
+ export { ServerAudio, Sound, splitSubtitles, type SoundOptions, type SpeakOptions, type Speech } from "./audio.js";
19
+ export { ServerAnimations, type AnimationSetInfo } from "./animations.js";
20
+ export { ServerModels, type CustomModelInfo, isCustomModelId } from "./models.js";
21
+ export { AudioPresets, type AudioEffect, type AudioEffects, type AudioPreset } from "./audio_effects.js";
22
+ export { Claims } from "./claims.js";
23
+ export { command, arg, Commands, CommandBuilder, CommandError, type ArgType, type CommandArgs } from "./commands.js";
24
+ export type { ChatOptions } from "./server.js";
25
+ export { PlayerCamera, type CameraShot, type CameraTarget, type CameraThing, type CameraPosition, type CameraRotation, type CameraEase, type CameraPath, type CameraPathPoint, type CameraStep, type CameraPlayOptions, type CameraSequence, type CameraFocus, } from "./camera.js";
26
+ export { PlayerSplash } from "./splash.js";
27
+ export { ServerEffects, Effect, type EffectTarget, type EffectOptions, type DustOptions } from "./effects.js";
28
+ export { GameObject, Pickup, Label, type ObjectOptions, type MaterialOptions, type MaterialTextOptions, type PickupOptions, type LabelOptions, type LabelTarget, type Rotation } from "./objects.js";
29
+ export { Interaction, Interactions, type InteractionOptions, type InteractionUse } from "./interaction.js";
30
+ export { CutscenePlay, type CutsceneOptions, type CutsceneResult } from "./cutscene.js";
31
+ export { PayNSpray, type PayNSprayOptions } from "./paynspray.js";
32
+ export type { Livery, PaintFinish, MetallicFinish, PearlFinish, SatinFinish, ColorShiftFinish, CustomFinish, PaintSlots } from "./paint.js";
33
+ export { VehicleColors } from "./vehiclecolors.js";
34
+ export { ScreenEffects, ScreenEffect, BUILT_IN_SCREEN_EFFECTS, type ScreenEffectOptions, type ScreenEffectParams } from "./screeneffects.js";
35
+ export { ModShops, ModShop, ModShopSite, DEFAULT_MOD_SHOP_FINISHES, type ModShopOptions, type ModShopFinish, type ModShopLivery, type ModShopArea, type ModShopCreate, } from "./modshop.js";
36
+ export { MOD_SHOP_PARTS, MOD_SHOP_SITES, MOD_SHOP_COLORS, CAR_COLORS } from "./modshop_data.js";
37
+ export { PlayerMenu, type MenuHint, type MenuOptions, type MenuRow } from "./menu.js";
38
+ export { PlayerUi, UiDocument, type UiEvent, type UiEventType, type UiOpenOptions, type ShowDocumentOptions } from "./ui.js";
39
+ export { ScreenDraw, Drawn, type DrawFont, type TextOptions, type DrawChanges, type Anchor, type PlaceOptions } from "./draw.js";
40
+ export { Actions, KEY_NAMES, type ActionOptions } from "./actions.js";
package/dist/index.js ADDED
@@ -0,0 +1,43 @@
1
+ // @sagl/server: write SAGL gamemodes in Node.js.
2
+ //
3
+ // import { Server } from "@sagl/server";
4
+ // const server = new Server({ port: 7777 });
5
+ // server.on("playerJoin", (player) => player.send("Welcome!"));
6
+ // server.listen();
7
+ export { Server } from "./server.js";
8
+ export { GangZone } from "./gangzones.js";
9
+ export { Player } from "./player.js";
10
+ export { Vehicle, DoorDamage, TyreDamage, PanelDamage, componentSlot, componentFits } from "./vehicle.js";
11
+ export { Zone, Garage, GarageType } from "./zone.js";
12
+ export { World, Weather, CullZone, ZoneAttribute, AudioZone, TrafficLights, } from "./world.js";
13
+ export { Console } from "./console.js";
14
+ export { Weapon, Stat, BodyPart, Color, RadioStation, VoiceContext, GameSound, GameTextStyle, ComponentSlot, Bone, ExplosionType, FightingStyle, MaterialSize, MaterialTextAlign, Key, keyPressed, keyReleased, Crime } from "./constants.js";
15
+ export { Ped } from "./ped.js";
16
+ export { ClientScripts, Channel } from "./scripts.js";
17
+ export { GameMap } from "./map.js";
18
+ export { PlayerHud, Blip, HudCounter } from "./hud.js";
19
+ export { defineMission, Mission, Missions, MissionBlip, MissionCounter, MissionMarker, MissionEnded, MissionRefused, } from "./mission.js";
20
+ export { gxt } from "./text.js";
21
+ export { distance, distance2d, headingVector, headingTo, along } from "./geo.js";
22
+ export { ServerAudio, Sound, splitSubtitles } from "./audio.js";
23
+ export { ServerAnimations } from "./animations.js";
24
+ export { ServerModels, isCustomModelId } from "./models.js";
25
+ export { AudioPresets } from "./audio_effects.js";
26
+ export { Claims } from "./claims.js";
27
+ export { command, arg, Commands, CommandBuilder, CommandError } from "./commands.js";
28
+ export { PlayerCamera, } from "./camera.js";
29
+ export { PlayerSplash } from "./splash.js";
30
+ export { ServerEffects, Effect } from "./effects.js";
31
+ export { GameObject, Pickup, Label } from "./objects.js";
32
+ export { Interaction, Interactions } from "./interaction.js";
33
+ export { CutscenePlay } from "./cutscene.js";
34
+ export { PayNSpray } from "./paynspray.js";
35
+ export { VehicleColors } from "./vehiclecolors.js";
36
+ export { ScreenEffects, ScreenEffect, BUILT_IN_SCREEN_EFFECTS } from "./screeneffects.js";
37
+ export { ModShops, ModShop, ModShopSite, DEFAULT_MOD_SHOP_FINISHES, } from "./modshop.js";
38
+ export { MOD_SHOP_PARTS, MOD_SHOP_SITES, MOD_SHOP_COLORS, CAR_COLORS } from "./modshop_data.js";
39
+ export { PlayerMenu } from "./menu.js";
40
+ export { PlayerUi, UiDocument } from "./ui.js";
41
+ export { ScreenDraw, Drawn } from "./draw.js";
42
+ export { Actions, KEY_NAMES } from "./actions.js";
43
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,EAAE;AACF,2CAA2C;AAC3C,+CAA+C;AAC/C,kEAAkE;AAClE,qBAAqB;AAErB,OAAO,EAAE,MAAM,EAA6M,MAAM,aAAa,CAAC;AAGhP,OAAO,EAAE,QAAQ,EAAqB,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,MAAM,EAA+F,MAAM,aAAa,CAAC;AAClI,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAuC,MAAM,cAAc,CAAC;AAC/I,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EACL,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa,GAElE,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,OAAO,EAAuB,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,IAAI,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,iBAAiB,EAAE,GAAG,EAAE,UAAU,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC9O,OAAO,EAAE,GAAG,E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O,EAAE,SAAS,EAAyB,MAAM,gBAAgB,CAAC;AAElE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,uBAAuB,EAAqD,MAAM,oBAAoB,CAAC;AAC7I,OAAO,EACL,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,yBAAyB,GAE1D,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAChG,OAAO,EAAE,UAAU,EAAiD,MAAM,WAAW,CAAC;AACtF,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAgF,MAAM,SAAS,CAAC;AAC7H,OAAO,EAAE,UAAU,EAAE,KAAK,EAAqF,MAAM,WAAW,CAAC;AACjI,OAAO,EAAE,OAAO,EAAE,SAAS,EAAsB,MAAM,cAAc,CAAC"}
@@ -0,0 +1,81 @@
1
+ import type { NativeServer } from "./native.js";
2
+ import type { Player, Vector3 } from "./player.js";
3
+ export interface InteractionOptions {
4
+ /** Every map object of these models (up to 16), e.g. vending machines. */
5
+ models?: number[];
6
+ /** Or one spot. */
7
+ at?: Vector3;
8
+ /** How close they must be, facing it (m). Default 1.5, at most 3. */
9
+ radius?: number;
10
+ /**
11
+ * In the help box while they can use it. Game codes work,
12
+ * `~k~~VEHICLE_ENTER_EXIT~` for the key, and `gxt()` text. Left out:
13
+ * none (show your own with `onReach`).
14
+ */
15
+ prompt?: string;
16
+ /** Only these players can see and use it (others never hear of it). Default everyone. */
17
+ to?: readonly Player[];
18
+ }
19
+ /** Where it was used: the object (its model and position) or the spot (model 0). */
20
+ export interface InteractionUse {
21
+ /** The object's model; 0: the spot. */
22
+ model: number;
23
+ /** The object's position, or the spot. */
24
+ position: Vector3;
25
+ /** Which way the object faces (degrees, 0 north, anticlockwise); 0 for a spot. */
26
+ heading: number;
27
+ }
28
+ /**
29
+ * Something players use by walking up to it and pressing the enter/exit key
30
+ * (F/Enter): any map object of some models (vending machines, payphones,
31
+ * ticket machines) or a spot. Made with `server.interactions.add()`.
32
+ */
33
+ export declare class Interaction {
34
+ #private;
35
+ readonly id: number;
36
+ readonly options: Readonly<InteractionOptions>;
37
+ /** @internal */
38
+ constructor(id: number, options: InteractionOptions, remove: (i: Interaction) => void, changed: (i: Interaction) => void);
39
+ /** @internal Whether players' games say when it comes in reach. */
40
+ get notifies(): boolean;
41
+ /**
42
+ * `fn(player, use, inReach)` when it comes in a player's reach (true) and
43
+ * goes (false): to show your own prompt or UI (`player.ui.open()`,
44
+ * `player.draw`) instead of, or as well as, `prompt`.
45
+ */
46
+ onReach(fn: (player: Player, use: InteractionUse, inReach: boolean) => void): this;
47
+ /** `fn` when a player uses it (checked: they're near where they say). */
48
+ onUse(fn: (player: Player, use: InteractionUse) => void): this;
49
+ /** Takes it away for everyone. */
50
+ remove(): void;
51
+ /** @internal */
52
+ reached(player: Player, use: InteractionUse, inReach: boolean): void;
53
+ /** @internal */
54
+ used(player: Player, use: InteractionUse): void;
55
+ }
56
+ /** `server.interactions`: what players can walk up to and use. */
57
+ export declare class Interactions {
58
+ #private;
59
+ /** @internal */
60
+ constructor(native: NativeServer, players: () => Player[]);
61
+ /**
62
+ * Something everyone can use (players joining later too).
63
+ *
64
+ * ```ts
65
+ * server.interactions.add({ models: [955, 956, 1775, 1776], prompt: "Press ~k~~VEHICLE_ENTER_EXIT~ to buy a drink ($1)" })
66
+ * .onUse((player) => { if (player.money >= 1) { player.money -= 1; player.health = Math.min(100, player.health + 35); } });
67
+ * ```
68
+ */
69
+ add(options: InteractionOptions): Interaction;
70
+ /** @internal A player joined: everything there is. */
71
+ replay(player: Player): void;
72
+ /** @internal */
73
+ use(player: Player, id: number, where: {
74
+ event: "use" | "reach" | "leave";
75
+ model: number;
76
+ x: number;
77
+ y: number;
78
+ z: number;
79
+ heading: number;
80
+ }): void;
81
+ }
@@ -0,0 +1,143 @@
1
+ /**
2
+ * Something players use by walking up to it and pressing the enter/exit key
3
+ * (F/Enter): any map object of some models (vending machines, payphones,
4
+ * ticket machines) or a spot. Made with `server.interactions.add()`.
5
+ */
6
+ export class Interaction {
7
+ id;
8
+ options;
9
+ #handlers = [];
10
+ #reach = [];
11
+ #remove;
12
+ #changed;
13
+ /** @internal */
14
+ constructor(id, options, remove, changed) {
15
+ this.id = id;
16
+ this.options = options;
17
+ this.#remove = remove;
18
+ this.#changed = changed;
19
+ }
20
+ /** @internal Whether players' games say when it comes in reach. */
21
+ get notifies() {
22
+ return this.#reach.length > 0;
23
+ }
24
+ /**
25
+ * `fn(player, use, inReach)` when it comes in a player's reach (true) and
26
+ * goes (false): to show your own prompt or UI (`player.ui.open()`,
27
+ * `player.draw`) instead of, or as well as, `prompt`.
28
+ */
29
+ onReach(fn) {
30
+ this.#reach.push(fn);
31
+ if (this.#reach.length === 1)
32
+ this.#changed(this); // their games start saying so
33
+ return this;
34
+ }
35
+ /** `fn` when a player uses it (checked: they're near where they say). */
36
+ onUse(fn) {
37
+ this.#handlers.push(fn);
38
+ return this;
39
+ }
40
+ /** Takes it away for everyone. */
41
+ remove() {
42
+ this.#remove(this);
43
+ }
44
+ /** @internal */
45
+ reached(player, use, inReach) {
46
+ for (const fn of [...this.#reach]) {
47
+ try {
48
+ fn(player, use, inReach);
49
+ }
50
+ catch (err) {
51
+ console.error("[sagl] interaction handler threw:", err);
52
+ }
53
+ }
54
+ }
55
+ /** @internal */
56
+ used(player, use) {
57
+ for (const fn of [...this.#handlers]) {
58
+ try {
59
+ fn(player, use);
60
+ }
61
+ catch (err) {
62
+ console.error("[sagl] interaction handler threw:", err);
63
+ }
64
+ }
65
+ }
66
+ }
67
+ /** `server.interactions`: what players can walk up to and use. */
68
+ export class Interactions {
69
+ #native;
70
+ #players;
71
+ #all = new Map();
72
+ #next = 1;
73
+ /** @internal */
74
+ constructor(native, players) {
75
+ this.#native = native;
76
+ this.#players = players;
77
+ }
78
+ /**
79
+ * Something everyone can use (players joining later too).
80
+ *
81
+ * ```ts
82
+ * server.interactions.add({ models: [955, 956, 1775, 1776], prompt: "Press ~k~~VEHICLE_ENTER_EXIT~ to buy a drink ($1)" })
83
+ * .onUse((player) => { if (player.money >= 1) { player.money -= 1; player.health = Math.min(100, player.health + 35); } });
84
+ * ```
85
+ */
86
+ add(options) {
87
+ if (!options.models?.length && !options.at)
88
+ throw new TypeError("an interaction needs models or a spot (at)");
89
+ if ((options.models?.length ?? 0) > 16)
90
+ throw new RangeError("at most 16 models");
91
+ const i = new Interaction(this.#next++, { ...options, to: options.to ? [...options.to] : undefined }, (x) => this.#delete(x), (x) => { for (const p of this.#players())
92
+ if (this.#for(x, p))
93
+ this.#send(p, x); });
94
+ this.#all.set(i.id, i);
95
+ for (const p of this.#players())
96
+ if (this.#for(i, p))
97
+ this.#send(p, i);
98
+ return i;
99
+ }
100
+ /** @internal A player joined: everything there is. */
101
+ replay(player) {
102
+ for (const i of this.#all.values())
103
+ if (this.#for(i, player))
104
+ this.#send(player, i);
105
+ }
106
+ /** @internal */
107
+ use(player, id, where) {
108
+ const i = this.#all.get(id);
109
+ if (!i || !this.#for(i, player))
110
+ return;
111
+ const o = i.options;
112
+ if (where.model ? !o.models?.includes(where.model) : !o.at)
113
+ return;
114
+ const at = where.model ? where : o.at;
115
+ // Their game says where; the server checks they're there.
116
+ const p = player.position;
117
+ const near = Math.hypot(p.x - at.x, p.y - at.y) <= Math.min(o.radius ?? 1.5, 3) + 2 && Math.abs(p.z - at.z) <= 3;
118
+ if (!near && where.event !== "leave")
119
+ return; // (leaving: they've walked off)
120
+ const use = { model: where.model, position: { x: at.x, y: at.y, z: at.z }, heading: where.model ? where.heading : 0 };
121
+ if (where.event === "use")
122
+ i.used(player, use);
123
+ else
124
+ i.reached(player, use, where.event === "reach");
125
+ }
126
+ #for(i, player) {
127
+ return !i.options.to || i.options.to.includes(player);
128
+ }
129
+ #send(player, i) {
130
+ const o = i.options;
131
+ this.#native.interaction(player.id, i.id, {
132
+ models: o.models ?? [], x: o.at?.x ?? 0, y: o.at?.y ?? 0, z: o.at?.z ?? 0, radius: o.radius ?? 0,
133
+ prompt: o.prompt ?? "", notify: i.notifies,
134
+ });
135
+ }
136
+ #delete(i) {
137
+ if (!this.#all.delete(i.id))
138
+ return;
139
+ for (const p of this.#players())
140
+ this.#native.interaction(p.id, i.id, null);
141
+ }
142
+ }
143
+ //# sourceMappingURL=interaction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interaction.js","sourceRoot":"","sources":["../src/interaction.ts"],"names":[],"mappings":"AA8BA;;;;GAIG;AACH,MAAM,OAAO,WAAW;IACb,EAAE,CAAS;IACX,OAAO,CAA+B;IAC/C,SAAS,GAAsD,EAAE,CAAC;IAClE,MAAM,GAAwE,EAAE,CAAC;IACjF,OAAO,CAA2B;IAClC,QAAQ,CAA2B;IAEnC,gBAAgB;IAChB,YAAY,EAAU,EAAE,OAA2B,EAAE,MAAgC,EACnF,OAAiC;QACjC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC1B,CAAC;IAED,mEAAmE;IACnE,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;IAChC,CAAC;IAED;;;;OAIG;IACH,OAAO,CAAC,EAAmE;QACzE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACrB,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC;YAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAE,8BAA8B;QAClF,OAAO,IAAI,CAAC;IACd,CAAC;IAED,yEAAyE;IACzE,KAAK,CAAC,EAAiD;QACrD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACxB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