hytopia 0.8.6-devtrace-aac4c1b → 0.8.6-devtrace-dc032c8

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/bun-server.mjs CHANGED
@@ -447,7 +447,7 @@ qYGMwU/HBVHkLAn5XvT2a9xM0mzZ558d+ahbw8qAgRxg7BZ+2PW/bf7F2WRBUk1f
447
447
  xauhAoGBALEspoxQozwohGQnP7EMF0/0JoKNpdNv0b0qCVvNiMo0+N297lI2mFQp
448
448
  6xYlW/1l9afLokklF/J2IsyBrTCZoY7SaEk/lMMrQSyra+y0z71ogZ8A4ny9fxsj
449
449
  0dDYJZGllL+3E/MQfd7k+KnOM/+A+cPoAnci76+L3vdkUb2P8SJk
450
- -----END RSA PRIVATE KEY-----`;var iS=process.env.PORT??8080,nS="0.8.6-devtrace-aac4c1b",aS;(($)=>{$.READY="WEBSERVER.READY";$.STOPPED="WEBSERVER.STOPPED";$.ERROR="WEBSERVER.ERROR";$.UPGRADE="WEBSERVER.UPGRADE"})(aS||={});class mK extends j0{static instance=new mK;_webserver=xj.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:nS,runtime:typeof Bun!=="undefined"?"bun":"node"})}),this._webserver.use(xj.default.static("assets"));try{this._webserver.use(xj.default.static(Pi1.dirname(c.resolve("/Users/arkdev/Desktop/HYTOPIA/hytopia/assets/release/index.js"))))}catch{}}start(){if(!this._internalHttpServer)this._internalHttpServer=process.env.NODE_ENV==="production"?Ni1.createServer(this._webserver):Di1.createServer({key:Aj.existsSync("assets/certs/localhost.key")?Aj.readFileSync("assets/certs/localhost.key"):v$0,cert:Aj.existsSync("assets/certs/localhost.crt")?Aj.readFileSync("assets/certs/localhost.crt"):I$0},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(iS,this._onStarted),console.info(`WebServer.start(): Server running on port ${iS}.`)}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=Ci1.parse(Z.url??"",!0).query,$=Y.connectionId?.toString(),Q=Y.sessionToken?.toString()??"";if($&&a7.instance.isValidConnectionId($))Z.connectionId=$;else{let W=await b7.instance.getPlayerSession(Q);if(W?.error){let K=`${W.error.code}: ${W.error.message}`;J.write(`HTTP/1.1 401 Unauthorized\r
450
+ -----END RSA PRIVATE KEY-----`;var iS=process.env.PORT??8080,nS="0.8.6-devtrace-dc032c8",aS;(($)=>{$.READY="WEBSERVER.READY";$.STOPPED="WEBSERVER.STOPPED";$.ERROR="WEBSERVER.ERROR";$.UPGRADE="WEBSERVER.UPGRADE"})(aS||={});class mK extends j0{static instance=new mK;_webserver=xj.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:nS,runtime:typeof Bun!=="undefined"?"bun":"node"})}),this._webserver.use(xj.default.static("assets"));try{this._webserver.use(xj.default.static(Pi1.dirname(c.resolve("/Users/arkdev/Desktop/HYTOPIA/hytopia/assets/release/index.js"))))}catch{}}start(){if(!this._internalHttpServer)this._internalHttpServer=process.env.NODE_ENV==="production"?Ni1.createServer(this._webserver):Di1.createServer({key:Aj.existsSync("assets/certs/localhost.key")?Aj.readFileSync("assets/certs/localhost.key"):v$0,cert:Aj.existsSync("assets/certs/localhost.crt")?Aj.readFileSync("assets/certs/localhost.crt"):I$0},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(iS,this._onStarted),console.info(`WebServer.start(): Server running on port ${iS}.`)}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=Ci1.parse(Z.url??"",!0).query,$=Y.connectionId?.toString(),Q=Y.sessionToken?.toString()??"";if($&&a7.instance.isValidConnectionId($))Z.connectionId=$;else{let W=await b7.instance.getPlayerSession(Q);if(W?.error){let K=`${W.error.code}: ${W.error.message}`;J.write(`HTTP/1.1 401 Unauthorized\r
451
451
  Content-Type: text/plain\r
452
452
  Content-Length: ${K.length}\r
453
453
  Connection: close\r
