hytopia 0.10.27-prerelease-1 → 0.10.27-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 CHANGED
@@ -78,6 +78,8 @@ async function build() {
78
78
  sourcemap: 'inline',
79
79
  mainFields: ['module', 'main'],
80
80
  conditions: ['import', 'node'],
81
+ treeShaking: true,
82
+ minify: true,
81
83
  banner: {
82
84
  js: 'import { createRequire as __cr } from "module"; import { fileURLToPath } from "url"; import { dirname as __bundlerDirname } from "path"; const require = __cr(import.meta.url); const __filename = fileURLToPath(import.meta.url); const __dirname = __bundlerDirname(__filename);'
83
85
  }
@@ -115,6 +117,8 @@ function start() {
115
117
  external: [ 'mediasoup' ], // prevent pathing issues in dev env, prod sets the bin path so no issue bundling in prod build/package.
116
118
  mainFields: ['module', 'main'],
117
119
  conditions: ['import', 'node'],
120
+ treeShaking: true,
121
+ minify: true,
118
122
  banner: {
119
123
  js: 'import { createRequire as __cr } from "module"; import { fileURLToPath } from "url"; import { dirname } from "path"; const require = __cr(import.meta.url); const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename);'
120
124
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hytopia",
3
- "version": "0.10.27-prerelease-1",
3
+ "version": "0.10.27-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.mjs",
package/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 hf=process.env.PORT??8080,Sf="0.10.27-prerelease-1",bf;((Y)=>{Y.READY="WEBSERVER.READY";Y.STOPPED="WEBSERVER.STOPPED";Y.ERROR="WEBSERVER.ERROR";Y.UPGRADE="WEBSERVER.UPGRADE"})(bf||={});class cK extends j0{static instance=new cK;_webserver=QU.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:Sf,runtime:"node"})}),this._webserver.use(QU.default.static("assets",{dotfiles:"allow"}));try{this._webserver.use(QU.default.static(Pn1.dirname(i.resolve("/Users/arkdev/Desktop/HYTOPIA/hytopia/assets/release/index.js")),{dotfiles:"allow"}))}catch{}}start(){if(!this._internalHttpServer)this._internalHttpServer=process.env.NODE_ENV==="production"?Mn1.createServer(this._webserver):Rn1.createServer({key:YU.existsSync("assets/certs/localhost.key")?YU.readFileSync("assets/certs/localhost.key"):iY0,cert:YU.existsSync("assets/certs/localhost.crt")?YU.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 p.warning("WebServer.start(): server already started!");this._internalHttpServer.listen(hf,this._onStarted),console.info(`WebServer.start(): Server running on port ${hf}.`)}stop(){if(this._internalHttpServer)return new Promise((Z,J)=>{this._internalHttpServer.close((X)=>{if(X)J(X);else Z(!0)})});else return p.warning("WebServer.stop(): server not started."),Promise.resolve(!1)}_onStarted=()=>{this.emitWithGlobal("WEBSERVER.READY",{})};_onUpgrade=async(Z,J,X)=>{let $=Nn1.parse(Z.url??"",!0).query,Y=$.connectionId?.toString(),Q=$.sessionToken?.toString()??"";if(Y&&R7.instance.isValidConnectionId(Y))Z.connectionId=Y;else{let K=await F7.instance.getPlayerSession(Q);if(K?.error){let W=`${K.error.code}: ${K.error.message}`;J.write(`HTTP/1.1 401 Unauthorized\r
450
+ -----END RSA PRIVATE KEY-----`;var hf=process.env.PORT??8080,Sf="0.10.27-prerelease-3",bf;((Y)=>{Y.READY="WEBSERVER.READY";Y.STOPPED="WEBSERVER.STOPPED";Y.ERROR="WEBSERVER.ERROR";Y.UPGRADE="WEBSERVER.UPGRADE"})(bf||={});class cK extends j0{static instance=new cK;_webserver=QU.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:Sf,runtime:"node"})}),this._webserver.use(QU.default.static("assets",{dotfiles:"allow"}));try{this._webserver.use(QU.default.static(Pn1.dirname(i.resolve("/Users/arkdev/Desktop/HYTOPIA/hytopia/assets/release/index.js")),{dotfiles:"allow"}))}catch{}}start(){if(!this._internalHttpServer)this._internalHttpServer=process.env.NODE_ENV==="production"?Mn1.createServer(this._webserver):Rn1.createServer({key:YU.existsSync("assets/certs/localhost.key")?YU.readFileSync("assets/certs/localhost.key"):iY0,cert:YU.existsSync("assets/certs/localhost.crt")?YU.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 p.warning("WebServer.start(): server already started!");this._internalHttpServer.listen(hf,this._onStarted),console.info(`WebServer.start(): Server running on port ${hf}.`)}stop(){if(this._internalHttpServer)return new Promise((Z,J)=>{this._internalHttpServer.close((X)=>{if(X)J(X);else Z(!0)})});else return p.warning("WebServer.stop(): server not started."),Promise.resolve(!1)}_onStarted=()=>{this.emitWithGlobal("WEBSERVER.READY",{})};_onUpgrade=async(Z,J,X)=>{let $=Nn1.parse(Z.url??"",!0).query,Y=$.connectionId?.toString(),Q=$.sessionToken?.toString()??"";if(Y&&R7.instance.isValidConnectionId(Y))Z.connectionId=Y;else{let K=await F7.instance.getPlayerSession(Q);if(K?.error){let W=`${K.error.code}: ${K.error.message}`;J.write(`HTTP/1.1 401 Unauthorized\r
451
451
  Content-Type: text/plain\r
452
452
  Content-Length: ${W.length}\r
453
453
  Connection: close\r