hytopia 0.1.72 → 0.1.74

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.
@@ -9,7 +9,7 @@ Emit an event, invoking all registered listeners for the event type.
9
9
  **Signature:**
10
10
 
11
11
  ```typescript
12
- emit<TPayload>(event: Event<TPayload>): boolean;
12
+ emit<TPayload>(eventType: string, payload: TPayload): boolean;
13
13
  ```
14
14
 
15
15
  ## Parameters
@@ -32,17 +32,33 @@ Description
32
32
  </th></tr></thead>
33
33
  <tbody><tr><td>
34
34
 
35
- event
35
+ eventType
36
36
 
37
37
 
38
38
  </td><td>
39
39
 
40
- [Event](./server.event_2.md)<!-- -->&lt;TPayload&gt;
40
+ string
41
41
 
42
42
 
43
43
  </td><td>
44
44
 
45
- The event to emit.
45
+ The type of event to emit.
46
+
47
+
48
+ </td></tr>
49
+ <tr><td>
50
+
51
+ payload
52
+
53
+
54
+ </td><td>
55
+
56
+ TPayload
57
+
58
+
59
+ </td><td>
60
+
61
+ The payload to emit.
46
62
 
47
63
 
48
64
  </td></tr>
@@ -213,7 +213,7 @@ Description
213
213
  </th></tr></thead>
214
214
  <tbody><tr><td>
215
215
 
216
- [emit(event)](./server.eventrouter.emit.md)
216
+ [emit(eventType, payload)](./server.eventrouter.emit.md)
217
217
 
218
218
 
219
219
  </td><td>
@@ -266,5 +266,47 @@ Remove all listeners for a specific event type.
266
266
  Register a listener for a specific event type.
267
267
 
268
268
 
269
+ </td></tr>
270
+ <tr><td>
271
+
272
+ [once(eventType, listener)](./server.eventrouter.once.md)
273
+
274
+
275
+ </td><td>
276
+
277
+
278
+ </td><td>
279
+
280
+ Register a listener for a specific event type that will be invoked once.
281
+
282
+
283
+ </td></tr>
284
+ <tr><td>
285
+
286
+ [prependOn(eventType, listener)](./server.eventrouter.prependon.md)
287
+
288
+
289
+ </td><td>
290
+
291
+
292
+ </td><td>
293
+
294
+ Register a listener for a specific event type that will be invoked before all other existing listeners.
295
+
296
+
297
+ </td></tr>
298
+ <tr><td>
299
+
300
+ [prependOnce(eventType, listener)](./server.eventrouter.prependonce.md)
301
+
302
+
303
+ </td><td>
304
+
305
+
306
+ </td><td>
307
+
308
+ Register a listener for a specific event type that will be invoked once before all other existing listeners.
309
+
310
+
269
311
  </td></tr>
270
312
  </tbody></table>
@@ -69,5 +69,5 @@ void
69
69
 
70
70
  ## Remarks
71
71
 
72
- When the same event router instance used to register a listener emits an event a listener was registered for, the listener will be invoked with the event payload. Listeners are called in the order they are registered.
72
+ Listeners are invoked in the order they are registered.
73
73
 
