hytopia 0.7.10 → 0.7.11
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.mjs +2 -0
- package/bun-server.mjs +1 -1
- package/node-server.mjs +1 -1
- package/package.json +1 -1
package/bin/scripts.mjs
CHANGED
|
@@ -115,6 +115,8 @@ function installProjectDependencies() {
|
|
|
115
115
|
execSync('bun init --yes');
|
|
116
116
|
execSync('bun add hytopia@latest --force');
|
|
117
117
|
execSync('bun add @hytopia.com/assets --force');
|
|
118
|
+
try { execSync('bun pm trust mediasoup'); } catch { console.log('Failed to install optional dependency "mediasoup", skipping for local development...'); }
|
|
119
|
+
try { execSync('bun pm trust sharp'); } catch { console.log('Failed to install optional dependency "sharp", skipping for local development...'); }
|
|
118
120
|
}
|
|
119
121
|
|
|
120
122
|
/**
|
package/bun-server.mjs
CHANGED
|
@@ -449,7 +449,7 @@ qYGMwU/HBVHkLAn5XvT2a9xM0mzZ558d+ahbw8qAgRxg7BZ+2PW/bf7F2WRBUk1f
|
|
|
449
449
|
xauhAoGBALEspoxQozwohGQnP7EMF0/0JoKNpdNv0b0qCVvNiMo0+N297lI2mFQp
|
|
450
450
|
6xYlW/1l9afLokklF/J2IsyBrTCZoY7SaEk/lMMrQSyra+y0z71ogZ8A4ny9fxsj
|
|
451
451
|
0dDYJZGllL+3E/MQfd7k+KnOM/+A+cPoAnci76+L3vdkUb2P8SJk
|
|
452
|
-
-----END RSA PRIVATE KEY-----`;var Cv=process.env.PORT??8080,Tv="0.7.
|
|
452
|
+
-----END RSA PRIVATE KEY-----`;var Cv=process.env.PORT??8080,Tv="0.7.11",kv;(($)=>{$.READY="WEBSERVER.READY";$.STOPPED="WEBSERVER.STOPPED";$.ERROR="WEBSERVER.ERROR";$.UPGRADE="WEBSERVER.UPGRADE"})(kv||={});class PW extends O0{static instance=new PW;_webserver=iB.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:Tv,runtime:typeof Bun!=="undefined"?"bun":"node"})}),this._webserver.use(iB.default.static("assets"));try{this._webserver.use(iB.default.static(ac1.dirname(c.resolve("/Users/arkdev/Desktop/HYTOPIA/hytopia/assets/release/index.js"))))}catch{}}start(){if(!this._internalHttpServer)this._internalHttpServer=process.env.NODE_ENV==="production"?ic1.createServer(this._webserver):nc1.createServer({key:pB.existsSync("assets/certs/localhost.key")?pB.readFileSync("assets/certs/localhost.key"):iY0,cert:pB.existsSync("assets/certs/localhost.crt")?pB.readFileSync("assets/certs/localhost.crt"):pY0},this._webserver),this._internalHttpServer.on("upgrade",this._onUpgrade),this._internalHttpServer.on("error",this._onError),this._internalHttpServer.on("close",this._onStopped);else d.warning("WebServer.start(): server already started!");this._internalHttpServer.listen(Cv,this._onStarted),console.info(`WebServer.start(): Server running on port ${Cv}.`)}stop(){if(this._internalHttpServer)return new Promise((Z,J)=>{this._internalHttpServer.close((X)=>{if(X)J(X);else Z(!0)})});else return d.warning("WebServer.stop(): server not started."),Promise.resolve(!1)}_onStarted=()=>{this.emitWithGlobal("WEBSERVER.READY",{})};_onUpgrade=async(Z,J,X)=>{let Y=sc1.parse(Z.url??"",!0).query,$=Y.connectionId?.toString(),Q=Y.sessionToken?.toString()??"";if($&&g7.instance.isValidConnectionId($))Z.connectionId=$;else{let K=await E7.instance.getPlayerSession(Q);if(K?.error){let W=`${K.error.code}: ${K.error.message}`;J.write(`HTTP/1.1 401 Unauthorized\r
|
|
453
453
|
Content-Type: text/plain\r
|
|
454
454
|
Content-Length: ${W.length}\r
|
|
455
455
|
Connection: close\r
|
package/node-server.mjs
CHANGED
|
@@ -457,7 +457,7 @@ qYGMwU/HBVHkLAn5XvT2a9xM0mzZ558d+ahbw8qAgRxg7BZ+2PW/bf7F2WRBUk1f
|
|
|
457
457
|
xauhAoGBALEspoxQozwohGQnP7EMF0/0JoKNpdNv0b0qCVvNiMo0+N297lI2mFQp
|
|
458
458
|
6xYlW/1l9afLokklF/J2IsyBrTCZoY7SaEk/lMMrQSyra+y0z71ogZ8A4ny9fxsj
|
|
459
459
|
0dDYJZGllL+3E/MQfd7k+KnOM/+A+cPoAnci76+L3vdkUb2P8SJk
|
|
460
|
-
-----END RSA PRIVATE KEY-----`;var nv=process.env.PORT??8080,av="0.7.
|
|
460
|
+
-----END RSA PRIVATE KEY-----`;var nv=process.env.PORT??8080,av="0.7.11",sv;(($)=>{$.READY="WEBSERVER.READY";$.STOPPED="WEBSERVER.STOPPED";$.ERROR="WEBSERVER.ERROR";$.UPGRADE="WEBSERVER.UPGRADE"})(sv||={});class FW extends O0{static instance=new FW;_webserver=NO.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:av,runtime:typeof Bun!=="undefined"?"bun":"node"})}),this._webserver.use(NO.default.static("assets"));try{this._webserver.use(NO.default.static(io1.dirname(m.resolve("/Users/arkdev/Desktop/HYTOPIA/hytopia/assets/release/index.js"))))}catch{}}start(){if(!this._internalHttpServer)this._internalHttpServer=process.env.NODE_ENV==="production"?lo1.createServer(this._webserver):po1.createServer({key:RO.existsSync("assets/certs/localhost.key")?RO.readFileSync("assets/certs/localhost.key"):AK0,cert:RO.existsSync("assets/certs/localhost.crt")?RO.readFileSync("assets/certs/localhost.crt"):vK0},this._webserver),this._internalHttpServer.on("upgrade",this._onUpgrade),this._internalHttpServer.on("error",this._onError),this._internalHttpServer.on("close",this._onStopped);else c.warning("WebServer.start(): server already started!");this._internalHttpServer.listen(nv,this._onStarted),console.info(`WebServer.start(): Server running on port ${nv}.`)}stop(){if(this._internalHttpServer)return new Promise((Z,J)=>{this._internalHttpServer.close((X)=>{if(X)J(X);else Z(!0)})});else return c.warning("WebServer.stop(): server not started."),Promise.resolve(!1)}_onStarted=()=>{this.emitWithGlobal("WEBSERVER.READY",{})};_onUpgrade=async(Z,J,X)=>{let Y=no1.parse(Z.url??"",!0).query,$=Y.connectionId?.toString(),Q=Y.sessionToken?.toString()??"";if($&&a7.instance.isValidConnectionId($))Z.connectionId=$;else{let K=await f7.instance.getPlayerSession(Q);if(K?.error){let G=`${K.error.code}: ${K.error.message}`;J.write(`HTTP/1.1 401 Unauthorized\r
|
|
461
461
|
Content-Type: text/plain\r
|
|
462
462
|
Content-Length: ${G.length}\r
|
|
463
463
|
Connection: close\r
|
package/package.json
CHANGED