hytopia 0.1.5 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- package/bin/scripts.js +43 -10
- package/boilerplate/assets/certs/README.md +6 -0
- package/boilerplate/index.ts +4 -4
- package/bun.lockb +0 -0
- package/docs/assets/banner.png +0 -0
- package/docs/{server.hytopia.simulation.enabledebug.md → server.hytopia.simulation.enabledebugrendering.md} +4 -4
- package/docs/{server.hytopia.simulation.isdebugenabled.md → server.hytopia.simulation.isdebugrenderingenabled.md} +3 -3
- package/docs/server.hytopia.simulation.md +3 -3
- package/docs/{server.simulation.enabledebug.md → server.simulation.enabledebugrendering.md} +4 -4
- package/docs/{server.simulation.isdebugenabled.md → server.simulation.isdebugrenderingenabled.md} +3 -3
- package/docs/server.simulation.md +3 -3
- package/package.json +5 -2
- package/server.api.json +14 -14
- package/server.d.ts +5 -5
- package/server.js +1 -1
package/bin/scripts.js
CHANGED
@@ -2,17 +2,50 @@
|
|
2
2
|
|
3
3
|
const fs = require('fs');
|
4
4
|
const path = require('path');
|
5
|
-
const
|
5
|
+
const mkcert = require('mkcert');
|
6
6
|
|
7
|
-
|
8
|
-
const
|
9
|
-
const destDir = process.cwd();
|
7
|
+
(async () => {
|
8
|
+
const command = process.argv[2];
|
10
9
|
|
11
|
-
|
10
|
+
/**
|
11
|
+
* Init command
|
12
|
+
*
|
13
|
+
* Initializes a new HYTOPIA project.
|
14
|
+
*/
|
15
|
+
if (command === 'init') {
|
16
|
+
const srcDir = path.join(__dirname, '..', 'boilerplate');
|
17
|
+
const destDir = process.cwd();
|
18
|
+
|
19
|
+
// Copy boilerplate
|
20
|
+
console.log(`🖨️ Copying boilerplate to ${destDir}`);
|
21
|
+
fs.cpSync(srcDir, destDir, { recursive: true });
|
22
|
+
|
23
|
+
// Generate SSL cert and allow mkcert to auto handle CA/Cert setup
|
24
|
+
console.log(`🔒 Generating SSL cert for local development`);
|
25
|
+
const validity = 3650; // 10 years
|
26
|
+
const ca = await mkcert.createCA({
|
27
|
+
organization: 'HYTOPIA',
|
28
|
+
countryCode: 'US',
|
29
|
+
state: 'Washington',
|
30
|
+
locality: 'Seattle',
|
31
|
+
validity,
|
32
|
+
});
|
12
33
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
34
|
+
const cert = await mkcert.createCert({
|
35
|
+
ca: { key: ca.key, cert: ca.cert },
|
36
|
+
domains: ['localhost', '127.0.0.1'],
|
37
|
+
validity,
|
38
|
+
});
|
39
|
+
|
40
|
+
fs.writeFileSync(path.join(destDir, 'assets', 'certs', 'localhost.crt'), cert.cert);
|
41
|
+
fs.writeFileSync(path.join(destDir, 'assets', 'certs', 'localhost.key'), cert.key);
|
42
|
+
|
43
|
+
// Done, lfg!
|
44
|
+
console.log('🚀 Hytopia project initialized successfully!');
|
45
|
+
console.log('💡 Start your development server with `bun --watch index.ts`!');
|
46
|
+
return;
|
47
|
+
}
|
48
|
+
|
49
|
+
console.log('Unknown command: ' + command);
|
50
|
+
})();
|
17
51
|
|
18
|
-
console.log('Unknown command: ' + command);
|
@@ -0,0 +1,6 @@
|
|
1
|
+
For local development, mkcert generated certs will be stored here.
|
2
|
+
We do this to allow https://localhost & wss://localhost support.
|
3
|
+
Without this, play.hytopia.com requires a bunch of funky browser
|
4
|
+
flag workarounds in order to connect to our local server.
|
5
|
+
This is only used for local development and will be ignored
|
6
|
+
when your game is deployed to HYTOPIA servers.
|
package/boilerplate/index.ts
CHANGED
@@ -42,15 +42,15 @@ import worldMap from './assets/map.json';
|
|
42
42
|
|
43
43
|
startServer(world => {
|
44
44
|
/**
|
45
|
-
* Enable
|
45
|
+
* Enable debug rendering of the physics simulation.
|
46
46
|
* This will overlay lines in-game representing colliders,
|
47
47
|
* rigid bodies, and raycasts. This is useful for debugging
|
48
|
-
* physics-related issues
|
48
|
+
* physics-related issues in a development environment.
|
49
49
|
* For larger worlds, enabling this can cause performance
|
50
50
|
* issues, which will be noticed as dropped frame rates
|
51
51
|
* and higher RTT times.
|
52
52
|
*/
|
53
|
-
world.simulation.
|
53
|
+
world.simulation.enableDebugRendering(true);
|
54
54
|
|
55
55
|
/**
|
56
56
|
* Load our map.
|
@@ -84,7 +84,7 @@ startServer(world => {
|
|
84
84
|
world.chatManager.sendPlayerMessage(player, 'Use WASD to move around.');
|
85
85
|
world.chatManager.sendPlayerMessage(player, 'Press space to jump.');
|
86
86
|
world.chatManager.sendPlayerMessage(player, 'Hold shift to sprint.');
|
87
|
-
world.chatManager.sendPlayerMessage(player, '
|
87
|
+
world.chatManager.sendPlayerMessage(player, 'Press \\ to enter or exit debug view.');
|
88
88
|
};
|
89
89
|
|
90
90
|
/**
|
package/bun.lockb
ADDED
Binary file
|
Binary file
|
@@ -1,15 +1,15 @@
|
|
1
1
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
2
|
|
3
|
-
[Home](./index.md) > [server](./server.md) > [HYTOPIA](./server.hytopia.md) > [Simulation](./server.hytopia.simulation.md) > [
|
3
|
+
[Home](./index.md) > [server](./server.md) > [HYTOPIA](./server.hytopia.md) > [Simulation](./server.hytopia.simulation.md) > [enableDebugRendering](./server.hytopia.simulation.enabledebugrendering.md)
|
4
4
|
|
5
|
-
## HYTOPIA.Simulation.
|
5
|
+
## HYTOPIA.Simulation.enableDebugRendering() method
|
6
6
|
|
7
|
-
Enables or disables debug rendering for the simulation. When enabled, all colliders and
|
7
|
+
Enables or disables debug rendering for the simulation. When enabled, all colliders, rigid body and raycast outlines will be rendered in the world. Do not enable this in production. In large worlds enabling this can cause noticable lag and RTT spikes.
|
8
8
|
|
9
9
|
**Signature:**
|
10
10
|
|
11
11
|
```typescript
|
12
|
-
|
12
|
+
enableDebugRendering(enabled: boolean): void;
|
13
13
|
```
|
14
14
|
|
15
15
|
## Parameters
|
@@ -1,13 +1,13 @@
|
|
1
1
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
2
|
|
3
|
-
[Home](./index.md) > [server](./server.md) > [HYTOPIA](./server.hytopia.md) > [Simulation](./server.hytopia.simulation.md) > [
|
3
|
+
[Home](./index.md) > [server](./server.md) > [HYTOPIA](./server.hytopia.md) > [Simulation](./server.hytopia.simulation.md) > [isDebugRenderingEnabled](./server.hytopia.simulation.isdebugrenderingenabled.md)
|
4
4
|
|
5
|
-
## HYTOPIA.Simulation.
|
5
|
+
## HYTOPIA.Simulation.isDebugRenderingEnabled property
|
6
6
|
|
7
7
|
Whether the simulation has debug rendering enabled.
|
8
8
|
|
9
9
|
**Signature:**
|
10
10
|
|
11
11
|
```typescript
|
12
|
-
get
|
12
|
+
get isDebugRenderingEnabled(): boolean;
|
13
13
|
```
|
@@ -64,7 +64,7 @@ The gravity vector for the simulation.
|
|
64
64
|
</td></tr>
|
65
65
|
<tr><td>
|
66
66
|
|
67
|
-
[
|
67
|
+
[isDebugRenderingEnabled](./server.hytopia.simulation.isdebugrenderingenabled.md)
|
68
68
|
|
69
69
|
|
70
70
|
</td><td>
|
@@ -161,7 +161,7 @@ Casts a ray through the simulation.
|
|
161
161
|
</td></tr>
|
162
162
|
<tr><td>
|
163
163
|
|
164
|
-
[
|
164
|
+
[enableDebugRendering(enabled)](./server.hytopia.simulation.enabledebugrendering.md)
|
165
165
|
|
166
166
|
|
167
167
|
</td><td>
|
@@ -169,7 +169,7 @@ Casts a ray through the simulation.
|
|
169
169
|
|
170
170
|
</td><td>
|
171
171
|
|
172
|
-
Enables or disables debug rendering for the simulation. When enabled, all colliders and
|
172
|
+
Enables or disables debug rendering for the simulation. When enabled, all colliders, rigid body and raycast outlines will be rendered in the world. Do not enable this in production. In large worlds enabling this can cause noticable lag and RTT spikes.
|
173
173
|
|
174
174
|
|
175
175
|
</td></tr>
|
@@ -1,15 +1,15 @@
|
|
1
1
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
2
|
|
3
|
-
[Home](./index.md) > [server](./server.md) > [Simulation](./server.simulation.md) > [
|
3
|
+
[Home](./index.md) > [server](./server.md) > [Simulation](./server.simulation.md) > [enableDebugRendering](./server.simulation.enabledebugrendering.md)
|
4
4
|
|
5
|
-
## Simulation.
|
5
|
+
## Simulation.enableDebugRendering() method
|
6
6
|
|
7
|
-
Enables or disables debug rendering for the simulation. When enabled, all colliders and
|
7
|
+
Enables or disables debug rendering for the simulation. When enabled, all colliders, rigid body and raycast outlines will be rendered in the world. Do not enable this in production. In large worlds enabling this can cause noticable lag and RTT spikes.
|
8
8
|
|
9
9
|
**Signature:**
|
10
10
|
|
11
11
|
```typescript
|
12
|
-
|
12
|
+
enableDebugRendering(enabled: boolean): void;
|
13
13
|
```
|
14
14
|
|
15
15
|
## Parameters
|
package/docs/{server.simulation.isdebugenabled.md → server.simulation.isdebugrenderingenabled.md}
RENAMED
@@ -1,13 +1,13 @@
|
|
1
1
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
2
|
|
3
|
-
[Home](./index.md) > [server](./server.md) > [Simulation](./server.simulation.md) > [
|
3
|
+
[Home](./index.md) > [server](./server.md) > [Simulation](./server.simulation.md) > [isDebugRenderingEnabled](./server.simulation.isdebugrenderingenabled.md)
|
4
4
|
|
5
|
-
## Simulation.
|
5
|
+
## Simulation.isDebugRenderingEnabled property
|
6
6
|
|
7
7
|
Whether the simulation has debug rendering enabled.
|
8
8
|
|
9
9
|
**Signature:**
|
10
10
|
|
11
11
|
```typescript
|
12
|
-
get
|
12
|
+
get isDebugRenderingEnabled(): boolean;
|
13
13
|
```
|
@@ -64,7 +64,7 @@ The gravity vector for the simulation.
|
|
64
64
|
</td></tr>
|
65
65
|
<tr><td>
|
66
66
|
|
67
|
-
[
|
67
|
+
[isDebugRenderingEnabled](./server.simulation.isdebugrenderingenabled.md)
|
68
68
|
|
69
69
|
|
70
70
|
</td><td>
|
@@ -161,7 +161,7 @@ Casts a ray through the simulation.
|
|
161
161
|
</td></tr>
|
162
162
|
<tr><td>
|
163
163
|
|
164
|
-
[
|
164
|
+
[enableDebugRendering(enabled)](./server.simulation.enabledebugrendering.md)
|
165
165
|
|
166
166
|
|
167
167
|
</td><td>
|
@@ -169,7 +169,7 @@ Casts a ray through the simulation.
|
|
169
169
|
|
170
170
|
</td><td>
|
171
171
|
|
172
|
-
Enables or disables debug rendering for the simulation. When enabled, all colliders and
|
172
|
+
Enables or disables debug rendering for the simulation. When enabled, all colliders, rigid body and raycast outlines will be rendered in the world. Do not enable this in production. In large worlds enabling this can cause noticable lag and RTT spikes.
|
173
173
|
|
174
174
|
|
175
175
|
</td></tr>
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "hytopia",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.9",
|
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,5 +46,8 @@
|
|
46
46
|
"bugs": {
|
47
47
|
"url": "https://github.com/hytopiagg/sdk/issues"
|
48
48
|
},
|
49
|
-
"homepage": "https://github.com/hytopiagg/sdk#readme"
|
49
|
+
"homepage": "https://github.com/hytopiagg/sdk#readme",
|
50
|
+
"dependencies": {
|
51
|
+
"mkcert": "^3.2.0"
|
52
|
+
}
|
50
53
|
}
|
package/server.api.json
CHANGED
@@ -28116,12 +28116,12 @@
|
|
28116
28116
|
},
|
28117
28117
|
{
|
28118
28118
|
"kind": "Method",
|
28119
|
-
"canonicalReference": "server!HYTOPIA.Simulation#
|
28120
|
-
"docComment": "/**\n * Enables or disables debug rendering for the simulation. When enabled, all colliders and
|
28119
|
+
"canonicalReference": "server!HYTOPIA.Simulation#enableDebugRendering:member(1)",
|
28120
|
+
"docComment": "/**\n * Enables or disables debug rendering for the simulation. When enabled, all colliders, rigid body and raycast outlines will be rendered in the world. Do not enable this in production. In large worlds enabling this can cause noticable lag and RTT spikes.\n *\n * @param enabled - Whether to enable debug rendering.\n */\n",
|
28121
28121
|
"excerptTokens": [
|
28122
28122
|
{
|
28123
28123
|
"kind": "Content",
|
28124
|
-
"text": "
|
28124
|
+
"text": "enableDebugRendering(enabled: "
|
28125
28125
|
},
|
28126
28126
|
{
|
28127
28127
|
"kind": "Content",
|
@@ -28160,7 +28160,7 @@
|
|
28160
28160
|
],
|
28161
28161
|
"isOptional": false,
|
28162
28162
|
"isAbstract": false,
|
28163
|
-
"name": "
|
28163
|
+
"name": "enableDebugRendering"
|
28164
28164
|
},
|
28165
28165
|
{
|
28166
28166
|
"kind": "Property",
|
@@ -28195,12 +28195,12 @@
|
|
28195
28195
|
},
|
28196
28196
|
{
|
28197
28197
|
"kind": "Property",
|
28198
|
-
"canonicalReference": "server!HYTOPIA.Simulation#
|
28198
|
+
"canonicalReference": "server!HYTOPIA.Simulation#isDebugRenderingEnabled:member",
|
28199
28199
|
"docComment": "/**\n * Whether the simulation has debug rendering enabled.\n */\n",
|
28200
28200
|
"excerptTokens": [
|
28201
28201
|
{
|
28202
28202
|
"kind": "Content",
|
28203
|
-
"text": "get
|
28203
|
+
"text": "get isDebugRenderingEnabled(): "
|
28204
28204
|
},
|
28205
28205
|
{
|
28206
28206
|
"kind": "Content",
|
@@ -28214,7 +28214,7 @@
|
|
28214
28214
|
"isReadonly": true,
|
28215
28215
|
"isOptional": false,
|
28216
28216
|
"releaseTag": "Public",
|
28217
|
-
"name": "
|
28217
|
+
"name": "isDebugRenderingEnabled",
|
28218
28218
|
"propertyTypeTokenRange": {
|
28219
28219
|
"startIndex": 1,
|
28220
28220
|
"endIndex": 2
|
@@ -34853,12 +34853,12 @@
|
|
34853
34853
|
},
|
34854
34854
|
{
|
34855
34855
|
"kind": "Method",
|
34856
|
-
"canonicalReference": "server!Simulation#
|
34857
|
-
"docComment": "/**\n * Enables or disables debug rendering for the simulation. When enabled, all colliders and
|
34856
|
+
"canonicalReference": "server!Simulation#enableDebugRendering:member(1)",
|
34857
|
+
"docComment": "/**\n * Enables or disables debug rendering for the simulation. When enabled, all colliders, rigid body and raycast outlines will be rendered in the world. Do not enable this in production. In large worlds enabling this can cause noticable lag and RTT spikes.\n *\n * @param enabled - Whether to enable debug rendering.\n */\n",
|
34858
34858
|
"excerptTokens": [
|
34859
34859
|
{
|
34860
34860
|
"kind": "Content",
|
34861
|
-
"text": "
|
34861
|
+
"text": "enableDebugRendering(enabled: "
|
34862
34862
|
},
|
34863
34863
|
{
|
34864
34864
|
"kind": "Content",
|
@@ -34897,7 +34897,7 @@
|
|
34897
34897
|
],
|
34898
34898
|
"isOptional": false,
|
34899
34899
|
"isAbstract": false,
|
34900
|
-
"name": "
|
34900
|
+
"name": "enableDebugRendering"
|
34901
34901
|
},
|
34902
34902
|
{
|
34903
34903
|
"kind": "Property",
|
@@ -34932,12 +34932,12 @@
|
|
34932
34932
|
},
|
34933
34933
|
{
|
34934
34934
|
"kind": "Property",
|
34935
|
-
"canonicalReference": "server!Simulation#
|
34935
|
+
"canonicalReference": "server!Simulation#isDebugRenderingEnabled:member",
|
34936
34936
|
"docComment": "/**\n * Whether the simulation has debug rendering enabled.\n */\n",
|
34937
34937
|
"excerptTokens": [
|
34938
34938
|
{
|
34939
34939
|
"kind": "Content",
|
34940
|
-
"text": "get
|
34940
|
+
"text": "get isDebugRenderingEnabled(): "
|
34941
34941
|
},
|
34942
34942
|
{
|
34943
34943
|
"kind": "Content",
|
@@ -34951,7 +34951,7 @@
|
|
34951
34951
|
"isReadonly": true,
|
34952
34952
|
"isOptional": false,
|
34953
34953
|
"releaseTag": "Public",
|
34954
|
-
"name": "
|
34954
|
+
"name": "isDebugRenderingEnabled",
|
34955
34955
|
"propertyTypeTokenRange": {
|
34956
34956
|
"startIndex": 1,
|
34957
34957
|
"endIndex": 2
|
package/server.d.ts
CHANGED
@@ -2299,7 +2299,7 @@ export declare class Simulation {
|
|
2299
2299
|
|
2300
2300
|
|
2301
2301
|
/** Whether the simulation has debug rendering enabled. */
|
2302
|
-
get
|
2302
|
+
get isDebugRenderingEnabled(): boolean;
|
2303
2303
|
/** The gravity vector for the simulation. */
|
2304
2304
|
get gravity(): RAPIER.Vector3;
|
2305
2305
|
/** The fixed timestep for the simulation. */
|
@@ -2319,12 +2319,12 @@ export declare class Simulation {
|
|
2319
2319
|
|
2320
2320
|
/**
|
2321
2321
|
* Enables or disables debug rendering for the simulation.
|
2322
|
-
* When enabled, all colliders
|
2323
|
-
* in the world. Do not enable this in production.
|
2324
|
-
* worlds this can cause noticable lag and RTT spikes.
|
2322
|
+
* When enabled, all colliders, rigid body and raycast outlines
|
2323
|
+
* will be rendered in the world. Do not enable this in production.
|
2324
|
+
* In large worlds enabling this can cause noticable lag and RTT spikes.
|
2325
2325
|
* @param enabled - Whether to enable debug rendering.
|
2326
2326
|
*/
|
2327
|
-
|
2327
|
+
enableDebugRendering(enabled: boolean): void;
|
2328
2328
|
|
2329
2329
|
|
2330
2330
|
|