hytopia 0.1.14 → 0.1.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. package/README.md +5 -10
  2. package/bin/scripts.js +12 -23
  3. package/boilerplate/assets/certs/README.md +11 -6
  4. package/boilerplate/assets/certs/localhost.crt +20 -0
  5. package/boilerplate/assets/certs/localhost.key +27 -0
  6. package/docs/server.hytopia.md +1 -1
  7. package/docs/server.hytopia.port.md +2 -2
  8. package/docs/server.hytopia.supported_input_keys.md +1 -1
  9. package/docs/server.md +1 -1
  10. package/docs/server.port.md +2 -2
  11. package/docs/server.supported_input_keys.md +1 -1
  12. package/examples/character-controller/MyCharacterController.ts +230 -0
  13. package/examples/character-controller/README.md +15 -0
  14. package/examples/character-controller/assets/audio/sfx/damage.wav +0 -0
  15. package/examples/character-controller/assets/audio/sfx/step.wav +0 -0
  16. package/examples/character-controller/assets/certs/README.md +11 -0
  17. package/examples/character-controller/assets/certs/localhost.crt +20 -0
  18. package/examples/character-controller/assets/certs/localhost.key +27 -0
  19. package/examples/character-controller/assets/cubemaps/skybox/+x.png +0 -0
  20. package/examples/character-controller/assets/cubemaps/skybox/+y.png +0 -0
  21. package/examples/character-controller/assets/cubemaps/skybox/+z.png +0 -0
  22. package/examples/character-controller/assets/cubemaps/skybox/-x.png +0 -0
  23. package/examples/character-controller/assets/cubemaps/skybox/-y.png +0 -0
  24. package/examples/character-controller/assets/cubemaps/skybox/-z.png +0 -0
  25. package/examples/character-controller/assets/map.json +2623 -0
  26. package/examples/character-controller/assets/models/player.gltf +1 -0
  27. package/examples/character-controller/assets/textures/bricks.png +0 -0
  28. package/examples/character-controller/assets/textures/clay.png +0 -0
  29. package/examples/character-controller/assets/textures/diamond_ore.png +0 -0
  30. package/examples/character-controller/assets/textures/dirt.png +0 -0
  31. package/examples/character-controller/assets/textures/dragons_stone.png +0 -0
  32. package/examples/character-controller/assets/textures/glass.png +0 -0
  33. package/examples/character-controller/assets/textures/grass/+x.png +0 -0
  34. package/examples/character-controller/assets/textures/grass/+y.png +0 -0
  35. package/examples/character-controller/assets/textures/grass/+z.png +0 -0
  36. package/examples/character-controller/assets/textures/grass/-x.png +0 -0
  37. package/examples/character-controller/assets/textures/grass/-y.png +0 -0
  38. package/examples/character-controller/assets/textures/grass/-z.png +0 -0
  39. package/examples/character-controller/assets/textures/grass.png +0 -0
  40. package/examples/character-controller/assets/textures/gravel.png +0 -0
  41. package/examples/character-controller/assets/textures/ice.png +0 -0
  42. package/examples/character-controller/assets/textures/infected_shadowrock.png +0 -0
  43. package/examples/character-controller/assets/textures/log_side.png +0 -0
  44. package/examples/character-controller/assets/textures/log_top.png +0 -0
  45. package/examples/character-controller/assets/textures/mossy_coblestone.png +0 -0
  46. package/examples/character-controller/assets/textures/nuit.png +0 -0
  47. package/examples/character-controller/assets/textures/oak_leaves.png +0 -0
  48. package/examples/character-controller/assets/textures/oak_planks.png +0 -0
  49. package/examples/character-controller/assets/textures/sand.png +0 -0
  50. package/examples/character-controller/assets/textures/shadowrock.png +0 -0
  51. package/examples/character-controller/assets/textures/stone.png +0 -0
  52. package/examples/character-controller/assets/textures/stone_bricks.png +0 -0
  53. package/examples/character-controller/assets/textures/void_sand.png +0 -0
  54. package/examples/character-controller/assets/textures/water_still.png +0 -0
  55. package/examples/character-controller/bun.lockb +0 -0
  56. package/examples/character-controller/index.ts +43 -0
  57. package/examples/character-controller/package.json +14 -0
  58. package/examples/character-controller/tsconfig.json +27 -0
  59. package/examples/entity-spawn/README.md +15 -0
  60. package/examples/entity-spawn/assets/certs/README.md +11 -0
  61. package/examples/entity-spawn/assets/certs/localhost.crt +20 -0
  62. package/examples/entity-spawn/assets/certs/localhost.key +27 -0
  63. package/examples/entity-spawn/assets/cubemaps/skybox/+x.png +0 -0
  64. package/examples/entity-spawn/assets/cubemaps/skybox/+y.png +0 -0
  65. package/examples/entity-spawn/assets/cubemaps/skybox/+z.png +0 -0
  66. package/examples/entity-spawn/assets/cubemaps/skybox/-x.png +0 -0
  67. package/examples/entity-spawn/assets/cubemaps/skybox/-y.png +0 -0
  68. package/examples/entity-spawn/assets/cubemaps/skybox/-z.png +0 -0
  69. package/examples/entity-spawn/assets/map.json +2623 -0
  70. package/examples/entity-spawn/assets/models/player.gltf +1 -0
  71. package/examples/entity-spawn/assets/models/spider.gltf +1 -0
  72. package/examples/entity-spawn/assets/textures/bricks.png +0 -0
  73. package/examples/entity-spawn/assets/textures/clay.png +0 -0
  74. package/examples/entity-spawn/assets/textures/diamond_ore.png +0 -0
  75. package/examples/entity-spawn/assets/textures/dirt.png +0 -0
  76. package/examples/entity-spawn/assets/textures/dragons_stone.png +0 -0
  77. package/examples/entity-spawn/assets/textures/glass.png +0 -0
  78. package/examples/entity-spawn/assets/textures/grass/+x.png +0 -0
  79. package/examples/entity-spawn/assets/textures/grass/+y.png +0 -0
  80. package/examples/entity-spawn/assets/textures/grass/+z.png +0 -0
  81. package/examples/entity-spawn/assets/textures/grass/-x.png +0 -0
  82. package/examples/entity-spawn/assets/textures/grass/-y.png +0 -0
  83. package/examples/entity-spawn/assets/textures/grass/-z.png +0 -0
  84. package/examples/entity-spawn/assets/textures/grass.png +0 -0
  85. package/examples/entity-spawn/assets/textures/gravel.png +0 -0
  86. package/examples/entity-spawn/assets/textures/ice.png +0 -0
  87. package/examples/entity-spawn/assets/textures/infected_shadowrock.png +0 -0
  88. package/examples/entity-spawn/assets/textures/log_side.png +0 -0
  89. package/examples/entity-spawn/assets/textures/log_top.png +0 -0
  90. package/examples/entity-spawn/assets/textures/mossy_coblestone.png +0 -0
  91. package/examples/entity-spawn/assets/textures/nuit.png +0 -0
  92. package/examples/entity-spawn/assets/textures/oak_leaves.png +0 -0
  93. package/examples/entity-spawn/assets/textures/oak_planks.png +0 -0
  94. package/examples/entity-spawn/assets/textures/sand.png +0 -0
  95. package/examples/entity-spawn/assets/textures/shadowrock.png +0 -0
  96. package/examples/entity-spawn/assets/textures/stone.png +0 -0
  97. package/examples/entity-spawn/assets/textures/stone_bricks.png +0 -0
  98. package/examples/entity-spawn/assets/textures/void_sand.png +0 -0
  99. package/examples/entity-spawn/assets/textures/water_still.png +0 -0
  100. package/examples/entity-spawn/bun.lockb +0 -0
  101. package/examples/entity-spawn/index.ts +93 -0
  102. package/examples/entity-spawn/package.json +14 -0
  103. package/examples/entity-spawn/tsconfig.json +27 -0
  104. package/examples/payload-game/README.md +15 -0
  105. package/examples/payload-game/assets/certs/README.md +11 -0
  106. package/examples/payload-game/assets/certs/localhost.crt +20 -0
  107. package/examples/payload-game/assets/certs/localhost.key +27 -0
  108. package/examples/payload-game/bun.lockb +0 -0
  109. package/examples/payload-game/index.ts +12 -3
  110. package/examples/payload-game/package.json +14 -0
  111. package/examples/payload-game/tsconfig.json +27 -0
  112. package/package.json +2 -5
  113. package/server.api.json +6 -6
  114. package/server.d.ts +10 -3
  115. package/server.js +1 -1
  116. package/tsconfig.json +1 -4
