hytopia 0.5.20 → 0.5.22-dev1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hytopia",
3
- "version": "0.5.20",
3
+ "version": "0.5.22-dev1",
4
4
  "description": "The HYTOPIA SDK makes it easy for developers to create massively multiplayer games using JavaScript or TypeScript.",
5
5
  "type": "module",
6
6
  "main": "./node-server.mjs",
package/server.api.json CHANGED
@@ -39440,7 +39440,7 @@
39440
39440
  {
39441
39441
  "kind": "Function",
39442
39442
  "canonicalReference": "server!startServer:function(1)",
39443
- "docComment": "/**\n * The entry point for running game setup and starting the game server.\n *\n * @remarks\n *\n * This function should always be called first when initializing your game. It will internally handle initialization of the physics engine and other systems required systems. All of your game setup logic should be executed in the init function.\n *\n * @param init - A function that initializes the world.\n *\n * @public\n */\n",
39443
+ "docComment": "/**\n * The entry point for running game setup and starting the game server.\n *\n * @remarks\n *\n * This function should always be called first when initializing your game. It will internally handle initialization of the physics engine and other systems required systems. All of your game setup logic should be executed in the init function.\n *\n * @param init - A function that initializes the game. The function can take no parameters to just initialize game logic, or it can accept a world parameter. If it accepts a world parameter, a default world will be automatically created and passed to the function.\n *\n * @public\n */\n",
39444
39444
  "excerptTokens": [
39445
39445
  {
39446
39446
  "kind": "Content",
@@ -39448,7 +39448,7 @@
39448
39448
  },
39449
39449
  {
39450
39450
  "kind": "Content",
39451
- "text": "(world: "
39451
+ "text": "((() => void) | ((world: "
39452
39452
  },
39453
39453
  {
39454
39454
  "kind": "Reference",
@@ -39457,7 +39457,7 @@
39457
39457
  },
39458
39458
  {
39459
39459
  "kind": "Content",
39460
- "text": ") => void"
39460
+ "text": ") => void))"
39461
39461
  },
39462
39462
  {
39463
39463
  "kind": "Content",
@@ -44447,6 +44447,54 @@
44447
44447
  "isAbstract": false,
44448
44448
  "name": "setDirectionalLightPosition"
44449
44449
  },
44450
+ {
44451
+ "kind": "Method",
44452
+ "canonicalReference": "server!World#setSkyboxIntensity:member(1)",
44453
+ "docComment": "/**\n * Sets the intensity of the world's skybox brightness.\n *\n * @param intensity - The intensity.\n */\n",
44454
+ "excerptTokens": [
44455
+ {
44456
+ "kind": "Content",
44457
+ "text": "setSkyboxIntensity(intensity: "
44458
+ },
44459
+ {
44460
+ "kind": "Content",
44461
+ "text": "number"
44462
+ },
44463
+ {
44464
+ "kind": "Content",
44465
+ "text": "): "
44466
+ },
44467
+ {
44468
+ "kind": "Content",
44469
+ "text": "void"
44470
+ },
44471
+ {
44472
+ "kind": "Content",
44473
+ "text": ";"
44474
+ }
44475
+ ],
44476
+ "isStatic": false,
44477
+ "returnTypeTokenRange": {
44478
+ "startIndex": 3,
44479
+ "endIndex": 4
44480
+ },
44481
+ "releaseTag": "Public",
44482
+ "isProtected": false,
44483
+ "overloadIndex": 1,
44484
+ "parameters": [
44485
+ {
44486
+ "parameterName": "intensity",
44487
+ "parameterTypeTokenRange": {
44488
+ "startIndex": 1,
44489
+ "endIndex": 2
44490
+ },
44491
+ "isOptional": false
44492
+ }
44493
+ ],
44494
+ "isOptional": false,
44495
+ "isAbstract": false,
44496
+ "name": "setSkyboxIntensity"
44497
+ },
44450
44498
  {
44451
44499
  "kind": "Property",
44452
44500
  "canonicalReference": "server!World#simulation:member",
@@ -44478,6 +44526,36 @@
44478
44526
  "isProtected": false,
44479
44527
  "isAbstract": false
44480
44528
  },
44529
+ {
44530
+ "kind": "Property",
44531
+ "canonicalReference": "server!World#skyboxIntensity:member",
44532
+ "docComment": "/**\n * The intensity of the world's skybox brightness.\n */\n",
44533
+ "excerptTokens": [
44534
+ {
44535
+ "kind": "Content",
44536
+ "text": "get skyboxIntensity(): "
44537
+ },
44538
+ {
44539
+ "kind": "Content",
44540
+ "text": "number"
44541
+ },
44542
+ {
44543
+ "kind": "Content",
44544
+ "text": ";"
44545
+ }
44546
+ ],
44547
+ "isReadonly": true,
44548
+ "isOptional": false,
44549
+ "releaseTag": "Public",
44550
+ "name": "skyboxIntensity",
44551
+ "propertyTypeTokenRange": {
44552
+ "startIndex": 1,
44553
+ "endIndex": 2
44554
+ },
44555
+ "isStatic": false,
44556
+ "isProtected": false,
44557
+ "isAbstract": false
44558
+ },
44481
44559
  {
44482
44560
  "kind": "Property",
44483
44561
  "canonicalReference": "server!World#skyboxUri:member",
@@ -44732,6 +44810,27 @@
44732
44810
  "releaseTag": "Public",
44733
44811
  "name": "SET_DIRECTIONAL_LIGHT_POSITION"
44734
44812
  },
44813
+ {
44814
+ "kind": "EnumMember",
44815
+ "canonicalReference": "server!WorldEvent.SET_SKYBOX_INTENSITY:member",
44816
+ "docComment": "",
44817
+ "excerptTokens": [
44818
+ {
44819
+ "kind": "Content",
44820
+ "text": "SET_SKYBOX_INTENSITY = "
44821
+ },
44822
+ {
44823
+ "kind": "Content",
44824
+ "text": "\"WORLD.SET_SKYBOX_INTENSITY\""
44825
+ }
44826
+ ],
44827
+ "initializerTokenRange": {
44828
+ "startIndex": 1,
44829
+ "endIndex": 2
44830
+ },
44831
+ "releaseTag": "Public",
44832
+ "name": "SET_SKYBOX_INTENSITY"
44833
+ },
44735
44834
  {
44736
44835
  "kind": "EnumMember",
44737
44836
  "canonicalReference": "server!WorldEvent.START:member",
@@ -45043,6 +45142,51 @@
45043
45142
  "endIndex": 8
45044
45143
  }
45045
45144
  },
45145
+ {
45146
+ "kind": "PropertySignature",
45147
+ "canonicalReference": "server!WorldEventPayloads#\"WORLD.SET_SKYBOX_INTENSITY\":member",
45148
+ "docComment": "/**\n * Emitted when the intensity of the world's skybox brightness is set.\n */\n",
45149
+ "excerptTokens": [
45150
+ {
45151
+ "kind": "Content",
45152
+ "text": "["
45153
+ },
45154
+ {
45155
+ "kind": "Reference",
45156
+ "text": "WorldEvent.SET_SKYBOX_INTENSITY",
45157
+ "canonicalReference": "server!WorldEvent.SET_SKYBOX_INTENSITY:member"
45158
+ },
45159
+ {
45160
+ "kind": "Content",
45161
+ "text": "]: "
45162
+ },
45163
+ {
45164
+ "kind": "Content",
45165
+ "text": "{\n world: "
45166
+ },
45167
+ {
45168
+ "kind": "Reference",
45169
+ "text": "World",
45170
+ "canonicalReference": "server!World:class"
45171
+ },
45172
+ {
45173
+ "kind": "Content",
45174
+ "text": ";\n intensity: number;\n }"
45175
+ },
45176
+ {
45177
+ "kind": "Content",
45178
+ "text": ";"
45179
+ }
45180
+ ],
45181
+ "isReadonly": false,
45182
+ "isOptional": false,
45183
+ "releaseTag": "Public",
45184
+ "name": "\"WORLD.SET_SKYBOX_INTENSITY\"",
45185
+ "propertyTypeTokenRange": {
45186
+ "startIndex": 3,
45187
+ "endIndex": 6
45188
+ }
45189
+ },
45046
45190
  {
45047
45191
  "kind": "PropertySignature",
45048
45192
  "canonicalReference": "server!WorldEventPayloads#\"WORLD.START\":member",
@@ -45946,6 +46090,55 @@
45946
46090
  "isStatic": true,
45947
46091
  "isProtected": false,
45948
46092
  "isAbstract": false
46093
+ },
46094
+ {
46095
+ "kind": "Method",
46096
+ "canonicalReference": "server!WorldManager#setDefaultWorld:member(1)",
46097
+ "docComment": "/**\n * Sets the default world. This is the world players automatically join when they connect to the game.\n *\n * @param world - The world to set as the default.\n */\n",
46098
+ "excerptTokens": [
46099
+ {
46100
+ "kind": "Content",
46101
+ "text": "setDefaultWorld(world: "
46102
+ },
46103
+ {
46104
+ "kind": "Reference",
46105
+ "text": "World",
46106
+ "canonicalReference": "server!World:class"
46107
+ },
46108
+ {
46109
+ "kind": "Content",
46110
+ "text": "): "
46111
+ },
46112
+ {
46113
+ "kind": "Content",
46114
+ "text": "void"
46115
+ },
46116
+ {
46117
+ "kind": "Content",
46118
+ "text": ";"
46119
+ }
46120
+ ],
46121
+ "isStatic": false,
46122
+ "returnTypeTokenRange": {
46123
+ "startIndex": 3,
46124
+ "endIndex": 4
46125
+ },
46126
+ "releaseTag": "Public",
46127
+ "isProtected": false,
46128
+ "overloadIndex": 1,
46129
+ "parameters": [
46130
+ {
46131
+ "parameterName": "world",
46132
+ "parameterTypeTokenRange": {
46133
+ "startIndex": 1,
46134
+ "endIndex": 2
46135
+ },
46136
+ "isOptional": false
46137
+ }
46138
+ ],
46139
+ "isOptional": false,
46140
+ "isAbstract": false,
46141
+ "name": "setDefaultWorld"
45949
46142
  }
45950
46143
  ],
