@rezless/vm 0.6.2 → 0.8.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.
- package/dist/builtins/agents.d.ts +14 -0
- package/dist/builtins/agents.d.ts.map +1 -0
- package/dist/builtins/agents.js +117 -0
- package/dist/builtins/agents.js.map +1 -0
- package/dist/builtins/animation.d.ts +46 -0
- package/dist/builtins/animation.d.ts.map +1 -0
- package/dist/builtins/animation.js +316 -0
- package/dist/builtins/animation.js.map +1 -0
- package/dist/builtins/attachments.d.ts +9 -0
- package/dist/builtins/attachments.d.ts.map +1 -0
- package/dist/builtins/attachments.js +127 -0
- package/dist/builtins/attachments.js.map +1 -0
- package/dist/builtins/base64.d.ts +13 -2
- package/dist/builtins/base64.d.ts.map +1 -1
- package/dist/builtins/base64.js +8 -6
- package/dist/builtins/base64.js.map +1 -1
- package/dist/builtins/camera.d.ts +35 -0
- package/dist/builtins/camera.d.ts.map +1 -0
- package/dist/builtins/camera.js +104 -0
- package/dist/builtins/camera.js.map +1 -0
- package/dist/builtins/collision.d.ts +21 -0
- package/dist/builtins/collision.d.ts.map +1 -0
- package/dist/builtins/collision.js +44 -0
- package/dist/builtins/collision.js.map +1 -0
- package/dist/builtins/controls.d.ts +19 -0
- package/dist/builtins/controls.d.ts.map +1 -0
- package/dist/builtins/controls.js +27 -0
- package/dist/builtins/controls.js.map +1 -0
- package/dist/builtins/damage.d.ts +24 -0
- package/dist/builtins/damage.d.ts.map +1 -0
- package/dist/builtins/damage.js +166 -0
- package/dist/builtins/damage.js.map +1 -0
- package/dist/builtins/detected.d.ts +22 -1
- package/dist/builtins/detected.d.ts.map +1 -1
- package/dist/builtins/detected.js +28 -2
- package/dist/builtins/detected.js.map +1 -1
- package/dist/builtins/dialog.d.ts +23 -0
- package/dist/builtins/dialog.d.ts.map +1 -0
- package/dist/builtins/dialog.js +69 -0
- package/dist/builtins/dialog.js.map +1 -0
- package/dist/builtins/email.d.ts +61 -0
- package/dist/builtins/email.d.ts.map +1 -0
- package/dist/builtins/email.js +121 -0
- package/dist/builtins/email.js.map +1 -0
- package/dist/builtins/environment.d.ts +27 -0
- package/dist/builtins/environment.d.ts.map +1 -0
- package/dist/builtins/environment.js +126 -0
- package/dist/builtins/environment.js.map +1 -0
- package/dist/builtins/experience.d.ts +51 -0
- package/dist/builtins/experience.d.ts.map +1 -0
- package/dist/builtins/experience.js +202 -0
- package/dist/builtins/experience.js.map +1 -0
- package/dist/builtins/game-control.d.ts +17 -0
- package/dist/builtins/game-control.d.ts.map +1 -0
- package/dist/builtins/game-control.js +21 -0
- package/dist/builtins/game-control.js.map +1 -0
- package/dist/builtins/give.d.ts +16 -0
- package/dist/builtins/give.d.ts.map +1 -0
- package/dist/builtins/give.js +137 -0
- package/dist/builtins/give.js.map +1 -0
- package/dist/builtins/ground.d.ts +18 -0
- package/dist/builtins/ground.d.ts.map +1 -0
- package/dist/builtins/ground.js +83 -0
- package/dist/builtins/ground.js.map +1 -0
- package/dist/builtins/hash.d.ts +1 -0
- package/dist/builtins/hash.d.ts.map +1 -1
- package/dist/builtins/hash.js +12 -2
- package/dist/builtins/hash.js.map +1 -1
- package/dist/builtins/http.d.ts +99 -4
- package/dist/builtins/http.d.ts.map +1 -1
- package/dist/builtins/http.js +216 -6
- package/dist/builtins/http.js.map +1 -1
- package/dist/builtins/index.d.ts.map +1 -1
- package/dist/builtins/index.js +250 -14
- package/dist/builtins/index.js.map +1 -1
- package/dist/builtins/inventory.d.ts +8 -5
- package/dist/builtins/inventory.d.ts.map +1 -1
- package/dist/builtins/inventory.js +37 -15
- package/dist/builtins/inventory.js.map +1 -1
- package/dist/builtins/json.d.ts.map +1 -1
- package/dist/builtins/json.js +45 -34
- package/dist/builtins/json.js.map +1 -1
- package/dist/builtins/land.d.ts +29 -0
- package/dist/builtins/land.d.ts.map +1 -0
- package/dist/builtins/land.js +339 -0
- package/dist/builtins/land.js.map +1 -0
- package/dist/builtins/link-info.js +2 -2
- package/dist/builtins/link-info.js.map +1 -1
- package/dist/builtins/links.d.ts +20 -0
- package/dist/builtins/links.d.ts.map +1 -0
- package/dist/builtins/links.js +53 -0
- package/dist/builtins/links.js.map +1 -0
- package/dist/builtins/linksetdata.d.ts +5 -0
- package/dist/builtins/linksetdata.d.ts.map +1 -1
- package/dist/builtins/linksetdata.js +22 -9
- package/dist/builtins/linksetdata.js.map +1 -1
- package/dist/builtins/lists.d.ts +21 -0
- package/dist/builtins/lists.d.ts.map +1 -1
- package/dist/builtins/lists.js +137 -17
- package/dist/builtins/lists.js.map +1 -1
- package/dist/builtins/math.d.ts +18 -0
- package/dist/builtins/math.d.ts.map +1 -1
- package/dist/builtins/math.js +104 -5
- package/dist/builtins/math.js.map +1 -1
- package/dist/builtins/media.d.ts +8 -0
- package/dist/builtins/media.d.ts.map +1 -0
- package/dist/builtins/media.js +167 -0
- package/dist/builtins/media.js.map +1 -0
- package/dist/builtins/motion.d.ts +79 -0
- package/dist/builtins/motion.d.ts.map +1 -0
- package/dist/builtins/motion.js +396 -0
- package/dist/builtins/motion.js.map +1 -0
- package/dist/builtins/notecard-search.d.ts +15 -0
- package/dist/builtins/notecard-search.d.ts.map +1 -0
- package/dist/builtins/notecard-search.js +374 -0
- package/dist/builtins/notecard-search.js.map +1 -0
- package/dist/builtins/object-animation.d.ts +21 -0
- package/dist/builtins/object-animation.d.ts.map +1 -0
- package/dist/builtins/object-animation.js +193 -0
- package/dist/builtins/object-animation.js.map +1 -0
- package/dist/builtins/object-reads.d.ts +39 -0
- package/dist/builtins/object-reads.d.ts.map +1 -0
- package/dist/builtins/object-reads.js +332 -0
- package/dist/builtins/object-reads.js.map +1 -0
- package/dist/builtins/object.d.ts +11 -2
- package/dist/builtins/object.d.ts.map +1 -1
- package/dist/builtins/object.js +32 -8
- package/dist/builtins/object.js.map +1 -1
- package/dist/builtins/particles.d.ts +4 -0
- package/dist/builtins/particles.d.ts.map +1 -0
- package/dist/builtins/particles.js +65 -0
- package/dist/builtins/particles.js.map +1 -0
- package/dist/builtins/pathfinding.d.ts +39 -0
- package/dist/builtins/pathfinding.d.ts.map +1 -0
- package/dist/builtins/pathfinding.js +83 -0
- package/dist/builtins/pathfinding.js.map +1 -0
- package/dist/builtins/permissions.d.ts.map +1 -1
- package/dist/builtins/permissions.js +6 -0
- package/dist/builtins/permissions.js.map +1 -1
- package/dist/builtins/physics.d.ts +49 -0
- package/dist/builtins/physics.d.ts.map +1 -0
- package/dist/builtins/physics.js +47 -0
- package/dist/builtins/physics.js.map +1 -0
- package/dist/builtins/prim-accessors.d.ts +4 -0
- package/dist/builtins/prim-accessors.d.ts.map +1 -1
- package/dist/builtins/prim-accessors.js +75 -28
- package/dist/builtins/prim-accessors.js.map +1 -1
- package/dist/builtins/prim-params.d.ts.map +1 -1
- package/dist/builtins/prim-params.js +6 -2
- package/dist/builtins/prim-params.js.map +1 -1
- package/dist/builtins/raycast.d.ts +3 -0
- package/dist/builtins/raycast.d.ts.map +1 -0
- package/dist/builtins/raycast.js +65 -0
- package/dist/builtins/raycast.js.map +1 -0
- package/dist/builtins/region.d.ts +31 -0
- package/dist/builtins/region.d.ts.map +1 -0
- package/dist/builtins/region.js +125 -0
- package/dist/builtins/region.js.map +1 -0
- package/dist/builtins/remote-load.d.ts +3 -0
- package/dist/builtins/remote-load.d.ts.map +1 -0
- package/dist/builtins/remote-load.js +53 -0
- package/dist/builtins/remote-load.js.map +1 -0
- package/dist/builtins/rez.d.ts +10 -0
- package/dist/builtins/rez.d.ts.map +1 -0
- package/dist/builtins/rez.js +255 -0
- package/dist/builtins/rez.js.map +1 -0
- package/dist/builtins/rsa.d.ts +4 -0
- package/dist/builtins/rsa.d.ts.map +1 -0
- package/dist/builtins/rsa.js +44 -0
- package/dist/builtins/rsa.js.map +1 -0
- package/dist/builtins/script-control.d.ts +8 -3
- package/dist/builtins/script-control.d.ts.map +1 -1
- package/dist/builtins/script-control.js +27 -8
- package/dist/builtins/script-control.js.map +1 -1
- package/dist/builtins/sensor.d.ts +11 -0
- package/dist/builtins/sensor.d.ts.map +1 -0
- package/dist/builtins/sensor.js +145 -0
- package/dist/builtins/sensor.js.map +1 -0
- package/dist/builtins/sit.d.ts +23 -0
- package/dist/builtins/sit.d.ts.map +1 -0
- package/dist/builtins/sit.js +150 -0
- package/dist/builtins/sit.js.map +1 -0
- package/dist/builtins/sound.d.ts +19 -0
- package/dist/builtins/sound.d.ts.map +1 -0
- package/dist/builtins/sound.js +113 -0
- package/dist/builtins/sound.js.map +1 -0
- package/dist/builtins/strings.d.ts +6 -0
- package/dist/builtins/strings.d.ts.map +1 -1
- package/dist/builtins/strings.js +47 -6
- package/dist/builtins/strings.js.map +1 -1
- package/dist/builtins/targets.d.ts +12 -0
- package/dist/builtins/targets.d.ts.map +1 -0
- package/dist/builtins/targets.js +121 -0
- package/dist/builtins/targets.js.map +1 -0
- package/dist/builtins/time.d.ts +15 -5
- package/dist/builtins/time.d.ts.map +1 -1
- package/dist/builtins/time.js +36 -11
- package/dist/builtins/time.js.map +1 -1
- package/dist/builtins/vehicles.d.ts +22 -0
- package/dist/builtins/vehicles.d.ts.map +1 -0
- package/dist/builtins/vehicles.js +78 -0
- package/dist/builtins/vehicles.js.map +1 -0
- package/dist/builtins/viewer.d.ts +39 -0
- package/dist/builtins/viewer.d.ts.map +1 -0
- package/dist/builtins/viewer.js +74 -0
- package/dist/builtins/viewer.js.map +1 -0
- package/dist/clock.d.ts +45 -7
- package/dist/clock.d.ts.map +1 -1
- package/dist/clock.js +125 -14
- package/dist/clock.js.map +1 -1
- package/dist/dispatch.d.ts +3 -2
- package/dist/dispatch.d.ts.map +1 -1
- package/dist/dispatch.js +15 -10
- package/dist/dispatch.js.map +1 -1
- package/dist/experience.d.ts +39 -0
- package/dist/experience.d.ts.map +1 -0
- package/dist/experience.js +38 -0
- package/dist/experience.js.map +1 -0
- package/dist/index.d.ts +20 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/interpreter.d.ts +5 -10
- package/dist/interpreter.d.ts.map +1 -1
- package/dist/interpreter.js +143 -70
- package/dist/interpreter.js.map +1 -1
- package/dist/inventory.d.ts +2 -0
- package/dist/inventory.d.ts.map +1 -1
- package/dist/inventory.js +2 -0
- package/dist/inventory.js.map +1 -1
- package/dist/linkset.d.ts +147 -11
- package/dist/linkset.d.ts.map +1 -1
- package/dist/linkset.js +401 -28
- package/dist/linkset.js.map +1 -1
- package/dist/memory.d.ts +5 -2
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +5 -2
- package/dist/memory.js.map +1 -1
- package/dist/prim-params.d.ts +27 -10
- package/dist/prim-params.d.ts.map +1 -1
- package/dist/prim-params.js +209 -125
- package/dist/prim-params.js.map +1 -1
- package/dist/prim.d.ts +95 -5
- package/dist/prim.d.ts.map +1 -1
- package/dist/prim.js +96 -7
- package/dist/prim.js.map +1 -1
- package/dist/runtime.d.ts +52 -3
- package/dist/runtime.d.ts.map +1 -1
- package/dist/script.d.ts +171 -12
- package/dist/script.d.ts.map +1 -1
- package/dist/script.js +480 -73
- package/dist/script.js.map +1 -1
- package/dist/typecheck.d.ts +3 -1
- package/dist/typecheck.d.ts.map +1 -1
- package/dist/typecheck.js +25 -5
- package/dist/typecheck.js.map +1 -1
- package/dist/values/coerce.d.ts +1 -1
- package/dist/values/coerce.d.ts.map +1 -1
- package/dist/values/coerce.js +10 -6
- package/dist/values/coerce.js.map +1 -1
- package/dist/values/format.d.ts +3 -1
- package/dist/values/format.d.ts.map +1 -1
- package/dist/values/format.js +10 -6
- package/dist/values/format.js.map +1 -1
- package/dist/values/ops.d.ts +3 -0
- package/dist/values/ops.d.ts.map +1 -1
- package/dist/values/ops.js +2 -2
- package/dist/values/ops.js.map +1 -1
- package/dist/world.d.ts +247 -1
- package/dist/world.d.ts.map +1 -1
- package/dist/world.js +318 -6
- package/dist/world.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { DEBUG_CHANNEL, ACTIVE, PASSIVE, SCRIPTED, DAMAGEABLE, STATUS_PHYSICS } from '../generated/constants.js';
|
|
2
|
+
import { findObjectPrim } from './object-reads.js';
|
|
3
|
+
import { NULL_KEY, ZERO_VECTOR } from '../values/types.js';
|
|
4
|
+
const avatars = new WeakMap();
|
|
5
|
+
export function combatAvatars(script) {
|
|
6
|
+
let result = avatars.get(script.linkset.clock);
|
|
7
|
+
if (!result)
|
|
8
|
+
avatars.set(script.linkset.clock, result = new Map());
|
|
9
|
+
return result;
|
|
10
|
+
}
|
|
11
|
+
const deliveries = new WeakMap();
|
|
12
|
+
/** Called when a damage handler starts and finishes, including suspension/abandonment. */
|
|
13
|
+
export function enterDamageEvent(payload) {
|
|
14
|
+
const delivery = payload['__damageDelivery'];
|
|
15
|
+
if (delivery)
|
|
16
|
+
delivery.active = true;
|
|
17
|
+
}
|
|
18
|
+
export function leaveDamageEvent(payload) {
|
|
19
|
+
const delivery = payload['__damageDelivery'];
|
|
20
|
+
if (!delivery)
|
|
21
|
+
return;
|
|
22
|
+
delivery.active = false;
|
|
23
|
+
deliveries.get(delivery.script.linkset.clock)?.delete(delivery);
|
|
24
|
+
delivery.complete();
|
|
25
|
+
}
|
|
26
|
+
/** Release a barrier when reset, state change, death or queue overflow drops its event. */
|
|
27
|
+
export function flushDamageEvents(clock) {
|
|
28
|
+
const pending = deliveries.get(clock);
|
|
29
|
+
if (!pending?.size)
|
|
30
|
+
return;
|
|
31
|
+
const queued = new Set(clock.pendingEvents().map((e) => e.payload));
|
|
32
|
+
for (const delivery of [...pending]) {
|
|
33
|
+
const parked = delivery.script.parkedEvents.some((event) => event.payload === delivery.payload);
|
|
34
|
+
if (!delivery.script.dead && (delivery.active || queued.has(delivery.payload) || parked))
|
|
35
|
+
continue;
|
|
36
|
+
pending.delete(delivery);
|
|
37
|
+
delivery.complete();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function dispatch(ctx, scripts, entry, apply, skipAdjustment = false) {
|
|
41
|
+
const targets = scripts.filter((s) => s.running && !s.dead);
|
|
42
|
+
const adjustmentEnabled = !skipAdjustment && (ctx.linkset.world?.region(ctx.linkset.region).env?.['allow_damage_adjust'] !== '0');
|
|
43
|
+
const adjust = adjustmentEnabled ? targets.filter((s) => s.handles('on_damage')) : [];
|
|
44
|
+
const notify = () => {
|
|
45
|
+
apply();
|
|
46
|
+
for (const s of targets) {
|
|
47
|
+
if (s.running && !s.dead && s.handles('final_damage')) {
|
|
48
|
+
ctx.linkset.clock.schedule(s, ctx.linkset.clock.now, 'final_damage', { num_detected: 1, detected: [entry] });
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
let remaining = adjust.length;
|
|
53
|
+
if (!remaining) {
|
|
54
|
+
notify();
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
let pending = deliveries.get(ctx.linkset.clock);
|
|
58
|
+
if (!pending)
|
|
59
|
+
deliveries.set(ctx.linkset.clock, pending = new Set());
|
|
60
|
+
for (const s of adjust) {
|
|
61
|
+
const payload = { num_detected: 1, detected: [entry] };
|
|
62
|
+
const delivery = {
|
|
63
|
+
script: s,
|
|
64
|
+
payload,
|
|
65
|
+
active: false,
|
|
66
|
+
complete: () => {
|
|
67
|
+
if (--remaining === 0)
|
|
68
|
+
notify();
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
payload['__damageDelivery'] = delivery;
|
|
72
|
+
pending.add(delivery);
|
|
73
|
+
ctx.linkset.clock.schedule(s, ctx.linkset.clock.now, 'on_damage', payload);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
export const llGetHealth = (ctx, args) => {
|
|
77
|
+
const id = args[0].toLowerCase();
|
|
78
|
+
const prim = findObjectPrim(ctx, id);
|
|
79
|
+
if (prim)
|
|
80
|
+
return prim.params.health;
|
|
81
|
+
const avatar = combatAvatars(ctx.script).get(id);
|
|
82
|
+
if (avatar)
|
|
83
|
+
return avatar.health;
|
|
84
|
+
// The owner is the one implicit avatar, as with the other agent builtins.
|
|
85
|
+
const ownerPresent = id !== NULL_KEY && ctx.linkset.peers.some((l) => l.region === ctx.linkset.region && l.owner.toLowerCase() === id);
|
|
86
|
+
return ownerPresent ? 100 : 0;
|
|
87
|
+
};
|
|
88
|
+
export const llSetDamage = (ctx, args) => {
|
|
89
|
+
ctx.prim.params.damage.amount = args[0];
|
|
90
|
+
return undefined;
|
|
91
|
+
};
|
|
92
|
+
export const llAdjustDamage = (ctx, args) => {
|
|
93
|
+
const context = ctx.state.detectedStack.at(-1);
|
|
94
|
+
// Aditi silently ignores calls outside on_damage, including negative indexes.
|
|
95
|
+
if (context?.event !== 'on_damage')
|
|
96
|
+
return undefined;
|
|
97
|
+
const damage = context.entries[args[0]]?.damage;
|
|
98
|
+
if (damage)
|
|
99
|
+
damage.amount = args[1];
|
|
100
|
+
return undefined;
|
|
101
|
+
};
|
|
102
|
+
const damageTimes = new WeakMap();
|
|
103
|
+
function throttled(ctx, id) {
|
|
104
|
+
const root = ctx.linkset.prims[0];
|
|
105
|
+
let targets = damageTimes.get(root);
|
|
106
|
+
if (!targets)
|
|
107
|
+
damageTimes.set(root, targets = new Map());
|
|
108
|
+
const recent = (targets.get(id) ?? []).filter((at) => at > ctx.linkset.clock.now - 30000);
|
|
109
|
+
if (recent.length >= 10) {
|
|
110
|
+
const text = 'llDamage: damage throttle exceeded for target.';
|
|
111
|
+
ctx.state.chat.push({ channel: DEBUG_CHANNEL, text, type: 'shout' });
|
|
112
|
+
ctx.linkset.routeChat(ctx.prim, 'shout', DEBUG_CHANNEL, text);
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
recent.push(ctx.linkset.clock.now);
|
|
116
|
+
targets.set(id, recent);
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
export const llDamage = (ctx, args) => {
|
|
120
|
+
if (!ctx.linkset.damageEnabled)
|
|
121
|
+
return undefined;
|
|
122
|
+
const id = args[0].toLowerCase();
|
|
123
|
+
const prim = findObjectPrim(ctx, id);
|
|
124
|
+
const avatar = combatAvatars(ctx.script).get(id);
|
|
125
|
+
if (prim) {
|
|
126
|
+
if (!prim.linkset.damageEnabled)
|
|
127
|
+
return undefined;
|
|
128
|
+
}
|
|
129
|
+
else if (!avatar?.damageEnabled || avatar.region !== ctx.linkset.region)
|
|
130
|
+
return undefined;
|
|
131
|
+
const amount = args[1];
|
|
132
|
+
const ownAttachment = !prim && (avatar.scripts?.some((s) => s.linkset === ctx.linkset) ?? false);
|
|
133
|
+
if (amount >= 0 && !ownAttachment && !ctx.linkset.damageThrottleExempt && throttled(ctx, id)) {
|
|
134
|
+
return undefined;
|
|
135
|
+
}
|
|
136
|
+
const entry = {
|
|
137
|
+
key: ctx.prim.key,
|
|
138
|
+
name: ctx.prim.name,
|
|
139
|
+
owner: ctx.linkset.owner,
|
|
140
|
+
rezzer: ctx.linkset.owner,
|
|
141
|
+
pos: ctx.prim.regionPosition(),
|
|
142
|
+
rot: ctx.prim.regionRotation(),
|
|
143
|
+
vel: ZERO_VECTOR,
|
|
144
|
+
linkNumber: prim?.linkNumber ?? 0,
|
|
145
|
+
type: SCRIPTED | ((ctx.linkset.prims[0].statusFlags & STATUS_PHYSICS) ? ACTIVE : PASSIVE)
|
|
146
|
+
| (ctx.linkset.allScripts().some((s) => s.running && !s.dead && (s.handles('on_damage') || s.handles('final_damage'))) ? DAMAGEABLE : 0),
|
|
147
|
+
damage: { amount, original: amount, type: args[2] },
|
|
148
|
+
};
|
|
149
|
+
// Object health belongs to its scripts. The simulator only changes avatar health.
|
|
150
|
+
const scripts = prim ? prim.linkset.allScripts() : avatar.scripts ?? [];
|
|
151
|
+
dispatch(ctx, scripts, entry, () => {
|
|
152
|
+
if (!prim && avatar) {
|
|
153
|
+
const before = avatar.health;
|
|
154
|
+
avatar.health = Math.max(0, Math.min(100, avatar.health - entry.damage.amount));
|
|
155
|
+
if (before > 0 && avatar.health === 0) {
|
|
156
|
+
for (const attachment of avatar.scripts ?? []) {
|
|
157
|
+
if (attachment.running && !attachment.dead && attachment.handles('on_death')) {
|
|
158
|
+
ctx.linkset.clock.schedule(attachment, ctx.linkset.clock.now, 'on_death');
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}, ownAttachment);
|
|
164
|
+
return undefined;
|
|
165
|
+
};
|
|
166
|
+
//# sourceMappingURL=damage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"damage.js","sourceRoot":"","sources":["../../src/builtins/damage.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAGhH,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAU1D,MAAM,OAAO,GAAG,IAAI,OAAO,EAAqD,CAAA;AAChF,MAAM,UAAU,aAAa,CAAC,MAAc;IAC1C,IAAI,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC9C,IAAI,CAAC,MAAM;QAAE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,EAAE,CAAC,CAAA;IAClE,OAAO,MAAM,CAAA;AACf,CAAC;AAQD,MAAM,UAAU,GAAG,IAAI,OAAO,EAA+B,CAAA;AAE7D,0FAA0F;AAC1F,MAAM,UAAU,gBAAgB,CAAC,OAAgC;IAC/D,MAAM,QAAQ,GAAG,OAAO,CAAC,kBAAkB,CAAyB,CAAA;IACpE,IAAI,QAAQ;QAAE,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAA;AACtC,CAAC;AACD,MAAM,UAAU,gBAAgB,CAAC,OAAgC;IAC/D,MAAM,QAAQ,GAAG,OAAO,CAA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AE,UAAU,CAAC,CAAA;oBAC3E,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC,EAAE,aAAa,CAAC,CAAA;IACjB,OAAO,SAAS,CAAA;AAClB,CAAC,CAAA"}
|
|
@@ -10,7 +10,7 @@ export interface DetectedEntry {
|
|
|
10
10
|
readonly key: string;
|
|
11
11
|
readonly name: string;
|
|
12
12
|
readonly owner?: string;
|
|
13
|
-
readonly group?:
|
|
13
|
+
readonly group?: number;
|
|
14
14
|
readonly pos?: Vector;
|
|
15
15
|
readonly rot?: Rotation;
|
|
16
16
|
readonly vel?: Vector;
|
|
@@ -18,12 +18,26 @@ export interface DetectedEntry {
|
|
|
18
18
|
readonly linkNumber?: number;
|
|
19
19
|
readonly grab?: Vector;
|
|
20
20
|
readonly touchPos?: Vector;
|
|
21
|
+
readonly touchFace?: number;
|
|
22
|
+
readonly touchST?: Vector;
|
|
23
|
+
readonly touchUV?: Vector;
|
|
24
|
+
readonly touchNormal?: Vector;
|
|
25
|
+
readonly touchBinormal?: Vector;
|
|
26
|
+
/** Who rezzed the detected object. Defaults to `owner`, then `key`. */
|
|
27
|
+
readonly rezzer?: string;
|
|
28
|
+
/** What `on_damage` / `final_damage` read. `original` defaults to `amount`. */
|
|
29
|
+
readonly damage?: {
|
|
30
|
+
amount: number;
|
|
31
|
+
readonly type: number;
|
|
32
|
+
readonly original?: number;
|
|
33
|
+
};
|
|
21
34
|
}
|
|
22
35
|
/**
|
|
23
36
|
* Per-handler detected context. The interpreter sets this before invoking
|
|
24
37
|
* a touch / sensor / collision handler and clears it on return.
|
|
25
38
|
*/
|
|
26
39
|
export interface DetectedContext {
|
|
40
|
+
event?: string;
|
|
27
41
|
readonly entries: ReadonlyArray<DetectedEntry>;
|
|
28
42
|
}
|
|
29
43
|
export declare const llDetectedKey: BuiltinImpl;
|
|
@@ -37,4 +51,11 @@ export declare const llDetectedType: BuiltinImpl;
|
|
|
37
51
|
export declare const llDetectedLinkNumber: BuiltinImpl;
|
|
38
52
|
export declare const llDetectedGrab: BuiltinImpl;
|
|
39
53
|
export declare const llDetectedTouchPos: BuiltinImpl;
|
|
54
|
+
export declare const llDetectedTouchFace: BuiltinImpl;
|
|
55
|
+
export declare const llDetectedTouchST: BuiltinImpl;
|
|
56
|
+
export declare const llDetectedTouchUV: BuiltinImpl;
|
|
57
|
+
export declare const llDetectedTouchNormal: BuiltinImpl;
|
|
58
|
+
export declare const llDetectedTouchBinormal: BuiltinImpl;
|
|
59
|
+
export declare const llDetectedRezzer: BuiltinImpl;
|
|
60
|
+
export declare const llDetectedDamage: BuiltinImpl;
|
|
40
61
|
//# sourceMappingURL=detected.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detected.d.ts","sourceRoot":"","sources":["../../src/builtins/detected.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"detected.d.ts","sourceRoot":"","sources":["../../src/builtins/detected.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAK1D;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAA;IACvB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;IACrB,QAA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CAAA;AACnC,eAAO,MAAM,cAAc,EAAE,WAAkE,CAAA;AAC/F,eAAO,MAAM,kBAAkB,EAAE,WACU,CAAA;AAC3C,eAAO,MAAM,mBAAmB,EAAE,WAA6D,CAAA;AAM/F,eAAO,MAAM,iBAAiB,EAAE,WAG/B,CAAA;AACD,eAAO,MAAM,iBAAiB,EAAE,WAG/B,CAAA;AACD,eAAO,MAAM,qBAAqB,EAAE,WACU,CAAA;AAC9C,eAAO,MAAM,uBAAuB,EAAE,WACU,CAAA;AAEhD,eAAO,MAAM,gBAAgB,EAAE,WAG9B,CAAA;AACD,eAAO,MAAM,gBAAgB,EAAE,WAI9B,CAAA"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { ZERO_VECTOR, ZERO_ROTATION, NULL_KEY } from '../values/types.js';
|
|
2
|
+
import { TOUCH_INVALID_TEXCOORD } from '../generated/constants.js';
|
|
3
|
+
import { typedList } from '../values/list-types.js';
|
|
2
4
|
function get(ctx) {
|
|
3
5
|
return ctx.state.detectedStack[ctx.state.detectedStack.length - 1]?.entries ?? [];
|
|
4
6
|
}
|
|
@@ -10,9 +12,9 @@ function entry(ctx, args) {
|
|
|
10
12
|
return list[i];
|
|
11
13
|
}
|
|
12
14
|
export const llDetectedKey = (ctx, args) => entry(ctx, args)?.key ?? NULL_KEY;
|
|
13
|
-
export const llDetectedName = (ctx, args) => entry(ctx, args)?.name ??
|
|
15
|
+
export const llDetectedName = (ctx, args) => entry(ctx, args)?.name ?? NULL_KEY;
|
|
14
16
|
export const llDetectedOwner = (ctx, args) => entry(ctx, args)?.owner ?? entry(ctx, args)?.key ?? NULL_KEY;
|
|
15
|
-
export const llDetectedGroup = (ctx, args) => entry(ctx, args)?.group ??
|
|
17
|
+
export const llDetectedGroup = (ctx, args) => entry(ctx, args)?.group ?? 0;
|
|
16
18
|
export const llDetectedPos = (ctx, args) => entry(ctx, args)?.pos ?? ZERO_VECTOR;
|
|
17
19
|
export const llDetectedRot = (ctx, args) => entry(ctx, args)?.rot ?? ZERO_ROTATION;
|
|
18
20
|
export const llDetectedVel = (ctx, args) => entry(ctx, args)?.vel ?? ZERO_VECTOR;
|
|
@@ -20,4 +22,28 @@ export const llDetectedType = (ctx, args) => entry(ctx, args)?.type ?? 0;
|
|
|
20
22
|
export const llDetectedLinkNumber = (ctx, args) => entry(ctx, args)?.linkNumber ?? 0;
|
|
21
23
|
export const llDetectedGrab = (ctx, args) => entry(ctx, args)?.grab ?? ZERO_VECTOR;
|
|
22
24
|
export const llDetectedTouchPos = (ctx, args) => entry(ctx, args)?.touchPos ?? ZERO_VECTOR;
|
|
25
|
+
export const llDetectedTouchFace = (ctx, args) => entry(ctx, args)?.touchFace ?? 0;
|
|
26
|
+
// In-world, a click that carries no surface point reads <-1, -1, 0> here;
|
|
27
|
+
// outside a touch event and past the count these read ZERO_VECTOR.
|
|
28
|
+
const texcoord = (e, v) => e ? (v ?? TOUCH_INVALID_TEXCOORD) : ZERO_VECTOR;
|
|
29
|
+
export const llDetectedTouchST = (ctx, args) => {
|
|
30
|
+
const e = entry(ctx, args);
|
|
31
|
+
return texcoord(e, e?.touchST);
|
|
32
|
+
};
|
|
33
|
+
export const llDetectedTouchUV = (ctx, args) => {
|
|
34
|
+
const e = entry(ctx, args);
|
|
35
|
+
return texcoord(e, e?.touchUV);
|
|
36
|
+
};
|
|
37
|
+
export const llDetectedTouchNormal = (ctx, args) => entry(ctx, args)?.touchNormal ?? ZERO_VECTOR;
|
|
38
|
+
export const llDetectedTouchBinormal = (ctx, args) => entry(ctx, args)?.touchBinormal ?? ZERO_VECTOR;
|
|
39
|
+
export const llDetectedRezzer = (ctx, args) => {
|
|
40
|
+
const e = entry(ctx, args);
|
|
41
|
+
return e?.rezzer ?? e?.owner ?? e?.key ?? NULL_KEY;
|
|
42
|
+
};
|
|
43
|
+
export const llDetectedDamage = (ctx, args) => {
|
|
44
|
+
const d = entry(ctx, args)?.damage;
|
|
45
|
+
if (!d)
|
|
46
|
+
return [];
|
|
47
|
+
return typedList([d.amount, d.type, d.original ?? d.amount], ['float', 'integer', 'float']);
|
|
48
|
+
};
|
|
23
49
|
//# sourceMappingURL=detected.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detected.js","sourceRoot":"","sources":["../../src/builtins/detected.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"detected.js","sourceRoot":"","sources":["../../src/builtins/detected.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAA;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAwCnD,SAAS,GAAG,CAAC,GAA+B;IAC1C,OAAO,GAAG,CAAC,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,OAAO,IAAI,EAAE,CAAA;AACnF,CAAC;AAED,SAAS,KAAK,CACZ,GAA+B,EAC/B,IAA4B;IAE5B,MAAM,CAAC,GAAI,IAAI,CAAC,CAAC,CAAwB,IAAI,CAAC,CAAA;IAC9C,MAAM,IAAI,GAAG,GAAG,CAAC,GAAG,CAAC,CAAA;IACrB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM;QAAE,OAAO,SAAS,CAAA;IAC/C,OAAO,IAAI,CAAC,CAAC,CAAC,CAAA;AAChB,CAAC;AAED,MAAM,CAAC,MAAM,aAAa,GAAgB,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,GAAG,IAAI,QAAQ,CAAA;AAC1F,MAAM,CAAC,MAAM,cAAc,GAAgB,CAAC,GAAG,EAA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C,GAAG,EAAE,IAAI,EAAE,EAAE,CAChE,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,aAAa,IAAI,WAAW,CAAA;AAEhD,MAAM,CAAC,MAAM,gBAAgB,GAAgB,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;IACzD,MAAM,CAAC,GAAG,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IAC1B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,GAAG,IAAI,QAAQ,CAAA;AACpD,CAAC,CAAA;AACD,MAAM,CAAC,MAAM,gBAAgB,GAAgB,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;IACzD,MAAM,CAAC,GAAG,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,MAAM,CAAA;IAClC,IAAI,CAAC,CAAC;QAAE,OAAO,EAAE,CAAA;IACjB,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,CAAA;AAC7F,CAAC,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { BuiltinImpl } from '../runtime.js';
|
|
2
|
+
/** A llDialog or llTextBox the script showed, waiting for the test to answer it. */
|
|
3
|
+
export interface DialogEntry {
|
|
4
|
+
readonly kind: 'dialog' | 'textBox';
|
|
5
|
+
/** The avatar it was shown to. */
|
|
6
|
+
readonly agent: string;
|
|
7
|
+
readonly message: string;
|
|
8
|
+
/** The buttons the avatar sees: `['OK']` for an empty llDialog list, none for a text box. */
|
|
9
|
+
readonly buttons: ReadonlyArray<string>;
|
|
10
|
+
readonly channel: number;
|
|
11
|
+
/** Key of the prim that showed it; the answer is heard within 20 m of that prim. */
|
|
12
|
+
readonly objectKey: string;
|
|
13
|
+
answered: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* llDialog(key agent, string msg, list buttons, integer channel) — records the
|
|
17
|
+
* menu for the test to answer with Script.answerDialog. Bad arguments print
|
|
18
|
+
* the simulator's DEBUG_CHANNEL error and show nothing.
|
|
19
|
+
*/
|
|
20
|
+
export declare const llDialog: BuiltinImpl;
|
|
21
|
+
/** llTextBox(key agent, string msg, integer channel) — like llDialog, answered with any text. */
|
|
22
|
+
export declare const llTextBox: BuiltinImpl;
|
|
23
|
+
//# sourceMappingURL=dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../src/builtins/dialog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAe,MAAM,eAAe,CAAA;AAK7D,oFAAoF;AACpF,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,SAAS,CAAA;IACnC,kCAAkC;IAClC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,6FAA6F;IAC7F,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IACvC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,oFAAoF;IACpF,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,EAAE,OAAO,CAAA;CAClB;AA8BD;;;;GAIG;AACH,eAAO,MAAM,QAAQ,EAAE,WAetB,CAAA;AAED,iGAAiG;AACjG,eAAO,MAAM,SAAS,EAAE,WAcvB,CAAA"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { listElementType } from '../values/list-types.js';
|
|
2
|
+
import { sayError } from './debug.js';
|
|
3
|
+
const MAX_MESSAGE_BYTES = 511;
|
|
4
|
+
const MAX_BUTTONS = 12;
|
|
5
|
+
const MAX_LABEL_BYTES = 24;
|
|
6
|
+
function messageError(message) {
|
|
7
|
+
if (message === '')
|
|
8
|
+
return 'must supply a message';
|
|
9
|
+
if (Buffer.byteLength(message, 'utf8') > MAX_MESSAGE_BYTES)
|
|
10
|
+
return 'message too long, must be less than 512 characters';
|
|
11
|
+
return undefined;
|
|
12
|
+
}
|
|
13
|
+
function buttonError(buttons) {
|
|
14
|
+
if (buttons.length > MAX_BUTTONS)
|
|
15
|
+
return 'button list too long, must be 12 or fewer entries';
|
|
16
|
+
for (let i = 0; i < buttons.length; i++) {
|
|
17
|
+
const label = buttons[i];
|
|
18
|
+
const type = listElementType(buttons, i);
|
|
19
|
+
if (typeof label !== 'string' || (type !== undefined && type !== 'string'))
|
|
20
|
+
return 'button list must contain only strings';
|
|
21
|
+
if (label === '')
|
|
22
|
+
return 'all buttons must have label strings';
|
|
23
|
+
if (Buffer.byteLength(label, 'utf8') > MAX_LABEL_BYTES)
|
|
24
|
+
return 'button labels must be 24 or fewer characters long';
|
|
25
|
+
}
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
function show(ctx, entry) {
|
|
29
|
+
ctx.state.dialogs.push({ ...entry, objectKey: ctx.prim.key, answered: false });
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* llDialog(key agent, string msg, list buttons, integer channel) — records the
|
|
34
|
+
* menu for the test to answer with Script.answerDialog. Bad arguments print
|
|
35
|
+
* the simulator's DEBUG_CHANNEL error and show nothing.
|
|
36
|
+
*/
|
|
37
|
+
export const llDialog = (ctx, args) => {
|
|
38
|
+
const message = args[1] ?? '';
|
|
39
|
+
const buttons = args[2] ?? [];
|
|
40
|
+
const error = messageError(message) ?? buttonError(buttons);
|
|
41
|
+
if (error) {
|
|
42
|
+
sayError(ctx, `llDialog: ${error}`);
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
45
|
+
return show(ctx, {
|
|
46
|
+
kind: 'dialog',
|
|
47
|
+
agent: args[0] ?? '',
|
|
48
|
+
message,
|
|
49
|
+
buttons: buttons.length === 0 ? ['OK'] : [...buttons],
|
|
50
|
+
channel: args[3] ?? 0,
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
/** llTextBox(key agent, string msg, integer channel) — like llDialog, answered with any text. */
|
|
54
|
+
export const llTextBox = (ctx, args) => {
|
|
55
|
+
const message = args[1] ?? '';
|
|
56
|
+
const error = messageError(message);
|
|
57
|
+
if (error) {
|
|
58
|
+
sayError(ctx, `llTextBox: ${error}`);
|
|
59
|
+
return undefined;
|
|
60
|
+
}
|
|
61
|
+
return show(ctx, {
|
|
62
|
+
kind: 'textBox',
|
|
63
|
+
agent: args[0] ?? '',
|
|
64
|
+
message,
|
|
65
|
+
buttons: [],
|
|
66
|
+
channel: args[2] ?? 0,
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=dialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog.js","sourceRoot":"","sources":["../../src/builtins/dialog.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAgBrC,MAAM,iBAAiB,GAAG,GAAG,CAAA;AAC7B,MAAM,WAAW,GAAG,EAAE,CAAA;AACtB,MAAM,eAAe,GAAG,EAAE,CAAA;AAE1B,SAAS,YAAY,CAAC,OAAe;IACnC,IAAI,OAAO,KAAK,EAAE;QAAE,OAAO,uBAAuB,CAAA;IAClD,IAAI,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,iBAAiB;QAAE,OAAO,oDAAoD,CAAA;IACvH,OAAO,SAAS,CAAA;AAClB,CAAC;AAED,SAAS,WAAW,CAAC,OAAgC;IACnD,IAAI,OAAO,CAAC,MAAM,GAAG,WAAW;QAAE,OAAO,mDAAmD,CAAA;IAC5F,KAAK,IAAI,CAAC,GAAG,CAAC,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,IAAI,EAAE,QAAQ;QACd,KAAK,EAAG,IAAI,CAAC,CAAC,CAAwB,IAAI,EAAE;QAC5C,OAAO;QACP,OAAO,EAAE,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAE,CAAC,GAAG,OAAO,CAAc;QACnE,OAAO,EAAG,IAAI,CAAC,CAAC,CAAwB,IAAI,CAAC;KAC9C,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,iGAAiG;AACjG,MAAM,CAAC,MAAM,SAAS,GAAgB,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;IAClD,MAAM,OAAO,GAAI,IAAI,CAAC,CAAC,CAAwB,IAAI,EAAE,CAAA;IACrD,MAAM,KAAK,GAAG,YAAY,CAAC,OAAO,CAAC,CAAA;IACnC,IAAI,KAAK,EAAE,CAAC;QACV,QAAQ,CAAC,GAAG,EAAE,cAAc,KAAK,EAAE,CAAC,CAAA;QACpC,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,OAAO,IAAI,CAAC,GAAG,EAAE;QACf,IAAI,EAAE,SAAS;QACf,KAAK,EAAG,IAAI,CAAC,CAAC,CAAwB,IAAI,EAAE;QAC5C,OAAO;QACP,OAAO,EAAE,EAAE;QACX,OAAO,EAAG,IAAI,CAAC,CAAC,CAAwB,IAAI,CAAC;KAC9C,CAAC,CAAA;AACJ,CAAC,CAAA"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { BuiltinImpl } from '../runtime.js';
|
|
2
|
+
import type { Prim } from '../prim.js';
|
|
3
|
+
import type { Script } from '../script.js';
|
|
4
|
+
/** Domain of an object's address: `<prim key>@lsl.secondlife.com`. */
|
|
5
|
+
export declare const OBJECT_EMAIL_DOMAIN = "lsl.secondlife.com";
|
|
6
|
+
/** Mail a script sent with llEmail. */
|
|
7
|
+
export interface SentEmail {
|
|
8
|
+
readonly address: string;
|
|
9
|
+
readonly subject: string;
|
|
10
|
+
readonly message: string;
|
|
11
|
+
/** Unix time, in seconds, of the call. */
|
|
12
|
+
readonly time: number;
|
|
13
|
+
}
|
|
14
|
+
/** Mail a script sent with llTargetedEmail. */
|
|
15
|
+
export interface SentTargetedEmail {
|
|
16
|
+
/** TARGETED_EMAIL_OBJECT_OWNER, TARGETED_EMAIL_ROOT_CREATOR, or whatever else the script passed. */
|
|
17
|
+
readonly target: number;
|
|
18
|
+
readonly subject: string;
|
|
19
|
+
readonly message: string;
|
|
20
|
+
/** Unix time, in seconds, of the call. */
|
|
21
|
+
readonly time: number;
|
|
22
|
+
}
|
|
23
|
+
/** Mail waiting in a prim's queue for llGetNextEmail. */
|
|
24
|
+
export interface IncomingEmail {
|
|
25
|
+
/** Unix time, in seconds, the mail was sent. */
|
|
26
|
+
readonly time: number;
|
|
27
|
+
readonly address: string;
|
|
28
|
+
readonly subject: string;
|
|
29
|
+
readonly message: string;
|
|
30
|
+
}
|
|
31
|
+
/** What a test delivers to a prim with `script.deliverEmail`. */
|
|
32
|
+
export interface IncomingEmailInit {
|
|
33
|
+
readonly from: string;
|
|
34
|
+
readonly subject?: string;
|
|
35
|
+
readonly message?: string;
|
|
36
|
+
/** Unix time, in seconds, the mail was sent. Default: now. */
|
|
37
|
+
readonly time?: number;
|
|
38
|
+
}
|
|
39
|
+
/** A prim's queue holds this many mails; later ones are dropped. */
|
|
40
|
+
export declare const MAX_QUEUED_EMAILS = 101;
|
|
41
|
+
/** The mail queued on `prim`, oldest first. */
|
|
42
|
+
export declare function emailQueue(prim: Prim): IncomingEmail[];
|
|
43
|
+
/**
|
|
44
|
+
* llEmail(string address, string subject, string message). Records the mail
|
|
45
|
+
* on the script; mail to `<key>@lsl.secondlife.com` is queued on the prim
|
|
46
|
+
* with that key, after a header naming the sending prim, unless that queue
|
|
47
|
+
* is full. Other addresses, and keys no prim has, go nowhere. The 20 s sleep is the spec's delay.
|
|
48
|
+
*/
|
|
49
|
+
export declare const llEmail: BuiltinImpl;
|
|
50
|
+
/** llTargetedEmail(integer target, string subject, string message). Records the mail on the script. */
|
|
51
|
+
export declare const llTargetedEmail: BuiltinImpl;
|
|
52
|
+
/**
|
|
53
|
+
* llGetNextEmail(string address, string subject). Takes the oldest queued
|
|
54
|
+
* mail whose address and subject match, ignoring case, and fires `email` on
|
|
55
|
+
* every script in the prim. An empty filter matches anything; with no
|
|
56
|
+
* match nothing happens.
|
|
57
|
+
*/
|
|
58
|
+
export declare const llGetNextEmail: BuiltinImpl;
|
|
59
|
+
/** Queue a test's mail on the script's prim; false when the queue is full. */
|
|
60
|
+
export declare function deliverEmail(script: Script, init: IncomingEmailInit): boolean;
|
|
61
|
+
//# sourceMappingURL=email.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../../src/builtins/email.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAe,MAAM,eAAe,CAAA;AAC7D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAI1C,sEAAsE;AACtE,eAAO,MAAM,mBAAmB,uBAAuB,CAAA;AAEvD,uCAAuC;AACvC,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,0CAA0C;IAC1C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACtB;AAED,+CAA+C;AAC/C,MAAM,WAAW,iBAAiB;IAChC,oGAAoG;IACpG,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,0CAA0C;IAC1C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACtB;AAED,yDAAyD;AACzD,MAAM,WAAW,aAAa;IAC5B,gDAAgD;IAChD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB;AAED,iEAAiE;AACjE,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,8DAA8D;IAC9D,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,oEAAoE;AACpE,eAAO,MAAM,iBAAiB,MAAM,CAAA;AAIpC,+CAA+C;AAC/C,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,aAAa,EAAE,CAOtD;AAMD;;;;;GAKG;AACH,eAAO,MAAM,OAAO,EAAE,WAgBrB,CAAA;AAED,uGAAuG;AACvG,eAAO,MAAM,eAAe,EAAE,WAQ7B,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,cAAc,EAAE,WAoB5B,CAAA;AAoCD,8EAA8E;AAC9E,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAO7E"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { llGetRegionCorner, llGetRegionName } from './region.js';
|
|
2
|
+
/** Domain of an object's address: `<prim key>@lsl.secondlife.com`. */
|
|
3
|
+
export const OBJECT_EMAIL_DOMAIN = 'lsl.secondlife.com';
|
|
4
|
+
/** A prim's queue holds this many mails; later ones are dropped. */
|
|
5
|
+
export const MAX_QUEUED_EMAILS = 101;
|
|
6
|
+
const queues = new WeakMap();
|
|
7
|
+
/** The mail queued on `prim`, oldest first. */
|
|
8
|
+
export function emailQueue(prim) {
|
|
9
|
+
let queue = queues.get(prim);
|
|
10
|
+
if (!queue) {
|
|
11
|
+
queue = [];
|
|
12
|
+
queues.set(prim, queue);
|
|
13
|
+
}
|
|
14
|
+
return queue;
|
|
15
|
+
}
|
|
16
|
+
function unixSeconds(ctx) {
|
|
17
|
+
return Math.floor(ctx.state.clock.unixMicros() / 1e6);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* llEmail(string address, string subject, string message). Records the mail
|
|
21
|
+
* on the script; mail to `<key>@lsl.secondlife.com` is queued on the prim
|
|
22
|
+
* with that key, after a header naming the sending prim, unless that queue
|
|
23
|
+
* is full. Other addresses, and keys no prim has, go nowhere. The 20 s sleep is the spec's delay.
|
|
24
|
+
*/
|
|
25
|
+
export const llEmail = (ctx, args) => {
|
|
26
|
+
const address = args[0] ?? '';
|
|
27
|
+
const subject = args[1] ?? '';
|
|
28
|
+
const message = args[2] ?? '';
|
|
29
|
+
const time = unixSeconds(ctx);
|
|
30
|
+
ctx.state.emails.push({ address, subject, message, time });
|
|
31
|
+
const target = objectFor(ctx, address);
|
|
32
|
+
if (target) {
|
|
33
|
+
enqueue(target, {
|
|
34
|
+
time,
|
|
35
|
+
address: `${ctx.prim.key}@${OBJECT_EMAIL_DOMAIN}`,
|
|
36
|
+
subject,
|
|
37
|
+
message: header(ctx) + asciiOnly(message),
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
return undefined;
|
|
41
|
+
};
|
|
42
|
+
/** llTargetedEmail(integer target, string subject, string message). Records the mail on the script. */
|
|
43
|
+
export const llTargetedEmail = (ctx, args) => {
|
|
44
|
+
ctx.state.targetedEmails.push({
|
|
45
|
+
target: args[0] ?? 0,
|
|
46
|
+
subject: args[1] ?? '',
|
|
47
|
+
message: args[2] ?? '',
|
|
48
|
+
time: unixSeconds(ctx),
|
|
49
|
+
});
|
|
50
|
+
return undefined;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* llGetNextEmail(string address, string subject). Takes the oldest queued
|
|
54
|
+
* mail whose address and subject match, ignoring case, and fires `email` on
|
|
55
|
+
* every script in the prim. An empty filter matches anything; with no
|
|
56
|
+
* match nothing happens.
|
|
57
|
+
*/
|
|
58
|
+
export const llGetNextEmail = (ctx, args) => {
|
|
59
|
+
const address = (args[0] ?? '').toLowerCase();
|
|
60
|
+
const subject = (args[1] ?? '').toLowerCase();
|
|
61
|
+
const queue = emailQueue(ctx.prim);
|
|
62
|
+
const at = queue.findIndex((m) => (address === '' || m.address.toLowerCase() === address) &&
|
|
63
|
+
(subject === '' || m.subject.toLowerCase() === subject));
|
|
64
|
+
if (at < 0)
|
|
65
|
+
return undefined;
|
|
66
|
+
const [mail] = queue.splice(at, 1);
|
|
67
|
+
const payload = {
|
|
68
|
+
time: String(mail.time),
|
|
69
|
+
address: mail.address,
|
|
70
|
+
subject: mail.subject,
|
|
71
|
+
msg: mail.message,
|
|
72
|
+
num_left: queue.length,
|
|
73
|
+
};
|
|
74
|
+
for (const s of ctx.prim.scripts)
|
|
75
|
+
ctx.state.clock.scheduleOn(s, ctx.state.clock.now, 'email', payload);
|
|
76
|
+
return undefined;
|
|
77
|
+
};
|
|
78
|
+
function objectFor(ctx, address) {
|
|
79
|
+
const at = address.lastIndexOf('@');
|
|
80
|
+
if (at < 0 || address.slice(at + 1).toLowerCase() !== OBJECT_EMAIL_DOMAIN)
|
|
81
|
+
return undefined;
|
|
82
|
+
const key = address.slice(0, at).toLowerCase();
|
|
83
|
+
const linksets = ctx.linkset.world?.linksets ?? [ctx.linkset];
|
|
84
|
+
for (const l of linksets)
|
|
85
|
+
for (const p of l.prims)
|
|
86
|
+
if (p.key.toLowerCase() === key)
|
|
87
|
+
return p;
|
|
88
|
+
return undefined;
|
|
89
|
+
}
|
|
90
|
+
/** The lines Second Life puts in front of mail from an object, whole metres and region corner. */
|
|
91
|
+
function header(ctx) {
|
|
92
|
+
const name = llGetRegionName(ctx, []);
|
|
93
|
+
const corner = llGetRegionCorner(ctx, []);
|
|
94
|
+
const p = ctx.prim.regionPosition();
|
|
95
|
+
return (`Object-Name: ${ctx.prim.name}\n` +
|
|
96
|
+
`Region: ${name} (${corner.x}, ${corner.y})\n` +
|
|
97
|
+
`Local-Position: (${Math.trunc(p.x)}, ${Math.trunc(p.y)}, ${Math.trunc(p.z)})\n\n`);
|
|
98
|
+
}
|
|
99
|
+
function asciiOnly(text) {
|
|
100
|
+
let out = '';
|
|
101
|
+
for (const ch of text)
|
|
102
|
+
out += ch.codePointAt(0) > 127 ? '?' : ch;
|
|
103
|
+
return out;
|
|
104
|
+
}
|
|
105
|
+
function enqueue(prim, mail) {
|
|
106
|
+
const queue = emailQueue(prim);
|
|
107
|
+
if (queue.length >= MAX_QUEUED_EMAILS)
|
|
108
|
+
return false;
|
|
109
|
+
queue.push(mail);
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
112
|
+
/** Queue a test's mail on the script's prim; false when the queue is full. */
|
|
113
|
+
export function deliverEmail(script, init) {
|
|
114
|
+
return enqueue(script.host, {
|
|
115
|
+
time: init.time ?? Math.floor(script.clockView.unixMicros() / 1e6),
|
|
116
|
+
address: init.from,
|
|
117
|
+
subject: init.subject ?? '',
|
|
118
|
+
message: init.message ?? '',
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=email.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email.js","sourceRoot":"","sources":["../../src/builtins/email.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAEhE,sEAAsE;AACtE,MAAM,CAAC,MAAM,mBAAmB,GAAG,oBAAoB,CAAA;AAuCvD,oEAAoE;AACpE,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAA;AAEpC,MAAM,MAAM,GAAG,IAAI,OAAO,EAAyB,CAAA;AAEnD,+CAA+C;AAC/C,MAAM,UAAU,UAAU,CAAC,IAAU;I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,OAAO,IAAI,EAAE;QAC3B,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,EAAE;KAC5B,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { BuiltinImpl } from '../runtime.js';
|
|
2
|
+
/** llGetRegionDayLength() */
|
|
3
|
+
export declare const llGetRegionDayLength: BuiltinImpl;
|
|
4
|
+
/** llGetRegionDayOffset() */
|
|
5
|
+
export declare const llGetRegionDayOffset: BuiltinImpl;
|
|
6
|
+
/** llGetRegionTimeOfDay() — seconds into the region's day cycle: Unix time plus the offset, modulo the length. */
|
|
7
|
+
export declare const llGetRegionTimeOfDay: BuiltinImpl;
|
|
8
|
+
/** llGetRegionSunRotation() */
|
|
9
|
+
export declare const llGetRegionSunRotation: BuiltinImpl;
|
|
10
|
+
/** llGetRegionSunDirection() — the sun's rotation applied to <1, 0, 0>. */
|
|
11
|
+
export declare const llGetRegionSunDirection: BuiltinImpl;
|
|
12
|
+
/** llGetRegionMoonRotation() */
|
|
13
|
+
export declare const llGetRegionMoonRotation: BuiltinImpl;
|
|
14
|
+
/** llGetRegionMoonDirection() — the moon's rotation applied to <1, 0, 0>. */
|
|
15
|
+
export declare const llGetRegionMoonDirection: BuiltinImpl;
|
|
16
|
+
export declare const llGetDayLength: BuiltinImpl;
|
|
17
|
+
export declare const llGetDayOffset: BuiltinImpl;
|
|
18
|
+
export declare const llGetTimeOfDay: BuiltinImpl;
|
|
19
|
+
export declare const llGetSunRotation: BuiltinImpl;
|
|
20
|
+
export declare const llGetSunDirection: BuiltinImpl;
|
|
21
|
+
export declare const llGetMoonRotation: BuiltinImpl;
|
|
22
|
+
export declare const llGetMoonDirection: BuiltinImpl;
|
|
23
|
+
/** llGetEnvironment(vector pos, list params). Parcels share the region environment. */
|
|
24
|
+
export declare const llGetEnvironment: BuiltinImpl;
|
|
25
|
+
export declare const llSetEnvironment: BuiltinImpl;
|
|
26
|
+
export declare const llReplaceEnvironment: BuiltinImpl;
|
|
27
|
+
//# sourceMappingURL=environment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../src/builtins/environment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAe,MAAM,eAAe,CAAA;AAyB7D,6BAA6B;AAC7B,eAAO,MAAM,oBAAoB,EAAE,WAA+C,CAAA;AAElF,6BAA6B;AAC7B,eAAO,MAAM,oBAAoB,EAAE,WAA+C,CAAA;AAElF,kHAAkH;AAClH,eAAO,MAAM,oBAAoB,EAAE,WAAoE,CAAA;AAkBvG,+BAA+B;AAC/B,eAAO,MAAM,sBAAsB,EAAE,WAA+B,CAAA;AAEpE,2EAA2E;AAC3E,eAAO,MAAM,uBAAuB,EAAE,WAAqD,CAAA;AAE3F,gCAAgC;AAChC,eAAO,MAAM,uBAAuB,EAAE,WAAgC,CAAA;AAEtE,6EAA6E;AAC7E,eAAO,MAAM,wBAAwB,EAAE,WAAsD,CAAA;AAG7F,eAAO,MAAM,cAAc,aAAuB,CAAA;AAClD,eAAO,MAAM,cAAc,aAAuB,CAAA;AAClD,eAAO,MAAM,cAAc,aAAuB,CAAA;AAClD,eAAO,MAAM,gBAAgB,aAAyB,CAAA;AACtD,eAAO,MAAM,iBAAiB,aAA0B,CAAA;AACxD,eAAO,MAAM,iBAAiB,aAA0B,CAAA;AACxD,eAAO,MAAM,kBAAkB,aAA2B,CAAA;AAgD1D,uFAAuF;AACvF,eAAO,MAAM,gBAAgB,EAAE,WAsB9B,CAAA;AAID,eAAO,MAAM,gBAAgB,EAAE,WAAsC,CAAA;AACrE,eAAO,MAAM,oBAAoB,EAAE,WAAsC,CAAA"}
|