hytopia 0.2.7 → 0.2.9

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.
@@ -68,5 +68,24 @@ string
68
68
  </td><td>
69
69
 
70
70
 
71
+ </td></tr>
72
+ <tr><td>
73
+
74
+ [playerId?](./server.chateventpayload.sendbroadcastmessage.playerid.md)
75
+
76
+
77
+ </td><td>
78
+
79
+
80
+ </td><td>
81
+
82
+ string
83
+
84
+
85
+ </td><td>
86
+
87
+ _(Optional)_
88
+
89
+
71
90
  </td></tr>
72
91
  </tbody></table>
@@ -0,0 +1,11 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [server](./server.md) &gt; [ChatEventPayload](./server.chateventpayload.md) &gt; [SendBroadcastMessage](./server.chateventpayload.sendbroadcastmessage.md) &gt; [playerId](./server.chateventpayload.sendbroadcastmessage.playerid.md)
4
+
5
+ ## ChatEventPayload.SendBroadcastMessage.playerId property
6
+
7
+ **Signature:**
8
+
9
+ ```typescript
10
+ playerId?: string;
11
+ ```
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [server](./server.md) &gt; [ColliderOptions](./server.collideroptions.md) &gt; [flags](./server.collideroptions.flags.md)
4
+
5
+ ## ColliderOptions.flags property
6
+
7
+ The flags of the collider if the shape is a trimesh
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ flags?: number;
13
+ ```
@@ -129,6 +129,25 @@ boolean
129
129
  _(Optional)_ Whether the collider is enabled.
130
130
 
131
131
 
132
+ </td></tr>
133
+ <tr><td>
134
+
135
+ [flags?](./server.collideroptions.flags.md)
136
+
137
+
138
+ </td><td>
139
+
140
+
141
+ </td><td>
142
+
143
+ number
144
+
145
+
146
+ </td><td>
147
+
148
+ _(Optional)_ The flags of the collider if the shape is a trimesh
149
+
150
+
132
151
  </td></tr>
133
152
  <tr><td>
134
153
 
@@ -9,8 +9,9 @@ A player in the game.
9
9
  **Signature:**
10
10
 
11
11
  ```typescript