45951
46144
  "implementsTokenRanges": []
@@ -46408,6 +46601,34 @@
46408
46601
  "endIndex": 2
46409
46602
  }
46410
46603
  },
46604
+ {
46605
+ "kind": "PropertySignature",
46606
+ "canonicalReference": "server!WorldOptions#map:member",
46607
+ "docComment": "/**\n * The map of the world.\n */\n",
46608
+ "excerptTokens": [
46609
+ {
46610
+ "kind": "Content",
46611
+ "text": "map?: "
46612
+ },
46613
+ {
46614
+ "kind": "Reference",
46615
+ "text": "WorldMap",
46616
+ "canonicalReference": "server!WorldMap:interface"
46617
+ },
46618
+ {
46619
+ "kind": "Content",
46620
+ "text": ";"
46621
+ }
46622
+ ],
46623
+ "isReadonly": false,
46624
+ "isOptional": true,
46625
+ "releaseTag": "Public",
46626
+ "name": "map",
46627
+ "propertyTypeTokenRange": {
46628
+ "startIndex": 1,
46629
+ "endIndex": 2
46630
+ }
46631
+ },
46411
46632
  {
46412
46633
  "kind": "PropertySignature",
46413
46634
  "canonicalReference": "server!WorldOptions#name:member",
@@ -46435,6 +46656,33 @@
46435
46656
  "endIndex": 2
46436
46657
  }
