hytopia 0.10.0-prerelease → 0.10.0-prerelease-3
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/bin/scripts.js +5 -5
- package/package.json +1 -1
- package/server.js +1 -1
package/bin/scripts.js
CHANGED
@@ -77,7 +77,7 @@ function build() {
|
|
77
77
|
*/
|
78
78
|
function start() {
|
79
79
|
execSync(`
|
80
|
-
nodemon -q -w index.ts
|
80
|
+
npx nodemon -q -w index.ts
|
81
81
|
-x "npx bun build --format=esm --target=node --outfile=./index.js index.ts && node index.js"
|
82
82
|
`, { stdio: 'inherit'});
|
83
83
|
}
|
@@ -166,7 +166,7 @@ function installProjectDependencies() {
|
|
166
166
|
}, null, 2))
|
167
167
|
|
168
168
|
// install hytopia sdk and hytopia assets
|
169
|
-
execSync('npm install hytopia@latest @hytopia.com/assets@latest', { stdio: 'inherit' });
|
169
|
+
execSync('npm install --force hytopia@latest @hytopia.com/assets@latest', { stdio: 'inherit' });
|
170
170
|
}
|
171
171
|
|
172
172
|
/**
|
@@ -175,7 +175,7 @@ function installProjectDependencies() {
|
|
175
175
|
function initFromTemplate(destDir) {
|
176
176
|
console.log(`🖨️ Initializing project with examples template "${flags.template}"...`);
|
177
177
|
|
178
|
-
execSync('npm install @hytopia.com/examples@latest', { stdio: 'inherit' });
|
178
|
+
execSync('npm install --force @hytopia.com/examples@latest', { stdio: 'inherit' });
|
179
179
|
|
180
180
|
const templateDir = path.join(destDir, 'node_modules', '@hytopia.com', 'examples', flags.template);
|
181
181
|
|
@@ -604,7 +604,7 @@ async function fetchLatestVersion(signal) {
|
|
604
604
|
function upgradeCli() {
|
605
605
|
const versionArg = (process.argv[3] || 'latest').trim();
|
606
606
|
console.log(`🔄 Upgrading HYTOPIA CLI to: hytopia@${versionArg} ...`);
|
607
|
-
execSync(`npm install -g hytopia@${versionArg}`, { stdio: 'inherit' });
|
607
|
+
execSync(`npm install -g --force hytopia@${versionArg}`, { stdio: 'inherit' });
|
608
608
|
console.log('✅ Upgrade complete. You may need to restart your shell for changes to take effect.');
|
609
609
|
}
|
610
610
|
|
@@ -612,7 +612,7 @@ function upgradeProject() {
|
|
612
612
|
const versionArg = (process.argv[3] || 'latest').trim();
|
613
613
|
const spec = `hytopia@${versionArg}`;
|
614
614
|
console.log(`🔄 Upgrading project HYTOPIA SDK to: ${spec} ...`);
|
615
|
-
execSync(`npm install ${spec}`, { stdio: 'inherit' });
|
615
|
+
execSync(`npm install --force ${spec}`, { stdio: 'inherit' });
|
616
616
|
console.log('✅ Project dependency upgraded.');
|
617
617
|
}
|
618
618
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "hytopia",
|
3
|
-
"version": "0.10.0-prerelease",
|
3
|
+
"version": "0.10.0-prerelease-3",
|
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": "./server.js",
|
package/server.js
CHANGED
@@ -442,7 +442,7 @@ qYGMwU/HBVHkLAn5XvT2a9xM0mzZ558d+ahbw8qAgRxg7BZ+2PW/bf7F2WRBUk1f
|
|
442
442
|
xauhAoGBALEspoxQozwohGQnP7EMF0/0JoKNpdNv0b0qCVvNiMo0+N297lI2mFQp
|
443
443
|
6xYlW/1l9afLokklF/J2IsyBrTCZoY7SaEk/lMMrQSyra+y0z71ogZ8A4ny9fxsj
|
444
444
|
0dDYJZGllL+3E/MQfd7k+KnOM/+A+cPoAnci76+L3vdkUb2P8SJk
|
445
|
-
-----END RSA PRIVATE KEY-----`;var IE=process.env.PORT??8080,fE="0.10.0-prerelease",_E;((Y)=>{Y.READY="WEBSERVER.READY";Y.STOPPED="WEBSERVER.STOPPED";Y.ERROR="WEBSERVER.ERROR";Y.UPGRADE="WEBSERVER.UPGRADE"})(_E||={});class D3 extends L0{static instance=new D3;_webserver=k2.default();_internalHttpServer;constructor(){super();this._webserver.use((Z,J,X)=>{J.header("Access-Control-Allow-Origin","*"),X()}),this._webserver.get("/",(Z,J)=>{J.json({status:"OK",version:fE,runtime:"node"})}),this._webserver.use(k2.default.static("assets"));try{this._webserver.use(k2.default.static(tn1.dirname(p.resolve("/Users/arkdev/Desktop/HYTOPIA/hytopia/assets/release/index.js"))))}catch{}}start(){if(!this._internalHttpServer)this._internalHttpServer=process.env.NODE_ENV==="production"?on1.createServer(this._webserver):rn1.createServer({key:T2.existsSync("assets/certs/localhost.key")?T2.readFileSync("assets/certs/localhost.key"):cQ0,cert:T2.existsSync("assets/certs/localhost.crt")?T2.readFileSync("assets/certs/localhost.crt"):jQ0},this._webserver),this._internalHttpServer.on("upgrade",this._onUpgrade),this._internalHttpServer.on("error",this._onError),this._internalHttpServer.on("close",this._onStopped);else y.warning("WebServer.start(): server already started!");this._internalHttpServer.listen(IE,this._onStarted),console.info(`WebServer.start(): Server running on port ${IE}.`)}stop(){if(this._internalHttpServer)return new Promise((Z,J)=>{this._internalHttpServer.close((X)=>{if(X)J(X);else Z(!0)})});else return y.warning("WebServer.stop(): server not started."),Promise.resolve(!1)}_onStarted=()=>{this.emitWithGlobal("WEBSERVER.READY",{})};_onUpgrade=async(Z,J,X)=>{let $=en1.parse(Z.url??"",!0).query,Y=$.connectionId?.toString(),Q=$.sessionToken?.toString()??"";if(Y&&C7.instance.isValidConnectionId(Y))Z.connectionId=Y;else{let K=await x7.instance.getPlayerSession(Q);if(K?.error){let W=`${K.error.code}: ${K.error.message}`;J.write(`HTTP/1.1 401 Unauthorized\r
|
445
|
+
-----END RSA PRIVATE KEY-----`;var IE=process.env.PORT??8080,fE="0.10.0-prerelease-3",_E;((Y)=>{Y.READY="WEBSERVER.READY";Y.STOPPED="WEBSERVER.STOPPED";Y.ERROR="WEBSERVER.ERROR";Y.UPGRADE="WEBSERVER.UPGRADE"})(_E||={});class D3 extends L0{static instance=new D3;_webserver=k2.default();_internalHttpServer;constructor(){super();this._webserver.use((Z,J,X)=>{J.header("Access-Control-Allow-Origin","*"),X()}),this._webserver.get("/",(Z,J)=>{J.json({status:"OK",version:fE,runtime:"node"})}),this._webserver.use(k2.default.static("assets"));try{this._webserver.use(k2.default.static(tn1.dirname(p.resolve("/Users/arkdev/Desktop/HYTOPIA/hytopia/assets/release/index.js"))))}catch{}}start(){if(!this._internalHttpServer)this._internalHttpServer=process.env.NODE_ENV==="production"?on1.createServer(this._webserver):rn1.createServer({key:T2.existsSync("assets/certs/localhost.key")?T2.readFileSync("assets/certs/localhost.key"):cQ0,cert:T2.existsSync("assets/certs/localhost.crt")?T2.readFileSync("assets/certs/localhost.crt"):jQ0},this._webserver),this._internalHttpServer.on("upgrade",this._onUpgrade),this._internalHttpServer.on("error",this._onError),this._internalHttpServer.on("close",this._onStopped);else y.warning("WebServer.start(): server already started!");this._internalHttpServer.listen(IE,this._onStarted),console.info(`WebServer.start(): Server running on port ${IE}.`)}stop(){if(this._internalHttpServer)return new Promise((Z,J)=>{this._internalHttpServer.close((X)=>{if(X)J(X);else Z(!0)})});else return y.warning("WebServer.stop(): server not started."),Promise.resolve(!1)}_onStarted=()=>{this.emitWithGlobal("WEBSERVER.READY",{})};_onUpgrade=async(Z,J,X)=>{let $=en1.parse(Z.url??"",!0).query,Y=$.connectionId?.toString(),Q=$.sessionToken?.toString()??"";if(Y&&C7.instance.isValidConnectionId(Y))Z.connectionId=Y;else{let K=await x7.instance.getPlayerSession(Q);if(K?.error){let W=`${K.error.code}: ${K.error.message}`;J.write(`HTTP/1.1 401 Unauthorized\r
|
446
446
|
Content-Type: text/plain\r
|
447
447
|
Content-Length: ${W.length}\r
|
448
448
|
Connection: close\r
|