12
- export default class Player
12
+ export default class Player implements protocol.Serializable
13
13
  ```
14
+ **Implements:** protocol.Serializable
14
15
 
15
16
  ## Remarks
16
17
 
@@ -167,7 +167,7 @@ function addPlayerEntityToQueue(world: World, playerEntity: PlayerEntity) {
167
167
  world.chatManager.sendPlayerMessage(playerEntity.player, 'You have joined the next game queue!', '00FF00');
168
168
  uiUpdate({ queueCount: QUEUED_PLAYER_ENTITIES.size });
169
169
 
170
- if (gameState === 'awaitingPlayers' && QUEUED_PLAYER_ENTITIES.size > 1) {
170
+ if (gameState === 'awaitingPlayers' && QUEUED_PLAYER_ENTITIES.size > 0) {
171
171
  queueGame(world);
172
172
  }
173
173
 
@@ -270,7 +270,7 @@ function killPlayer(playerEntity: PlayerEntity) {
270
270
  playerEntity.setPosition(GAME_CONFIG.POSITIONS.PLAYER_SPAWN);
271
271
  GAME_PLAYER_ENTITIES.delete(playerEntity);
272
272
 
273
- if (GAME_PLAYER_ENTITIES.size <= 1) {
273
+ if (GAME_PLAYER_ENTITIES.size <= 0) {
274
274
  endGame();
275
275
  }
276
276
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hytopia",
3
- "version": "0.2.7",
3
+ "version": "0.2.9",
4
4
  "description": "The HYTOPIA SDK makes it easy for developers to create massively multiplayer games using JavaScript or TypeScript.",
5
5
  "main": "server.js",
6
6
  "bin": {
package/server.api.json CHANGED
@@ -4485,6 +4485,33 @@
4485
4485
  "startIndex": 1,
4486
4486
  "endIndex": 2
4487
4487
  }
4488
+ },
4489
+ {
4490
+ "kind": "PropertySignature",
4491
+ "canonicalReference": "server!ChatEventPayload.SendBroadcastMessage#playerId:member",
4492
+ "docComment": "",
4493
+ "excerptTokens": [
4494
+ {
4495
+ "kind": "Content",
4496
+ "text": "playerId?: "
4497
+ },
4498
+ {
4499
+ "kind": "Content",
4500
+ "text": "string"
4501
+ },
4502
+ {
4503
+ "kind": "Content",
4504
+ "text": ";"
4505
+ }
4506
+ ],
4507
+ "isReadonly": false,
4508
+ "isOptional": true,
4509
+ "releaseTag": "Public",
4510
+ "name": "playerId",
4511
+ "propertyTypeTokenRange": {
4512
+ "startIndex": 1,
4513
+ "endIndex": 2
4514
+ }
4488
4515
  }
4489
4516
  ],
4490
4517
  "extendsTokenRanges": []
@@ -8033,6 +8060,33 @@
8033
8060
  "endIndex": 2
8034
8061
  }
8035
8062
  },
8063
+ {
8064
+ "kind": "PropertySignature",
8065
+ "canonicalReference": "server!ColliderOptions#flags:member",
8066
+ "docComment": "/**\n * The flags of the collider if the shape is a trimesh\n */\n",
8067
+ "excerptTokens": [
8068
+ {
8069
+ "kind": "Content",
8070
+ "text": "flags?: "
8071
+ },
8072
+ {
8073
+ "kind": "Content",
8074
+ "text": "number"
8075
+ },
8076
+ {
8077
+ "kind": "Content",
8078
+ "text": ";"
8079
+ }
8080
+ ],
8081
+ "isReadonly": false,
8082
+ "isOptional": true,
8083
+ "releaseTag": "Public",
8084
+ "name": "flags",
8085
+ "propertyTypeTokenRange": {
8086
+ "startIndex": 1,
8087
+ "endIndex": 2
8088
+ }
8089
+ },
8036
8090
  {
8037
8091
  "kind": "PropertySignature",
8038
8092
  "canonicalReference": "server!ColliderOptions#friction:member",
@@ -22584,7 +22638,16 @@
22584
22638
  "excerptTokens": [
22585
22639
  {
22586
22640
  "kind": "Content",
22587
- "text": "export default class Player "
22641
+ "text": "export default class Player implements "
22642
+ },
22643
+ {
22644
+ "kind": "Reference",
22645
+ "text": "protocol.Serializable",
22646
+ "canonicalReference": "@hytopia.com/server-protocol!Serializable:interface"
22647
+ },
22648
+ {
22649
+ "kind": "Content",
22650
+ "text": " "
22588
22651
  }
22589
22652
  ],
22590
22653
  "fileUrlPath": "src/players/Player.ts",
@@ -22923,7 +22986,12 @@
22923
22986
  "isAbstract": false
22924
22987
  }
22925
22988
  ],
22926
- "implementsTokenRanges": []
22989
+ "implementsTokenRanges": [
22990
+ {
22991
+ "startIndex": 1,
22992
+ "endIndex": 2
22993
+ }
22994
+ ]
22927
22995
  },
22928
22996
  {
22929
22997
  "kind": "Class",
package/server.d.ts CHANGED
@@ -570,6 +570,7 @@ export declare namespace ChatEventPayload {
570
570
  export interface SendBroadcastMessage {
571
571
  message: string;
572
572
  color?: string;
573
+ playerId?: string;
573
574
  }
574
575
  export interface SendPlayerMessage {
575
576
  player: Player;
@@ -1054,6 +1055,8 @@ export declare interface ColliderOptions {
1054
1055
  collisionGroups?: CollisionGroups;
1055
1056
  /** Whether the collider is enabled. */
1056
1057
  enabled?: boolean;
1058
+ /** The flags of the collider if the shape is a trimesh */
1059
+ flags?: number;
1057
1060
  /** The friction of the collider. */
1058
1061
  friction?: number;
1059
1062
  /** The friction combine rule of the collider. */
@@ -2920,7 +2923,7 @@ export declare type PathfindingOptions = {
2920
2923
  *
2921
2924
  * @public
2922
2925
  */
2923
- export declare class Player {
2926
+ export declare class Player implements protocol.Serializable {
2924
2927
  /** The unique HYTOPIA UUID for the player. */
2925
2928
  readonly id: string;
2926
2929
  /** The unique HYTOPIA username for the player. */
@@ -2963,6 +2966,7 @@ export declare class Player {
2963
2966
 
2964
2967
 
2965
2968
 
2969
+
2966
2970
  }
2967
2971
 
2968
2972
  /**