@@ -0,0 +1,69 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [server](./server.md) &gt; [EventRouter](./server.eventrouter.md) &gt; [once](./server.eventrouter.once.md)
4
+
5
+ ## EventRouter.once() method
6
+
7
+ Register a listener for a specific event type that will be invoked once.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ once<TPayload>(eventType: string, listener: (payload: TPayload) => void): void;
13
+ ```
14
+
15
+ ## Parameters
16
+
17
+ <table><thead><tr><th>
18
+
19
+ Parameter
20
+
21
+
22
+ </th><th>
23
+
24
+ Type
25
+
26
+
27
+ </th><th>
28
+
29
+ Description
30
+
31
+
32
+ </th></tr></thead>
33
+ <tbody><tr><td>
34
+
35
+ eventType
36
+
37
+
38
+ </td><td>
39
+
40
+ string
41
+
42
+
43
+ </td><td>
44
+
45
+ The type of event to listen for.
46
+
47
+
48
+ </td></tr>
49
+ <tr><td>
50
+
51
+ listener
52
+
53
+
54
+ </td><td>
55
+
56
+ (payload: TPayload) =&gt; void
57
+
58
+
59
+ </td><td>
60
+
61
+ The listener function to invoke when the event is emitted.
62
+
63
+
64
+ </td></tr>
65
+ </tbody></table>
66
+ **Returns:**
67
+
68
+ void
69
+
@@ -0,0 +1,69 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [server](./server.md) &gt; [EventRouter](./server.eventrouter.md) &gt; [prependOn](./server.eventrouter.prependon.md)
4
+
5
+ ## EventRouter.prependOn() method
6
+
7
+ Register a listener for a specific event type that will be invoked before all other existing listeners.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ prependOn<TPayload>(eventType: string, listener: (payload: TPayload) => void): void;
13
+ ```
14
+
15
+ ## Parameters
16
+
17
+ <table><thead><tr><th>
18
+
19
+ Parameter
20
+
21
+
22
+ </th><th>
23
+
24
+ Type
25
+
26
+
27
+ </th><th>
28
+
29
+ Description
30
+
31
+
32
+ </th></tr></thead>
33
+ <tbody><tr><td>
34
+
35
+ eventType
36
+
37
+
38
+ </td><td>
39
+
40
+ string
41
+
42
+
43
+ </td><td>
44
+
45
+ The type of event to listen for.
46
+
47
+
48
+ </td></tr>
49
+ <tr><td>
50
+
51
+ listener
52
+
53
+
54
+ </td><td>
55
+
56
+ (payload: TPayload) =&gt; void
57
+
58
+
59
+ </td><td>
60
+
61
+ The listener function to invoke when the event is emitted.
62
+
63
+
64
+ </td></tr>
65
+ </tbody></table>
66
+ **Returns:**
67
+
68
+ void
69
+
@@ -0,0 +1,69 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [server](./server.md) &gt; [EventRouter](./server.eventrouter.md) &gt; [prependOnce](./server.eventrouter.prependonce.md)
4
+
5
+ ## EventRouter.prependOnce() method
6
+
7
+ Register a listener for a specific event type that will be invoked once before all other existing listeners.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ prependOnce<TPayload>(eventType: string, listener: (payload: TPayload) => void): void;
13
+ ```
14
+
15
+ ## Parameters
16
+
17
+ <table><thead><tr><th>
18
+
19
+ Parameter
20
+
21
+
22
+ </th><th>
23
+
24
+ Type
25
+
26
+
27
+ </th><th>
28
+
29
+ Description
30
+
31
+
32
+ </th></tr></thead>
33
+ <tbody><tr><td>
34
+
35
+ eventType
36
+
37
+
38
+ </td><td>
39
+
40
+ string
41
+
42
+
43
+ </td><td>
44
+
45
+ The type of event to listen for.
46
+
47
+
48
+ </td></tr>
49
+ <tr><td>
50
+
51
+ listener
52
+
53
+
54
+ </td><td>
55
+
56
+ (payload: TPayload) =&gt; void
57
+
58
+
59
+ </td><td>
60
+
61
+ The listener function to invoke when the event is emitted.
62
+
63
+
64
+ </td></tr>
65
+ </tbody></table>
66
+ **Returns:**
67
+
68
+ void
69
+
package/docs/server.md CHANGED
@@ -681,17 +681,6 @@ Options for creating a Collider instance.
681
681
  Options for creating an Entity instance.
682
682
 
683
683
 
684
- </td></tr>
685
- <tr><td>
686
-
687
- [Event\_2](./server.event_2.md)
688
-
689
-
690
- </td><td>
691
-
692
- An EventRouter event.
693
-
694
-
695
684
  </td></tr>
696
685
  <tr><td>
697
686
 
@@ -9,5 +9,5 @@ The current [PlayerInput](./server.playerinput.md) of the player.
9
9
  **Signature:**
10
10
 
11
11
  ```typescript
12
- get input(): Readonly<PlayerInput>;
12
+ get input(): PlayerInput;
13
13
  ```
@@ -95,7 +95,7 @@ The unique identifier for the player.
95
95
 
96
96
  </td><td>
97
97
 
98
- Readonly&lt;[PlayerInput](./server.playerinput.md)<!-- -->&gt;
98
+ [PlayerInput](./server.playerinput.md)
99
99
 
100
100
 
101
101
  </td><td>
@@ -1,15 +1,15 @@
1
1
  <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
2
 
3
- [Home](./index.md) &gt; [server](./server.md) &gt; [RigidBody](./server.rigidbody.md) &gt; [createAndAddChildColliderToSimulation](./server.rigidbody.createandaddchildcollidertosimulation.md)
3
+ [Home](./index.md) &gt; [server](./server.md) &gt; [RigidBody](./server.rigidbody.md) &gt; [createAndAddChildCollider](./server.rigidbody.createandaddchildcollider.md)
4
4
 
5
- ## RigidBody.createAndAddChildColliderToSimulation() method
5
+ ## RigidBody.createAndAddChildCollider() method
6
6
 
7
7
  Creates and adds a child collider to the rigid body for the simulation it belongs to.
8
8
 
9
9
  **Signature:**
10
10
 
11
11
  ```typescript
