diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index dfe0770..0000000 --- a/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -# Auto detect text files and perform LF normalization -* text=auto diff --git a/.gitignore b/.gitignore index 93f0288..40b878d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,109 +1 @@ -# Custom stuff -old/ - -#===- Default node gitignore -===# - -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* - -# Diagnostic reports (https://nodejs.org/api/report.html) -report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage -*.lcov - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# TypeScript v1 declaration files -typings/ - -# TypeScript cache -*.tsbuildinfo - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Microbundle cache -.rpt2_cache/ -.rts2_cache_cjs/ -.rts2_cache_es/ -.rts2_cache_umd/ - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env -.env.test - -# parcel-bundler cache (https://parceljs.org/) -.cache - -# Next.js build output -.next - -# Nuxt.js build / generate output -.nuxt -dist - -# Gatsby files -.cache/ -# Comment in the public line in if your project uses Gatsby and *not* Next.js -# https://nextjs.org/blog/next-9-1#public-directory-support -# public - -# vuepress build output -.vuepress/dist - -# Serverless directories -.serverless/ - -# FuseBox cache -.fusebox/ - -# DynamoDB Local files -.dynamodb/ - -# TernJS port file -.tern-port +node_modules/ \ No newline at end of file diff --git a/README.md b/README.md index 16d1a54..1a71afb 100644 --- a/README.md +++ b/README.md @@ -3,21 +3,20 @@ me trying to understand minecraft beta's protocol **Implemented:** - Basic flat terrain generation + +**WIP:** + +**To Implement:** - Terrain sending - Block placement - Block breaking - Entities: - Players - -**WIP:** - - Terrain generation using perlin noise - - Cross chunk structure generation (trees, buildings, etc...) - -**To Implement:** - - Entities: - Items/Blocks - Animals - Mobs + - Terrain generation using perlin noise + - Cross chunk structure generation (trees, buildings, etc...) - Inventories - Terrain saving to disk - Sleeping in beds diff --git a/bufferStuff.ts b/bufferStuff.ts new file mode 100644 index 0000000..6338cb1 --- /dev/null +++ b/bufferStuff.ts @@ -0,0 +1,206 @@ +export class Reader { + private buffer:Buffer; + private offset:number; + + public constructor(buffer:Buffer) { + this.buffer = buffer; + this.offset = 0; + } + + public readByte() { + const value = this.buffer.readInt8(this.offset); + this.offset++; + return value; + } + + public readUByte() { + const value = this.buffer.readUInt8(this.offset); + this.offset++; + return value; + } + + public readBool() { + return Boolean(this.readUByte()); + } + + public readShort() { + const value = this.buffer.readInt16BE(this.offset); + this.offset += 2 + return value; + } + + public readInt() { + const value = this.buffer.readInt32BE(this.offset); + this.offset += 4; + return value; + } + + public readLong() { + const value = this.buffer.readBigInt64BE(this.offset); + this.offset += 8; + return value; + } + + public readFloat() { + const value = this.buffer.readFloatBE(this.offset); + this.offset += 4; + return value; + } + + public readDouble() { + const value = this.buffer.readDoubleBE(this.offset); + this.offset += 8; + return value; + } + + public readString() { + const length = this.readShort(); + let text:string = ""; + + for (let i = 0; i < length; i++) { + text += String.fromCharCode(this.readShort()); + } + + return text; + } +} + +export class Writer { + private buffer:Buffer; + private offset:number; + private resizable:boolean; + + public constructor(size:number = 0) { + this.buffer = Buffer.alloc(size); + this.offset = 0; + this.resizable = size === 0; + } + + public toBuffer() { + return this.buffer; + } + + public toString() { + return this.buffer.toString(); + } + + public writeBuffer(buffer:Buffer) { + this.buffer = Buffer.concat([this.buffer, buffer], this.buffer.length + buffer.length); + + return this; + } + + public writeByte(value:number) { + if (this.resizable) { + const buffer = Buffer.alloc(1); + buffer.writeInt8(value); + this.writeBuffer(buffer); + } else { + this.buffer.writeInt8(value, this.offset); + this.offset++; + } + + return this; + } + + public writeUByte(value:number) { + if (this.resizable) { + const buffer = Buffer.alloc(1); + buffer.writeUInt8(value); + this.writeBuffer(buffer); + } else { + this.buffer.writeUInt8(value, this.offset); + this.offset++; + } + + return this; + } + + public writeBool(value:boolean|number) { + if (typeof(value) === "number") { + value = Boolean(value); + } + this.writeUByte(value ? 1 : 0); + + return this; + } + + public writeShort(value:number) { + if (this.resizable) { + const buffer = Buffer.alloc(2); + buffer.writeInt16BE(value); + this.writeBuffer(buffer); + } else { + this.buffer.writeInt16BE(value, this.offset); + this.offset += 2; + } + + return this; + } + + public writeInt(value:number) { + if (this.resizable) { + const buffer = Buffer.alloc(4); + buffer.writeInt32BE(value); + this.writeBuffer(buffer); + } else { + this.buffer.writeInt32BE(value, this.offset); + this.offset += 4; + } + + return this; + } + + public writeLong(value:number|bigint) { + if (typeof(value) !== "bigint") { + value = BigInt(value); + } + + if (this.resizable) { + const buffer = Buffer.alloc(8); + buffer.writeBigInt64BE(value); + this.writeBuffer(buffer); + } else { + this.buffer.writeBigInt64BE(value, this.offset); + this.offset += 8; + } + + return this; + } + + public writeFloat(value:number) { + if (this.resizable) { + const buffer = Buffer.alloc(4); + buffer.writeFloatBE(value); + this.writeBuffer(buffer); + } else { + this.buffer.writeFloatBE(value, this.offset); + this.offset += 4; + } + + return this; + } + + public writeDouble(value:number) { + if (this.resizable) { + const buffer = Buffer.alloc(8); + buffer.writeDoubleBE(value); + this.writeBuffer(buffer); + } else { + this.buffer.writeDoubleBE(value, this.offset); + this.offset += 8; + } + + return this; + } + + public writeString(text:string) { + this.writeShort(text.length); + + for (let i = 0; i < text.length; i++) { + this.writeShort(text.charCodeAt(i)); + } + + return this; + } +} \ No newline at end of file diff --git a/config.json b/config.json index b016789..e5c5af3 100644 --- a/config.json +++ b/config.json @@ -1,4 +1,5 @@ { "port": 25565, - "worldThreads": 4 -} + "onlineMode": false, + "maxPlayers": 20 +} \ No newline at end of file diff --git a/config.ts b/config.ts new file mode 100644 index 0000000..e09224e --- /dev/null +++ b/config.ts @@ -0,0 +1,5 @@ +export interface Config { + port: number, + onlineMode: boolean, + maxPlayers: number +} \ No newline at end of file diff --git a/console.ts b/console.ts new file mode 100644 index 0000000..def4934 --- /dev/null +++ b/console.ts @@ -0,0 +1,67 @@ +import chalk from "chalk"; + +console.clear(); + +enum LogType { + INFO, + WARN, + ERROR +}; + +const LogTags = { + INFO: chalk.bgGreen(chalk.black(" INFO ")), + BANCHO: chalk.bgMagenta(chalk.black(" BANCHO ")), + WEBREQ: chalk.bgGreen(chalk.black(" WEBREQ ")), + CHAT: chalk.bgCyan(chalk.black(" CHAT ")), + WARN: chalk.bgYellow(chalk.black(" WARN ")), + ERROR: chalk.bgRed(" ERRR "), + REDIS: chalk.bgRed(chalk.white(" bREDIS ")), + STREAM: chalk.bgBlue(chalk.black(" STREAM ")) +} as const; + +function correctValue(i:number) : string { + if (i <= 9) return `0${i}`; + else return i.toString(); +} + +function getTime() : string { + const time = new Date(); + return chalk.green(`[${correctValue(time.getHours())}:${correctValue(time.getMinutes())}:${correctValue(time.getSeconds())}]`); +} + +function log(tag:string, log:string, logType:LogType = LogType.INFO) : void { + switch (logType) { + case LogType.INFO: + return console.log(`${getTime()} ${tag} ${log}`); + case LogType.WARN: + return console.warn(`${getTime()} ${tag} ${log}`); + case LogType.ERROR: + return console.error(`${getTime()} ${tag} ${log}`); + } +} + +export class Console { + public static printWebReq(s:string) : void { + log(LogTags.WEBREQ, s); + } + + public static printStream(s:string) : void { + log(LogTags.STREAM, s); + } + + public static printInfo(s:string) : void { + log(LogTags.INFO, s); + } + + public static printChat(s:string) : void { + log(LogTags.CHAT, s); + } + + public static printWarn(s:string) : void { + log(LogTags.WARN, s); + } + + public static printError(s:string) : void { + log(LogTags.ERROR, s); + } +} \ No newline at end of file diff --git a/funkyArray.ts b/funkyArray.ts new file mode 100644 index 0000000..c769c20 --- /dev/null +++ b/funkyArray.ts @@ -0,0 +1,73 @@ +export class FunkyArray { + private items:Map = new Map(); + private itemKeys:Array = new Array(); + + private _getKeys() : Array { + const keyArray = new Array(); + let result:IteratorResult; + const iterator = this.items.keys(); + while (!(result = iterator.next()).done) { + keyArray.push(result.value); + } + return keyArray; + } + + public set(key:T, item:TT, regenerate:boolean = true) : TT { + this.items.set(key, item); + if (regenerate) { + this.itemKeys = this._getKeys(); + } + return item; + } + + public remove(key:T, regenerate:boolean = true) { + const success = this.items.delete(key); + if (regenerate) { + this.itemKeys = this._getKeys(); + } + return success; + } + + public removeFirst(regenerate:boolean = true) { + const success = this.items.delete(this.items.keys().next().value); + if (regenerate) { + this.itemKeys = this._getKeys(); + } + return success; + } + + public first() : TT { + return this.items.values().next().value; + } + + public get length() : number { + return this.items.size; + } + + public get(key:T) : TT | undefined { + return this.items.get(key); + } + + public get keys() : Array { + return this.itemKeys; + } + + public forEach(callback: (value:TT) => void) { + return new Promise((resolve, reject) => { + if (this.items.size === 0) { + return resolve(true); + } + + try { + const iterator = this.items.values(); + let result:IteratorResult; + while (!(result = iterator.next()).done) { + callback(result.value); + } + resolve(true); + } catch (e) { + reject(e); + } + }); + } +} \ No newline at end of file diff --git a/index.js b/index.js deleted file mode 100644 index 1e5104b..0000000 --- a/index.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - ==============- index.js -============== - Created by Holly (tgpethan) (c) 2021 - Licenced under MIT - ======================================== -*/ - -const server = new (require('net').Server)(); -const config = require("./config.json"); - -const mcServer = require("./server/server.js"); - -server.listen(config.port, () => mcServer.init(config)); - -server.on('connection', mcServer.connection); \ No newline at end of file diff --git a/index.ts b/index.ts new file mode 100644 index 0000000..95f4938 --- /dev/null +++ b/index.ts @@ -0,0 +1,6 @@ +import { Config } from "./config"; +import { readFileSync } from "fs"; +import { MinecraftServer } from "./server/MinecraftServer"; +const config:Config = JSON.parse(readFileSync("./config.json").toString()) as Config; + +const mcServer = new MinecraftServer(config); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 3ee6049..8fc30a1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,30 +9,3473 @@ "version": "1.0.0", "license": "MIT", "dependencies": { + "chalk": "^4.1.0", "net": "^1.0.2" + }, + "devDependencies": { + "@types/node": "^18.15.11", + "nodemon": "^2.0.20", + "ts-loader": "^9.4.1", + "ts-node": "^10.9.1", + "typescript": "^4.9.3", + "webpack": "^5.75.0", + "webpack-cli": "^4.10.0", + "webpack-node-externals": "^3.0.0" } }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@discoveryjs/json-ext": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", + "integrity": "sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==", + "dev": true, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", + "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "dev": true, + "dependencies": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/source-map": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.3.tgz", + "integrity": "sha512-b+fsZXeLYi9fEULmfBrhxn4IrPlINf8fiNarzTof004v3lFdntdwa9PF7vFJqm3mg7s+ScJMxXaE3Acp1irZcg==", + "dev": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/@tsconfig/node10": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", + "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", + "dev": true + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.3.tgz", + "integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==", + "dev": true + }, + "node_modules/@types/eslint": { + "version": "8.37.0", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.37.0.tgz", + "integrity": "sha512-Piet7dG2JBuDIfohBngQ3rCt7MgO9xCO4xIMKxBThCq5PNRB91IjlJ10eJVwfoNtvTErmxLzwBZ7rHZtbOMmFQ==", + "dev": true, + "dependencies": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "node_modules/@types/eslint-scope": { + "version": "3.7.4", + "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.4.tgz", + "integrity": "sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA==", + "dev": true, + "dependencies": { + "@types/eslint": "*", + "@types/estree": "*" + } + }, + "node_modules/@types/estree": { + "version": "0.0.51", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.51.tgz", + "integrity": "sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==", + "dev": true + }, + "node_modules/@types/json-schema": { + "version": "7.0.11", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", + "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", + "dev": true + }, + "node_modules/@types/node": { + "version": "18.15.11", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.11.tgz", + "integrity": "sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q==", + "dev": true + }, + "node_modules/@webassemblyjs/ast": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.1.tgz", + "integrity": "sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw==", + "dev": true, + "dependencies": { + "@webassemblyjs/helper-numbers": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1" + } + }, + "node_modules/@webassemblyjs/floating-point-hex-parser": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz", + "integrity": "sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-api-error": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz", + "integrity": "sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-buffer": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.1.tgz", + "integrity": "sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-numbers": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.1.tgz", + "integrity": "sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ==", + "dev": true, + "dependencies": { + "@webassemblyjs/floating-point-hex-parser": "1.11.1", + "@webassemblyjs/helper-api-error": "1.11.1", + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webassemblyjs/helper-wasm-bytecode": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz", + "integrity": "sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-wasm-section": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.1.tgz", + "integrity": "sha512-10P9No29rYX1j7F3EVPX3JvGPQPae+AomuSTPiF9eBQeChHI6iqjMIwR9JmOJXwpnn/oVGDk7I5IlskuMwU/pg==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-buffer": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1", + "@webassemblyjs/wasm-gen": "1.11.1" + } + }, + "node_modules/@webassemblyjs/ieee754": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.1.tgz", + "integrity": "sha512-hJ87QIPtAMKbFq6CGTkZYJivEwZDbQUgYd3qKSadTNOhVY7p+gfP6Sr0lLRVTaG1JjFj+r3YchoqRYxNH3M0GQ==", + "dev": true, + "dependencies": { + "@xtuc/ieee754": "^1.2.0" + } + }, + "node_modules/@webassemblyjs/leb128": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.1.tgz", + "integrity": "sha512-BJ2P0hNZ0u+Th1YZXJpzW6miwqQUGcIHT1G/sf72gLVD9DZ5AdYTqPNbHZh6K1M5VmKvFXwGSWZADz+qBWxeRw==", + "dev": true, + "dependencies": { + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webassemblyjs/utf8": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.1.tgz", + "integrity": "sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ==", + "dev": true + }, + "node_modules/@webassemblyjs/wasm-edit": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.1.tgz", + "integrity": "sha512-g+RsupUC1aTHfR8CDgnsVRVZFJqdkFHpsHMfJuWQzWU3tvnLC07UqHICfP+4XyL2tnr1amvl1Sdp06TnYCmVkA==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-buffer": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1", + "@webassemblyjs/helper-wasm-section": "1.11.1", + "@webassemblyjs/wasm-gen": "1.11.1", + "@webassemblyjs/wasm-opt": "1.11.1", + "@webassemblyjs/wasm-parser": "1.11.1", + "@webassemblyjs/wast-printer": "1.11.1" + } + }, + "node_modules/@webassemblyjs/wasm-gen": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.1.tgz", + "integrity": "sha512-F7QqKXwwNlMmsulj6+O7r4mmtAlCWfO/0HdgOxSklZfQcDu0TpLiD1mRt/zF25Bk59FIjEuGAIyn5ei4yMfLhA==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1", + "@webassemblyjs/ieee754": "1.11.1", + "@webassemblyjs/leb128": "1.11.1", + "@webassemblyjs/utf8": "1.11.1" + } + }, + "node_modules/@webassemblyjs/wasm-opt": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.1.tgz", + "integrity": "sha512-VqnkNqnZlU5EB64pp1l7hdm3hmQw7Vgqa0KF/KCNO9sIpI6Fk6brDEiX+iCOYrvMuBWDws0NkTOxYEb85XQHHw==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-buffer": "1.11.1", + "@webassemblyjs/wasm-gen": "1.11.1", + "@webassemblyjs/wasm-parser": "1.11.1" + } + }, + "node_modules/@webassemblyjs/wasm-parser": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.1.tgz", + "integrity": "sha512-rrBujw+dJu32gYB7/Lup6UhdkPx9S9SnobZzRVL7VcBH9Bt9bCBLEuX/YXOOtBsOZ4NQrRykKhffRWHvigQvOA==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-api-error": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1", + "@webassemblyjs/ieee754": "1.11.1", + "@webassemblyjs/leb128": "1.11.1", + "@webassemblyjs/utf8": "1.11.1" + } + }, + "node_modules/@webassemblyjs/wast-printer": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.1.tgz", + "integrity": "sha512-IQboUWM4eKzWW+N/jij2sRatKMh99QEelo3Eb2q0qXkvPRISAj8Qxtmw5itwqK+TTkBuUIE45AxYPToqPtL5gg==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.1", + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webpack-cli/configtest": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.2.0.tgz", + "integrity": "sha512-4FB8Tj6xyVkyqjj1OaTqCjXYULB9FMkqQ8yGrZjRDrYh0nOE+7Lhs45WioWQQMV+ceFlE368Ukhe6xdvJM9Egg==", + "dev": true, + "peerDependencies": { + "webpack": "4.x.x || 5.x.x", + "webpack-cli": "4.x.x" + } + }, + "node_modules/@webpack-cli/info": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.5.0.tgz", + "integrity": "sha512-e8tSXZpw2hPl2uMJY6fsMswaok5FdlGNRTktvFk2sD8RjH0hE2+XistawJx1vmKteh4NmGmNUrp+Tb2w+udPcQ==", + "dev": true, + "dependencies": { + "envinfo": "^7.7.3" + }, + "peerDependencies": { + "webpack-cli": "4.x.x" + } + }, + "node_modules/@webpack-cli/serve": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.7.0.tgz", + "integrity": "sha512-oxnCNGj88fL+xzV+dacXs44HcDwf1ovs3AuEzvP7mqXw7fQntqIhQ1BRmynh4qEKQSSSRSWVyXRjmTbZIX9V2Q==", + "dev": true, + "peerDependencies": { + "webpack-cli": "4.x.x" + }, + "peerDependenciesMeta": { + "webpack-dev-server": { + "optional": true + } + } + }, + "node_modules/@xtuc/ieee754": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", + "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", + "dev": true + }, + "node_modules/@xtuc/long": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", + "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", + "dev": true + }, + "node_modules/abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true + }, + "node_modules/acorn": { + "version": "8.8.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", + "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-import-assertions": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz", + "integrity": "sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==", + "dev": true, + "peerDependencies": { + "acorn": "^8" + } + }, + "node_modules/acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "dev": true, + "peerDependencies": { + "ajv": "^6.9.1" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browserslist": { + "version": "4.21.5", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.5.tgz", + "integrity": "sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + } + ], + "dependencies": { + "caniuse-lite": "^1.0.30001449", + "electron-to-chromium": "^1.4.284", + "node-releases": "^2.0.8", + "update-browserslist-db": "^1.0.10" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001474", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001474.tgz", + "integrity": "sha512-iaIZ8gVrWfemh5DG3T9/YqarVZoYf0r188IjaGwx68j4Pf0SGY6CQkmJUIE+NZHkkecQGohzXmBGEwWDr9aM3Q==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ] + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chalk/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/chalk/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/chrome-trace-event": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", + "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==", + "dev": true, + "engines": { + "node": ">=6.0" + } + }, + "node_modules/clone-deep": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", + "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", + "dev": true, + "dependencies": { + "is-plain-object": "^2.0.4", + "kind-of": "^6.0.2", + "shallow-clone": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/colorette": { + "version": "2.0.19", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.19.tgz", + "integrity": "sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ==", + "dev": true + }, + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.4.356", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.356.tgz", + "integrity": "sha512-nEftV1dRX3omlxAj42FwqRZT0i4xd2dIg39sog/CnCJeCcL1TRd2Uh0i9Oebgv8Ou0vzTPw++xc+Z20jzS2B6A==", + "dev": true + }, + "node_modules/enhanced-resolve": { + "version": "5.12.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.12.0.tgz", + "integrity": "sha512-QHTXI/sZQmko1cbDoNAa3mJ5qhWUUNAq3vR0/YiD379fWQrcfuoX1+HW2S0MTt7XmoPLapdaDKUtelUSPic7hQ==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/envinfo": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz", + "integrity": "sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==", + "dev": true, + "bin": { + "envinfo": "dist/cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/es-module-lexer": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.9.3.tgz", + "integrity": "sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ==", + "dev": true + }, + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "dev": true, + "engines": { + "node": ">=0.8.x" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fastest-levenshtein": { + "version": "1.0.16", + "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz", + "integrity": "sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==", + "dev": true, + "engines": { + "node": ">= 4.9.1" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/glob-to-regexp": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", + "dev": true + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", + "dev": true + }, + "node_modules/import-local": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", + "integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==", + "dev": true, + "dependencies": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + }, + "bin": { + "import-local-fixture": "fixtures/cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/interpret": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz", + "integrity": "sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-core-module": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", + "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", + "dev": true, + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/jest-worker": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", + "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==", + "dev": true, + "dependencies": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": ">= 10.13.0" + } + }, + "node_modules/jest-worker/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-worker/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/loader-runner": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz", + "integrity": "sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==", + "dev": true, + "engines": { + "node": ">=6.11.5" + } + }, + "node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true + }, "node_modules/net": { "version": "1.0.2", - "integrity": "sha1-0XV+yaf7I3HYPPR1XOPifhCCk4g=" + "resolved": "https://registry.npmjs.org/net/-/net-1.0.2.tgz", + "integrity": "sha512-kbhcj2SVVR4caaVnGLJKmlk2+f+oLkjqdKeQlmUtz6nGzOpbcobwVIeSURNgraV/v3tlmGIX82OcPCl0K6RbHQ==" }, - "node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "node_modules/node-releases": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.10.tgz", + "integrity": "sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w==", + "dev": true + }, + "node_modules/nodemon": { + "version": "2.0.22", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.22.tgz", + "integrity": "sha512-B8YqaKMmyuCO7BowF1Z1/mkPqLk6cs/l63Ojtd6otKjMx47Dq1utxfRxcavH1I7VSaL8n5BUaoutadnsX3AAVQ==", + "dev": true, + "dependencies": { + "chokidar": "^3.5.2", + "debug": "^3.2.7", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.1.2", + "pstree.remy": "^1.1.8", + "semver": "^5.7.1", + "simple-update-notifier": "^1.0.7", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5" + }, "bin": { - "uuid": "dist/bin/uuid" + "nodemon": "bin/nodemon.js" + }, + "engines": { + "node": ">=8.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nodemon" + } + }, + "node_modules/nopt": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", + "integrity": "sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==", + "dev": true, + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": "*" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pstree.remy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", + "dev": true + }, + "node_modules/punycode": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", + "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/rechoir": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.1.tgz", + "integrity": "sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg==", + "dev": true, + "dependencies": { + "resolve": "^1.9.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/resolve": { + "version": "1.22.2", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", + "integrity": "sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==", + "dev": true, + "dependencies": { + "is-core-module": "^2.11.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", + "dev": true, + "dependencies": { + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/schema-utils": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", + "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", + "dev": true, + "dependencies": { + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/serialize-javascript": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.1.tgz", + "integrity": "sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==", + "dev": true, + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/shallow-clone": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", + "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/simple-update-notifier": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-1.1.0.tgz", + "integrity": "sha512-VpsrsJSUcJEseSbMHkrsrAVSdvVS5I96Qo1QAQ4FxQ9wXFcB+pjj7FB7/us9+GcgfW4ziHtYMc1J0PLczb55mg==", + "dev": true, + "dependencies": { + "semver": "~7.0.0" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/simple-update-notifier/node_modules/semver": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", + "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/tapable": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", + "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/terser": { + "version": "5.16.8", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.16.8.tgz", + "integrity": "sha512-QI5g1E/ef7d+PsDifb+a6nnVgC4F22Bg6T0xrBrz6iloVB4PUkkunp6V8nzoOOZJIzjWVdAGqCdlKlhLq/TbIA==", + "dev": true, + "dependencies": { + "@jridgewell/source-map": "^0.3.2", + "acorn": "^8.5.0", + "commander": "^2.20.0", + "source-map-support": "~0.5.20" + }, + "bin": { + "terser": "bin/terser" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/terser-webpack-plugin": { + "version": "5.3.7", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.7.tgz", + "integrity": "sha512-AfKwIktyP7Cu50xNjXF/6Qb5lBNzYaWpU6YfoX3uZicTx0zTy0stDDCsvjDapKsSDvOeWo5MEq4TmdBy2cNoHw==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.17", + "jest-worker": "^27.4.5", + "schema-utils": "^3.1.1", + "serialize-javascript": "^6.0.1", + "terser": "^5.16.5" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.1.0" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "uglify-js": { + "optional": true + } + } + }, + "node_modules/terser-webpack-plugin/node_modules/@jridgewell/resolve-uri": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", + "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/terser-webpack-plugin/node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.14", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", + "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", + "dev": true + }, + "node_modules/terser-webpack-plugin/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.18", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz", + "integrity": "sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "3.1.0", + "@jridgewell/sourcemap-codec": "1.4.14" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/touch": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", + "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", + "dev": true, + "dependencies": { + "nopt": "~1.0.10" + }, + "bin": { + "nodetouch": "bin/nodetouch.js" + } + }, + "node_modules/ts-loader": { + "version": "9.4.2", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.4.2.tgz", + "integrity": "sha512-OmlC4WVmFv5I0PpaxYb+qGeGOdm5giHU7HwDDUjw59emP2UYMHy9fFSDcYgSNoH8sXcj4hGCSEhlDZ9ULeDraA==", + "dev": true, + "dependencies": { + "chalk": "^4.1.0", + "enhanced-resolve": "^5.0.0", + "micromatch": "^4.0.0", + "semver": "^7.3.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "typescript": "*", + "webpack": "^5.0.0" + } + }, + "node_modules/ts-loader/node_modules/semver": { + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/ts-node": { + "version": "10.9.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", + "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", + "dev": true, + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/typescript": { + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/undefsafe": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", + "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", + "dev": true + }, + "node_modules/update-browserslist-db": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz", + "integrity": "sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + } + ], + "dependencies": { + "escalade": "^3.1.1", + "picocolors": "^1.0.0" + }, + "bin": { + "browserslist-lint": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true + }, + "node_modules/watchpack": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", + "integrity": "sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==", + "dev": true, + "dependencies": { + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.1.2" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/webpack": { + "version": "5.78.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.78.0.tgz", + "integrity": "sha512-gT5DP72KInmE/3azEaQrISjTvLYlSM0j1Ezhht/KLVkrqtv10JoP/RXhwmX/frrutOPuSq3o5Vq0ehR/4Vmd1g==", + "dev": true, + "dependencies": { + "@types/eslint-scope": "^3.7.3", + "@types/estree": "^0.0.51", + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/wasm-edit": "1.11.1", + "@webassemblyjs/wasm-parser": "1.11.1", + "acorn": "^8.7.1", + "acorn-import-assertions": "^1.7.6", + "browserslist": "^4.14.5", + "chrome-trace-event": "^1.0.2", + "enhanced-resolve": "^5.10.0", + "es-module-lexer": "^0.9.0", + "eslint-scope": "5.1.1", + "events": "^3.2.0", + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.2.9", + "json-parse-even-better-errors": "^2.3.1", + "loader-runner": "^4.2.0", + "mime-types": "^2.1.27", + "neo-async": "^2.6.2", + "schema-utils": "^3.1.0", + "tapable": "^2.1.1", + "terser-webpack-plugin": "^5.1.3", + "watchpack": "^2.4.0", + "webpack-sources": "^3.2.3" + }, + "bin": { + "webpack": "bin/webpack.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependenciesMeta": { + "webpack-cli": { + "optional": true + } + } + }, + "node_modules/webpack-cli": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.10.0.tgz", + "integrity": "sha512-NLhDfH/h4O6UOy+0LSso42xvYypClINuMNBVVzX4vX98TmTaTUxwRbXdhucbFMd2qLaCTcLq/PdYrvi8onw90w==", + "dev": true, + "dependencies": { + "@discoveryjs/json-ext": "^0.5.0", + "@webpack-cli/configtest": "^1.2.0", + "@webpack-cli/info": "^1.5.0", + "@webpack-cli/serve": "^1.7.0", + "colorette": "^2.0.14", + "commander": "^7.0.0", + "cross-spawn": "^7.0.3", + "fastest-levenshtein": "^1.0.12", + "import-local": "^3.0.2", + "interpret": "^2.2.0", + "rechoir": "^0.7.0", + "webpack-merge": "^5.7.3" + }, + "bin": { + "webpack-cli": "bin/cli.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "4.x.x || 5.x.x" + }, + "peerDependenciesMeta": { + "@webpack-cli/generators": { + "optional": true + }, + "@webpack-cli/migrate": { + "optional": true + }, + "webpack-bundle-analyzer": { + "optional": true + }, + "webpack-dev-server": { + "optional": true + } + } + }, + "node_modules/webpack-cli/node_modules/commander": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", + "dev": true, + "engines": { + "node": ">= 10" + } + }, + "node_modules/webpack-merge": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.8.0.tgz", + "integrity": "sha512-/SaI7xY0831XwP6kzuwhKWVKDP9t1QY1h65lAFLbZqMPIuYcD9QAW4u9STIbU9kaJbPBB/geU/gLr1wDjOhQ+Q==", + "dev": true, + "dependencies": { + "clone-deep": "^4.0.1", + "wildcard": "^2.0.0" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/webpack-node-externals": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/webpack-node-externals/-/webpack-node-externals-3.0.0.tgz", + "integrity": "sha512-LnL6Z3GGDPht/AigwRh2dvL9PQPFQ8skEpVrWZXLWBYmqcaojHNN0onvHzie6rq7EWKrrBfPYqNEzTJgiwEQDQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/webpack-sources": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz", + "integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==", + "dev": true, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wildcard": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.0.tgz", + "integrity": "sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw==", + "dev": true + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true, + "engines": { + "node": ">=6" } } }, "dependencies": { + "@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "requires": { + "@jridgewell/trace-mapping": "0.3.9" + } + }, + "@discoveryjs/json-ext": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", + "integrity": "sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==", + "dev": true + }, + "@jridgewell/gen-mapping": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", + "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "dev": true, + "requires": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "@jridgewell/resolve-uri": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "dev": true + }, + "@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "dev": true + }, + "@jridgewell/source-map": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.3.tgz", + "integrity": "sha512-b+fsZXeLYi9fEULmfBrhxn4IrPlINf8fiNarzTof004v3lFdntdwa9PF7vFJqm3mg7s+ScJMxXaE3Acp1irZcg==", + "dev": true, + "requires": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + }, + "@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "requires": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "@tsconfig/node10": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", + "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", + "dev": true + }, + "@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true + }, + "@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true + }, + "@tsconfig/node16": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.3.tgz", + "integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==", + "dev": true + }, + "@types/eslint": { + "version": "8.37.0", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.37.0.tgz", + "integrity": "sha512-Piet7dG2JBuDIfohBngQ3rCt7MgO9xCO4xIMKxBThCq5PNRB91IjlJ10eJVwfoNtvTErmxLzwBZ7rHZtbOMmFQ==", + "dev": true, + "requires": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "@types/eslint-scope": { + "version": "3.7.4", + "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.4.tgz", + "integrity": "sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA==", + "dev": true, + "requires": { + "@types/eslint": "*", + "@types/estree": "*" + } + }, + "@types/estree": { + "version": "0.0.51", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.51.tgz", + "integrity": "sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==", + "dev": true + }, + "@types/json-schema": { + "version": "7.0.11", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", + "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", + "dev": true + }, + "@types/node": { + "version": "18.15.11", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.11.tgz", + "integrity": "sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q==", + "dev": true + }, + "@webassemblyjs/ast": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.1.tgz", + "integrity": "sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw==", + "dev": true, + "requires": { + "@webassemblyjs/helper-numbers": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1" + } + }, + "@webassemblyjs/floating-point-hex-parser": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz", + "integrity": "sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ==", + "dev": true + }, + "@webassemblyjs/helper-api-error": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz", + "integrity": "sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg==", + "dev": true + }, + "@webassemblyjs/helper-buffer": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.1.tgz", + "integrity": "sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA==", + "dev": true + }, + "@webassemblyjs/helper-numbers": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.1.tgz", + "integrity": "sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ==", + "dev": true, + "requires": { + "@webassemblyjs/floating-point-hex-parser": "1.11.1", + "@webassemblyjs/helper-api-error": "1.11.1", + "@xtuc/long": "4.2.2" + } + }, + "@webassemblyjs/helper-wasm-bytecode": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz", + "integrity": "sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q==", + "dev": true + }, + "@webassemblyjs/helper-wasm-section": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.1.tgz", + "integrity": "sha512-10P9No29rYX1j7F3EVPX3JvGPQPae+AomuSTPiF9eBQeChHI6iqjMIwR9JmOJXwpnn/oVGDk7I5IlskuMwU/pg==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-buffer": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1", + "@webassemblyjs/wasm-gen": "1.11.1" + } + }, + "@webassemblyjs/ieee754": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.1.tgz", + "integrity": "sha512-hJ87QIPtAMKbFq6CGTkZYJivEwZDbQUgYd3qKSadTNOhVY7p+gfP6Sr0lLRVTaG1JjFj+r3YchoqRYxNH3M0GQ==", + "dev": true, + "requires": { + "@xtuc/ieee754": "^1.2.0" + } + }, + "@webassemblyjs/leb128": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.1.tgz", + "integrity": "sha512-BJ2P0hNZ0u+Th1YZXJpzW6miwqQUGcIHT1G/sf72gLVD9DZ5AdYTqPNbHZh6K1M5VmKvFXwGSWZADz+qBWxeRw==", + "dev": true, + "requires": { + "@xtuc/long": "4.2.2" + } + }, + "@webassemblyjs/utf8": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.1.tgz", + "integrity": "sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ==", + "dev": true + }, + "@webassemblyjs/wasm-edit": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.1.tgz", + "integrity": "sha512-g+RsupUC1aTHfR8CDgnsVRVZFJqdkFHpsHMfJuWQzWU3tvnLC07UqHICfP+4XyL2tnr1amvl1Sdp06TnYCmVkA==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-buffer": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1", + "@webassemblyjs/helper-wasm-section": "1.11.1", + "@webassemblyjs/wasm-gen": "1.11.1", + "@webassemblyjs/wasm-opt": "1.11.1", + "@webassemblyjs/wasm-parser": "1.11.1", + "@webassemblyjs/wast-printer": "1.11.1" + } + }, + "@webassemblyjs/wasm-gen": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.1.tgz", + "integrity": "sha512-F7QqKXwwNlMmsulj6+O7r4mmtAlCWfO/0HdgOxSklZfQcDu0TpLiD1mRt/zF25Bk59FIjEuGAIyn5ei4yMfLhA==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1", + "@webassemblyjs/ieee754": "1.11.1", + "@webassemblyjs/leb128": "1.11.1", + "@webassemblyjs/utf8": "1.11.1" + } + }, + "@webassemblyjs/wasm-opt": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.1.tgz", + "integrity": "sha512-VqnkNqnZlU5EB64pp1l7hdm3hmQw7Vgqa0KF/KCNO9sIpI6Fk6brDEiX+iCOYrvMuBWDws0NkTOxYEb85XQHHw==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-buffer": "1.11.1", + "@webassemblyjs/wasm-gen": "1.11.1", + "@webassemblyjs/wasm-parser": "1.11.1" + } + }, + "@webassemblyjs/wasm-parser": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.1.tgz", + "integrity": "sha512-rrBujw+dJu32gYB7/Lup6UhdkPx9S9SnobZzRVL7VcBH9Bt9bCBLEuX/YXOOtBsOZ4NQrRykKhffRWHvigQvOA==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-api-error": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1", + "@webassemblyjs/ieee754": "1.11.1", + "@webassemblyjs/leb128": "1.11.1", + "@webassemblyjs/utf8": "1.11.1" + } + }, + "@webassemblyjs/wast-printer": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.1.tgz", + "integrity": "sha512-IQboUWM4eKzWW+N/jij2sRatKMh99QEelo3Eb2q0qXkvPRISAj8Qxtmw5itwqK+TTkBuUIE45AxYPToqPtL5gg==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.11.1", + "@xtuc/long": "4.2.2" + } + }, + "@webpack-cli/configtest": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.2.0.tgz", + "integrity": "sha512-4FB8Tj6xyVkyqjj1OaTqCjXYULB9FMkqQ8yGrZjRDrYh0nOE+7Lhs45WioWQQMV+ceFlE368Ukhe6xdvJM9Egg==", + "dev": true, + "requires": {} + }, + "@webpack-cli/info": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.5.0.tgz", + "integrity": "sha512-e8tSXZpw2hPl2uMJY6fsMswaok5FdlGNRTktvFk2sD8RjH0hE2+XistawJx1vmKteh4NmGmNUrp+Tb2w+udPcQ==", + "dev": true, + "requires": { + "envinfo": "^7.7.3" + } + }, + "@webpack-cli/serve": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.7.0.tgz", + "integrity": "sha512-oxnCNGj88fL+xzV+dacXs44HcDwf1ovs3AuEzvP7mqXw7fQntqIhQ1BRmynh4qEKQSSSRSWVyXRjmTbZIX9V2Q==", + "dev": true, + "requires": {} + }, + "@xtuc/ieee754": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", + "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", + "dev": true + }, + "@xtuc/long": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", + "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", + "dev": true + }, + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true + }, + "acorn": { + "version": "8.8.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", + "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", + "dev": true + }, + "acorn-import-assertions": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz", + "integrity": "sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==", + "dev": true, + "requires": {} + }, + "acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "dev": true + }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "dev": true, + "requires": {} + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "browserslist": { + "version": "4.21.5", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.5.tgz", + "integrity": "sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==", + "dev": true, + "requires": { + "caniuse-lite": "^1.0.30001449", + "electron-to-chromium": "^1.4.284", + "node-releases": "^2.0.8", + "update-browserslist-db": "^1.0.10" + } + }, + "buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true + }, + "caniuse-lite": { + "version": "1.0.30001474", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001474.tgz", + "integrity": "sha512-iaIZ8gVrWfemh5DG3T9/YqarVZoYf0r188IjaGwx68j4Pf0SGY6CQkmJUIE+NZHkkecQGohzXmBGEwWDr9aM3Q==", + "dev": true + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "dev": true, + "requires": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "fsevents": "~2.3.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + } + }, + "chrome-trace-event": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", + "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==", + "dev": true + }, + "clone-deep": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", + "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4", + "kind-of": "^6.0.2", + "shallow-clone": "^3.0.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "colorette": { + "version": "2.0.19", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.19.tgz", + "integrity": "sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ==", + "dev": true + }, + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true + }, + "electron-to-chromium": { + "version": "1.4.356", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.356.tgz", + "integrity": "sha512-nEftV1dRX3omlxAj42FwqRZT0i4xd2dIg39sog/CnCJeCcL1TRd2Uh0i9Oebgv8Ou0vzTPw++xc+Z20jzS2B6A==", + "dev": true + }, + "enhanced-resolve": { + "version": "5.12.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.12.0.tgz", + "integrity": "sha512-QHTXI/sZQmko1cbDoNAa3mJ5qhWUUNAq3vR0/YiD379fWQrcfuoX1+HW2S0MTt7XmoPLapdaDKUtelUSPic7hQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + } + }, + "envinfo": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz", + "integrity": "sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==", + "dev": true + }, + "es-module-lexer": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.9.3.tgz", + "integrity": "sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ==", + "dev": true + }, + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true + }, + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + } + }, + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "requires": { + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + } + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + }, + "events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "dev": true + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "fastest-levenshtein": { + "version": "1.0.16", + "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz", + "integrity": "sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==", + "dev": true + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "optional": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "glob-to-regexp": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", + "dev": true + }, + "graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true + }, + "ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", + "dev": true + }, + "import-local": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", + "integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==", + "dev": true, + "requires": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + } + }, + "interpret": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz", + "integrity": "sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==", + "dev": true + }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-core-module": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", + "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true + }, + "is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", + "dev": true + }, + "jest-worker": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", + "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==", + "dev": true, + "requires": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "dependencies": { + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true + }, + "loader-runner": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz", + "integrity": "sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==", + "dev": true + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, + "merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "requires": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + } + }, + "mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true + }, + "mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, + "requires": { + "mime-db": "1.52.0" + } + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true + }, "net": { "version": "1.0.2", - "integrity": "sha1-0XV+yaf7I3HYPPR1XOPifhCCk4g=" + "resolved": "https://registry.npmjs.org/net/-/net-1.0.2.tgz", + "integrity": "sha512-kbhcj2SVVR4caaVnGLJKmlk2+f+oLkjqdKeQlmUtz6nGzOpbcobwVIeSURNgraV/v3tlmGIX82OcPCl0K6RbHQ==" }, - "uuid": { - "version": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + "node-releases": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.10.tgz", + "integrity": "sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w==", + "dev": true + }, + "nodemon": { + "version": "2.0.22", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.22.tgz", + "integrity": "sha512-B8YqaKMmyuCO7BowF1Z1/mkPqLk6cs/l63Ojtd6otKjMx47Dq1utxfRxcavH1I7VSaL8n5BUaoutadnsX3AAVQ==", + "dev": true, + "requires": { + "chokidar": "^3.5.2", + "debug": "^3.2.7", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.1.2", + "pstree.remy": "^1.1.8", + "semver": "^5.7.1", + "simple-update-notifier": "^1.0.7", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5" + } + }, + "nopt": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", + "integrity": "sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==", + "dev": true, + "requires": { + "abbrev": "1" + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true + }, + "picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "requires": { + "find-up": "^4.0.0" + } + }, + "pstree.remy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", + "dev": true + }, + "punycode": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", + "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", + "dev": true + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "requires": { + "picomatch": "^2.2.1" + } + }, + "rechoir": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.1.tgz", + "integrity": "sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg==", + "dev": true, + "requires": { + "resolve": "^1.9.0" + } + }, + "resolve": { + "version": "1.22.2", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", + "integrity": "sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==", + "dev": true, + "requires": { + "is-core-module": "^2.11.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + } + }, + "resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", + "dev": true, + "requires": { + "resolve-from": "^5.0.0" + } + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + }, + "schema-utils": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", + "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "serialize-javascript": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.1.tgz", + "integrity": "sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } + }, + "shallow-clone": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", + "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", + "dev": true, + "requires": { + "kind-of": "^6.0.2" + } + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "simple-update-notifier": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-1.1.0.tgz", + "integrity": "sha512-VpsrsJSUcJEseSbMHkrsrAVSdvVS5I96Qo1QAQ4FxQ9wXFcB+pjj7FB7/us9+GcgfW4ziHtYMc1J0PLczb55mg==", + "dev": true, + "requires": { + "semver": "~7.0.0" + }, + "dependencies": { + "semver": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", + "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", + "dev": true + } + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true + }, + "tapable": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", + "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", + "dev": true + }, + "terser": { + "version": "5.16.8", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.16.8.tgz", + "integrity": "sha512-QI5g1E/ef7d+PsDifb+a6nnVgC4F22Bg6T0xrBrz6iloVB4PUkkunp6V8nzoOOZJIzjWVdAGqCdlKlhLq/TbIA==", + "dev": true, + "requires": { + "@jridgewell/source-map": "^0.3.2", + "acorn": "^8.5.0", + "commander": "^2.20.0", + "source-map-support": "~0.5.20" + } + }, + "terser-webpack-plugin": { + "version": "5.3.7", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.7.tgz", + "integrity": "sha512-AfKwIktyP7Cu50xNjXF/6Qb5lBNzYaWpU6YfoX3uZicTx0zTy0stDDCsvjDapKsSDvOeWo5MEq4TmdBy2cNoHw==", + "dev": true, + "requires": { + "@jridgewell/trace-mapping": "^0.3.17", + "jest-worker": "^27.4.5", + "schema-utils": "^3.1.1", + "serialize-javascript": "^6.0.1", + "terser": "^5.16.5" + }, + "dependencies": { + "@jridgewell/resolve-uri": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", + "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", + "dev": true + }, + "@jridgewell/sourcemap-codec": { + "version": "1.4.14", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", + "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", + "dev": true + }, + "@jridgewell/trace-mapping": { + "version": "0.3.18", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz", + "integrity": "sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==", + "dev": true, + "requires": { + "@jridgewell/resolve-uri": "3.1.0", + "@jridgewell/sourcemap-codec": "1.4.14" + } + } + } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "touch": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", + "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", + "dev": true, + "requires": { + "nopt": "~1.0.10" + } + }, + "ts-loader": { + "version": "9.4.2", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.4.2.tgz", + "integrity": "sha512-OmlC4WVmFv5I0PpaxYb+qGeGOdm5giHU7HwDDUjw59emP2UYMHy9fFSDcYgSNoH8sXcj4hGCSEhlDZ9ULeDraA==", + "dev": true, + "requires": { + "chalk": "^4.1.0", + "enhanced-resolve": "^5.0.0", + "micromatch": "^4.0.0", + "semver": "^7.3.4" + }, + "dependencies": { + "semver": { + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + } + } + }, + "ts-node": { + "version": "10.9.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", + "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", + "dev": true, + "requires": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + } + }, + "typescript": { + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "dev": true + }, + "undefsafe": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", + "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", + "dev": true + }, + "update-browserslist-db": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz", + "integrity": "sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==", + "dev": true, + "requires": { + "escalade": "^3.1.1", + "picocolors": "^1.0.0" + } + }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true + }, + "watchpack": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", + "integrity": "sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==", + "dev": true, + "requires": { + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.1.2" + } + }, + "webpack": { + "version": "5.78.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.78.0.tgz", + "integrity": "sha512-gT5DP72KInmE/3azEaQrISjTvLYlSM0j1Ezhht/KLVkrqtv10JoP/RXhwmX/frrutOPuSq3o5Vq0ehR/4Vmd1g==", + "dev": true, + "requires": { + "@types/eslint-scope": "^3.7.3", + "@types/estree": "^0.0.51", + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/wasm-edit": "1.11.1", + "@webassemblyjs/wasm-parser": "1.11.1", + "acorn": "^8.7.1", + "acorn-import-assertions": "^1.7.6", + "browserslist": "^4.14.5", + "chrome-trace-event": "^1.0.2", + "enhanced-resolve": "^5.10.0", + "es-module-lexer": "^0.9.0", + "eslint-scope": "5.1.1", + "events": "^3.2.0", + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.2.9", + "json-parse-even-better-errors": "^2.3.1", + "loader-runner": "^4.2.0", + "mime-types": "^2.1.27", + "neo-async": "^2.6.2", + "schema-utils": "^3.1.0", + "tapable": "^2.1.1", + "terser-webpack-plugin": "^5.1.3", + "watchpack": "^2.4.0", + "webpack-sources": "^3.2.3" + } + }, + "webpack-cli": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.10.0.tgz", + "integrity": "sha512-NLhDfH/h4O6UOy+0LSso42xvYypClINuMNBVVzX4vX98TmTaTUxwRbXdhucbFMd2qLaCTcLq/PdYrvi8onw90w==", + "dev": true, + "requires": { + "@discoveryjs/json-ext": "^0.5.0", + "@webpack-cli/configtest": "^1.2.0", + "@webpack-cli/info": "^1.5.0", + "@webpack-cli/serve": "^1.7.0", + "colorette": "^2.0.14", + "commander": "^7.0.0", + "cross-spawn": "^7.0.3", + "fastest-levenshtein": "^1.0.12", + "import-local": "^3.0.2", + "interpret": "^2.2.0", + "rechoir": "^0.7.0", + "webpack-merge": "^5.7.3" + }, + "dependencies": { + "commander": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", + "dev": true + } + } + }, + "webpack-merge": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.8.0.tgz", + "integrity": "sha512-/SaI7xY0831XwP6kzuwhKWVKDP9t1QY1h65lAFLbZqMPIuYcD9QAW4u9STIbU9kaJbPBB/geU/gLr1wDjOhQ+Q==", + "dev": true, + "requires": { + "clone-deep": "^4.0.1", + "wildcard": "^2.0.0" + } + }, + "webpack-node-externals": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/webpack-node-externals/-/webpack-node-externals-3.0.0.tgz", + "integrity": "sha512-LnL6Z3GGDPht/AigwRh2dvL9PQPFQ8skEpVrWZXLWBYmqcaojHNN0onvHzie6rq7EWKrrBfPYqNEzTJgiwEQDQ==", + "dev": true + }, + "webpack-sources": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz", + "integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==", + "dev": true + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "wildcard": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.0.tgz", + "integrity": "sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw==", + "dev": true + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true } } } diff --git a/package.json b/package.json index b0da585..81278c5 100644 --- a/package.json +++ b/package.json @@ -2,8 +2,13 @@ "name": "mc-beta-server", "version": "1.0.0", "description": "", - "main": "index.js", - "scripts": {}, + "main": "index.ts", + "scripts": { + "dev:run": "nodemon --watch './**/*.ts' index.ts", + "pack": "webpack", + "build": "tsc --build", + "_clean": "tsc --build --clean" + }, "repository": { "type": "git", "url": "git+https://github.com/tgpethan/mc-beta-server.git" @@ -16,6 +21,17 @@ }, "homepage": "https://github.com/tgpethan/mc-beta-server#readme", "dependencies": { + "chalk": "^4.1.0", "net": "^1.0.2" + }, + "devDependencies": { + "@types/node": "^18.15.11", + "nodemon": "^2.0.20", + "ts-loader": "^9.4.1", + "ts-node": "^10.9.1", + "typescript": "^4.9.3", + "webpack": "^5.75.0", + "webpack-cli": "^4.10.0", + "webpack-node-externals": "^3.0.0" } } diff --git a/server/Blocks/Block.js b/server/Blocks/Block.js deleted file mode 100644 index edf2a02..0000000 --- a/server/Blocks/Block.js +++ /dev/null @@ -1,86 +0,0 @@ -class Block { - static blocksList = []; - static blockOpaqueList = []; - static blockOpacity = []; - static blockGrassable = []; - static blockContainer = []; - - constructor(blockID = 0) { - this.blockID = blockID; - - this.blockHardness = 0; - this.blockResistance = 0; - this.blockName = ""; - - if (Block.blocksList[blockID] != null) { - throw `[Block] Slot ${blockID} is already occupied by ${Block.blocksList[blockID]} when adding ID:${blockID}`; - } else { - Block.blocksList[blockID] = this; - Block.blockOpaqueList[blockID] = false; // TODO: Block opaque - Block.blockOpacity[blockID] = 0; // TODO: Opacity - Block.blockGrassable[blockID] = false; // TODO: Get if block can be grass'd - Block.blockContainer[blockID] = false; // TODO: Containers - } - } - - setHardness(hardness = 0) { - this.blockHardness = hardness; - return this; - } - - setBlockUnbreakable() { - this.blockHardness = -1; - return this; - } - - setResistance(resistance = 0) { - this.blockHardness = resistance; - return this; - } - - setName(name = "") { - this.blockName = name; - return this; - } - - static stone = new Block(1).setHardness(1.5).setResistance(10).setName("Stone"); - static grass = new Block(2).setHardness(0.6).setName("Grass"); - static dirt = new Block(3).setHardness(0.5).setName("Dirt"); - static cobblestone = new Block(4).setHardness(2.0).setResistance(10).setName("Cobblestone"); - static planks = new Block(5).setHardness(2).setResistance(5).setName("Planks"); - static sapling = new Block(6).setName("Sapling"); - static bedrock = new Block(7).setBlockUnbreakable().setResistance(6000000).setName("Bedrock"); - static waterFlowing = new Block(8).setHardness(100).setName("Flowing Water"); - static waterStill = new Block(9).setHardness(100).setName("Still Water"); - static lavaMoving = new Block(10).setHardness(1.5).setResistance(10).setName("Flowing Lava"); - static lavaStill = new Block(11).setHardness(1.5).setResistance(10).setName("Still Lava"); - static sand = new Block(12).setHardness(1.5).setResistance(10).setName("Sand"); - static gravel = new Block(13).setHardness(1.5).setResistance(10).setName("Gravel"); - static goldOre = new Block(14).setHardness(1.5).setResistance(10).setName("Gold Ore"); - static ironOre = new Block(15).setHardness(1.5).setResistance(10).setName("Iron Ore"); - static coalOre = new Block(16).setHardness(1.5).setResistance(10).setName("Coal Ore"); - static wood = new Block(17).setHardness(1.5).setResistance(10).setName("Wood"); - static leaves = new Block(18).setHardness(1.5).setResistance(10).setName("Leaves"); - static sponge = new Block(19).setHardness(1.5).setResistance(10).setName("Sponge"); - static glass = new Block(20).setHardness(1.5).setResistance(10).setName("Glass"); - static lapisOre = new Block(21).setHardness(1.5).setResistance(10).setName("Lapis Ore"); - static lapisBlock = new Block(22).setHardness(1.5).setResistance(10).setName("Lapis Block"); - static dispenser = new Block(23).setHardness(1.5).setResistance(10).setName("Dispenser"); - static sandStone = new Block(24).setHardness(1.5).setResistance(10).setName("Sandstone"); - static noteBlock = new Block(25).setHardness(1.5).setResistance(10).setName("Noteblock"); - static blockBed = new Block(26).setHardness(1.5).setResistance(10).setName("Bed"); - static poweredRail = new Block(27).setHardness(1.5).setResistance(10).setName("Powered Rail"); - static detectorRail = new Block(28).setHardness(1.5).setResistance(10).setName("Detector Rail"); - static stickyPisonBase = new Block(29).setHardness(1.5).setResistance(10).setName("Sticky Piston Base"); - static cobweb = new Block(30).setHardness(4).setName("Cobweb"); - static tallGrass = new Block(31).setName("Tall Grass"); - static deadBush = new Block(32).setName("Dead Bush"); - static pistonBase = new Block(33).setName("Piston Base"); - static pistonExtension = new Block(34).setName("Piston Extension"); - static wool = new Block(35).setHardness(0.8).setName("Wool"); - static pistonMoving = new Block(36).setName("Piston Moving") - static dandilion = new Block(37).setName("Dandilion"); - static rose = new Block(38).setName("Rose"); -} - -module.exports = Block; \ No newline at end of file diff --git a/server/Chunk.ts b/server/Chunk.ts new file mode 100644 index 0000000..ac037ed --- /dev/null +++ b/server/Chunk.ts @@ -0,0 +1,36 @@ +import { Block } from "./blocks/Block"; +import { World } from "./World"; + +export class Chunk { + private readonly MAX_HEIGHT:number = 128; + private readonly world:World; + private readonly x:number; + private readonly z:number; + + private blocks:Uint8Array; + + public static CreateCoordPair(x:number, z:number) { + return (x >= 0 ? 0 : 2147483648) | (x & 0x7fff) << 16 | (z >= 0 ? 0 : 0x8000) | z & 0x7fff; + } + + public constructor(world:World, x:number, z:number) { + this.world = world; + this.x = x; + this.z = z; + this.blocks = new Uint8Array(16 * 16 * this.MAX_HEIGHT); + + this.world.generator.generate(this); + } + + public setBlock(blockId:number, x:number, y:number, z:number) { + this.blocks[x << 11 | z << 7 | y] = blockId; + } + + public getBlockId(x:number, y:number, z:number) { + return this.blocks[x << 11 | z << 7 | y]; + } + + public getData() { + return this.blocks; + } +} \ No newline at end of file diff --git a/server/Commands/Command.js b/server/Commands/Command.js deleted file mode 100644 index e69de29..0000000 diff --git a/server/Converter.js b/server/Converter.js deleted file mode 100644 index b6e3c64..0000000 --- a/server/Converter.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - ============- Converter.js -============ - Created by Holly (tgpethan) (c) 2021 - Licenced under MIT - ======================================== -*/ - -module.exports.toAbsoluteInt = function(float = 0.0) { - return Math.floor(float * 32.0); -} - -module.exports.to360Fraction = function(float = 0.0) { - if (float < 0) { - return Math.abs(Math.max(Math.floor((map(float, 0, -360, 360, 0) / 360) * 256) - 1, 0)); - } else if (float > 0) { - return Math.max(Math.floor((float / 360) * 256) - 1, 0); - } - //return Math.max(Math.floor((float / 360) * 256), 0) - 1; -} - -function map(input, inputMin, inputMax, outputMin, outputMax) { - const newv = (input - inputMin) / (inputMax - inputMin) * (outputMax - outputMin) + outputMin; - - if (outputMin < outputMax) return constrain(newv, outputMin, outputMax); - else return constrain(newv, outputMax, outputMin); -} - -function constrain(input, low, high) { - return Math.max(Math.min(input, high), low); -} \ No newline at end of file diff --git a/server/Entities/Entity.js b/server/Entities/Entity.js deleted file mode 100644 index fe4ec26..0000000 --- a/server/Entities/Entity.js +++ /dev/null @@ -1,28 +0,0 @@ -/* - ==============- Entity.js -============= - Created by Holly (tgpethan) (c) 2021 - Licenced under MIT - ======================================== -*/ - -class Entity { - constructor(EID = 0, x = 0, y = 0, z = 0, yaw = 0, pitch = 0) { - this.EID = EID; - - this.x = x; - this.y = y; - this.z = z; - this.yaw = yaw; - this.pitch = pitch; - - this.motionX = 0; - this.motionY = 0; - this.motionZ = 0; - } - - onTick() { - - } -} - -module.exports = Entity; \ No newline at end of file diff --git a/server/Entities/EntityItem.js b/server/Entities/EntityItem.js deleted file mode 100644 index 6268fe9..0000000 --- a/server/Entities/EntityItem.js +++ /dev/null @@ -1,20 +0,0 @@ -/* - ============- EntityItem.js -=========== - Created by Holly (tgpethan) (c) 2021 - Licenced under MIT - ======================================== -*/ - -const Entity = require("./Entity.js"); - -class EntityItem extends Entity { - constructor(itemStack, x = 0, y = 0, z = 0) { - super(global.fromIDPool(), x, y, z); - - this.itemStack = itemStack; - - this.motionX = (Math.random() * 0.2 - 0.1); - this.motionY = 0.2; - this.motionZ = (Math.random() * 0.2 - 0.1); - } -} \ No newline at end of file diff --git a/server/Entities/EntityLiving.js b/server/Entities/EntityLiving.js deleted file mode 100644 index 178d52b..0000000 --- a/server/Entities/EntityLiving.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - ==========- EntityLiving.js -=========== - Created by Holly (tgpethan) (c) 2021 - Licenced under MIT - ======================================== -*/ - -const Entity = require("./Entity.js"); - -class EntityLiving extends Entity { - constructor(EID = 0, x = 0, y = 0, z = 0) { - super(EID, x, y, z); - - - } - - onTick() { - super.onTick(); - } -} - -module.exports = EntityLiving; \ No newline at end of file diff --git a/server/Entities/EntityPlayer.js b/server/Entities/EntityPlayer.js deleted file mode 100644 index 0a32ba8..0000000 --- a/server/Entities/EntityPlayer.js +++ /dev/null @@ -1,73 +0,0 @@ -/* - ===========- EntityPlayer.js -========== - Created by Holly (tgpethan) (c) 2021 - Licenced under MIT - ======================================== -*/ - -const EntityLiving = require("./EntityLiving.js"); -const user = require("../user.js"); - -const Converter = require("../Converter.js"); -const PacketMappingTable = require("../PacketMappingTable.js"); -const NamedPackets = require("../NamedPackets.js"); - -class EntityPlayer extends EntityLiving { - constructor(parent = new user, x = 0, y = 0, z = 0) { - super(parent.id, x, y, z); - - this.lastX = 0; - this.lastY = 0; - this.lastZ = 0; - this.absX = 0; - this.absY = 0; - this.absZ = 0; - - this.absYaw = 0; - this.absPitch = 0; - - this.lastYaw = 0; - this.lastPitch = 0; - - this.allPacket = new PacketMappingTable[NamedPackets.EntityTeleport](this.EID, this.x, this.y, this.z, this.absYaw, this.absPitch); - this.allPacket.soup(); - this.allPacket.writePacket(); - - this.parentPlayer = parent; - } - - onTick() { - super.onTick(); - - this.absX = this.x.toFixed(2); - this.absY = this.y.toFixed(2); - this.absZ = this.z.toFixed(2); - - this.absYaw = Math.floor(this.yaw); - this.absPitch = Math.floor(this.pitch); - - if ((this.absX != this.lastX || this.absY != this.lastY || this.absZ != this.lastZ)) { - // all - this.allPacket.writer.offset = 5; - this.allPacket.writer.writeInt(Converter.toAbsoluteInt(this.x)); - this.allPacket.writer.writeInt(Converter.toAbsoluteInt(this.y)); - this.allPacket.writer.writeInt(Converter.toAbsoluteInt(this.z)); - this.allPacket.writer.writeUByte(Converter.to360Fraction(this.absYaw)); - this.allPacket.writer.writeUByte(Converter.to360Fraction(this.absPitch)); - - global.sendToAllPlayersButSelf(this.EID, this.allPacket.toBuffer()); - } else if (this.absYaw != this.lastYaw || this.absPitch != this.lastPitch) { - // look only - global.sendToAllPlayersButSelf(this.EID, new PacketMappingTable[NamedPackets.EntityLook](this.EID, this.absYaw, this.absPitch).writePacket()); - } - - this.lastYaw = this.absYaw; - this.lastPitch = this.absPitch; - - this.lastX = this.absX; - this.lastY = this.absY; - this.lastZ = this.absZ; - } -} - -module.exports = EntityPlayer; \ No newline at end of file diff --git a/server/Generators/GeneratorFlat.js b/server/Generators/GeneratorFlat.js deleted file mode 100644 index da17442..0000000 --- a/server/Generators/GeneratorFlat.js +++ /dev/null @@ -1,31 +0,0 @@ -const Block = require("../Blocks/Block.js"); - -module.exports = function(x = 0, z = 0) { - // Create chunk - let chunk = {}; - for (let y = 0; y < 128; y++) { - chunk[y] = {}; - for (let x = 0; x < 16; x++) { - chunk[y][x] = {}; - for (let z = 0; z < 16; z++) { - chunk[y][x][z] = [0, 0]; - } - } - } - - for (let y = 0; y < 128; y++) { - for (let x = 0; x < 16; x++) { - for (let z = 0; z < 16; z++) { - if (y == 64) { - chunk[y][x][z] = 2; - } - else if (y == 63 || y == 62) chunk[y][x][z][0] = Block.dirt.blockID; - else if (y == 0) chunk[y][x][z][0] = Block.bedrock.blockID; - else if (y < 62) chunk[y][x][z][0] = Block.stone.blockID; - else chunk[y][x][z][0] = 0; - } - } - } - - return chunk; -} \ No newline at end of file diff --git a/server/Generators/GeneratorPerlin.js b/server/Generators/GeneratorPerlin.js deleted file mode 100644 index 66ce940..0000000 --- a/server/Generators/GeneratorPerlin.js +++ /dev/null @@ -1,187 +0,0 @@ -const { perlin2D } = require("./perlin.js"); -const Block = require("../Blocks/Block.js"); - -module.exports = function(cx = 0, cz = 0, seed = 0) { - // Create bare chunk - let chunk = {}; - for (let y = 0; y < 128; y++) { - chunk[y] = {}; - for (let x = 0; x < 16; x++) { - chunk[y][x] = {}; - for (let z = 0; z < 16; z++) { - chunk[y][x][z] = [0, 0]; - } - } - } - - let stripTopCoord = {}; - // History has shown it's better to alloc all at once - for (let x = 0; x < 16; x++) { - stripTopCoord[x] = {}; - for (let z = 0; z < 16; z++) { - stripTopCoord[x][z] = 0; - } - } - - // Generate top layer of grass - for (let x = 0; x < 16; x++) { - for (let z = 0; z < 16; z++) { - // NOTE: Because of the way this is, it is not random at all. The heightmap is simply offset so uhhh. - // TODO: Figure out a better way of dealing with this :) - const layer1 = (64 + (perlin2D(((cx << 4) + x) / 15, ((cz << 4) + z) / 15) * 10)); - const layer2 = (64 + (perlin2D(((cx + (10 + seed) << 4) + x) / 15, ((cz + (4 + seed) << 4) + z) / 15) * 10)); - const layer3_1 = (64 + (perlin2D(((cx + (-15 + seed) << 4) + x) / 15, ((cz + (-2 + seed) << 4) + z) / 15) * 23)); - const layer3_2 = (64 + (perlin2D(((cx + (25 + seed) << 4) + x) / 15, ((cz + (-17 + seed) << 4) + z) / 15) * 40)); - const layer3 = (layer3_1 + layer3_2) / 2; - const average = Math.floor((layer1 + layer2 + layer3) / 3); - stripTopCoord[x][z] = average; - chunk[average][x][z][0] = Block.grass.blockID; - } - } - - // Generate down from the top layer - for (let x = 0; x < 16; x++) { - for (let z = 0; z < 16; z++) { - // Cache these otherwise we'll be doing more maths 128 times for each column and row - const topM1 = stripTopCoord[x][z] - 1, - topM2 = topM1 - 1; - - for (let y = stripTopCoord[x][z]; y != -1; y--) { - if (y == topM1 || y == topM2) chunk[y][x][z][0] = Block.dirt.blockID; - else if (y == 0) chunk[y][x][z][0] = Block.bedrock.blockID; - else if (y < topM2) chunk[y][x][z][0] = Block.stone.blockID; - } - } - } - - // 2nd pass - for (let y = 0; y < 128; y++) { - for (let x = 0; x < 16; x++) { - for (let z = 0; z < 16; z++) { - if (chunk[y][x][z][0] == 0 && y < 64) chunk[y][x][z][0] = Block.waterStill.blockID; - - if (y < 127 && y > 0) if (chunk[y][x][z][0] == Block.waterStill.blockID && chunk[y - 1][x][z][0] == 2) chunk[y - 1][x][z][0] = Block.dirt.blockID; - - //if (x == 0 && z == 0) chunk[y][x][z] = 57; - } - } - } - - let treeBlocks = []; - - const chunkX = cx << 4; - const chunkZ = cz << 4; - let topBlock = 0; - // 3rd pass??? - for (let x = 0; x < 16; x++) { - for (let z = 0; z < 16; z++) { - topBlock = stripTopCoord[x][z]; - - if (chunk[topBlock][x][z][0] == Block.grass.blockID) { - if (Math.floor(Math.random() * 5) == 0) { - chunk[topBlock + 1][x][z][0] = Block.tallGrass.blockID; - chunk[topBlock + 1][x][z][1] = 1; - } else if (Math.floor(Math.random() * 150) == 0) { - chunk[topBlock + 1][x][z][0] = Block.rose.blockID; - } else if (Math.floor(Math.random() * 150) == 0) { - chunk[topBlock + 1][x][z][0] = Block.dandilion.blockID; - } - } - - // Need a better way of doing this it currently takes a severely long time (gee I wonder why) - if (chunk[topBlock][x][z][0] == 2 && Math.floor(Math.random() * 200) == 0) { - chunk[topBlock][x][z][0] = 3; - // Logs - treeBlocks.push([(chunkX + x), topBlock + 1, (chunkZ + z), Block.wood.blockID]); - treeBlocks.push([(chunkX + x), topBlock + 2, (chunkZ + z), Block.wood.blockID]); - treeBlocks.push([(chunkX + x), topBlock + 3, (chunkZ + z), Block.wood.blockID]); - treeBlocks.push([(chunkX + x), topBlock + 4, (chunkZ + z), Block.wood.blockID]); - treeBlocks.push([(chunkX + x), topBlock + 5, (chunkZ + z), Block.wood.blockID]); - - // Leaves - // Layer 1 - treeBlocks.push([(chunkX + x) - 1, topBlock + 3, (chunkZ + z), Block.leaves.blockID]); - treeBlocks.push([(chunkX + x) - 2, topBlock + 3, (chunkZ + z), Block.leaves.blockID]); - treeBlocks.push([(chunkX + x) + 1, topBlock + 3, (chunkZ + z), Block.leaves.blockID]); - treeBlocks.push([(chunkX + x) + 2, topBlock + 3, (chunkZ + z), Block.leaves.blockID]); - - treeBlocks.push([(chunkX + x), topBlock + 3, (chunkZ + z) - 1, Block.leaves.blockID]); - treeBlocks.push([(chunkX + x), topBlock + 3, (chunkZ + z) - 2, Block.leaves.blockID]); - treeBlocks.push([(chunkX + x), topBlock + 3, (chunkZ + z) + 1, Block.leaves.blockID]); - treeBlocks.push([(chunkX + x), topBlock + 3, (chunkZ + z) + 2, Block.leaves.blockID]); - - treeBlocks.push([(chunkX + x) + 1, topBlock + 3, (chunkZ + z) - 1, Block.leaves.blockID]); - treeBlocks.push([(chunkX + x) + 1, topBlock + 3, (chunkZ + z) - 2, Block.leaves.blockID]); - treeBlocks.push([(chunkX + x) + 1, topBlock + 3, (chunkZ + z) + 1, Block.leaves.blockID]); - treeBlocks.push([(chunkX + x) + 1, topBlock + 3, (chunkZ + z) + 2, Block.leaves.blockID]); - - treeBlocks.push([(chunkX + x) + 2, topBlock + 3, (chunkZ + z) - 1, Block.leaves.blockID]); - treeBlocks.push([(chunkX + x) + 2, topBlock + 3, (chunkZ + z) - 2, Block.leaves.blockID]); - treeBlocks.push([(chunkX + x) + 2, topBlock + 3, (chunkZ + z) + 1, Block.leaves.blockID]); - treeBlocks.push([(chunkX + x) + 2, topBlock + 3, (chunkZ + z) + 2, Block.leaves.blockID]); - - treeBlocks.push([(chunkX + x) - 1, topBlock + 3, (chunkZ + z) - 1, Block.leaves.blockID]); - treeBlocks.push([(chunkX + x) - 1, topBlock + 3, (chunkZ + z) - 2, Block.leaves.blockID]); - treeBlocks.push([(chunkX + x) - 1, topBlock + 3, (chunkZ + z) + 1, Block.leaves.blockID]); - treeBlocks.push([(chunkX + x) - 1, topBlock + 3, (chunkZ + z) + 2, Block.leaves.blockID]); - - treeBlocks.push([(chunkX + x) - 2, topBlock + 3, (chunkZ + z) - 1, Block.leaves.blockID]); - treeBlocks.push([(chunkX + x) - 2, topBlock + 3, (chunkZ + z) - 2, Block.leaves.blockID]); - treeBlocks.push([(chunkX + x) - 2, topBlock + 3, (chunkZ + z) + 1, Block.leaves.blockID]); - treeBlocks.push([(chunkX + x) - 2, topBlock + 3, (chunkZ + z) + 2, Block.leaves.blockID]); - - // Layer 2 - treeBlocks.push([(chunkX + x) - 1, topBlock + 4, (chunkZ + z), Block.leaves.blockID]); - treeBlocks.push([(chunkX + x) - 2, topBlock + 4, (chunkZ + z), Block.leaves.blockID]); - treeBlocks.push([(chunkX + x) + 1, topBlock + 4, (chunkZ + z), Block.leaves.blockID]); - treeBlocks.push([(chunkX + x) + 2, topBlock + 4, (chunkZ + z), Block.leaves.blockID]); - - treeBlocks.push([(chunkX + x), topBlock + 4, (chunkZ + z) - 1, Block.leaves.blockID]); - treeBlocks.push([(chunkX + x), topBlock + 4, (chunkZ + z) - 2, Block.leaves.blockID]); - treeBlocks.push([(chunkX + x), topBlock + 4, (chunkZ + z) + 1, Block.leaves.blockID]); - treeBlocks.push([(chunkX + x), topBlock + 4, (chunkZ + z) + 2, Block.leaves.blockID]); - - treeBlocks.push([(chunkX + x) + 1, topBlock + 4, (chunkZ + z) - 1, Block.leaves.blockID]); - treeBlocks.push([(chunkX + x) + 1, topBlock + 4, (chunkZ + z) - 2, Block.leaves.blockID]); - treeBlocks.push([(chunkX + x) + 1, topBlock + 4, (chunkZ + z) + 1, Block.leaves.blockID]); - treeBlocks.push([(chunkX + x) + 1, topBlock + 4, (chunkZ + z) + 2, Block.leaves.blockID]); - - treeBlocks.push([(chunkX + x) + 2, topBlock + 4, (chunkZ + z) - 1, Block.leaves.blockID]); - treeBlocks.push([(chunkX + x) + 2, topBlock + 4, (chunkZ + z) - 2, Block.leaves.blockID]); - treeBlocks.push([(chunkX + x) + 2, topBlock + 4, (chunkZ + z) + 1, Block.leaves.blockID]); - treeBlocks.push([(chunkX + x) + 2, topBlock + 4, (chunkZ + z) + 2, Block.leaves.blockID]); - - treeBlocks.push([(chunkX + x) - 1, topBlock + 4, (chunkZ + z) - 1, Block.leaves.blockID]); - treeBlocks.push([(chunkX + x) - 1, topBlock + 4, (chunkZ + z) - 2, Block.leaves.blockID]); - treeBlocks.push([(chunkX + x) - 1, topBlock + 4, (chunkZ + z) + 1, Block.leaves.blockID]); - treeBlocks.push([(chunkX + x) - 1, topBlock + 4, (chunkZ + z) + 2, Block.leaves.blockID]); - - treeBlocks.push([(chunkX + x) - 2, topBlock + 4, (chunkZ + z) - 1, Block.leaves.blockID]); - treeBlocks.push([(chunkX + x) - 2, topBlock + 4, (chunkZ + z) - 2, Block.leaves.blockID]); - treeBlocks.push([(chunkX + x) - 2, topBlock + 4, (chunkZ + z) + 1, Block.leaves.blockID]); - treeBlocks.push([(chunkX + x) - 2, topBlock + 4, (chunkZ + z) + 2, Block.leaves.blockID]); - - // Layer 3 - treeBlocks.push([(chunkX + x) - 1, topBlock + 5, (chunkZ + z), Block.leaves.blockID]); - treeBlocks.push([(chunkX + x) + 1, topBlock + 5, (chunkZ + z), Block.leaves.blockID]); - treeBlocks.push([(chunkX + x), topBlock + 5, (chunkZ + z) - 1, Block.leaves.blockID]); - treeBlocks.push([(chunkX + x), topBlock + 5, (chunkZ + z) + 1, Block.leaves.blockID]); - - treeBlocks.push([(chunkX + x) - 1, topBlock + 5, (chunkZ + z) - 1, Block.leaves.blockID]); - treeBlocks.push([(chunkX + x) + 1, topBlock + 5, (chunkZ + z) + 1, Block.leaves.blockID]); - treeBlocks.push([(chunkX + x) - 1, topBlock + 5, (chunkZ + z) - 1, Block.leaves.blockID]); - treeBlocks.push([(chunkX + x) + 1, topBlock + 5, (chunkZ + z) + 1, Block.leaves.blockID]); - treeBlocks.push([(chunkX + x) + 1, topBlock + 5, (chunkZ + z) - 1, Block.leaves.blockID]); - - // Layer 4 - treeBlocks.push([(chunkX + x) - 1, topBlock + 6, (chunkZ + z), Block.leaves.blockID]); - treeBlocks.push([(chunkX + x) + 1, topBlock + 6, (chunkZ + z), Block.leaves.blockID]); - treeBlocks.push([(chunkX + x), topBlock + 6, (chunkZ + z) - 1, Block.leaves.blockID]); - treeBlocks.push([(chunkX + x), topBlock + 6, (chunkZ + z) + 1, Block.leaves.blockID]); - treeBlocks.push([(chunkX + x), topBlock + 6, (chunkZ + z), Block.leaves.blockID]); - } - } - } - - return [chunk, treeBlocks]; -} \ No newline at end of file diff --git a/server/Generators/perlin.js b/server/Generators/perlin.js deleted file mode 100644 index cba4ff9..0000000 --- a/server/Generators/perlin.js +++ /dev/null @@ -1,307 +0,0 @@ -/** - * A Perlin Noise library for JavaScript. - * - * Based on implementations by Ken Perlin (Java, C) & Stefan Gustavson (C). - * - * MIT License. - * Copyright (c) 2018 Leonardo de S.L.F. - * http://leodeslf.com/ - */ - -// Permutation table. - -const p = [ - 151, 160, 137, 91, 90, 15, 131, 13, 201, 95, 96, 53, 194, 233, 7, 225, 140, - 36, 103, 30, 69, 142, 8, 99, 37, 240, 21, 10, 23, 190, 6, 148, 247, 120, 234, - 75, 0, 26, 197, 62, 94, 252, 219, 203, 117, 35, 11, 32, 57, 177, 33, 88, 237, - 149, 56, 87, 174, 20, 125, 136, 171, 168, 68, 175, 74, 165, 71, 134, 139, 48, - 27, 166, 77, 146, 158, 231, 83, 111, 229, 122, 60, 211, 133, 230, 220, 105, - 92, 41, 55, 46, 245, 40, 244, 102, 143, 54, 65, 25, 63, 161, 1, 216, 80, 73, - 209, 76, 132, 187, 208, 89, 18, 169, 200, 196, 135, 130, 116, 188, 159, 86, - 164, 100, 109, 198, 173, 186, 3, 64, 52, 217, 226, 250, 124, 123, 5, 202, 38, - 147, 118, 126, 255, 82, 85, 212, 207, 206, 59, 227, 47, 16, 58, 17, 182, 189, - 28, 42, 223, 183, 170, 213, 119, 248, 152, 2, 44, 154, 163, 70, 221, 153, - 101, 155, 167, 43, 172, 9, 129, 22, 39, 253, 19, 98, 108, 110, 79, 113, 224, - 232, 178, 185, 112, 104, 218, 246, 97, 228, 251, 34, 242, 193, 238, 210, 144, - 12, 191, 179, 162, 241, 81, 51, 145, 235, 249, 14, 239, 107, 49, 192, 214, - 31, 181, 199, 106, 157, 184, 84, 204, 176, 115, 121, 50, 45, 127, 4, 150, - 254, 138, 236, 205, 93, 222, 114, 67, 29, 24, 72, 243, 141, 128, 195, 78, 66, - 215, 61, 156, 180 -]; -const P = [...p, ...p]; - -// Utility functions. - -function fade(t) { - return t * t * t * (t * (t * 6 - 15) + 10); -} - -function lerp(t, a, b) { - return a + t * (b - a); -} - -// Helper functions to find gradients for each vertex. - -function gradient1D(hash, x) { - return hash & 1 ? -x : x; -} - -function gradient2D(hash, x, y) { - const H = hash & 3; - return (H < 2 ? x : -x) + (H === 0 || H === 2 ? y : -y); -} - -function gradient3D(hash, x, y, z) { - const - H = hash & 15, - U = H < 8 ? x : y, - V = H < 4 ? y : H === 12 || H === 14 ? x : z; - return ((H & 1) ? -U : U) + ((H & 2) ? -V : V); -} - -function gradient4D(hash, x, y, z, t) { - const - H = hash & 31, - U = H < 24 ? x : y, - V = H < 16 ? y : z, - W = H < 8 ? z : t; - return ((H & 1) ? -U : U) + ((H & 2) ? -V : V) + ((H & 4) ? -W : W); -} - -// Perlin Noise functions. - -/** - * Returns a one-dimensional noise value between -1 and 1. - * @param {number} x A numeric expression. - * @returns {number} Perlin Noise value. - */ -function perlin1D(x) { - const - FX = Math.floor(x), - X = FX & 255; - - x = x - FX; - - return lerp( - fade(x), - gradient1D(P[P[X]], x), - gradient1D(P[P[X + 1]], x - 1) - ); -} - -/** - * Returns a two-dimensional noise value between -1 and 1. - * @param {number} x A numeric expression. - * @param {number} y A numeric expression. - * @returns {number} Perlin Noise value. - */ -function perlin2D(x = 0, y = 0) { - // Hack to allow this to work with integer block coords - x += 0.2; - y += 0.2; - - const FX = Math.floor(x), - FY = Math.floor(y), - X = FX & 255, - Y = FY & 255, - A = P[X] + Y, - B = P[X + 1] + Y; - - x = x - FX; - y = y - FY; - - const - FDX = fade(x), - x1 = x - 1, - y1 = y - 1; - - return lerp( - fade(y), - lerp( - FDX, - gradient2D(P[A], x, y), - gradient2D(P[B], x1, y) - ), - lerp( - FDX, - gradient2D(P[A + 1], x, y1), - gradient2D(P[B + 1], x1, y1) - ) - ); -} - -/** - * Returns a three-dimensional noise value between -1 and 1. - * @param {number} x A numeric expression. - * @param {number} y A numeric expression. - * @param {number} z A numeric expression. - * @returns {number} Perlin Noise value. - */ -function perlin3D(x, y, z) { - const - FX = Math.floor(x), - FY = Math.floor(y), - FZ = Math.floor(z), - X = FX & 255, - Y = FY & 255, - Z = FZ & 255, - A = P[X] + Y, - B = P[X + 1] + Y, - AA = P[A] + Z, - BA = P[B] + Z, - AB = P[A + 1] + Z, - BB = P[B + 1] + Z; - - x = x - FX; - y = y - FY; - z = z - FZ; - - const - FDX = fade(x), - FDY = fade(y), - x1 = x - 1, - y1 = y - 1, - z1 = z - 1; - - return lerp( - fade(z), - lerp( - FDY, - lerp( - FDX, - gradient3D(P[AA], x, y, z), - gradient3D(P[BA], x1, y, z) - ), - lerp( - FDX, - gradient3D(P[AB], x, y1, z), - gradient3D(P[BB], x1, y1, z) - ) - ), - lerp( - FDY, - lerp( - FDX, - gradient3D(P[AA + 1], x, y, z1), - gradient3D(P[BA + 1], x1, y, z1) - ), - lerp( - FDX, - gradient3D(P[AB + 1], x, y1, z1), - gradient3D(P[BB + 1], x1, y1, z1) - ) - ) - ); -} - -/** - * Returns a four-dimensional noise value between -1 and 1. - * @param {number} x A numeric expression. - * @param {number} y A numeric expression. - * @param {number} z A numeric expression. - * @param {number} t A numeric expression. - * @returns {number} Perlin Noise value. - */ -function perlin4D(x, y, z, t) { - const - FX = Math.floor(x), - FY = Math.floor(y), - FZ = Math.floor(z), - FT = Math.floor(t), - X = FX & 255, - Y = FY & 255, - Z = FZ & 255, - T = FT & 255, - A = P[X] + Y, - B = P[X + 1] + Y, - AA = P[A] + Z, - BA = P[B] + Z, - AB = P[A + 1] + Z, - BB = P[B + 1] + Z, - AAA = P[AA] + T, - BAA = P[BA] + T, - ABA = P[AB] + T, - BBA = P[BB] + T, - AAB = P[AA + 1] + T, - BAB = P[BA + 1] + T, - ABB = P[AB + 1] + T, - BBB = P[BB + 1] + T; - - x = x - FX; - y = y - FY; - z = z - FZ; - t = t - FT; - - const - FDX = fade(x), - FDY = fade(y), - FDZ = fade(z), - x1 = x - 1, - y1 = y - 1, - z1 = z - 1, - t1 = t - 1; - - return lerp( - fade(t), - lerp( - FDZ, - lerp( - FDY, - lerp( - FDX, - gradient4D(P[AAA], x, y, z, t), - gradient4D(P[BAA], x1, y, z, t) - ), - lerp( - FDX, - gradient4D(P[ABA], x, y1, z, t), - gradient4D(P[BBA], x1, y1, z, t) - ) - ), - lerp( - FDY, - lerp( - FDX, - gradient4D(P[AAB], x, y, z1, t), - gradient4D(P[BAB], x1, y, z1, t) - ), - lerp( - FDX, - gradient4D(P[ABB], x, y1, z1, t), - gradient4D(P[BBB], x1, y1, z1, t) - ) - ) - ), - lerp( - FDZ, - lerp( - FDY, - lerp( - FDX, - gradient4D(P[AAA + 1], x, y, z, t1), - gradient4D(P[BAA + 1], x1, y, z, t1) - ), - lerp( - FDX, - gradient4D(P[ABA + 1], x, y1, z, t1), - gradient4D(P[BBA + 1], x1, y1, z, t1) - ) - ), - lerp( - FDY, - lerp( - FDX, - gradient4D(P[AAB + 1], x, y, z1, t1), - gradient4D(P[BAB + 1], x1, y, z1, t1) - ), - lerp( - FDX, - gradient4D(P[ABB + 1], x, y1, z1, t1), - gradient4D(P[BBB + 1], x1, y1, z1, t1) - ) - ) - ) - ); -} - -module.exports = { perlin1D, perlin2D, perlin3D, perlin4D }; \ No newline at end of file diff --git a/server/Inventories/Inventory.js b/server/Inventories/Inventory.js deleted file mode 100644 index 893d3f9..0000000 --- a/server/Inventories/Inventory.js +++ /dev/null @@ -1,23 +0,0 @@ -const ItemStack = require("../ItemStack.js"); - -module.exports = class { - constructor() { - this.Slots = {}; - } - - saveData() { - - } - - loadData() { - - } - - getSlot(slot = 0) { - return this.Slots[slot]; // If the slot doesn't exist well sucks to be you I guess! Haha :Þ - } - - setSlot(slot = 0, itemStack = new ItemStack) { - this.Slots[slot] = itemStack; - } -} \ No newline at end of file diff --git a/server/ItemStack.js b/server/ItemStack.js deleted file mode 100644 index de90af0..0000000 --- a/server/ItemStack.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = class { - constructor(id, count) { - this.id = id; - this.count = count; - } - - updateCount(count) { - this.count += count; - } -} \ No newline at end of file diff --git a/server/MPClient.ts b/server/MPClient.ts new file mode 100644 index 0000000..cf86872 --- /dev/null +++ b/server/MPClient.ts @@ -0,0 +1,21 @@ +import { Socket } from "net"; +import { IEntity } from "./entities/IEntity"; +import { Writer } from "../bufferStuff"; + +export class MPClient { + private readonly socket:Socket; + private readonly entity:IEntity; + + public constructor(socket:Socket, entity:IEntity) { + this.socket = socket; + this.entity = entity; + } + + send(buffer:Buffer|Writer) { + if (buffer instanceof Writer) { + this.socket.write(buffer.toBuffer()); + } else { + this.socket.write(buffer); + } + } +} \ No newline at end of file diff --git a/server/MinecraftServer.ts b/server/MinecraftServer.ts new file mode 100644 index 0000000..fc080b7 --- /dev/null +++ b/server/MinecraftServer.ts @@ -0,0 +1,124 @@ +import { Config } from "../config"; +import { Console } from "../console"; +import { Server, Socket } from "net"; +import { FunkyArray } from "../funkyArray"; +import { World } from "./World"; +import { Reader } from "../bufferStuff"; +import { Packets } from "./enums/Packets"; +import { PacketHandshake } from "./packets/Handshake"; +import { MPClient } from "./MPClient"; +import { PacketKeepAlive } from "./packets/KeepAlive"; +import { PacketLoginRequest } from "./packets/LoginRequest"; +import { PacketDisconnectKick } from "./packets/DisconnectKick"; +import { Player } from "./entities/Player"; +import { PacketTimeUpdate } from "./packets/TimeUpdate"; +import { PacketSpawnPosition } from "./packets/SpawnPosition"; +import { Chunk } from "./Chunk"; +import { PacketMapChunk } from "./packets/MapChunk"; +import { PacketPlayerPositionLook } from "./packets/PlayerPositionLook"; +import { PacketPreChunk } from "./packets/PreChunk"; + +export class MinecraftServer { + private static readonly PROTOCOL_VERSION = 14; + private static readonly TICK_RATE = 20; + private static readonly TICK_RATE_MS = 1000 / MinecraftServer.TICK_RATE; + private readonly keepalivePacket = new PacketKeepAlive().writeData(); + + private totalClients:number = 0; + private config:Config; + private server:Server; + private serverClock:NodeJS.Timer; + private tickCounter:number = 0; + private clients:FunkyArray; + private worlds:FunkyArray; + + public constructor(config:Config) { + this.config = config; + + this.clients = new FunkyArray(); + + this.worlds = new FunkyArray(); + this.worlds.set(0, new World()); + + this.serverClock = setInterval(() => { + // Every 1 sec + if (this.tickCounter % MinecraftServer.TICK_RATE === 0) { + if (this.clients.length !== 0) { + const timePacket = new PacketTimeUpdate(this.tickCounter).writeData(); + this.clients.forEach(client => { + client.send(this.keepalivePacket); + client.send(timePacket); + }); + } + } + + this.worlds.forEach(world => { + world.tick(this.tickCounter); + }); + this.tickCounter++; + }, MinecraftServer.TICK_RATE_MS); + + this.server = new Server(); + this.server.on("connection", this.onConnection.bind(this)); + this.server.listen(config.port, () => Console.printInfo(`Minecraft server started at ${config.port}`)); + } + + sendToAllClients(buffer:Buffer) { + this.clients.forEach(client => { + client.send(buffer); + }); + } + + onConnection(socket:Socket) { + socket.on("data", chunk => { + const reader = new Reader(chunk); + + const packetId = reader.readUByte(); + //console.log(packetId); + switch (packetId) { + // Handle timeouts at some point, idk. + case Packets.KeepAlive: + break; + + case Packets.LoginRequest: + const loginPacket = new PacketLoginRequest().readData(reader); + if (loginPacket.protocolVersion !== MinecraftServer.PROTOCOL_VERSION) { + if (loginPacket.protocolVersion > MinecraftServer.PROTOCOL_VERSION) { + socket.write(new PacketDisconnectKick("Outdated server!").writeData()); + } else { + socket.write(new PacketDisconnectKick("Outdated or modded client!").writeData()); + } + return; + } + + const world = this.worlds.get(0); + if (world instanceof World) { + const clientEntity = new Player(this, world, loginPacket.username); + world.addEntity(clientEntity); + socket.write(new PacketLoginRequest(clientEntity.entityId, "", 0, -1).writeData()); + socket.write(new PacketSpawnPosition(8, 64, 8).writeData()); + + socket.write(new PacketPreChunk(0, 0, true).writeData()); + const chunk = world.getChunk(0, 0); + if (chunk instanceof Chunk) { + (async () => { + const chunkData = await (new PacketMapChunk(0, 0, 0, 15, 127, 15, chunk).writeData()); + socket.write(chunkData); + socket.write(new PacketPlayerPositionLook(8, 66, 66.62, 8, 0, 0, false).writeData()); + })(); + } + const client = new MPClient(socket, clientEntity); + this.clients.set(this.totalClients++, client); + } else { + socket.write(new PacketDisconnectKick("Failed to find world to put player in.").writeData()); + } + break; + + case Packets.Handshake: + const handshakePacket = new PacketHandshake().readData(reader); + socket.write(handshakePacket.writeData()); + break; + } + }); + } +} \ No newline at end of file diff --git a/server/NamedPackets.js b/server/NamedPackets.js deleted file mode 100644 index c36c3c6..0000000 --- a/server/NamedPackets.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - ===========- NamedPackets.js -========== - Created by Holly (tgpethan) (c) 2021 - Licenced under MIT - ======================================== -*/ - -const namedPackets = { - "Disconnect": -1, - "KeepAlive": 0x00, - "LoginRequest": 0x01, - "Handshake": 0x02, - "ChatMessage": 0x03, - "TimeUpdate": 0x04, - "EntityEquipment": 0x05, - "SpawnPosition": 0x06, - "UseEntity": 0x07, - "UpdateHealth": 0x08, - "Respawn": 0x09, - "Player": 0x0A, - "PlayerPosition": 0x0B, - "PlayerLook": 0x0C, - "PlayerPositionAndLook": 0x0D, - "PlayerDigging": 0x0E, - "PlayerBlockPlacement": 0x0F, - "HoldingChange": 0x10, - "UseBed": 0x11, - "Animation": 0x12, - "EntityAction": 0x13, - "NamedEntitySpawn": 0x14, - "PickupSpawn": 0x15, - "CollectItem": 0x16, - "AddObjectOrVehicle": 0x17, - "MobSpawn": 0x18, - "EntityPainting": 0x19, - "StanceUpdate": 0x1B, - "EntityVelocity": 0x1C, - "DestroyEntity": 0x1D, - "Entity": 0x1E, - "EntityRelativeMove": 0x1F, - "EntityLook": 0x20, - "EntityLookAndRelativeMove": 0x21, - "EntityTeleport": 0x22, - "EntityStatus": 0x26, - "AttachEntity": 0x27, - "EntityMetadata": 0x28, - "PreChunk": 0x32, - "MapChunk": 0x33, - "MultiBlockChange": 0x34, - "BlockChange": 0x35, - "BlockAction": 0x36, - "Explosion": 0x3C, - "SoundEffect": 0x3D, - "NewOrInvalidState": 0x46, - "Thunderbolt": 0x47, - "OpenWindow": 0x64, - "CloseWindow": 0x65, - "WindowClick": 0x66, - "SetSlot": 0x67, - "WindowItems": 0x68, - "UpdateProgressBar": 0x69, - "Transaction": 0x6A, - "UpdateSign": 0x82, - "ItemData": 0x83, - "IncrementStatistic": 0xC8, - "DisconnectOrKick": 0xFF -}; - -module.exports = namedPackets; \ No newline at end of file diff --git a/server/PacketMappingTable.js b/server/PacketMappingTable.js deleted file mode 100644 index 21c3d73..0000000 --- a/server/PacketMappingTable.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - ========- PacketMappingTable.js -======= - Created by Holly (tgpethan) (c) 2021 - Licenced under MIT - ======================================== -*/ - -const Packet0KeepAlive = require("./Packets/Packet0KeepAlive.js"), - Packet1LoginRequest = require("./Packets/Packet1LoginRequest.js"), - Packet2Handshake = require("./Packets/Packet2Handshake.js"), - Packet3Chat = require("./Packets/Packet3Chat.js"), - Packet4TimeUpdate = require("./Packets/Packet4TimeUpdate"), - Packet6SpawnPosition = require("./Packets/Packet6SpawnPosition.js"), - Packet10Player = require("./Packets/Packet10Player.js"), - Packet13PlayerPositionAndLook = require("./Packets/Packet13PlayerPositionAndLook.js"), - Packet18Animation = require("./Packets/Packet18Animation.js"), - Packet20NamedEntitySpawn = require("./Packets/Packet20NamedEntitySpawn.js"), - Packet32EntityLook = require("./Packets/Packet32EntityLook.js"), - Packet34EntityTeleport = require("./Packets/Packet34EntityTeleport.js"), - Packet50PreChunk = require("./Packets/Packet50PreChunk.js"), - Packet53BlockChange = require("./Packets/Packet53BlockChange.js"), - Packet103SetSlot = require("./Packets/Packet103SetSlot.js"); - -const mappingTable = { - 0x00: Packet0KeepAlive, - 0x01: Packet1LoginRequest, - 0x02: Packet2Handshake, - 0x03: Packet3Chat, - 0x04: Packet4TimeUpdate, - 0x06: Packet6SpawnPosition, - 0x0A: Packet10Player, - 0x0D: Packet13PlayerPositionAndLook, - 0x12: Packet18Animation, - 0x14: Packet20NamedEntitySpawn, - 0x20: Packet32EntityLook, - 0x22: Packet34EntityTeleport, - 0x32: Packet50PreChunk, - 0x35: Packet53BlockChange, - 0x67: Packet103SetSlot -}; - -module.exports = mappingTable; \ No newline at end of file diff --git a/server/Packets/Packet.js b/server/Packets/Packet.js deleted file mode 100644 index 539f493..0000000 --- a/server/Packets/Packet.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - ==============- Packet.js -============= - Created by Holly (tgpethan) (c) 2021 - Licenced under MIT - ======================================== -*/ - -const bufferStuff = require("../bufferStuff.js"); - -module.exports = class { - constructor(packetID = 0x00) { - this.id = packetID; - - this.packetSize = 0; - - this.writer = null; - } - - writePacket() { - this.writer = new bufferStuff.Writer(this.packetSize); - - this.writer.writeByte(this.id); - - return this.writer; - } - - toBuffer() { - return this.writer == null ? Buffer.alloc(0) : this.writer.buffer; - } -} \ No newline at end of file diff --git a/server/Packets/Packet0KeepAlive.js b/server/Packets/Packet0KeepAlive.js deleted file mode 100644 index 9740e49..0000000 --- a/server/Packets/Packet0KeepAlive.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - ========- Packet0KeepAlive.js -========= - Created by Holly (tgpethan) (c) 2021 - Licenced under MIT - ======================================== -*/ - -const Packet = require("./Packet.js"); - -class Packet0KeepAlive extends Packet { - writePacket() { - super.writePacket(); - - return this.toBuffer(); - } -} - -module.exports = Packet0KeepAlive; \ No newline at end of file diff --git a/server/Packets/Packet103SetSlot.js b/server/Packets/Packet103SetSlot.js deleted file mode 100644 index 07c4b82..0000000 --- a/server/Packets/Packet103SetSlot.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - ========- Packet103SetSlot.js -========= - Created by Holly (tgpethan) (c) 2021 - Licenced under MIT - ======================================== -*/ - -const Packet = require("./Packet.js"); - -class Packet103SetSlot extends Packet { - constructor(window_id = 0, slot = 0, item_id = -1, item_count = 0, item_uses = 0) { - super(0x67); - - this.window_id = window_id; - this.slot = slot; - this.item_id = item_id; - this.item_count = item_count; - this.item_uses = item_uses; - } - - writePacket() { - super.writePacket(); - - this.writer.writeByte(this.window_id); - this.writer.writeShort(this.slot); - this.writer.writeShort(this.item_id); - this.writer.writeByte(this.item_count); - if (this.item_id != -1) this.writer.writeShort(this.item_uses); - - return this.toBuffer(); - } -} - -module.exports = Packet103SetSlot; \ No newline at end of file diff --git a/server/Packets/Packet10Player.js b/server/Packets/Packet10Player.js deleted file mode 100644 index 256b444..0000000 --- a/server/Packets/Packet10Player.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - =========- Packet10Player.js -========== - Created by Holly (tgpethan) (c) 2021 - Licenced under MIT - ======================================== -*/ - -const Packet = require("./Packet.js"); - -class Packet10Player extends Packet { - constructor(onGround = true) { - super(0x0A); - - this.onGround = onGround; - } - - writePacket() { - super.writePacket(); - - this.writer.writeBool(this.onGround); - - return this.toBuffer(); - } -} - -module.exports = Packet10Player; \ No newline at end of file diff --git a/server/Packets/Packet13PlayerPositionAndLook.js b/server/Packets/Packet13PlayerPositionAndLook.js deleted file mode 100644 index 1bfda75..0000000 --- a/server/Packets/Packet13PlayerPositionAndLook.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - ==- Packet13PlayerPositionAndLook.js -== - Created by Holly (tgpethan) (c) 2021 - Licenced under MIT - ======================================== -*/ - -const Packet = require("./Packet.js"); - -class Packet13PlayerPositionAndLook extends Packet { - constructor(x = 0, y = 65, stance = 67, z = 0, yaw = 0.0, pitch = 0.0, onGround = true) { - super(0x0D); - - this.x = x; - this.y = y; - this.stance = stance; - this.z = z; - this.yaw = yaw; - this.pitch = pitch; - this.onGround = onGround; - } - - writePacket() { - super.writePacket(); - - this.writer.writeDouble(this.x); - this.writer.writeDouble(this.y); - this.writer.writeDouble(this.stance); - this.writer.writeDouble(this.z); - this.writer.writeFloat(this.yaw); - this.writer.writeFloat(this.pitch); - this.writer.writeBool(this.onGround); - - return this.toBuffer(); - } -} - -module.exports = Packet13PlayerPositionAndLook; \ No newline at end of file diff --git a/server/Packets/Packet18Animation.js b/server/Packets/Packet18Animation.js deleted file mode 100644 index b0e08b7..0000000 --- a/server/Packets/Packet18Animation.js +++ /dev/null @@ -1,28 +0,0 @@ -/* - ========- Packet18Animation.js -======== - Created by Holly (tgpethan) (c) 2021 - Licenced under MIT - ======================================== -*/ - -const Packet = require("./Packet.js"); - -class Packet18Animation extends Packet { - constructor(EID = 0, animation = 0) { - super(0x12); - - this.EID = EID; - this.animation = animation; - } - - writePacket() { - super.writePacket(); - - this.writer.writeInt(this.EID); - this.writer.writeByte(this.animation); - - return this.toBuffer(); - } -} - -module.exports = Packet18Animation; \ No newline at end of file diff --git a/server/Packets/Packet1LoginRequest.js b/server/Packets/Packet1LoginRequest.js deleted file mode 100644 index be9ad47..0000000 --- a/server/Packets/Packet1LoginRequest.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - =======- Packet1LoginRequest.js -======= - Created by Holly (tgpethan) (c) 2021 - Licenced under MIT - ======================================== -*/ - -const Packet = require("./Packet.js"); - -class Packet1LoginRequest extends Packet { - constructor(protocol_version = 0, username = "", map_seed = BigInt(0), dimension = 0) { - super(0x01); - - this.protocol_version = protocol_version; - this.username = username; - this.map_seed = map_seed; - this.dimension = dimension; - } - - readPacket() { - - } - - writePacket(EID = 0) { - super.writePacket(); - - this.writer.writeInt(EID); - this.writer.writeString(""); - this.writer.writeLong(971768181197178410); - this.writer.writeByte(0); - - return this.toBuffer(); - } -} - -module.exports = Packet1LoginRequest; \ No newline at end of file diff --git a/server/Packets/Packet20NamedEntitySpawn.js b/server/Packets/Packet20NamedEntitySpawn.js deleted file mode 100644 index 522a42d..0000000 --- a/server/Packets/Packet20NamedEntitySpawn.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - =====- Packet20NamedEntitySpawn.js -==== - Created by Holly (tgpethan) (c) 2021 - Licenced under MIT - ======================================== -*/ - -const Packet = require("./Packet.js"); -const Converter = require("../Converter.js"); - -class Packet20NamedEntitySpawn extends Packet { - constructor(EID = 0, entityName = "", x = 0.0, y = 0.0, z = 0.0, yaw = 0.0, pitch = 0.0, currentItem = 0) { - super(0x14); - - this.EID = EID; - this.entityName = entityName; - this.absX = Converter.toAbsoluteInt(x); - this.absY = Converter.toAbsoluteInt(y); - this.absZ = Converter.toAbsoluteInt(z); - this.packedYaw = Converter.to360Fraction(yaw); - this.packedPitch = Converter.to360Fraction(pitch); - this.currentItem = currentItem; - } - - writePacket() { - super.writePacket(); - - this.writer.writeInt(this.EID); - this.writer.writeString(this.entityName); - this.writer.writeInt(this.absX); - this.writer.writeInt(this.absY); - this.writer.writeInt(this.absZ); - this.writer.writeUByte(this.packedYaw); - this.writer.writeUByte(this.packedPitch); - this.writer.writeShort(this.currentItem); - - return this.toBuffer(); - } -} - -module.exports = Packet20NamedEntitySpawn; \ No newline at end of file diff --git a/server/Packets/Packet2Handshake.js b/server/Packets/Packet2Handshake.js deleted file mode 100644 index 29875aa..0000000 --- a/server/Packets/Packet2Handshake.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - =========- Packet2Handshake.js -======== - Created by Holly (tgpethan) (c) 2021 - Licenced under MIT - ======================================== -*/ - -const Packet = require("./Packet.js"); - -class Packet2Handshake extends Packet { - constructor(username = "") { - super(0x02); - - this.username = username; - } - - writePacket() { - super.writePacket(); - - this.writer.writeString("-"); // "-" == Offline mode - - return this.toBuffer(); - } -} - -module.exports = Packet2Handshake; \ No newline at end of file diff --git a/server/Packets/Packet32EntityLook.js b/server/Packets/Packet32EntityLook.js deleted file mode 100644 index 2846fe4..0000000 --- a/server/Packets/Packet32EntityLook.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - =======- Packet32EntityLook.js -======== - Created by Holly (tgpethan) (c) 2021 - Licenced under MIT - ======================================== -*/ - -const Packet = require("./Packet.js"); -const Converter = require("../Converter.js"); - -class Packet32EntityLook extends Packet { - constructor(EID = 0, yaw = 0, pitch = 0) { - super(0x20); - - this.packetSize = 7; - - this.EID = EID; - this.packedYaw = Converter.to360Fraction(yaw); - this.packedPitch = Converter.to360Fraction(pitch); - } - - writePacket() { - super.writePacket(); - - this.writer.writeInt(this.EID); - this.writer.writeUByte(this.packedYaw); - this.writer.writeUByte(this.packedPitch); - - return this.toBuffer(); - } -} - -module.exports = Packet32EntityLook; \ No newline at end of file diff --git a/server/Packets/Packet34EntityTeleport.js b/server/Packets/Packet34EntityTeleport.js deleted file mode 100644 index cdf2edf..0000000 --- a/server/Packets/Packet34EntityTeleport.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - ======- Packet34EntityTeleport.js -===== - Created by Holly (tgpethan) (c) 2021 - Licenced under MIT - ======================================== -*/ - -const Packet = require("./Packet.js"); -const Converter = require("../Converter.js"); - -class Packet34EntityTeleport extends Packet { - constructor(EID = 0, x = 0, y = 0, z = 0, yaw = 0, pitch = 0) { - super(0x22); - - this.packetSize = 19; - - this.EID = EID; - this.absX = Converter.toAbsoluteInt(x); - this.absY = Converter.toAbsoluteInt(y); - this.absZ = Converter.toAbsoluteInt(z); - this.packedYaw = Converter.to360Fraction(yaw); - this.packedPitch = Converter.to360Fraction(pitch); - } - - soup() { - super.writePacket(); - this.writer.writeInt(this.EID); - } - - writePacket() { - this.writer.writeInt(this.absX); - this.writer.writeInt(this.absY); - this.writer.writeInt(this.absZ); - this.writer.writeUByte(this.packedYaw); - this.writer.writeUByte(this.packedPitch); - - return this.toBuffer(); - } -} - -module.exports = Packet34EntityTeleport; \ No newline at end of file diff --git a/server/Packets/Packet3Chat.js b/server/Packets/Packet3Chat.js deleted file mode 100644 index a3d30c6..0000000 --- a/server/Packets/Packet3Chat.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - ===========- Packet3Chat.js -=========== - Created by Holly (tgpethan) (c) 2021 - Licenced under MIT - ======================================== -*/ - -const Packet = require("./Packet.js"); - -class Packet3Chat extends Packet { - constructor(message = "") { - super(0x03); - - this.message = message; - } - - writePacket() { - super.writePacket(); - - this.writer.writeString(this.message); - - return this.toBuffer(); - } -} - -module.exports = Packet3Chat; \ No newline at end of file diff --git a/server/Packets/Packet4TimeUpdate.js b/server/Packets/Packet4TimeUpdate.js deleted file mode 100644 index b5f6e70..0000000 --- a/server/Packets/Packet4TimeUpdate.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - ========- Packet4TimeUpdate.js -======== - Created by Holly (tgpethan) (c) 2021 - Licenced under MIT - ======================================== -*/ - -const Packet = require("./Packet.js"); - -class Packet4TimeUpdate extends Packet { - constructor(time = BigInt(0)) { - super(0x04); - - this.time = time; - } - - readPacket() { - - } - - writePacket() { - super.writePacket(); - - this.writer.writeLong(this.time); - - return this.toBuffer(); - } -} - -module.exports = Packet4TimeUpdate; \ No newline at end of file diff --git a/server/Packets/Packet50PreChunk.js b/server/Packets/Packet50PreChunk.js deleted file mode 100644 index efa9f4e..0000000 --- a/server/Packets/Packet50PreChunk.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - ========- Packet50PreChunk.js -========= - Created by Holly (tgpethan) (c) 2021 - Licenced under MIT - ======================================== -*/ - -const Packet = require("./Packet.js"); - -class Packet50PreChunk extends Packet { - constructor(x = 0, z = 0, mode = true) { - super(0x32); - - this.x = x; - this.z = z; - this.mode = mode; - } - - writePacket() { - super.writePacket(); - - this.writer.writeInt(this.x); - this.writer.writeInt(this.z); - this.writer.writeBool(this.mode); - - return this.toBuffer(); - } -} - -module.exports = Packet50PreChunk; \ No newline at end of file diff --git a/server/Packets/Packet53BlockChange.js b/server/Packets/Packet53BlockChange.js deleted file mode 100644 index 1e6a9dc..0000000 --- a/server/Packets/Packet53BlockChange.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - =======- Packet53BlockChange.js -======= - Created by Holly (tgpethan) (c) 2021 - Licenced under MIT - ======================================== -*/ - -const Packet = require("./Packet.js"); - -class Packet53BlockChange extends Packet { - constructor(x = 0, y = 0, z = 0, block_type = 0, block_metadata = 0) { - super(0x35); - - this.x = x; - this.y = y; - this.z = z; - this.block_type = block_type; - this.block_metadata = block_metadata; - } - - writePacket() { - super.writePacket(); - - this.writer.writeInt(this.x); - this.writer.writeByte(this.y); - this.writer.writeInt(this.z); - this.writer.writeByte(this.block_type); - this.writer.writeByte(this.block_metadata); - - return this.toBuffer(); - } -} - -module.exports = Packet53BlockChange; \ No newline at end of file diff --git a/server/Packets/Packet6SpawnPosition.js b/server/Packets/Packet6SpawnPosition.js deleted file mode 100644 index 0dcd617..0000000 --- a/server/Packets/Packet6SpawnPosition.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - ======- Packet6SpawnPosition.js -======= - Created by Holly (tgpethan) (c) 2021 - Licenced under MIT - ======================================== -*/ - -const Packet = require("./Packet.js"); - -class Packet6SpawnPosition extends Packet { - constructor(x = 8.5, y = 65.5, z = 8.5) { - super(0x06); - - this.x = x; - this.y = y; - this.z = z; - } - - writePacket() { - super.writePacket(); - - this.writer.writeInt(this.x); - this.writer.writeInt(this.y); - this.writer.writeInt(this.z); - - return this.toBuffer(); - } -} - -module.exports = Packet6SpawnPosition; \ No newline at end of file diff --git a/server/Util/funkyArray.js b/server/Util/funkyArray.js deleted file mode 100644 index 434ab89..0000000 --- a/server/Util/funkyArray.js +++ /dev/null @@ -1,91 +0,0 @@ -/* - ===========- funkyArray.js -============ - Created by Holly (tgpethan) (c) 2021 - Licenced under MIT - ======================================== -*/ - -const pRandom = require("./prettyRandom.js"); - -module.exports = class { - constructor(indexingMode = false) { - this.items = {}; - this.itemKeys = Object.keys(this.items); - - this.indexingMode = indexingMode; - this.index = 0; - - this.iterableArray = []; - } - - add(item, regenerate = true) { - let id; - if (this.indexingMode) { - this.items[id = this.index] = item; - this.index++; - } else { - this.items[id = pRandom()] = item; - } - - if (regenerate) { - this.regenerateIterableArray(); - this.itemKeys = Object.keys(this.items); - } - - return this.items[id]; - } - - remove(id, regenerate = true) { - delete this.items[id]; - if (regenerate) { - this.regenerateIterableArray(); - this.itemKeys = Object.keys(this.items); - } - } - - removeFirstItem(regenerate = true) { - delete this.items[this.itemKeys[0]]; - if (regenerate) this.regenerateIterableArray(); - this.itemKeys = Object.keys(this.items); - } - - regenerateIterableArray() { - this.iterableArray = new Array(); - for (let itemKey of this.itemKeys) { - this.iterableArray.push(this.items[itemKey]); - } - this.itemKeys = Object.keys(this.items); - } - - getFirstItem() { - return this.items[this.itemKeys[0]]; - } - - getLength() { - return this.itemKeys.length; - } - - getKeyById(id) { - return this.itemKeys[id]; - } - - getById(id) { - return this.items[this.itemKeys[id]]; - } - - getByKey(key) { - return this.items[key]; - } - - getKeys() { - return this.itemKeys; - } - - getItems() { - return this.items; - } - - getIterableItems() { - return this.iterableArray; - } -} \ No newline at end of file diff --git a/server/Util/prettyRandom.js b/server/Util/prettyRandom.js deleted file mode 100644 index 81e75e5..0000000 --- a/server/Util/prettyRandom.js +++ /dev/null @@ -1,28 +0,0 @@ -/* - ===========- prettyRandom.js -========== - Created by Holly (tgpethan) (c) 2021 - Licenced under MIT - ======================================== -*/ - -let lastRandom = -1; - -function pRandom(from = 0, to = 2147483647) { - let thisRandom = Math.floor(map(Math.random(), 0, 1, from, to)); - if (thisRandom == lastRandom) thisRandom = pRandom(from, to); - - return thisRandom; -} - -function map(input, inputMin, inputMax, outputMin, outputMax) { - const newv = (input - inputMin) / (inputMax - inputMin) * (outputMax - outputMin) + outputMin; - - if (outputMin < outputMax) return constrain(newv, outputMin, outputMax); - else return constrain(newv, outputMax, outputMin); -} - -function constrain(input, low, high) { - return Math.max(Math.min(input, high), low); -} - -module.exports = pRandom; \ No newline at end of file diff --git a/server/Workers/ChunkWorker.js b/server/Workers/ChunkWorker.js deleted file mode 100644 index 3a6ae59..0000000 --- a/server/Workers/ChunkWorker.js +++ /dev/null @@ -1,82 +0,0 @@ -/* - ===========- ChunkWorker.js -=========== - Created by Holly (tgpethan) (c) 2021 - Licenced under MIT - ======================================== -*/ - -const { parentPort } = require('worker_threads'), - { deflateSync } = require("zlib"); - -const GeneratorFlat = require("../Generators/GeneratorFlat.js"); -const GeneratorPerlin = require("../Generators/GeneratorPerlin.js"); - -const bufferStuff = require("../bufferStuff.js"); - -let busyInterval = null; - -parentPort.on("message", (data) => { - // This stops the thread from stopping :) - if (busyInterval == null) busyInterval = setInterval(() => {}, 86400000); // Runs once a day - - switch (data[0]) { - case "chunk": - parentPort.postMessage([data[0], doChunk(data[1]), data[2]]); - break; - - case "generate": - const startTime = Date.now(); - const chunkData = generateChunk(data[1], data[2], data[4]); - parentPort.postMessage([data[0], chunkData[0], data[1], data[2], data[3], chunkData[1]]); - console.log(`Chunk took ${Date.now() - startTime}ms`); - break; - } -}); - -function generateChunk(x = 0, z = 0, seed = 0) { - return GeneratorPerlin(x, z, seed); -} - -function doChunk(chunk) { - const writer = new bufferStuff.Writer(18); - - writer.writeByte(0x33); // Chunk - writer.writeInt(chunk[0] << 4); // Chunk X - writer.writeShort(0 << 7); // Chunk Y - writer.writeInt(chunk[1] << 4); // Chunk Z - writer.writeByte(15); // Size X - writer.writeByte(127); // Size Y - writer.writeByte(15); // Size Z - - // pre-alloc since doing an alloc 98,304 times takes a while yknow. - const blocks = new bufferStuff.Writer(32768); - const metadata = new bufferStuff.Writer(32768); - const lighting = new bufferStuff.Writer(32768); - - let blockMeta = false; - for (let x = 0; x < 16; x++) { - for (let z = 0; z < 16; z++) { - for (let y = 0; y < 128; y++) { - blocks.writeByte(chunk[2][y][x][z][0]); - if (blockMeta) { - metadata.writeNibble(chunk[2][y - 1][x][z][1], chunk[2][y][x][z][1]); // NOTE: This is sorta jank but it does work - // Light level 15 for 2 blocks (1111 1111) - lighting.writeNibble(15, 15); // TODO: Lighting (Client seems to do it's own (when a block update happens) so it's not top priority) - } - // Hack for nibble stuff - blockMeta = !blockMeta; - } - } - } - // These are hacks for the nibbles - blocks.writeBuffer(metadata.buffer); - blocks.writeBuffer(lighting.buffer); // Block lighting - //blocks.writeBuffer(lighting.buffer); // Sky lighting (Looks like this isn't needed???) - - // We're on another thread we don't care if we halt - const deflated = deflateSync(blocks.buffer); - writer.writeInt(deflated.length); // Compressed Size - writer.writeBuffer(deflated); // Compressed chunk data - - return writer.buffer; -} \ No newline at end of file diff --git a/server/World.ts b/server/World.ts new file mode 100644 index 0000000..9377c0c --- /dev/null +++ b/server/World.ts @@ -0,0 +1,39 @@ +import { FunkyArray } from "../funkyArray"; +import { Chunk } from "./Chunk"; +import { IEntity } from "./entities/IEntity"; +import { FlatGenerator } from "./generators/Flat"; +import { IGenerator } from "./generators/IGenerator"; + +export class World { + public chunks:FunkyArray; + public entites:FunkyArray; + + public generator:IGenerator; + + public constructor() { + this.chunks = new FunkyArray(); + this.entites = new FunkyArray(); + this.generator = new FlatGenerator(); + this.chunks.set(Chunk.CreateCoordPair(0, 0), new Chunk(this, 0, 0)); + } + + public addEntity(entity:IEntity) { + this.entites.set(entity.entityId, entity); + } + + public removeEntity(entity:IEntity|number) { + if (typeof(entity) === "number") { + return this.entites.remove(entity); + } + + return this.entites.remove(entity.entityId); + } + + public getChunk(x:number, z:number) { + return this.chunks.get(Chunk.CreateCoordPair(x, z)); + } + + public tick(tickCount:number) { + + } +} \ No newline at end of file diff --git a/server/blocks/Block.ts b/server/blocks/Block.ts new file mode 100644 index 0000000..3884477 --- /dev/null +++ b/server/blocks/Block.ts @@ -0,0 +1,15 @@ +export class Block { + public readonly blockId:number; + + public constructor(blockId:number) { + this.blockId = blockId; + } + + static stone = new Block(1); + static grass = new Block(2); + static dirt = new Block(3); + + + + static bedrock = new Block(7); +} \ No newline at end of file diff --git a/server/bufferStuff.js b/server/bufferStuff.js deleted file mode 100644 index de2ea9e..0000000 --- a/server/bufferStuff.js +++ /dev/null @@ -1,225 +0,0 @@ -/* - ===========- bufferStuff.js -=========== - Created by Holly (tgpethan) (c) 2021 - Licenced under MIT - ======================================== -*/ - -module.exports.Writer = class { - // bufferStuff supports pre-allocating memory for the buffer - // if you pass in a size of 0 then it will just dynamicly allocate at the - // cost of performance - - // NOTE: In pre-allocation mode if you exceed the size of the buffer - // that you set it will cause a crash. - constructor(size = 0) { - this.buffer = Buffer.alloc(size); - this.offset = 0; - this.baseSize = size; - } - - reset() { - this.buffer = Buffer.alloc(0); - } - - writeBuffer(buff = Buffer.alloc(0)) { - this.buffer = Buffer.concat([this.buffer, buff], this.buffer.length + buff.length); - } - - writeBool(data = false) { - this.writeByte(data ? 1 : 0); - } - - // NOTE: Currently writing a nibble requires you to write both halves at the same time. - writeNibble(nibble1 = 0, nibble2 = 0) { - this.writeUByte(nibble1 | (nibble2 << 4)); - } - - writeByte(data = 0) { - if (this.baseSize == 0) { - const buff = Buffer.alloc(1); - buff.writeInt8(data, 0); - - this.writeBuffer(buff); - } else { - this.buffer.writeInt8(data, this.offset); - this.offset += 1; - } - } - - writeUByte(data = 0) { - if (this.baseSize == 0) { - const buff = Buffer.alloc(1); - buff.writeUInt8(data, 0); - - this.writeBuffer(buff); - } else { - this.buffer.writeUInt8(data, this.offset); - this.offset += 1; - } - } - - writeByteArray(data = [0]) { - if (this.baseSize == 0) { - const buff = Buffer.alloc(data.length); - - for (let byte of data) { - buff.writeInt8(byte); - } - - this.writeBuffer(buff); - } else { - for (let byte of data) { - this.buffer.writeInt8(byte); - this.offset += 1; - } - } - } - - writeShort(data = 0) { - if (this.baseSize == 0) { - const buff = Buffer.alloc(2); - buff.writeIntBE(data, 0, 2); - - this.writeBuffer(buff); - } else { - this.buffer.writeIntBE(data, this.offset, 2); - this.offset += 2; - } - } - - writeShortArray(data = [0]) { - if (this.baseSize == 0) { - const buff = Buffer.alloc(data.length * 2); - let offset = 0; - - for (let short of data) { - buff.writeIntBE(short, offset, 2); - offset += 2; - } - - this.writeBuffer(buff); - } else { - for (let short of data) { - this.buffer.writeIntBE(short, this.offset, 2); - this.offset += 2; - } - } - } - - writeInt(data = 0) { - if (this.baseSize == 0) { - const buff = Buffer.alloc(4); - buff.writeIntBE(data, 0, 4); - - this.writeBuffer(buff); - } else { - this.buffer.writeIntBE(data, this.offset, 4); - this.offset += 4; - } - } - - writeLong(data = 0) { - if (this.baseSize == 0) { - const buff = Buffer.alloc(8); - if (data instanceof BigInt) buff.writeBigInt64BE(data, 0); - else buff.writeBigInt64BE(BigInt(data), 0); - - this.writeBuffer(buff); - } else { - if (data instanceof BigInt) this.buffer.writeBigInt64BE(data, this.offset); - else this.buffer.writeBigInt64BE(BigInt(data), this.offset); - this.offset += 8; - } - } - - writeFloat(data = 0.0) { - if (this.baseSize == 0) { - const buff = Buffer.alloc(4); - buff.writeFloatBE(data, 0); - - this.writeBuffer(buff); - } else { - this.buffer.writeFloatBE(data, this.offset); - this.offset += 4; - } - } - - writeDouble(data = 0.0) { - if (this.baseSize == 0) { - const buff = Buffer.alloc(8); - buff.writeDoubleBE(data, 0); - - this.writeBuffer(buff); - } else { - this.buffer.writeDoubleBE(data, this.offset); - this.offset += 8; - } - } - - writeString(string = "") { - this.writeShort(string.length); - - for (let i = 0; i < string.length; i++) { - this.writeShort(string.charCodeAt(i)); - } - } -} - -module.exports.Reader = class { - constructor(buffer = Buffer.alloc(0)) { - this.buffer = buffer; - this.offset = 0; - } - - readBool() { - return this.readByte() == 0x01 ? true : false; - } - - readByte() { - const data = this.buffer.readInt8(this.offset); - this.offset += 1; - return data; - } - - readShort() { - const data = this.buffer.readIntBE(this.offset, 2); - this.offset += 2; - return data; - } - - readInt() { - const data = this.buffer.readIntBE(this.offset, 4); - this.offset += 4; - return data; - } - - readLong() { - const data = this.buffer.readBigInt64BE(this.offset); - this.offset += 8; - return data; - } - - readFloat() { - const data = this.buffer.readFloatBE(this.offset); - this.offset += 4; - return data; - } - - readDouble() { - const data = this.buffer.readDoubleBE(this.offset); - this.offset += 8; - return data; - } - - readString() { - const length = this.readShort(); - let data = ""; - - for (let i = 0; i < length; i++) { - data += String.fromCharCode(this.readShort()); - } - - return data; - } -} \ No newline at end of file diff --git a/server/chunkManager.js b/server/chunkManager.js deleted file mode 100644 index 3864df8..0000000 --- a/server/chunkManager.js +++ /dev/null @@ -1,130 +0,0 @@ -/* - ===========- chunkManager.js -========== - Created by Holly (tgpethan) (c) 2021 - Licenced under MIT - ======================================== -*/ - -const { Worker } = require('worker_threads'); -const FunkyArray = require("./Util/funkyArray.js"); -const pRandom = require("./Util/prettyRandom.js"); -const config = require("../config.json"); - -const workerPath = `${__dirname}/Workers/ChunkWorker.js`; - -module.exports = class { - constructor() { - this.chunks = {}; - - this.queuedBlockUpdates = new FunkyArray(); - - global.generatingChunks = true; - - this.threadPool = []; - this.workPool = new FunkyArray(); - this.toRemove = []; - - // TODO: Figure out a better way of doing this? - this.seed = pRandom(-2147483647, 2147483647) - new Date().getTime() * pRandom(1, 6); - - // WoAh!!! Thread pool in js!?!??!???!11!?!?! - for (let i = 0; i < config.worldThreads; i++) { - const worker = new Worker(workerPath); - this.threadPool.push([false, worker]); - const myID = i; - worker.on("message", (data) => { - let user; - switch (data[0]) { - case "chunk": - user = global.getUserByKey(data[2]); - user.chunksToSend.add(Buffer.from(data[1])); - this.toRemove.push(data[1]); - this.threadPool[myID][0] = false; - break; - - case "generate": - this.chunks[data[2]][data[3]] = data[1]; - this.toRemove.push(data[4]); - const treeBlocksRef = data[5]; - treeBlocksRef.forEach((block) => { - this.setBlock(block[0], block[1], block[2], block[3], 0, false); - }); - this.queuedBlockUpdates.regenerateIterableArray(); - this.threadPool[myID][0] = false; - break; - } - }); - } - - console.log("Created thread pool with " + this.threadPool.length + " threads"); - - setInterval(() => { - if (this.workPool.getLength() > 0) { - let limit = Math.min(this.workPool.getLength(), this.threadPool.length); - for (let i = 0; i < limit; i++) { - for (let i1 = 0; i1 < this.threadPool.length; i1++) { - let thread = this.threadPool[i1]; - if (!thread[0]) { - const key = this.workPool.itemKeys[i]; - const item = this.workPool.getByKey(key); - // Already being processed - if (item == null) break; - if (item[0] == true) { - limit += 1; - break; - } - item[0] = true; - item[1][3] = key; - thread[1].postMessage(item[1]); - thread[0] = true; - break; - } - } - } - - for (let item of this.toRemove) { - //console.log("removing item " + this.workPool.getByKey(item)[0]); - this.workPool.remove(item); - } - this.toRemove = []; - } - }, 1000 / 60); - - global.generatingChunks = false; - } - - // TODO: Store metadata! - createChunk(cx = 0, cz = 0) { - if (this.chunks[cx] == null) this.chunks[cx] = {}; - - this.workPool.add([false, ["generate", cx, cz, null, this.seed]]); - } - - chunkExists(cx = 0, cz = 0) { - if (this.chunks[cx] == null) return false; - if (this.chunks[cx][cz] == null) return false; - - // In any other case the chunk exists - return true; - } - - multiBlockChunk(chunkX = 0, chunkZ = 0, user) { - this.workPool.add([false, ["chunk", [chunkX, chunkZ, this.chunks[chunkX][chunkZ]], user.id, null]]); - } - - setBlock(x = 0, y = 0, z = 0, id = 0, metadata = 0, regenerate = true) { - if (y < 0 || y > 127) return console.error("Tried to set a block outside of the world!"); - - const chunkX = x >> 4; - const chunkZ = z >> 4; - const blockX = x - (chunkX << 4); - const blockZ = z - (chunkZ << 4); - - // Don't queue a block update if that block is already this block (wow those ifs) - if (this.chunks[chunkX] != null) - if (this.chunks[chunkX][chunkZ] != null) - if (this.chunks[chunkX][chunkZ][y][blockX][blockZ] == id) return; - - this.queuedBlockUpdates.add([chunkX, chunkZ, y, blockX, blockZ, id, metadata], regenerate); - } -} \ No newline at end of file diff --git a/server/entities/Entity.ts b/server/entities/Entity.ts new file mode 100644 index 0000000..79fcf06 --- /dev/null +++ b/server/entities/Entity.ts @@ -0,0 +1,23 @@ +import { World } from "../World"; +import { IEntity } from "./IEntity"; + +export class Entity implements IEntity { + public static nextEntityId:number = 0; + + public entityId:number; + + public world:World; + public x:number; + public y:number; + public z:number; + public lastX:number; + public lastY:number; + public lastZ:number; + + public constructor(world:World) { + this.entityId = Entity.nextEntityId++; + + this.world = world; + this.x = this.y = this.z = this.lastX = this.lastY = this.lastZ = 0; + } +} \ No newline at end of file diff --git a/server/entities/IEntity.ts b/server/entities/IEntity.ts new file mode 100644 index 0000000..3172fd8 --- /dev/null +++ b/server/entities/IEntity.ts @@ -0,0 +1,3 @@ +export interface IEntity { + entityId:number +} \ No newline at end of file diff --git a/server/entities/Player.ts b/server/entities/Player.ts new file mode 100644 index 0000000..d576be7 --- /dev/null +++ b/server/entities/Player.ts @@ -0,0 +1,18 @@ +import { MinecraftServer } from "../MinecraftServer"; +import { World } from "../World"; +import { Entity } from "./Entity"; + +export class Player extends Entity { + public username:string; + private server:MinecraftServer; + + public constructor(server:MinecraftServer, world:World, username:string) { + super(world); + this.server = server; + + this.username = username; + this.x = 8; + this.y = 64; + this.z = 8; + } +} \ No newline at end of file diff --git a/server/enums/Packets.ts b/server/enums/Packets.ts new file mode 100644 index 0000000..4e1e5a7 --- /dev/null +++ b/server/enums/Packets.ts @@ -0,0 +1,21 @@ +export enum Packets { + KeepAlive = 0x00, + LoginRequest = 0x01, + Handshake = 0x02, + Chat = 0x03, + TimeUpdate = 0x04, + EntityEquipment = 0x05, + SpawnPosition = 0x06, + UseEntity = 0x07, + UpdateHealth = 0x08, + Respawn = 0x09, + Player = 0x0A, + PlayerPosition = 0x0B, + PlayerLook = 0x0C, + PlayerPositionLook = 0x0D, + + PreChunk = 0x32, + MapChunk = 0x33, + + DisconnectKick = 255 +} \ No newline at end of file diff --git a/server/generators/Flat.ts b/server/generators/Flat.ts new file mode 100644 index 0000000..600a961 --- /dev/null +++ b/server/generators/Flat.ts @@ -0,0 +1,23 @@ +import { Block } from "../blocks/Block"; +import { Chunk } from "../Chunk"; +import { IGenerator } from "./IGenerator"; + +export class FlatGenerator implements IGenerator { + public generate(chunk:Chunk) { + for (let x = 0; x < 16; x++) { + for (let z = 0; z < 16; z++) { + for (let y = 0; y < 128; y++) { + if (y === 63) { + chunk.setBlock(Block.grass.blockId, x, y, z); + } else if (y === 62 || y === 61) { + chunk.setBlock(Block.dirt.blockId, x, y, z); + } else if (y === 0) { + chunk.setBlock(Block.bedrock.blockId, x, y, z); + } else if (y < 61) { + chunk.setBlock(Block.stone.blockId, x, y, z); + } + } + } + } + } +} \ No newline at end of file diff --git a/server/generators/IGenerator.ts b/server/generators/IGenerator.ts new file mode 100644 index 0000000..086e564 --- /dev/null +++ b/server/generators/IGenerator.ts @@ -0,0 +1,5 @@ +import { Chunk } from "../Chunk"; + +export interface IGenerator { + generate: (chunk:Chunk) => void +} \ No newline at end of file diff --git a/server/packets/Chat.ts b/server/packets/Chat.ts new file mode 100644 index 0000000..2be031b --- /dev/null +++ b/server/packets/Chat.ts @@ -0,0 +1,22 @@ +import { Reader, Writer } from "../../bufferStuff"; +import { Packets } from "../enums/Packets"; +import { IPacket } from "./IPacket"; + +export class PacketChat implements IPacket { + public packetId = Packets.Chat; + public message:string; + + public constructor(message:string) { + this.message = message; + } + + public readData(reader:Reader) { + this.message = reader.readString(); + + return this; + } + + public writeData() { + return new Writer(3 + this.message.length * 2).writeUByte(this.packetId).writeString(this.message).toBuffer(); + } +} \ No newline at end of file diff --git a/server/packets/DisconnectKick.ts b/server/packets/DisconnectKick.ts new file mode 100644 index 0000000..20acd18 --- /dev/null +++ b/server/packets/DisconnectKick.ts @@ -0,0 +1,20 @@ +import { Reader, Writer } from "../../bufferStuff"; +import { Packets } from "../enums/Packets"; +import { IPacket } from "./IPacket"; + +export class PacketDisconnectKick implements IPacket { + public packetId = Packets.DisconnectKick; + public reason:string; + + public constructor(reason:string) { + this.reason = reason; + } + + public readData(reader:Reader) { + return this; + } + + public writeData() { + return new Writer(3 + this.reason.length * 2).writeUByte(this.packetId).writeString(this.reason).toBuffer(); + } +} \ No newline at end of file diff --git a/server/packets/EntityEquipment.ts b/server/packets/EntityEquipment.ts new file mode 100644 index 0000000..b4c1440 --- /dev/null +++ b/server/packets/EntityEquipment.ts @@ -0,0 +1,31 @@ +import { Reader, Writer } from "../../bufferStuff"; +import { Packets } from "../enums/Packets"; +import { IPacket } from "./IPacket"; + +export class PacketEntityEquipment implements IPacket { + public packetId = Packets.EntityEquipment; + public entityId:number; + public slot:number; + public itemId:number; + public damage:number; + + public constructor(entityId:number, slot:number, itemId:number, damage:number) { + this.entityId = entityId; + this.slot = slot; + this.itemId = itemId; + this.damage = damage; + } + + public readData(reader:Reader) { + this.entityId = reader.readInt(); + this.slot = reader.readShort(); + this.itemId = reader.readShort(); + this.damage = reader.readShort(); + + return this; + } + + public writeData() { + return new Writer(10).writeUByte(this.packetId).writeInt(this.entityId).writeShort(this.slot).writeShort(this.itemId).writeShort(this.damage).toBuffer(); + } +} \ No newline at end of file diff --git a/server/packets/Handshake.ts b/server/packets/Handshake.ts new file mode 100644 index 0000000..f38c107 --- /dev/null +++ b/server/packets/Handshake.ts @@ -0,0 +1,26 @@ +import { Reader, Writer } from "../../bufferStuff"; +import { Packets } from "../enums/Packets"; +import { IPacket } from "./IPacket"; + +export class PacketHandshake implements IPacket { + public packetId:Packets = Packets.Handshake; + private username:string; + + public constructor(username?:string) { + if (typeof(username) === "string") { + this.username = username; + } else { + this.username = ""; + } + } + + public readData(reader:Reader) { + this.username = reader.readString(); + + return this; + } + + public writeData() { + return new Writer(5).writeUByte(this.packetId).writeString("-").toBuffer(); + } +} \ No newline at end of file diff --git a/server/packets/IPacket.ts b/server/packets/IPacket.ts new file mode 100644 index 0000000..d64416e --- /dev/null +++ b/server/packets/IPacket.ts @@ -0,0 +1,8 @@ +import { Reader, Writer } from "../../bufferStuff"; +import { Packets } from "../enums/Packets"; + +export interface IPacket { + packetId: Packets, + readData: (reader:Reader) => IPacket, + writeData: () => Buffer|Promise +} \ No newline at end of file diff --git a/server/packets/KeepAlive.ts b/server/packets/KeepAlive.ts new file mode 100644 index 0000000..4f04a37 --- /dev/null +++ b/server/packets/KeepAlive.ts @@ -0,0 +1,16 @@ +import { Reader, Writer } from "../../bufferStuff"; +import { Packets } from "../enums/Packets"; +import { IPacket } from "./IPacket"; + +export class PacketKeepAlive implements IPacket { + public packetId = Packets.KeepAlive; + private static readonly KeepAliveBuffer:Buffer = new Writer(1).writeByte(Packets.KeepAlive).toBuffer(); + + public readData(reader:Reader) { + return this; + } + + public writeData() { + return PacketKeepAlive.KeepAliveBuffer; + } +} \ No newline at end of file diff --git a/server/packets/LoginRequest.ts b/server/packets/LoginRequest.ts new file mode 100644 index 0000000..01c6405 --- /dev/null +++ b/server/packets/LoginRequest.ts @@ -0,0 +1,38 @@ +import { Reader, Writer } from "../../bufferStuff"; +import { Packets } from "../enums/Packets"; +import { IPacket } from "./IPacket"; + +export class PacketLoginRequest implements IPacket { + public packetId = Packets.LoginRequest; + public protocolVersion:number; + public username:string; + public mapSeed:number; + public dimension:number; + + public constructor(protocolVersion?:number, username?:string, mapSpeed?:number, dimension?:number) { + if (typeof(protocolVersion) === "number" && typeof(username) === "string" && typeof(mapSpeed) === "number" && typeof(dimension) === "number") { + this.protocolVersion = protocolVersion; + this.username = username; + this.mapSeed = mapSpeed; + this.dimension = dimension; + } else { + this.protocolVersion = Number.MIN_VALUE; + this.username = ""; + this.mapSeed = Number.MIN_VALUE; + this.dimension = Number.MIN_VALUE; + } + } + + public readData(reader:Reader) { + this.protocolVersion = reader.readInt(); + this.username = reader.readString(); + this.mapSeed = Number(reader.readLong()); + this.dimension = reader.readByte(); + + return this; + } + + public writeData() { + return new Writer(16 + (2 * this.username.length)).writeUByte(this.packetId).writeInt(this.protocolVersion).writeString(this.username).writeLong(this.mapSeed).writeByte(this.dimension).toBuffer(); + } +} \ No newline at end of file diff --git a/server/packets/MapChunk.ts b/server/packets/MapChunk.ts new file mode 100644 index 0000000..61800f3 --- /dev/null +++ b/server/packets/MapChunk.ts @@ -0,0 +1,68 @@ +import { deflate } from "zlib"; +import { Reader, Writer } from "../../bufferStuff"; +import { Packets } from "../enums/Packets"; +import { IPacket } from "./IPacket"; +import { Chunk } from "../Chunk"; + +export class PacketMapChunk implements IPacket { + public packetId = Packets.MapChunk; + public x:number; + public y:number; + public z:number; + public sizeX:number; + public sizeY:number; + public sizeZ:number; + public chunk:Chunk; + + public constructor(x:number, y:number, z:number, sizeX:number, sizeY:number, sizeZ:number, chunk:Chunk) { + this.x = x; + this.y = y; + this.z = z; + this.sizeX = sizeX; + this.sizeY = sizeY; + this.sizeZ = sizeZ; + this.chunk = chunk; + } + + public readData(reader:Reader) { + + + return this; + } + + public writeData() { + return new Promise((resolve, reject) => { + const blocks = new Writer(32768); + const metadata = new Writer(16384); + const lighting = new Writer(32768); + + let blockMeta = false; + for (let x = 0; x < 16; x++) { + for (let z = 0; z < 16; z++) { + for (let y = 0; y < 128; y++) { + blocks.writeUByte(this.chunk.getBlockId(x, y, z)); + if (blockMeta) { + metadata.writeUByte(0); + // Light level 15 for 2 blocks (1111 1111) + lighting.writeUByte(0xff); // TODO: Lighting (Client seems to do it's own (when a block update happens) so it's not top priority) + lighting.writeUByte(0xff); + } + // Hack for nibble stuff + blockMeta = !blockMeta; + } + } + } + + // Write meta and lighting data into block buffer for compression + blocks.writeBuffer(metadata.toBuffer()).writeBuffer(lighting.toBuffer()); + + deflate(blocks.toBuffer(), (err, data) => { + if (err) { + return reject(err); + } + + resolve(new Writer(18).writeUByte(this.packetId).writeInt(this.x).writeShort(this.y).writeInt(this.z).writeUByte(this.sizeX).writeUByte(this.sizeY).writeUByte(this.sizeZ).writeInt(data.length).writeBuffer(data).toBuffer()); + }); + }); + } +} \ No newline at end of file diff --git a/server/packets/Player.ts b/server/packets/Player.ts new file mode 100644 index 0000000..3374169 --- /dev/null +++ b/server/packets/Player.ts @@ -0,0 +1,22 @@ +import { Reader, Writer } from "../../bufferStuff"; +import { Packets } from "../enums/Packets"; +import { IPacket } from "./IPacket"; + +export class PacketPlayer implements IPacket { + public packetId = Packets.Player; + public onGround:boolean; + + public constructor(onGround:boolean = false) { + this.onGround = onGround; + } + + public readData(reader:Reader) { + this.onGround = reader.readBool(); + + return this; + } + + public writeData() { + return new Writer(2).writeUByte(this.packetId).writeBool(this.onGround).toBuffer(); + } +} \ No newline at end of file diff --git a/server/packets/PlayerLook.ts b/server/packets/PlayerLook.ts new file mode 100644 index 0000000..9ab4c22 --- /dev/null +++ b/server/packets/PlayerLook.ts @@ -0,0 +1,28 @@ +import { Reader, Writer } from "../../bufferStuff"; +import { Packets } from "../enums/Packets"; +import { IPacket } from "./IPacket"; + +export class PacketPlayerLook implements IPacket { + public packetId = Packets.Player; + public yaw:number; + public pitch:number; + public onGround:boolean; + + public constructor(yaw:number, pitch:number, onGround:boolean = false) { + this.yaw = yaw; + this.pitch = pitch; + this.onGround = onGround; + } + + public readData(reader:Reader) { + this.yaw = reader.readFloat(); + this.pitch = reader.readFloat(); + this.onGround = reader.readBool(); + + return this; + } + + public writeData() { + return new Writer(10).writeUByte(this.packetId).writeFloat(this.yaw).writeFloat(this.pitch).writeBool(this.onGround).toBuffer(); + } +} \ No newline at end of file diff --git a/server/packets/PlayerPosition.ts b/server/packets/PlayerPosition.ts new file mode 100644 index 0000000..f537800 --- /dev/null +++ b/server/packets/PlayerPosition.ts @@ -0,0 +1,34 @@ +import { Reader, Writer } from "../../bufferStuff"; +import { Packets } from "../enums/Packets"; +import { IPacket } from "./IPacket"; + +export class PacketPlayerPosition implements IPacket { + public packetId = Packets.PlayerPosition; + public x:number; + public y:number; + public stance:number; + public z:number; + public onGround:boolean; + + public constructor(x:number, y:number, stance:number, z:number, onGround:boolean = false) { + this.x = x; + this.y = y; + this.stance = stance; + this.z = z; + this.onGround = onGround; + } + + public readData(reader:Reader) { + this.x = reader.readDouble(); + this.y = reader.readDouble(); + this.stance = reader.readDouble(); + this.z = reader.readDouble(); + this.onGround = reader.readBool(); + + return this; + } + + public writeData() { + return new Writer(34).writeUByte(this.packetId).writeDouble(this.x).writeDouble(this.y).writeDouble(this.stance).writeDouble(this.z).writeBool(this.onGround).toBuffer(); + } +} \ No newline at end of file diff --git a/server/packets/PlayerPositionLook.ts b/server/packets/PlayerPositionLook.ts new file mode 100644 index 0000000..fbb2b08 --- /dev/null +++ b/server/packets/PlayerPositionLook.ts @@ -0,0 +1,40 @@ +import { Reader, Writer } from "../../bufferStuff"; +import { Packets } from "../enums/Packets"; +import { IPacket } from "./IPacket"; + +export class PacketPlayerPositionLook implements IPacket { + public packetId = Packets.PlayerPosition; + public x:number; + public y:number; + public stance:number; + public z:number; + public yaw:number; + public pitch:number; + public onGround:boolean; + + public constructor(x:number, y:number, stance:number, z:number, yaw:number, pitch:number, onGround:boolean = false) { + this.x = x; + this.y = y; + this.stance = stance; + this.z = z; + this.yaw = yaw; + this.pitch = pitch; + this.onGround = onGround; + } + + public readData(reader:Reader) { + this.x = reader.readDouble(); + this.y = reader.readDouble(); + this.stance = reader.readDouble(); + this.z = reader.readDouble(); + this.yaw = reader.readFloat(); + this.pitch = reader.readFloat(); + this.onGround = reader.readBool(); + + return this; + } + + public writeData() { + return new Writer(42).writeUByte(this.packetId).writeDouble(this.x).writeDouble(this.y).writeDouble(this.stance).writeDouble(this.z).writeFloat(this.yaw).writeFloat(this.pitch).writeBool(this.onGround).toBuffer(); + } +} \ No newline at end of file diff --git a/server/packets/PreChunk.ts b/server/packets/PreChunk.ts new file mode 100644 index 0000000..38fde2d --- /dev/null +++ b/server/packets/PreChunk.ts @@ -0,0 +1,28 @@ +import { Reader, Writer } from "../../bufferStuff"; +import { Packets } from "../enums/Packets"; +import { IPacket } from "./IPacket"; + +export class PacketPreChunk implements IPacket { + public packetId = Packets.PreChunk; + public x:number; + public z:number; + public mode:boolean; + + public constructor(x:number, z:number, mode:boolean) { + this.x = x; + this.z = z; + this.mode = mode; + } + + public readData(reader:Reader) { + this.x = reader.readInt(); + this.z = reader.readInt(); + this.mode = reader.readBool(); + + return this; + } + + public writeData() { + return new Writer(10).writeUByte(this.packetId).writeInt(this.x).writeInt(this.z).writeBool(this.mode).toBuffer(); + } +} \ No newline at end of file diff --git a/server/packets/Respawn.ts b/server/packets/Respawn.ts new file mode 100644 index 0000000..cd08787 --- /dev/null +++ b/server/packets/Respawn.ts @@ -0,0 +1,22 @@ +import { Reader, Writer } from "../../bufferStuff"; +import { Packets } from "../enums/Packets"; +import { IPacket } from "./IPacket"; + +export class PacketRespawn implements IPacket { + public packetId = Packets.Respawn; + public health:number; + + public constructor(health:number) { + this.health = health; + } + + public readData(reader:Reader) { + this.health = reader.readShort(); + + return this; + } + + public writeData() { + return new Writer(3).writeUByte(this.packetId).writeShort(this.health).toBuffer(); + } +} \ No newline at end of file diff --git a/server/packets/SpawnPosition.ts b/server/packets/SpawnPosition.ts new file mode 100644 index 0000000..e530093 --- /dev/null +++ b/server/packets/SpawnPosition.ts @@ -0,0 +1,28 @@ +import { Reader, Writer } from "../../bufferStuff"; +import { Packets } from "../enums/Packets"; +import { IPacket } from "./IPacket"; + +export class PacketSpawnPosition implements IPacket { + public packetId = Packets.SpawnPosition; + public x:number; + public y:number; + public z:number; + + public constructor(x:number, y:number, z:number) { + this.x = x; + this.y = y; + this.z = z; + } + + public readData(reader:Reader) { + this.x = reader.readInt(); + this.y = reader.readInt(); + this.z = reader.readInt(); + + return this; + } + + public writeData() { + return new Writer(13).writeUByte(this.packetId).writeInt(this.x).writeInt(this.y).writeInt(this.z).toBuffer(); + } +} \ No newline at end of file diff --git a/server/packets/TimeUpdate.ts b/server/packets/TimeUpdate.ts new file mode 100644 index 0000000..832f373 --- /dev/null +++ b/server/packets/TimeUpdate.ts @@ -0,0 +1,22 @@ +import { Reader, Writer } from "../../bufferStuff"; +import { Packets } from "../enums/Packets"; +import { IPacket } from "./IPacket"; + +export class PacketTimeUpdate implements IPacket { + public packetId = Packets.TimeUpdate; + public time:number; + + public constructor(time:number) { + this.time = time; + } + + public readData(reader:Reader) { + this.time = Number(reader.readLong()); + + return this; + } + + public writeData() { + return new Writer(9).writeUByte(this.packetId).writeLong(this.time).toBuffer(); + } +} \ No newline at end of file diff --git a/server/packets/UpdateHealth.ts b/server/packets/UpdateHealth.ts new file mode 100644 index 0000000..015c155 --- /dev/null +++ b/server/packets/UpdateHealth.ts @@ -0,0 +1,22 @@ +import { Reader, Writer } from "../../bufferStuff"; +import { Packets } from "../enums/Packets"; +import { IPacket } from "./IPacket"; + +export class PacketUpdateHealth implements IPacket { + public packetId = Packets.UpdateHealth; + public health:number; + + public constructor(health:number) { + this.health = health; + } + + public readData(reader:Reader) { + this.health = reader.readShort(); + + return this; + } + + public writeData() { + return new Writer(3).writeUByte(this.packetId).writeShort(this.health).toBuffer(); + } +} \ No newline at end of file diff --git a/server/packets/UseEntity.ts b/server/packets/UseEntity.ts new file mode 100644 index 0000000..c6515a6 --- /dev/null +++ b/server/packets/UseEntity.ts @@ -0,0 +1,28 @@ +import { Reader, Writer } from "../../bufferStuff"; +import { Packets } from "../enums/Packets"; +import { IPacket } from "./IPacket"; + +export class PacketUseEntity implements IPacket { + public packetId = Packets.UseEntity; + public userId:number; + public targetId:number; + public leftClick:boolean; + + public constructor(userId:number, targetId:number, leftClick:boolean) { + this.userId = userId; + this.targetId = targetId; + this.leftClick = leftClick; + } + + public readData(reader:Reader) { + this.userId = reader.readInt(); + this.targetId = reader.readInt(); + this.leftClick = reader.readBool(); + + return this; + } + + public writeData() { + return new Writer(10).writeUByte(this.packetId).writeInt(this.userId).writeInt(this.targetId).writeBool(this.leftClick).toBuffer(); + } +} \ No newline at end of file diff --git a/server/server.js b/server/server.js deleted file mode 100644 index 4f85f49..0000000 --- a/server/server.js +++ /dev/null @@ -1,357 +0,0 @@ -/* - ==============- server.js -============= - Created by Holly (tgpethan) (c) 2021 - Licenced under MIT - ======================================== -*/ - -const bufferStuff = require("./bufferStuff.js"); -const ChunkManager = require("./chunkManager.js"); -const User = require("./user.js"); -const EntityPlayer = require("./Entities/EntityPlayer.js"); -const PacketMappingTable = require("./PacketMappingTable.js"); -const NamedPackets = require("./NamedPackets.js"); -const Converter = require("./Converter.js"); -const Block = require("./Blocks/Block.js"); - -const Socket = require("net").Socket; - -let idPool = 1; -global.fromIDPool = function() { - const oldVal = idPool; - idPool++; - return oldVal; -} - -let netUsers = {}, - netUserKeys = Object.keys(netUsers); - -global.getUserByKey = function(key) { - return netUsers[key]; -} - -global.sendToAllPlayers = function(buffer = Buffer.alloc(0)) { - for (let key of netUserKeys) { - const user = netUsers[key]; - user.socket.write(buffer); - } -} - -global.sendToAllPlayersButSelf = function(id, buffer = Buffer.alloc(0)) { - for (let key of netUserKeys) { - if (key == id) continue; - const user = netUsers[key]; - user.socket.write(buffer); - } -} - -function addUser(socket) { - let user = new User(global.fromIDPool(), socket); - user.entityRef = new EntityPlayer(user, 8.5, 65.5, 8.5); - netUsers[user.id] = user; - netUserKeys = Object.keys(netUsers); - - return user; -} - -function removeUser(id) { - delete netUsers[id]; - netUserKeys = Object.keys(netUsers); -} - -let config = {}; - -let entities = {}; -let entityKeys = {}; - -global.chunkManager = new ChunkManager(); -global.generatingChunks = false; - -let tickInterval, tickCounter = BigInt(0), worldTime = 0; -let tickRate = BigInt(20); - -module.exports.init = function(config) { - config = config; - console.log(`Up! Running at 0.0.0.0:${config.port}`); - - tickInterval = setInterval(() => { - // Runs every sec - if (tickCounter % tickRate == 0) { - for (let key of netUserKeys) { - const user = netUsers[key]; - user.socket.write(new PacketMappingTable[NamedPackets.KeepAlive]().writePacket()); - if (user.loginFinished) user.socket.write(new PacketMappingTable[NamedPackets.TimeUpdate](BigInt(worldTime)).writePacket()); - } - } - // Do chunk updates - // Don't update if chunk is generating - if (global.chunkManager.queuedBlockUpdates.getLength() > 0) { - let itemsToRemove = []; - // Do a max of 128 block updates per tick - for (let i = 0; i < Math.min(global.chunkManager.queuedBlockUpdates.getLength(), 128); i++) { - const chunkUpdateKey = global.chunkManager.queuedBlockUpdates.itemKeys[i]; - const chunkUpdate = global.chunkManager.queuedBlockUpdates.items[chunkUpdateKey]; - - // TODO: Remove this once infinite terrain is in :) - if (chunkUpdate[0] < -3 || chunkUpdate[0] > 3 || chunkUpdate[1] < -3 || chunkUpdate[1] > 3) { - itemsToRemove.push(chunkUpdateKey, false); - continue; - } - - // If the chunk just plain doesn't exist (yet) skip this one - if (global.chunkManager.chunks[chunkUpdate[0]] == null) continue; - if (global.chunkManager.chunks[chunkUpdate[0]][chunkUpdate[1]] == null) continue; - - global.chunkManager.chunks[chunkUpdate[0]][chunkUpdate[1]][chunkUpdate[2]][chunkUpdate[3]][chunkUpdate[4]][0] = chunkUpdate[5]; - global.chunkManager.chunks[chunkUpdate[0]][chunkUpdate[1]][chunkUpdate[2]][chunkUpdate[3]][chunkUpdate[4]][1] = chunkUpdate[6]; - - const packet = new PacketMappingTable[NamedPackets.BlockChange](chunkUpdate[3] + (chunkUpdate[0] << 4), chunkUpdate[2], chunkUpdate[4] + (chunkUpdate[1] << 4), chunkUpdate[5], chunkUpdate[6]).writePacket(); - for (let userKey of netUserKeys) { - const user = netUsers[userKey]; - if (user.loginFinished) user.socket.write(packet); - } - - itemsToRemove.push(chunkUpdateKey); - } - - for (let item of itemsToRemove) { - global.chunkManager.queuedBlockUpdates.remove(item, false); - } - - global.chunkManager.queuedBlockUpdates.regenerateIterableArray(); - } - - // Entity update! - for (let key of netUserKeys) { - const user = netUsers[key]; - - if (user.loginFinished) user.entityRef.onTick(); - } - - // Send queued chunks to users - for (let key of netUserKeys) { - const user = netUsers[key]; - - if (user.loginFinished) { - let itemsToRemove = []; - for (let i = 0; i < Math.min(user.chunksToSend.getLength(), 128); i++) { - const chunkKey = user.chunksToSend.itemKeys[i]; - itemsToRemove.push(chunkKey); - user.socket.write(user.chunksToSend.items[chunkKey]); - } - - for (let item of itemsToRemove) { - user.chunksToSend.remove(item, false); - } - - user.chunksToSend.regenerateIterableArray(); - } - } - - tickCounter++; - worldTime++; - }, 1000 / parseInt(tickRate.toString())); - - for (let x = -3; x < 4; x++) { - for (let z = -3; z < 4; z++) { - global.chunkManager.createChunk(x, z); - } - } -} - -module.exports.connection = async function(socket = new Socket) { - const thisUser = addUser(socket); - - socket.on('data', function(chunk) { - const reader = new bufferStuff.Reader(chunk); - - const packetID = reader.readByte(); - - switch(packetID) { - case NamedPackets.Disconnect: - removeUser(thisUser.id); - break; - - case NamedPackets.KeepAlive: - - break; - - case NamedPackets.LoginRequest: - socket.write(new PacketMappingTable[NamedPackets.LoginRequest](reader.readInt(), reader.readString(), global.chunkManager.seed, reader.readByte()).writePacket(thisUser.id)); - socket.write(new PacketMappingTable[NamedPackets.SpawnPosition]().writePacket()); - - for (let x = -3; x < 4; x++) { - for (let z = -3; z < 4; z++) { - socket.write(new PacketMappingTable[NamedPackets.PreChunk](x, z, true).writePacket()); - } - } - - // Place a layer of glass under the player so they don't fall n' die - for (let x = 0; x < 16; x++) { - for (let z = 0; z < 16; z++) { - socket.write(new PacketMappingTable[NamedPackets.BlockChange](x, 64, z, Block.glass.blockID, 0).writePacket()); - } - } - - socket.write(new PacketMappingTable[NamedPackets.Player](true).writePacket()); - - const joinMessage = new PacketMappingTable[NamedPackets.ChatMessage](`\u00A7e${thisUser.username} has joined the game`).writePacket(); - for (let key of netUserKeys) { - netUsers[key].socket.write(joinMessage); - } - - socket.write(new PacketMappingTable[NamedPackets.SetSlot](0, 36, 3, 64, 0).writePacket()); - - socket.write(new PacketMappingTable[NamedPackets.PlayerPositionAndLook](8.5, 65 + 1.6200000047683716, 65, 8.5, 0, 0, false).writePacket()); - - thisUser.loginFinished = true; - - // Send chunks - for (let x = -3; x < 4; x++) { - for (let z = -3; z < 4; z++) { - global.chunkManager.multiBlockChunk(x, z, thisUser); - } - } - - // Send this user to other online user - global.sendToAllPlayersButSelf(thisUser.id, new PacketMappingTable[NamedPackets.NamedEntitySpawn](thisUser.id, thisUser.username, thisUser.entityRef.x, thisUser.entityRef.y, thisUser.entityRef.z, thisUser.entityRef.yaw, thisUser.entityRef.pitch, 0).writePacket()); - - // send all online users to this user - for (let key of netUserKeys) { - if (key == thisUser.id) continue; - const user = netUsers[key]; - - socket.write(new PacketMappingTable[NamedPackets.NamedEntitySpawn](user.id, user.username, user.entityRef.x, user.entityRef.y, user.entityRef.z, user.entityRef.yaw, user.entityRef.pitch, 0).writePacket()); - } - break; - - case NamedPackets.Handshake: - thisUser.username = reader.readString(); - - socket.write(new PacketMappingTable[NamedPackets.Handshake](thisUser.username).writePacket()); - break; - - case NamedPackets.ChatMessage: - const message = reader.readString(); - // Hacky commands until I made a command system - if (message.startsWith("/")) { - const command = message.substring(1, message.length).split(" "); - console.log(command); - if (command[0] == "time") { - if (command.length < 2) { - } else if (command[1] == "set") { - if (command.length < 3) { - } else { - switch (command[2]) { - case "day": - worldTime = (24000 * (worldTime / 24000)); - break; - - case "noon": - worldTime = (24000 * (worldTime / 24000)) + 6000; - break; - - case "sunset": - worldTime = (24000 * (worldTime / 24000)) + 12000; - break; - - case "midnight": - worldTime = (24000 * (worldTime / 24000)) + 18000; - break; - } - } - } - } - } else { - // Send player's message to all players - const cachedPacket = new PacketMappingTable[NamedPackets.ChatMessage](`<${thisUser.username}> ${message}`).writePacket(); - for (let key of netUserKeys) { - netUsers[key].socket.write(cachedPacket); - } - } - break; - - case NamedPackets.PlayerLook: - thisUser.entityRef.yaw = reader.readFloat() % 360 % -360; - thisUser.entityRef.pitch = reader.readFloat() % 360 % -360; - break; - - case NamedPackets.PlayerPosition: - thisUser.entityRef.x = reader.readDouble(); - thisUser.entityRef.y = reader.readDouble(); - reader.readDouble(); // stance - thisUser.entityRef.z = reader.readDouble(); - break; - - case NamedPackets.PlayerPositionAndLook: - thisUser.entityRef.x = reader.readDouble(); - thisUser.entityRef.y = reader.readDouble(); - reader.readDouble(); // stance - thisUser.entityRef.z = reader.readDouble(); - thisUser.entityRef.yaw = reader.readFloat() % 360 % -360; - thisUser.entityRef.pitch = reader.readFloat() % 360 % -360; - break; - - case NamedPackets.Animation: - const EID = reader.readInt(); - const cachedPacket = new PacketMappingTable[NamedPackets.Animation](thisUser.id, reader.readByte()).writePacket(); - for (let key of netUserKeys) { - if (netUsers[key].id !== thisUser.id) netUsers[key].socket.write(cachedPacket); - } - break; - - case NamedPackets.PlayerDigging: - const status = reader.readByte(); - - if (status == 2) { - const x = reader.readInt(); - const y = reader.readByte(); - const z = reader.readInt(); - - global.chunkManager.setBlock(x, y, z, 0); - } - break; - - case NamedPackets.PlayerBlockPlacement: - const x = reader.readInt(); - const y = reader.readByte(); - const z = reader.readInt(); - let xOff = 0, yOff = 0, zOff = 0; - switch (reader.readByte()) { // direction - case 0: yOff = -1; break; - case 1: yOff = 1; break; - case 2: zOff = -1; break; - case 3: zOff = 1; break; - case 4: xOff = -1; break; - case 5: xOff = 1; break; - } - const block = reader.readShort(); - - global.chunkManager.setBlock(x + xOff, y + yOff, z + zOff, block); - break; - - case NamedPackets.Player: - - break; - - default: - console.log(toHexValue(packetID)); - break; - } - }); - - socket.on('end', function() { - console.log("Connection closed"); - removeUser(thisUser.id); - }); - - socket.on('error', function(err) { - console.log("Connection error!"); - removeUser(thisUser.id); - }); -} - -function toHexValue(val = 0x00) { - if (val < 16) return `0x0${val.toString(16).toUpperCase()}`; - else return `0x${val.toString(16).toUpperCase()}`; -} \ No newline at end of file diff --git a/server/user.js b/server/user.js deleted file mode 100644 index ad92a3c..0000000 --- a/server/user.js +++ /dev/null @@ -1,25 +0,0 @@ -/* - ===============- user.js -============== - Created by Holly (tgpethan) (c) 2021 - Licenced under MIT - ======================================== -*/ - -const funkyArray = require("./Util/funkyArray.js"); - -const Socket = require("net").Socket; - -module.exports = class { - constructor(id = 1, socket = new Socket) { - this.id = id; - this.socket = socket; - - this.username = "UNNAMED"; - - this.loginFinished = false; - - this.entityRef = null; - - this.chunksToSend = new funkyArray(); - } -} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..21fddc5 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "module": "commonjs", + "moduleResolution": "node", + "target": "es6", + "esModuleInterop": true, + "resolveJsonModule": true, + "rootDir": "./", + "outDir": "./build", + "strict": true + } +} \ No newline at end of file diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000..fb8c7b8 --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,15 @@ +const path = require('path'); +const nodeExternals = require('webpack-node-externals'); + +module.exports = { + target: 'node', + externals: [ nodeExternals() ], + entry: './build/index.js', + output: { + path: path.join(__dirname, 'bundle'), + filename: 'MCBS.js', + }, + optimization: { + minimize: true, + }, +}; \ No newline at end of file