package/node-server.mjs CHANGED
@@ -455,7 +455,7 @@ qYGMwU/HBVHkLAn5XvT2a9xM0mzZ558d+ahbw8qAgRxg7BZ+2PW/bf7F2WRBUk1f
455
455
  xauhAoGBALEspoxQozwohGQnP7EMF0/0JoKNpdNv0b0qCVvNiMo0+N297lI2mFQp
456
456
  6xYlW/1l9afLokklF/J2IsyBrTCZoY7SaEk/lMMrQSyra+y0z71ogZ8A4ny9fxsj
457
457
  0dDYJZGllL+3E/MQfd7k+KnOM/+A+cPoAnci76+L3vdkUb2P8SJk
458
- -----END RSA PRIVATE KEY-----`;var UA=process.env.PORT??8080,BA="0.8.6-devtrace-aac4c1b",LA;(($)=>{$.READY="WEBSERVER.READY";$.STOPPED="WEBSERVER.STOPPED";$.ERROR="WEBSERVER.ERROR";$.UPGRADE="WEBSERVER.UPGRADE"})(LA||={});class I3 extends O0{static instance=new I3;_webserver=zN.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:BA,runtime:typeof Bun!=="undefined"?"bun":"node"})}),this._webserver.use(zN.default.static("assets"));try{this._webserver.use(zN.default.static(De1.dirname(m.resolve("/Users/arkdev/Desktop/HYTOPIA/hytopia/assets/release/index.js"))))}catch{}}start(){if(!this._internalHttpServer)this._internalHttpServer=process.env.NODE_ENV==="production"?Re1.createServer(this._webserver):je1.createServer({key:VN.existsSync("assets/certs/localhost.key")?VN.readFileSync("assets/certs/localhost.key"):wW0,cert:VN.existsSync("assets/certs/localhost.crt")?VN.readFileSync("assets/certs/localhost.crt"):LW0},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(UA,this._onStarted),console.info(`WebServer.start(): Server running on port ${UA}.`)}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=Pe1.parse(Z.url??"",!0).query,$=Y.connectionId?.toString(),Q=Y.sessionToken?.toString()??"";if($&&YZ.instance.isValidConnectionId($))Z.connectionId=$;else{let K=await p7.instance.getPlayerSession(Q);if(K?.error){let W=`${K.error.code}: ${K.error.message}`;J.write(`HTTP/1.1 401 Unauthorized\r
458
+ -----END RSA PRIVATE KEY-----`;var UA=process.env.PORT??8080,BA="0.8.6-devtrace-dc032c8",LA;(($)=>{$.READY="WEBSERVER.READY";$.STOPPED="WEBSERVER.STOPPED";$.ERROR="WEBSERVER.ERROR";$.UPGRADE="WEBSERVER.UPGRADE"})(LA||={});class I3 extends O0{static instance=new I3;_webserver=zN.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:BA,runtime:typeof Bun!=="undefined"?"bun":"node"})}),this._webserver.use(zN.default.static("assets"));try{this._webserver.use(zN.default.static(De1.dirname(m.resolve("/Users/arkdev/Desktop/HYTOPIA/hytopia/assets/release/index.js"))))}catch{}}start(){if(!this._internalHttpServer)this._internalHttpServer=process.env.NODE_ENV==="production"?Re1.createServer(this._webserver):je1.createServer({key:VN.existsSync("assets/certs/localhost.key")?VN.readFileSync("assets/certs/localhost.key"):wW0,cert:VN.existsSync("assets/certs/localhost.crt")?VN.readFileSync("assets/certs/localhost.crt"):LW0},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(UA,this._onStarted),console.info(`WebServer.start(): Server running on port ${UA}.`)}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=Pe1.parse(Z.url??"",!0).query,$=Y.connectionId?.toString(),Q=Y.sessionToken?.toString()??"";if($&&YZ.instance.isValidConnectionId($))Z.connectionId=$;else{let K=await p7.instance.getPlayerSession(Q);if(K?.error){let W=`${K.error.code}: ${K.error.message}`;J.write(`HTTP/1.1 401 Unauthorized\r
459
459
  Content-Type: text/plain\r
460
460
  Content-Length: ${W.length}\r
461
461
  Connection: close\r
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hytopia",
3
- "version": "0.8.6-devtrace-aac4c1b",
3
+ "version": "0.8.6-devtrace-dc032c8",
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",