12
- createAndAddChildColliderToSimulation(colliderOptions: ColliderOptions): Collider;
12
+ createAndAddChildCollider(colliderOptions: ColliderOptions): Collider;
13
13
  ```
14
14
 
15
15
  ## Parameters
@@ -53,3 +53,7 @@ The options for the child collider to add.
53
53
 
54
54
  The child collider that was added to the rigid body.
55
55
 
56
+ ## Remarks
57
+
58
+ If the rigid body is not simulated, the collider will be added to the rigid body as a pending child collider and also simulated when the rigid body is simulated.
59
+
@@ -1054,7 +1054,7 @@ Applies a torque impulse to the rigid body.
1054
1054
  </td></tr>
1055
1055
  <tr><td>
1056
1056
 
1057
- [createAndAddChildCollidersToSimulation(colliderOptions)](./server.rigidbody.createandaddchildcolliderstosimulation.md)
1057
+ [createAndAddChildCollider(colliderOptions)](./server.rigidbody.createandaddchildcollider.md)
1058
1058
 
1059
1059
 
1060
1060
  </td><td>
@@ -1062,13 +1062,13 @@ Applies a torque impulse to the rigid body.
1062
1062
 
1063
1063
  </td><td>
1064
1064
 
1065
- Creates and adds multiple child colliders to the rigid body for the simulation it belongs to.
1065
+ Creates and adds a child collider to the rigid body for the simulation it belongs to.
1066
1066
 
1067
1067
 
1068
1068
  </td></tr>
1069
1069
  <tr><td>
1070
1070
 
1071
- [createAndAddChildColliderToSimulation(colliderOptions)](./server.rigidbody.createandaddchildcollidertosimulation.md)
1071
+ [createAndAddChildCollidersToSimulation(colliderOptions)](./server.rigidbody.createandaddchildcolliderstosimulation.md)
1072
1072
 
1073
1073
 
1074
1074
  </td><td>
@@ -1076,7 +1076,7 @@ Creates and adds multiple child colliders to the rigid body for the simulation i
1076
1076
 
1077
1077
  </td><td>
1078
1078
 
1079
- Creates and adds a child collider to the rigid body for the simulation it belongs to.
1079
+ Creates and adds multiple child colliders to the rigid body for the simulation it belongs to.
1080
1080
 
1081
1081
 
1082
1082
  </td></tr>
@@ -135,7 +135,7 @@ export default class MyEntityController extends BaseEntityController {
135
135
  }
136
136
 
137
137
  // Ground sensor
138
- entity.createAndAddChildColliderToSimulation({
138
+ entity.createAndAddChildCollider({
139
139
  shape: ColliderShape.CYLINDER,
140
140
  radius: 0.23,
141
141
  halfHeight: 0.125,
@@ -169,7 +169,7 @@ export default class MyEntityController extends BaseEntityController {
169
169
 
170
170
 
171
171
  // Wall collider
172
- entity.createAndAddChildColliderToSimulation({
172
+ entity.createAndAddChildCollider({
173
173
  shape: ColliderShape.CAPSULE,
174
174
  halfHeight: 0.30,
175
175
  radius: 0.37,
@@ -107,7 +107,7 @@
107
107
  },
108
108
  {
109
109
  "id": 22,
110
- "name": "water_still",
110
+ "name": "water",
111
111
  "textureUri": "textures/water.png",
112
112
  "isLiquid": true
113
113
  }
@@ -8104,6 +8104,7 @@
8104
8104
  "1,27,-10": 14,
8105
8105
  "0,27,-10": 14,
8106
8106
  "0,28,-10": 14,
8107
- "1,28,-10": 14
8107
+ "1,28,-10": 14,
8108
+ "-5,31,-6": 6
8108
8109
  }
8109
8110
  }
@@ -63,11 +63,10 @@
63
63
  const countdownSeconds = data.countdown;
64
64
 
65
65
  const updateCountdown = () => {
66
- const now = Date.now();
67
- const timeLeft = Math.max(0, Math.ceil((gameCountdownStartTime + (countdownSeconds * 1000) - now) / 1000));
68
- updateGameStatus(`GAME STARTING IN ${timeLeft}...`);
69
-
70
66
  if (timeLeft > 0 && gameState === 'starting') {
67
+ const now = Date.now();
68
+ const timeLeft = Math.max(0, Math.ceil((gameCountdownStartTime + (countdownSeconds * 1000) - now) / 1000));
69
+ updateGameStatus(`GAME STARTING IN ${timeLeft}...`);
71
70
  setTimeout(updateCountdown, 1000);
72
71
  }
73
72
  };