46437
46658
  },
46659
+ {
46660
+ "kind": "PropertySignature",
46661
+ "canonicalReference": "server!WorldOptions#skyboxIntensity:member",
46662
+ "docComment": "/**\n * The intensity of the skybox brightness for the world. 0 is black, 1 is full brightness, 1+ is brighter.\n */\n",
46663
+ "excerptTokens": [
46664
+ {
46665
+ "kind": "Content",
46666
+ "text": "skyboxIntensity?: "
46667
+ },
46668
+ {
46669
+ "kind": "Content",
46670
+ "text": "number"
46671
+ },
46672
+ {
46673
+ "kind": "Content",
46674
+ "text": ";"
46675
+ }
46676
+ ],
46677
+ "isReadonly": false,
46678
+ "isOptional": true,
46679
+ "releaseTag": "Public",
46680
+ "name": "skyboxIntensity",
46681
+ "propertyTypeTokenRange": {
46682
+ "startIndex": 1,
46683
+ "endIndex": 2
46684
+ }
46685
+ },
46438
46686
  {
46439
46687
  "kind": "PropertySignature",
46440
46688
  "canonicalReference": "server!WorldOptions#skyboxUri:member",
package/server.d.ts CHANGED
@@ -5088,11 +5088,13 @@ export declare interface SpdMatrix3 extends SdpMatrix3 {
5088
5088
  * and other systems required systems. All of your game setup logic
5089
5089
  * should be executed in the init function.
5090
5090
  *
5091
- * @param init - A function that initializes the world.
5091
+ * @param init - A function that initializes the game. The function can take no parameters
5092
+ * to just initialize game logic, or it can accept a world parameter. If it accepts a world
5093
+ * parameter, a default world will be automatically created and passed to the function.
5092
5094
  *
5093
5095
  * @public
5094
5096
  */
5095
- export declare function startServer(init: (world: World) => void): void;
5097
+ export declare function startServer(init: ((() => void) | ((world: World) => void))): void;
5096
5098
 
5097
5099
  /** The input keys that are included in the PlayerInput. @public */
5098
5100
  export declare const SUPPORTED_INPUT_KEYS: readonly ["w", "a", "s", "d", "sp", "sh", "tb", "ml", "mr", "q", "e", "r", "f", "z", "x", "c", "v", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"];
@@ -5699,6 +5701,7 @@ export declare class World extends EventRouter implements protocol.Serializable
5699
5701
 
5700
5702
 
5701
5703
 
5704
+
5702
5705
  /**
5703
5706
  * @param options - The options for the world.
5704
5707
  */
@@ -5717,6 +5720,8 @@ export declare class World extends EventRouter implements protocol.Serializable
5717
5720
  get directionalLightPosition(): Vector3Like;
5718
5721
  /** The name of the world. */
5719
5722
  get name(): string;
5723
+ /** The intensity of the world's skybox brightness. */
5724
+ get skyboxIntensity(): number;
5720
5725
  /** The URI of the skybox cubemap for the world. */
5721
5726
  get skyboxUri(): string;
5722
5727
  /** The audio manager for the world. */
@@ -5770,6 +5775,11 @@ export declare class World extends EventRouter implements protocol.Serializable
5770
5775
  * @param position - The position in the world.
5771
5776
  */
5772
5777
  setDirectionalLightPosition(position: Vector3Like): void;
5778
+ /**
5779
+ * Sets the intensity of the world's skybox brightness.
5780
+ * @param intensity - The intensity.
5781
+ */
5782
+ setSkyboxIntensity(intensity: number): void;
5773
5783
  /**
5774
5784
  * Starts the world loop, which begins ticking physics, entities, etc.
5775
5785
  */
@@ -5788,6 +5798,7 @@ export declare enum WorldEvent {
5788
5798
  SET_DIRECTIONAL_LIGHT_COLOR = "WORLD.SET_DIRECTIONAL_LIGHT_COLOR",
5789
5799
  SET_DIRECTIONAL_LIGHT_INTENSITY = "WORLD.SET_DIRECTIONAL_LIGHT_INTENSITY",
5790
5800
  SET_DIRECTIONAL_LIGHT_POSITION = "WORLD.SET_DIRECTIONAL_LIGHT_POSITION",
5801
+ SET_SKYBOX_INTENSITY = "WORLD.SET_SKYBOX_INTENSITY",
5791
5802
  START = "WORLD.START",
5792
5803
  STOP = "WORLD.STOP"
5793
5804
  }
@@ -5819,6 +5830,11 @@ export declare interface WorldEventPayloads {
5819
5830
  world: World;
5820
5831
  position: Vector3Like;
5821
5832
  };
5833
+ /** Emitted when the intensity of the world's skybox brightness is set. */
5834
+ [WorldEvent.SET_SKYBOX_INTENSITY]: {
5835
+ world: World;
5836
+ intensity: number;
5837
+ };
5822
5838
  /** Emitted when the world starts. */
5823
5839
  [WorldEvent.START]: {
5824
5840
  world: World;
@@ -5943,6 +5959,7 @@ export declare class WorldManager {
5943
5959
  static readonly instance: WorldManager;
5944
5960
 
5945
5961
 
5962
+
5946
5963
  /**
5947
5964
  * Creates a new world.
5948
5965
  * @param options - The options for the world.
@@ -5972,6 +5989,12 @@ export declare class WorldManager {
5972
5989
  * @returns The world with the provided id, or undefined if no world is found.
5973
5990
  */
5974
5991
  getWorld(id: number): World | undefined;
5992
+ /**
5993
+ * Sets the default world. This is the world players
5994
+ * automatically join when they connect to the game.
5995
+ * @param world - The world to set as the default.
5996
+ */
5997
+ setDefaultWorld(world: World): void;
5975
5998
  }
5976
5999
 
5977
6000
  /** Event types a WorldManager instance can emit to the global event router. See {@link WorldManagerEventPayloads} for the payloads. @public */
@@ -6021,8 +6044,12 @@ export declare interface WorldOptions {
6021
6044
  directionalLightIntensity?: number;
6022
6045
  /** The position the directional light originates from for the world. */
6023
6046
  directionalLightPosition?: Vector3Like;
6047
+ /** The map of the world. */
6048
+ map?: WorldMap;
6024
6049
  /** The name of the world. */
6025
6050
  name: string;
6051
+ /** The intensity of the skybox brightness for the world. 0 is black, 1 is full brightness, 1+ is brighter. */
6052
+ skyboxIntensity?: number;
6026
6053
  /** The URI of the skybox cubemap for the world. */
6027
6054
  skyboxUri: string;
6028
6055
  /** An arbitrary identifier tag of the world. Useful for your own logic */