@@ -0,0 +1,27 @@
1
+ {
2
+ "compilerOptions": {
3
+ // Enable latest features
4
+ "lib": ["ESNext", "DOM"],
5
+ "target": "ESNext",
6
+ "module": "ESNext",
7
+ "moduleDetection": "force",
8
+ "jsx": "react-jsx",
9
+ "allowJs": true,
10
+
11
+ // Bundler mode
12
+ "moduleResolution": "bundler",
13
+ "allowImportingTsExtensions": true,
14
+ "verbatimModuleSyntax": true,
15
+ "noEmit": true,
16
+
17
+ // Best practices
18
+ "strict": true,
19
+ "skipLibCheck": true,
20
+ "noFallthroughCasesInSwitch": true,
21
+
22
+ // Some stricter flags (disabled by default)
23
+ "noUnusedLocals": false,
24
+ "noUnusedParameters": false,
25
+ "noPropertyAccessFromIndexSignature": false
26
+ }
27
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hytopia",
3
- "version": "0.1.14",
3
+ "version": "0.1.16",
4
4
  "description": "The HYTOPIA SDK makes it easy for developers to create multiplayer games on the HYTOPIA platform using JavaScript or TypeScript.",
5
5
  "main": "server.js",
6
6
  "bin": {
@@ -46,8 +46,5 @@
46
46
  "bugs": {
47
47
  "url": "https://github.com/hytopiagg/sdk/issues"
48
48
  },
49
- "homepage": "https://github.com/hytopiagg/sdk#readme",
50
- "dependencies": {
51
- "mkcert": "^3.2.0"
52
- }
49
+ "homepage": "https://github.com/hytopiagg/sdk#readme"
53
50
  }
package/server.api.json CHANGED
@@ -24001,7 +24001,7 @@
24001
24001
  {
24002
24002
  "kind": "Variable",
24003
24003
  "canonicalReference": "server!HYTOPIA.PORT:var",
24004
- "docComment": "/**\n * The port the server will listen on. You can override this in your .env by setting PORT.\n */\n",
24004
+ "docComment": "/**\n * The port the server will run on. You can override this in your .env by setting PORT. When deployed in production to HYTOPIA servers, any .env value will be ignored and 8080 will be used.\n *\n * @public\n */\n",
24005
24005
  "excerptTokens": [
24006
24006
  {
24007
24007
  "kind": "Content",
@@ -24009,7 +24009,7 @@
24009
24009
  },
24010
24010
  {
24011
24011
  "kind": "Content",
24012
- "text": "string | number"
24012
+ "text": "string | 8080"
24013
24013
  }
24014
24014
  ],
24015
24015
  "fileUrlPath": "src/networking/WebServer.ts",
@@ -28468,7 +28468,7 @@
28468
28468
  },
28469
28469
  {
28470
28470
  "kind": "Content",
28471
- "text": "string[]"
28471
+ "text": "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\"]"
28472
28472
  }
28473
28473
  ],
28474
28474
  "fileUrlPath": "src/networking/players/Player.ts",
@@ -30825,7 +30825,7 @@
30825
30825
  {
30826
30826
  "kind": "Variable",
30827
30827
  "canonicalReference": "server!PORT:var",
30828
- "docComment": "/**\n * The port the server will listen on. You can override this in your .env by setting PORT.\n */\n",
30828
+ "docComment": "/**\n * The port the server will run on. You can override this in your .env by setting PORT. When deployed in production to HYTOPIA servers, any .env value will be ignored and 8080 will be used.\n *\n * @public\n */\n",
30829
30829
  "excerptTokens": [
30830
30830
  {
30831
30831
  "kind": "Content",
@@ -30833,7 +30833,7 @@
30833
30833
  },
30834
30834
  {
30835
30835
  "kind": "Content",
30836
- "text": "string | number"
30836
+ "text": "string | 8080"
30837
30837
  }
30838
30838
  ],
30839
30839
  "fileUrlPath": "src/networking/WebServer.ts",
@@ -35292,7 +35292,7 @@
35292
35292
  },
35293
35293
  {
35294
35294
  "kind": "Content",
35295
- "text": "string[]"
35295
+ "text": "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\"]"
35296
35296
  }
35297
35297
  ],
35298
35298
  "fileUrlPath": "src/networking/players/Player.ts",
package/server.d.ts CHANGED
@@ -1801,8 +1801,15 @@ export declare type PlayerOrientationState = {
1801
1801
  yaw: number;
1802
1802
  };
1803
1803
 
1804
- /** The port the server will listen on. You can override this in your .env by setting PORT. */
1805
- export declare const PORT: string | number;
1804
+ /**
1805
+ * The port the server will run on. You can override
1806
+ * this in your .env by setting PORT. When deployed in
1807
+ * production to HYTOPIA servers, any .env value will
1808
+ * be ignored and 8080 will be used.
1809
+ *
1810
+ * @public
1811
+ */
1812
+ export declare const PORT: string | 8080;
1806
1813
 
1807
1814
  /** A raw set of collision groups represented as a 32-bit number. @public */
1808
1815
  export declare type RawCollisionGroups = RAPIER.InteractionGroups;
@@ -2359,7 +2366,7 @@ export declare interface SpdMatrix3 extends SdpMatrix3 {
2359
2366
  export declare function startServer(init: (world: World) => void): void;
2360
2367
 
2361
2368
  /** The input keys included in the PlayerInputState. @public */
2362
- export declare const SUPPORTED_INPUT_KEYS: string[];
2369
+ 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"];
2363
2370
 
2364
2371
  /** A 3-dimensional vector. @public */
2365
2372
  export declare interface Vector3 {