omegga 0.1.85 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +142 -62
- package/bin/omegga +10 -4
- package/dist/brickadia/config.d.ts +3 -0
- package/dist/brickadia/config.d.ts.map +1 -0
- package/dist/brickadia/config.js +61 -0
- package/dist/brickadia/config.js.map +1 -0
- package/dist/brickadia/presets.d.ts +65 -0
- package/dist/brickadia/presets.js +3 -0
- package/dist/brickadia/presets.js.map +1 -0
- package/dist/brickadia/server.d.ts +20 -0
- package/dist/brickadia/server.d.ts.map +1 -0
- package/dist/brickadia/server.js +188 -0
- package/dist/brickadia/server.js.map +1 -0
- package/dist/brickadia/types.d.ts +45 -0
- package/dist/brickadia/types.d.ts.map +1 -0
- package/dist/brickadia/types.js +3 -0
- package/dist/brickadia/types.js.map +1 -0
- package/dist/cli/auth.d.ts +20 -0
- package/dist/cli/auth.d.ts.map +1 -0
- package/dist/cli/auth.js +115 -0
- package/dist/cli/auth.js.map +1 -0
- package/dist/cli/config.d.ts +10 -0
- package/dist/cli/config.d.ts.map +1 -0
- package/dist/cli/config.js +72 -0
- package/dist/cli/config.js.map +1 -0
- package/dist/cli/index.d.ts +20 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +15 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/installer.d.ts +1 -0
- package/dist/cli/installer.d.ts.map +1 -0
- package/dist/cli/installer.js +55 -0
- package/dist/cli/installer.js.map +1 -0
- package/dist/cli/plugin.d.ts +11 -0
- package/dist/cli/plugin.d.ts.map +1 -0
- package/dist/cli/plugin.js +598 -0
- package/dist/cli/plugin.js.map +1 -0
- package/dist/cli/terminal.d.ts +34 -0
- package/dist/cli/terminal.d.ts.map +1 -0
- package/dist/cli/terminal.js +395 -0
- package/dist/cli/terminal.js.map +1 -0
- package/dist/config/authorizer.d.ts +2 -0
- package/dist/config/authorizer.d.ts.map +1 -0
- package/dist/config/authorizer.js +38 -0
- package/dist/config/authorizer.js.map +1 -0
- package/dist/config/formats/format_js.d.ts +3 -0
- package/dist/config/formats/format_js.d.ts.map +1 -0
- package/dist/config/formats/format_js.js +10 -0
- package/dist/config/formats/format_js.js.map +1 -0
- package/dist/config/formats/format_yml.d.ts +3 -0
- package/dist/config/formats/format_yml.d.ts.map +1 -0
- package/dist/config/formats/format_yml.js +14 -0
- package/dist/config/formats/format_yml.js.map +1 -0
- package/dist/config/index.d.ts +18 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +86 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/reader.d.ts +3 -0
- package/dist/config/reader.d.ts.map +1 -0
- package/dist/config/reader.js +30 -0
- package/dist/config/reader.js.map +1 -0
- package/dist/config/types.d.ts +37 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/types.js +3 -0
- package/dist/config/types.js.map +1 -0
- package/dist/config/validator.d.ts +6 -0
- package/dist/config/validator.d.ts.map +1 -0
- package/dist/config/validator.js +26 -0
- package/dist/config/validator.js.map +1 -0
- package/dist/config/writer.d.ts +3 -0
- package/dist/config/writer.d.ts.map +1 -0
- package/dist/config/writer.js +25 -0
- package/dist/config/writer.js.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +55 -0
- package/dist/index.js.map +1 -0
- package/dist/info/default_commands.json +28 -0
- package/dist/lib.d.ts +21 -0
- package/dist/lib.d.ts.map +1 -0
- package/dist/lib.js +54 -0
- package/dist/lib.js.map +1 -0
- package/dist/logger.d.ts +41 -0
- package/dist/logger.js +67 -0
- package/dist/logger.js.map +1 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +284 -0
- package/dist/main.js.map +1 -0
- package/dist/omegga/auth.d.ts +6 -0
- package/dist/omegga/auth.d.ts.map +1 -0
- package/dist/omegga/auth.js +139 -0
- package/dist/omegga/auth.js.map +1 -0
- package/dist/omegga/commandInjector.d.ts +35 -0
- package/dist/omegga/commandInjector.d.ts.map +1 -0
- package/dist/omegga/commandInjector.js +234 -0
- package/dist/omegga/commandInjector.js.map +1 -0
- package/dist/omegga/index.d.ts +7 -0
- package/dist/omegga/index.d.ts.map +1 -0
- package/dist/omegga/index.js +43 -0
- package/dist/omegga/index.js.map +1 -0
- package/dist/omegga/logWrangler.d.ts +32 -0
- package/dist/omegga/logWrangler.d.ts.map +1 -0
- package/dist/omegga/logWrangler.js +279 -0
- package/dist/omegga/logWrangler.js.map +1 -0
- package/dist/omegga/matchers/auth.d.ts +9 -0
- package/dist/omegga/matchers/auth.d.ts.map +1 -0
- package/dist/omegga/matchers/auth.js +53 -0
- package/dist/omegga/matchers/auth.js.map +1 -0
- package/dist/omegga/matchers/chat.d.ts +9 -0
- package/dist/omegga/matchers/chat.d.ts.map +1 -0
- package/dist/omegga/matchers/chat.js +68 -0
- package/dist/omegga/matchers/chat.js.map +1 -0
- package/dist/omegga/matchers/command.d.ts +7 -0
- package/dist/omegga/matchers/command.d.ts.map +1 -0
- package/dist/omegga/matchers/command.js +39 -0
- package/dist/omegga/matchers/command.js.map +1 -0
- package/dist/omegga/matchers/exit.d.ts +3 -0
- package/dist/omegga/matchers/exit.d.ts.map +1 -0
- package/dist/omegga/matchers/exit.js +21 -0
- package/dist/omegga/matchers/exit.js.map +1 -0
- package/dist/omegga/matchers/index.d.ts +3 -0
- package/dist/omegga/matchers/index.d.ts.map +1 -0
- package/dist/omegga/matchers/index.js +39 -0
- package/dist/omegga/matchers/index.js.map +1 -0
- package/dist/omegga/matchers/init.d.ts +3 -0
- package/dist/omegga/matchers/init.d.ts.map +1 -0
- package/dist/omegga/matchers/init.js +26 -0
- package/dist/omegga/matchers/init.js.map +1 -0
- package/dist/omegga/matchers/interact.d.ts +4 -0
- package/dist/omegga/matchers/interact.js +39 -0
- package/dist/omegga/matchers/interact.js.map +1 -0
- package/dist/omegga/matchers/join.d.ts +4 -0
- package/dist/omegga/matchers/join.d.ts.map +1 -0
- package/dist/omegga/matchers/join.js +95 -0
- package/dist/omegga/matchers/join.js.map +1 -0
- package/dist/omegga/matchers/leave.d.ts +4 -0
- package/dist/omegga/matchers/leave.d.ts.map +1 -0
- package/dist/omegga/matchers/leave.js +59 -0
- package/dist/omegga/matchers/leave.js.map +1 -0
- package/dist/omegga/matchers/mapChange.d.ts +3 -0
- package/dist/omegga/matchers/mapChange.d.ts.map +1 -0
- package/dist/omegga/matchers/mapChange.js +38 -0
- package/dist/omegga/matchers/mapChange.js.map +1 -0
- package/dist/omegga/matchers/types.d.ts +5 -0
- package/dist/omegga/matchers/types.d.ts.map +1 -0
- package/dist/omegga/matchers/types.js +7 -0
- package/dist/omegga/matchers/types.js.map +1 -0
- package/dist/omegga/matchers/version.d.ts +3 -0
- package/dist/omegga/matchers/version.d.ts.map +1 -0
- package/dist/omegga/matchers/version.js +45 -0
- package/dist/omegga/matchers/version.js.map +1 -0
- package/dist/omegga/player.d.ts +71 -0
- package/dist/omegga/player.d.ts.map +1 -0
- package/dist/omegga/player.js +442 -0
- package/dist/omegga/player.js.map +1 -0
- package/dist/omegga/plugin/plugin_jsonrpc_stdio.d.ts +23 -0
- package/dist/omegga/plugin/plugin_jsonrpc_stdio.d.ts.map +1 -0
- package/dist/omegga/plugin/plugin_jsonrpc_stdio.js +441 -0
- package/dist/omegga/plugin/plugin_jsonrpc_stdio.js.map +1 -0
- package/dist/omegga/plugin/plugin_node_safe/proxyOmegga.d.ts +129 -0
- package/dist/omegga/plugin/plugin_node_safe/proxyOmegga.d.ts.map +1 -0
- package/dist/omegga/plugin/plugin_node_safe/proxyOmegga.js +260 -0
- package/dist/omegga/plugin/plugin_node_safe/proxyOmegga.js.map +1 -0
- package/dist/omegga/plugin/plugin_node_safe/worker.d.ts +1 -0
- package/dist/omegga/plugin/plugin_node_safe/worker.d.ts.map +1 -0
- package/dist/omegga/plugin/plugin_node_safe/worker.js +289 -0
- package/dist/omegga/plugin/plugin_node_safe/worker.js.map +1 -0
- package/dist/omegga/plugin/plugin_node_safe.d.ts +24 -0
- package/dist/omegga/plugin/plugin_node_safe.d.ts.map +1 -0
- package/dist/omegga/plugin/plugin_node_safe.js +397 -0
- package/dist/omegga/plugin/plugin_node_safe.js.map +1 -0
- package/dist/omegga/plugin/plugin_node_unsafe.d.ts +13 -0
- package/dist/omegga/plugin/plugin_node_unsafe.d.ts.map +1 -0
- package/dist/omegga/plugin/plugin_node_unsafe.js +178 -0
- package/dist/omegga/plugin/plugin_node_unsafe.js.map +1 -0
- package/dist/omegga/plugin.d.ts +86 -0
- package/dist/omegga/plugin.d.ts.map +1 -0
- package/dist/omegga/plugin.js +458 -0
- package/dist/omegga/plugin.js.map +1 -0
- package/dist/omegga/server.d.ts +149 -0
- package/dist/omegga/server.d.ts.map +1 -0
- package/dist/omegga/server.js +601 -0
- package/dist/omegga/server.js.map +1 -0
- package/dist/omegga/types.d.ts +48 -0
- package/dist/omegga/types.d.ts.map +1 -0
- package/dist/omegga/types.js +3 -0
- package/dist/omegga/types.js.map +1 -0
- package/dist/omegga/wrapper.d.ts +22 -0
- package/dist/omegga/wrapper.d.ts.map +1 -0
- package/dist/omegga/wrapper.js +75 -0
- package/dist/omegga/wrapper.js.map +1 -0
- package/dist/omeggaplugin.d.ts +1 -0
- package/dist/omeggaplugin.js +4 -0
- package/dist/omeggaplugin.js.map +1 -0
- package/dist/plugin.d.ts +781 -0
- package/dist/plugin.js +41 -0
- package/dist/plugin.js.map +1 -0
- package/dist/softconfig.d.ts +51 -0
- package/dist/softconfig.d.ts.map +1 -0
- package/dist/softconfig.js +82 -0
- package/dist/softconfig.js.map +1 -0
- package/dist/util/brick/checkBounds.d.ts +8 -0
- package/dist/util/brick/checkBounds.d.ts.map +1 -0
- package/dist/util/brick/checkBounds.js +22 -0
- package/dist/util/brick/checkBounds.js.map +1 -0
- package/dist/util/brick/constants.d.ts +18 -0
- package/dist/util/brick/constants.d.ts.map +1 -0
- package/dist/util/brick/constants.js +184 -0
- package/dist/util/brick/constants.js.map +1 -0
- package/dist/util/brick/getBounds.d.ts +4 -0
- package/dist/util/brick/getBounds.d.ts.map +1 -0
- package/dist/util/brick/getBounds.js +39 -0
- package/dist/util/brick/getBounds.js.map +1 -0
- package/dist/util/brick/getBrickSize.d.ts +3 -0
- package/dist/util/brick/getBrickSize.d.ts.map +1 -0
- package/dist/util/brick/getBrickSize.js +12 -0
- package/dist/util/brick/getBrickSize.js.map +1 -0
- package/dist/util/brick/getScaleAxis.d.ts +3 -0
- package/dist/util/brick/getScaleAxis.d.ts.map +1 -0
- package/dist/util/brick/getScaleAxis.js +38 -0
- package/dist/util/brick/getScaleAxis.js.map +1 -0
- package/dist/util/brick/index.d.ts +13 -0
- package/dist/util/brick/index.d.ts.map +1 -0
- package/dist/util/brick/index.js +29 -0
- package/dist/util/brick/index.js.map +1 -0
- package/dist/util/brick/rotate.d.ts +17 -0
- package/dist/util/brick/rotate.d.ts.map +1 -0
- package/dist/util/brick/rotate.js +38 -0
- package/dist/util/brick/rotate.js.map +1 -0
- package/dist/util/brick/setOwnership.d.ts +12 -0
- package/dist/util/brick/setOwnership.d.ts.map +1 -0
- package/dist/util/brick/setOwnership.js +21 -0
- package/dist/util/brick/setOwnership.js.map +1 -0
- package/dist/util/chat.d.ts +23 -0
- package/dist/util/chat.d.ts.map +1 -0
- package/dist/util/chat.js +50 -0
- package/dist/util/chat.js.map +1 -0
- package/dist/util/color.d.ts +13 -0
- package/dist/util/color.d.ts.map +1 -0
- package/dist/util/color.js +130 -0
- package/dist/util/color.js.map +1 -0
- package/dist/util/file.d.ts +5 -0
- package/dist/util/file.d.ts.map +1 -0
- package/dist/util/file.js +114 -0
- package/dist/util/file.js.map +1 -0
- package/dist/util/index.d.ts +162 -0
- package/dist/util/index.d.ts.map +1 -0
- package/dist/util/index.js +92 -0
- package/dist/util/index.js.map +1 -0
- package/dist/util/map.d.ts +6 -0
- package/dist/util/map.d.ts.map +1 -0
- package/dist/util/map.js +26 -0
- package/dist/util/map.js.map +1 -0
- package/dist/util/pattern.d.ts +1 -0
- package/dist/util/pattern.d.ts.map +1 -0
- package/dist/util/pattern.js +11 -0
- package/dist/util/pattern.js.map +1 -0
- package/dist/util/time.d.ts +4 -0
- package/dist/util/time.d.ts.map +1 -0
- package/dist/util/time.js +41 -0
- package/dist/util/time.js.map +1 -0
- package/dist/util/uuid.d.ts +2 -0
- package/dist/util/uuid.d.ts.map +1 -0
- package/dist/util/uuid.js +8 -0
- package/dist/util/uuid.js.map +1 -0
- package/dist/util/wsl.d.ts +1 -0
- package/dist/util/wsl.d.ts.map +1 -0
- package/dist/util/wsl.js +14 -0
- package/dist/util/wsl.js.map +1 -0
- package/dist/webserver/backend/api.d.ts +3 -0
- package/dist/webserver/backend/api.d.ts.map +1 -0
- package/dist/webserver/backend/api.js +685 -0
- package/dist/webserver/backend/api.js.map +1 -0
- package/dist/webserver/backend/calendar.d.ts +5 -0
- package/dist/webserver/backend/calendar.d.ts.map +1 -0
- package/dist/webserver/backend/calendar.js +21 -0
- package/dist/webserver/backend/calendar.js.map +1 -0
- package/dist/webserver/backend/database.d.ts +149 -0
- package/dist/webserver/backend/database.d.ts.map +1 -0
- package/dist/webserver/backend/database.js +575 -0
- package/dist/webserver/backend/database.js.map +1 -0
- package/dist/webserver/backend/index.d.ts +31 -0
- package/dist/webserver/backend/index.d.ts.map +1 -0
- package/dist/webserver/backend/index.js +189 -0
- package/dist/webserver/backend/index.js.map +1 -0
- package/dist/webserver/backend/metrics.d.ts +3 -0
- package/dist/webserver/backend/metrics.d.ts.map +1 -0
- package/dist/webserver/backend/metrics.js +203 -0
- package/dist/webserver/backend/metrics.js.map +1 -0
- package/dist/webserver/backend/types.d.ts +115 -0
- package/dist/webserver/backend/types.d.ts.map +1 -0
- package/dist/webserver/backend/types.js +3 -0
- package/dist/webserver/backend/types.js.map +1 -0
- package/dist/webserver/backend/util.d.ts +2 -0
- package/dist/webserver/backend/util.d.ts.map +1 -0
- package/dist/webserver/backend/util.js +78 -0
- package/dist/webserver/backend/util.js.map +1 -0
- package/dist/webserver/index.d.ts +2 -0
- package/dist/webserver/index.d.ts.map +1 -0
- package/dist/webserver/index.js +9 -0
- package/dist/webserver/index.js.map +1 -0
- package/{src/webserver/frontend → frontend}/app.html +0 -0
- package/{src/webserver/frontend → frontend}/assets/fonts/GlacialIndifferenceBold.ttf +0 -0
- package/{src/webserver/frontend → frontend}/assets/fonts/GlacialIndifferenceItalic.otf +0 -0
- package/{src/webserver/frontend → frontend}/assets/fonts/GlacialIndifferenceMedium.otf +0 -0
- package/{src/webserver/frontend → frontend}/assets/fonts/GlacialIndifferenceRegular.ttf +0 -0
- package/{src/webserver/frontend → frontend}/assets/fonts/RobotoBold.ttf +0 -0
- package/{src/webserver/frontend → frontend}/assets/fonts/RobotoItalic.ttf +0 -0
- package/{src/webserver/frontend → frontend}/assets/fonts/RobotoRegular.ttf +0 -0
- package/{src/webserver/frontend → frontend}/assets/img/auth_bg.webp +0 -0
- package/{src/webserver/frontend → frontend}/assets/img/dark_bg.webp +0 -0
- package/{src/webserver/frontend → frontend}/assets/img/turkey.webp +0 -0
- package/{src/webserver/frontend → frontend}/auth.html +0 -0
- package/index.js +10 -2
- package/package.json +44 -16
- package/public/app.bundle.js +537 -73
- package/public/app.bundle.js.map +1 -1
- package/public/app.css +727 -2
- package/public/app.css.map +1 -1
- package/public/auth.bundle.js +18 -18
- package/public/auth.bundle.js.map +1 -1
- package/public/auth.css +364 -2
- package/public/auth.css.map +1 -1
- package/templates/rpc/README.md +29 -0
- package/templates/rpc/doc.json +7 -0
- package/templates/rpc/omegga_plugin +0 -0
- package/templates/rpc/plugin.json +4 -0
- package/templates/rpc/setup.sh +3 -0
- package/templates/safe/README.md +29 -0
- package/templates/safe/access.json +1 -0
- package/templates/safe/doc.json +7 -0
- package/templates/safe/omegga.plugin.js +20 -0
- package/templates/safe/plugin.json +4 -0
- package/templates/safe/setup.sh +4 -0
- package/templates/safe-ts/.gitignore.rename +3 -0
- package/templates/safe-ts/README.md +29 -0
- package/templates/safe-ts/access.json +1 -0
- package/templates/safe-ts/doc.json +7 -0
- package/templates/safe-ts/omegga.d.ts +1311 -0
- package/templates/safe-ts/omegga.plugin.ts +29 -0
- package/templates/safe-ts/plugin.json +4 -0
- package/templates/safe-ts/setup.sh +4 -0
- package/templates/safe-ts/tsconfig.json +10 -0
- package/templates/unsafe/README.md +29 -0
- package/templates/unsafe/doc.json +7 -0
- package/templates/unsafe/omegga.main.js +15 -0
- package/templates/unsafe/plugin.json +4 -0
- package/templates/unsafe/setup.sh +4 -0
- package/.babelrc.json +0 -5
- package/.github/workflows/lint.yml +0 -26
- package/.prettierrc +0 -7
- package/.vscode/extensions.json +0 -5
- package/src/OMEGGA_LEGACY_INSTALL +0 -44
- package/src/brickadia/config.js +0 -42
- package/src/brickadia/server.js +0 -227
- package/src/cli/auth.js +0 -104
- package/src/cli/config.js +0 -77
- package/src/cli/index.js +0 -6
- package/src/cli/installer.js +0 -65
- package/src/cli/plugin.js +0 -575
- package/src/cli/terminal.js +0 -466
- package/src/config/authorizer.js +0 -37
- package/src/config/formats/format_js.js +0 -6
- package/src/config/formats/format_yml.js +0 -8
- package/src/config/index.js +0 -81
- package/src/config/reader.js +0 -27
- package/src/config/validator.js +0 -32
- package/src/config/writer.js +0 -20
- package/src/info/default_commands.json +0 -26
- package/src/lib.js +0 -23
- package/src/main.js +0 -332
- package/src/omegga/auth.js +0 -138
- package/src/omegga/commandInjector.js +0 -228
- package/src/omegga/index.js +0 -22
- package/src/omegga/logWrangler.js +0 -323
- package/src/omegga/matchers/auth.js +0 -49
- package/src/omegga/matchers/chat.js +0 -73
- package/src/omegga/matchers/command.js +0 -39
- package/src/omegga/matchers/exit.js +0 -19
- package/src/omegga/matchers/init.js +0 -23
- package/src/omegga/matchers/join.js +0 -115
- package/src/omegga/matchers/leave.js +0 -58
- package/src/omegga/matchers/mapChange.js +0 -37
- package/src/omegga/matchers/version.js +0 -45
- package/src/omegga/player.js +0 -585
- package/src/omegga/plugin/plugin_jsonrpc_stdio.js +0 -526
- package/src/omegga/plugin/plugin_node_safe/proxyOmegga.js +0 -117
- package/src/omegga/plugin/plugin_node_safe/worker.js +0 -238
- package/src/omegga/plugin/plugin_node_safe.js +0 -473
- package/src/omegga/plugin/plugin_node_unsafe.js +0 -177
- package/src/omegga/plugin.js +0 -565
- package/src/omegga/server.js +0 -658
- package/src/omegga/wrapper.js +0 -62
- package/src/softconfig.js +0 -64
- package/src/util/brick/checkBounds.js +0 -22
- package/src/util/brick/constants.js +0 -185
- package/src/util/brick/getBounds.js +0 -36
- package/src/util/brick/getBrickSize.js +0 -9
- package/src/util/brick/getScaleAxis.js +0 -31
- package/src/util/brick/index.js +0 -9
- package/src/util/brick/rotate.js +0 -43
- package/src/util/brick/setOwnership.js +0 -20
- package/src/util/chat.js +0 -28
- package/src/util/color.js +0 -143
- package/src/util/file.js +0 -119
- package/src/util/index.js +0 -28
- package/src/util/map.js +0 -28
- package/src/util/pattern.js +0 -14
- package/src/util/time.js +0 -46
- package/src/util/uuid.js +0 -8
- package/src/util/wsl.js +0 -9
- package/src/webserver/backend/api.js +0 -795
- package/src/webserver/backend/calendar.js +0 -15
- package/src/webserver/backend/database.js +0 -725
- package/src/webserver/backend/index.js +0 -206
- package/src/webserver/backend/metrics.js +0 -148
- package/src/webserver/backend/util.js +0 -75
- package/src/webserver/frontend/.eslintrc.yml +0 -26
- package/src/webserver/frontend/app.js +0 -78
- package/src/webserver/frontend/auth.js +0 -16
- package/src/webserver/frontend/components/Background.vue +0 -83
- package/src/webserver/frontend/components/Button.vue +0 -105
- package/src/webserver/frontend/components/ChatEntry.vue +0 -107
- package/src/webserver/frontend/components/ChatTime.vue +0 -40
- package/src/webserver/frontend/components/Dimmer.vue +0 -43
- package/src/webserver/frontend/components/Dropdown.vue +0 -145
- package/src/webserver/frontend/components/Footer.vue +0 -29
- package/src/webserver/frontend/components/Header.vue +0 -27
- package/src/webserver/frontend/components/InfiniteScroll.vue +0 -51
- package/src/webserver/frontend/components/Input.vue +0 -93
- package/src/webserver/frontend/components/ListInput.vue +0 -105
- package/src/webserver/frontend/components/Loader.vue +0 -98
- package/src/webserver/frontend/components/MainMenuButton.vue +0 -83
- package/src/webserver/frontend/components/Modal.vue +0 -44
- package/src/webserver/frontend/components/NavBar.vue +0 -24
- package/src/webserver/frontend/components/PlayerDropdown.vue +0 -210
- package/src/webserver/frontend/components/PopoutContent.vue +0 -32
- package/src/webserver/frontend/components/RoleDropdown.vue +0 -157
- package/src/webserver/frontend/components/Scroll.vue +0 -33
- package/src/webserver/frontend/components/Toggle.vue +0 -91
- package/src/webserver/frontend/components/index.js +0 -33
- package/src/webserver/frontend/css/font.scss +0 -53
- package/src/webserver/frontend/css/mixins.scss +0 -49
- package/src/webserver/frontend/css/style.scss +0 -166
- package/src/webserver/frontend/css/theme.scss +0 -64
- package/src/webserver/frontend/partials/NavHeader.vue +0 -55
- package/src/webserver/frontend/partials/Page.vue +0 -40
- package/src/webserver/frontend/partials/PageContent.vue +0 -31
- package/src/webserver/frontend/partials/SideNav.vue +0 -115
- package/src/webserver/frontend/partials/index.js +0 -4
- package/src/webserver/frontend/router.js +0 -83
- package/src/webserver/frontend/views/Auth.vue +0 -190
- package/src/webserver/frontend/views/History.vue +0 -462
- package/src/webserver/frontend/views/Home.vue +0 -251
- package/src/webserver/frontend/views/Main.vue +0 -69
- package/src/webserver/frontend/views/NotFound.vue +0 -10
- package/src/webserver/frontend/views/Players.vue +0 -425
- package/src/webserver/frontend/views/PlayersInspector.vue +0 -538
- package/src/webserver/frontend/views/Plugins.vue +0 -217
- package/src/webserver/frontend/views/PluginsInspector.vue +0 -418
- package/src/webserver/frontend/views/Server.vue +0 -167
- package/src/webserver/frontend/views/Users.vue +0 -538
- package/src/webserver/frontend/widgets/Chat.vue +0 -124
- package/src/webserver/frontend/widgets/Status.vue +0 -91
- package/src/webserver/frontend/widgets/index.js +0 -2
- package/src/webserver/frontend/widgets/tooltip.js +0 -108
- package/src/webserver/index.js +0 -4
package/src/cli/terminal.js
DELETED
|
@@ -1,466 +0,0 @@
|
|
|
1
|
-
const readline = require('readline');
|
|
2
|
-
|
|
3
|
-
const {
|
|
4
|
-
chat: { sanitize },
|
|
5
|
-
} = require('../util/index.js');
|
|
6
|
-
|
|
7
|
-
let log, err, warn;
|
|
8
|
-
|
|
9
|
-
// the terminal wraps omegga and displays console output and handles console input
|
|
10
|
-
class Terminal {
|
|
11
|
-
constructor(omegga, options = {}) {
|
|
12
|
-
this.options = options;
|
|
13
|
-
this.omegga = omegga;
|
|
14
|
-
|
|
15
|
-
this.commands = {};
|
|
16
|
-
|
|
17
|
-
// terminal interface
|
|
18
|
-
this.rl = readline.createInterface({
|
|
19
|
-
input: process.stdin,
|
|
20
|
-
output: process.stdout,
|
|
21
|
-
terminal: true,
|
|
22
|
-
});
|
|
23
|
-
this.rl.setPrompt('> '.brightGreen);
|
|
24
|
-
|
|
25
|
-
// shortand fns
|
|
26
|
-
log = (...args) => this.log('>>'.green, ...args);
|
|
27
|
-
err = (...args) => this.error('!>'.red, ...args);
|
|
28
|
-
warn = (...args) => this.warn('W>'.yellow, ...args);
|
|
29
|
-
|
|
30
|
-
// print log line if debug is enabled
|
|
31
|
-
let launcherDone = false;
|
|
32
|
-
let lastDoneMessage = '';
|
|
33
|
-
omegga.on('line', l => {
|
|
34
|
-
if (options.debug) this.log('::'.blue, l);
|
|
35
|
-
else if (!launcherDone) {
|
|
36
|
-
if (l.startsWith('DOWNLOADING')) {
|
|
37
|
-
// TOOD: if someone is proactive enough in the future, you could turn these steps into a legitimate progress bar
|
|
38
|
-
/* Here's some launcher log lines that might be helpful
|
|
39
|
-
Grabbing manifest and checking game files...
|
|
40
|
-
DOWNLOADING MANIFEST | Hold on...
|
|
41
|
-
DOWNLOADING MANIFEST (100%) | Hold on...
|
|
42
|
-
DOWNLOADING MANIFEST (100%) | 0 B/s - 13 KiB / 13 KiB (Unknown time remaining...)
|
|
43
|
-
DOWNLOADING MANIFEST (100%) | Done!
|
|
44
|
-
Checking launcher and downloading version info...
|
|
45
|
-
Installing patches and booting...
|
|
46
|
-
DOWNLOADING BRICKADIA (0%) | Done!
|
|
47
|
-
DOWNLOADING BRICKADIA (100%) | 110 MiB/s - 584 MiB / 584 MiB (1 second remaining...)
|
|
48
|
-
DOWNLOADING BRICKADIA (100%) | Nearly done...
|
|
49
|
-
DOWNLOADING BRICKADIA (100%), INSTALLING BRICKADIA (86%) | Nearly done...
|
|
50
|
-
*/
|
|
51
|
-
process.stdout.clearLine();
|
|
52
|
-
process.stdout.cursorTo(0);
|
|
53
|
-
process.stdout.write(l);
|
|
54
|
-
// add a newline on "Done!" but prevent newlines on repeat done messages
|
|
55
|
-
if (l.match(/Done!/) && l !== lastDoneMessage) {
|
|
56
|
-
lastDoneMessage = l;
|
|
57
|
-
process.stdout.write('\n');
|
|
58
|
-
}
|
|
59
|
-
} else if (l.match(/Disabling core dumps./)) {
|
|
60
|
-
launcherDone = true;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
// print debug events regardless of debug status
|
|
66
|
-
omegga.on('debug', l => this.log('?>'.magenta, l));
|
|
67
|
-
|
|
68
|
-
// print chat events as players join/leave the server
|
|
69
|
-
omegga.on('join', p => this.log(`${p.name.underline} joined.`.brightBlue));
|
|
70
|
-
omegga.on('leave', p => this.log(`${p.name.underline} left.`.brightBlue));
|
|
71
|
-
omegga.on('chat', (name, message) =>
|
|
72
|
-
this.log(`${name.brightYellow.underline}: ${message}`)
|
|
73
|
-
);
|
|
74
|
-
omegga.on('start', () => {
|
|
75
|
-
const wsl = require('../util/wsl');
|
|
76
|
-
log(
|
|
77
|
-
`Server has started${
|
|
78
|
-
wsl === 1 ? ' in single thread mode due to WSL1' : ''
|
|
79
|
-
}. Type ${'/help'.yellow} for more commands`
|
|
80
|
-
);
|
|
81
|
-
|
|
82
|
-
// check if this is WSL2 and wsl2binds is installed
|
|
83
|
-
if (
|
|
84
|
-
wsl === 2 &&
|
|
85
|
-
this.omegga.pluginLoader &&
|
|
86
|
-
!this.omegga.pluginLoader.plugins.some(p => p.getName() === 'wsl2binds')
|
|
87
|
-
) {
|
|
88
|
-
warn(
|
|
89
|
-
'####'.yellow,
|
|
90
|
-
`You are running ${'WSL2'.yellow} and you don't have the ${
|
|
91
|
-
'wsl2binds'.yellow
|
|
92
|
-
} plugin.`
|
|
93
|
-
);
|
|
94
|
-
warn(
|
|
95
|
-
'####'.yellow,
|
|
96
|
-
`The wsl2binds plugin works as a ${
|
|
97
|
-
'UDP proxy'.underline
|
|
98
|
-
} between Windows and the WSL2 VM.`
|
|
99
|
-
);
|
|
100
|
-
warn('####'.yellow, 'Install it by:');
|
|
101
|
-
warn('####'.yellow, ' 1. Closing omegga with', '/stop'.green);
|
|
102
|
-
warn(
|
|
103
|
-
'####'.yellow,
|
|
104
|
-
' 2. Installing wsl2binds with',
|
|
105
|
-
'omegga install gh:Meshiest/wsl2binds'.green
|
|
106
|
-
);
|
|
107
|
-
warn('####'.yellow, ' 3. Restarting', 'omegga'.green);
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
omegga.on('mapchange', ({ map }) =>
|
|
111
|
-
log('Map changed to', (map.charAt(0).toUpperCase() + map.slice(1)).green)
|
|
112
|
-
);
|
|
113
|
-
omegga.on('unauthorized', () => {
|
|
114
|
-
err('Server failed authentication check');
|
|
115
|
-
process.exit();
|
|
116
|
-
});
|
|
117
|
-
omegga.on('error', e => err('Server caught unhandled exception:\n' + e));
|
|
118
|
-
omegga.on('server:stopped', () =>
|
|
119
|
-
log('Server has closed. Type', '/stop'.yellow, 'to close omegga')
|
|
120
|
-
);
|
|
121
|
-
|
|
122
|
-
this.rl.on('line', this.handleLine.bind(this));
|
|
123
|
-
|
|
124
|
-
// console commands
|
|
125
|
-
Object.entries({
|
|
126
|
-
debug: {
|
|
127
|
-
desc: 'toggle visibility of brickadia console logs',
|
|
128
|
-
fn() {
|
|
129
|
-
options.debug = !options.debug;
|
|
130
|
-
log(
|
|
131
|
-
'Brickadia logs now',
|
|
132
|
-
options.debug ? 'visible'.green : 'hidden'.red
|
|
133
|
-
);
|
|
134
|
-
},
|
|
135
|
-
},
|
|
136
|
-
|
|
137
|
-
help: {
|
|
138
|
-
desc: 'list supported commands and their descriptions',
|
|
139
|
-
fn() {
|
|
140
|
-
const maxCmdLen = Math.max(
|
|
141
|
-
...Object.keys(this.commands).map(s => s.length)
|
|
142
|
-
);
|
|
143
|
-
log('Omegga Help Text:\n');
|
|
144
|
-
this.log(
|
|
145
|
-
' Console input not starting with / will be sent in chat from a "SERVER" user'
|
|
146
|
-
);
|
|
147
|
-
this.log(
|
|
148
|
-
' Console input starting with / will be treated as one of the following commands\n'
|
|
149
|
-
);
|
|
150
|
-
this.log(
|
|
151
|
-
'-- Available Omegga commands (type',
|
|
152
|
-
'/command'.yellow.underline,
|
|
153
|
-
'to run)'
|
|
154
|
-
);
|
|
155
|
-
Object.keys(this.commands)
|
|
156
|
-
.sort()
|
|
157
|
-
.forEach(k => {
|
|
158
|
-
this.log(
|
|
159
|
-
' ',
|
|
160
|
-
k.yellow.underline,
|
|
161
|
-
'-'.padStart(maxCmdLen - k.length + 1),
|
|
162
|
-
this.commands[k].desc
|
|
163
|
-
);
|
|
164
|
-
});
|
|
165
|
-
this.log('');
|
|
166
|
-
},
|
|
167
|
-
},
|
|
168
|
-
|
|
169
|
-
cmd: {
|
|
170
|
-
desc: 'run a console command on the brickadia server. requires debug for log to show',
|
|
171
|
-
fn(...args) {
|
|
172
|
-
if (!this.omegga.started) {
|
|
173
|
-
err('Omegga is not running');
|
|
174
|
-
return;
|
|
175
|
-
}
|
|
176
|
-
this.omegga.writeln(args.join(' '));
|
|
177
|
-
},
|
|
178
|
-
},
|
|
179
|
-
|
|
180
|
-
ban: {
|
|
181
|
-
desc: 'ban a player',
|
|
182
|
-
fn(...args) {
|
|
183
|
-
if (!this.omegga.started) {
|
|
184
|
-
err('Omegga is not running');
|
|
185
|
-
return;
|
|
186
|
-
}
|
|
187
|
-
if (!args.length) {
|
|
188
|
-
return err(
|
|
189
|
-
'usage:',
|
|
190
|
-
'/ban <name|id> [duration in mins] [reason]'.yellow
|
|
191
|
-
);
|
|
192
|
-
}
|
|
193
|
-
this.omegga.writeln('Chat.Command /ban ' + args.join(' '));
|
|
194
|
-
},
|
|
195
|
-
},
|
|
196
|
-
unban: {
|
|
197
|
-
desc: 'unban a player',
|
|
198
|
-
fn(...args) {
|
|
199
|
-
if (!this.omegga.started) {
|
|
200
|
-
err('Omegga is not running');
|
|
201
|
-
return;
|
|
202
|
-
}
|
|
203
|
-
if (!args.length) {
|
|
204
|
-
return err('usage:', '/unban <name|id>'.yellow);
|
|
205
|
-
}
|
|
206
|
-
this.omegga.writeln('Chat.Command /unban ' + args.join(' '));
|
|
207
|
-
},
|
|
208
|
-
},
|
|
209
|
-
kick: {
|
|
210
|
-
desc: 'kick a player',
|
|
211
|
-
fn(...args) {
|
|
212
|
-
if (!this.omegga.started) {
|
|
213
|
-
err('Omegga is not running');
|
|
214
|
-
return;
|
|
215
|
-
}
|
|
216
|
-
if (!args.length) {
|
|
217
|
-
return err('usage:', '/kick <name|id> [reason]'.yellow);
|
|
218
|
-
}
|
|
219
|
-
this.omegga.writeln('Chat.Command /kick ' + args.join(' '));
|
|
220
|
-
},
|
|
221
|
-
},
|
|
222
|
-
grantrole: {
|
|
223
|
-
desc: 'grant a role to a player',
|
|
224
|
-
fn(...args) {
|
|
225
|
-
if (!this.omegga.started) {
|
|
226
|
-
err('Omegga is not running');
|
|
227
|
-
return;
|
|
228
|
-
}
|
|
229
|
-
if (!args.length) {
|
|
230
|
-
return err('usage:', '/grantrole <role name> <name|id>'.yellow);
|
|
231
|
-
}
|
|
232
|
-
this.omegga.writeln('Chat.Command /grantrole ' + args.join(' '));
|
|
233
|
-
},
|
|
234
|
-
},
|
|
235
|
-
revokerole: {
|
|
236
|
-
desc: 'revoke a role from a player',
|
|
237
|
-
fn(...args) {
|
|
238
|
-
if (!this.omegga.started) {
|
|
239
|
-
err('Omegga is not running');
|
|
240
|
-
return;
|
|
241
|
-
}
|
|
242
|
-
if (!args.length) {
|
|
243
|
-
return err('usage:', '/revokerole <role name> <name|id>'.yellow);
|
|
244
|
-
}
|
|
245
|
-
this.omegga.writeln('Chat.Command /revokerole ' + args.join(' '));
|
|
246
|
-
},
|
|
247
|
-
},
|
|
248
|
-
clearbricks: {
|
|
249
|
-
desc: "clear a player's bricks",
|
|
250
|
-
fn(...args) {
|
|
251
|
-
if (!this.omegga.started) {
|
|
252
|
-
err('Omegga is not running');
|
|
253
|
-
return;
|
|
254
|
-
}
|
|
255
|
-
if (!args.length) {
|
|
256
|
-
return err('usage:', '/clearbricks <name>'.yellow);
|
|
257
|
-
}
|
|
258
|
-
this.omegga.writeln(`Bricks.Clear "${args.join(' ')}"`);
|
|
259
|
-
},
|
|
260
|
-
},
|
|
261
|
-
clearallbricks: {
|
|
262
|
-
desc: 'clear all bricks',
|
|
263
|
-
fn() {
|
|
264
|
-
if (!this.omegga.started) {
|
|
265
|
-
err('Omegga is not running');
|
|
266
|
-
return;
|
|
267
|
-
}
|
|
268
|
-
this.omegga.writeln('Bricks.ClearAll');
|
|
269
|
-
},
|
|
270
|
-
},
|
|
271
|
-
|
|
272
|
-
status: {
|
|
273
|
-
desc: 'display server status information. brick count, online players, etc',
|
|
274
|
-
async fn() {
|
|
275
|
-
if (!this.omegga.started) {
|
|
276
|
-
err('Omegga is not running');
|
|
277
|
-
return;
|
|
278
|
-
}
|
|
279
|
-
const msToTime = ms => new Date(ms).toISOString().substr(11, 8);
|
|
280
|
-
try {
|
|
281
|
-
const status = await this.omegga.getServerStatus();
|
|
282
|
-
|
|
283
|
-
log('Server Status');
|
|
284
|
-
this.log(`
|
|
285
|
-
${status.serverName.yellow}
|
|
286
|
-
Bricks: ${(status.bricks + '').yellow}
|
|
287
|
-
Components: ${(status.components + '').yellow}
|
|
288
|
-
Uptime: ${msToTime(status.time).yellow}
|
|
289
|
-
Players: ${status.players.length === 0 ? 'none'.grey : ''}
|
|
290
|
-
${status.players
|
|
291
|
-
.map(p => `[${msToTime(p.time).grey}] ${p.name.brightYellow}`)
|
|
292
|
-
.join('\n ')}
|
|
293
|
-
`);
|
|
294
|
-
} catch (e) {
|
|
295
|
-
err('An error occurred while getting server status');
|
|
296
|
-
}
|
|
297
|
-
},
|
|
298
|
-
},
|
|
299
|
-
|
|
300
|
-
stop: {
|
|
301
|
-
desc: 'stop the server and close Omegga',
|
|
302
|
-
async fn() {
|
|
303
|
-
log('Stopping server...');
|
|
304
|
-
await this.omegga.stop();
|
|
305
|
-
process.exit();
|
|
306
|
-
},
|
|
307
|
-
},
|
|
308
|
-
|
|
309
|
-
kill: {
|
|
310
|
-
desc: 'forcefully kill brickadia server process without closing omegga',
|
|
311
|
-
async fn() {
|
|
312
|
-
log('Stopping server...');
|
|
313
|
-
await this.omegga.stop();
|
|
314
|
-
},
|
|
315
|
-
},
|
|
316
|
-
|
|
317
|
-
save: {
|
|
318
|
-
desc: 'Save bricks to a specified file',
|
|
319
|
-
async fn(...args) {
|
|
320
|
-
const name = args.join(' ');
|
|
321
|
-
if (!name.length) return err('usage:', '/save <name>'.yellow);
|
|
322
|
-
log('Saving bricks');
|
|
323
|
-
this.omegga.saveBricks(name);
|
|
324
|
-
},
|
|
325
|
-
},
|
|
326
|
-
|
|
327
|
-
load: {
|
|
328
|
-
desc: 'Load bricks from a specified file',
|
|
329
|
-
async fn(...args) {
|
|
330
|
-
const name = args.join(' ');
|
|
331
|
-
if (!name.length) return err('usage:', '/load <name>'.yellow);
|
|
332
|
-
log('Loading bricks');
|
|
333
|
-
this.omegga.loadBricks(name);
|
|
334
|
-
},
|
|
335
|
-
},
|
|
336
|
-
|
|
337
|
-
start: {
|
|
338
|
-
desc: 'start the server if it is stopped',
|
|
339
|
-
fn() {
|
|
340
|
-
if (
|
|
341
|
-
!this.omegga ||
|
|
342
|
-
(this.omegga && (this.omegga.starting || this.omegga.started))
|
|
343
|
-
) {
|
|
344
|
-
err('Omegga is already running');
|
|
345
|
-
return;
|
|
346
|
-
}
|
|
347
|
-
log('Starting server...');
|
|
348
|
-
this.omegga.start();
|
|
349
|
-
},
|
|
350
|
-
},
|
|
351
|
-
|
|
352
|
-
reload: {
|
|
353
|
-
desc: 'reload available plugins',
|
|
354
|
-
async fn() {
|
|
355
|
-
if (!this.omegga.pluginLoader) {
|
|
356
|
-
err('Omegga is not using plugins');
|
|
357
|
-
return;
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
log('Unloading current plugins');
|
|
361
|
-
let success = await this.omegga.pluginLoader.unload();
|
|
362
|
-
if (!success) {
|
|
363
|
-
err('Could not unload all plugins');
|
|
364
|
-
return;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
log('Scanning for new plugins');
|
|
368
|
-
success = await this.omegga.pluginLoader.scan();
|
|
369
|
-
if (!success) {
|
|
370
|
-
err('Could not scan for plugins');
|
|
371
|
-
return;
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
log('Starting plugins');
|
|
375
|
-
success = await this.omegga.pluginLoader.reload();
|
|
376
|
-
if (success) {
|
|
377
|
-
const plugins = this.omegga.pluginLoader.plugins
|
|
378
|
-
.filter(p => p.isLoaded())
|
|
379
|
-
.map(p => p.getName());
|
|
380
|
-
log('Loaded', (plugins.length + '').yellow, 'plugins:', plugins);
|
|
381
|
-
} else {
|
|
382
|
-
err('Could not load all plugins');
|
|
383
|
-
}
|
|
384
|
-
},
|
|
385
|
-
},
|
|
386
|
-
}).forEach(([cmd, { desc, fn }]) => this.addCommand(cmd, desc, fn));
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
// add a command
|
|
390
|
-
addCommand(name, desc, fn) {
|
|
391
|
-
this.commands[name] = { name, desc, fn: fn.bind(this) };
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
async handleLine(line) {
|
|
395
|
-
if (line.startsWith('/')) {
|
|
396
|
-
const [cmd, ...args] = line.slice(1).split(' ');
|
|
397
|
-
if (!this.commands[cmd]) {
|
|
398
|
-
err(
|
|
399
|
-
`unrecognized command /${cmd.underline}. Type /help for more info`.red
|
|
400
|
-
);
|
|
401
|
-
} else {
|
|
402
|
-
try {
|
|
403
|
-
const res = this.commands[cmd].fn(...args);
|
|
404
|
-
if (res instanceof Promise) {
|
|
405
|
-
await res;
|
|
406
|
-
}
|
|
407
|
-
} catch (e) {
|
|
408
|
-
err('unhandled terminal error', e);
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
} else if (line.trim().length > 0) {
|
|
412
|
-
if (this.omegga.started) {
|
|
413
|
-
// broadcast when the chat does not start with a command
|
|
414
|
-
this.omegga.broadcast(
|
|
415
|
-
`"[<b><color=\\"ff00ff\\">SERVER</></>]: ${sanitize(line)}"`
|
|
416
|
-
);
|
|
417
|
-
process.stdout.clearLine();
|
|
418
|
-
this.log(`[${'SERVER'.brightMagenta.underline}]: ${line}`);
|
|
419
|
-
|
|
420
|
-
// if omegga is running a webserver - send this message in the chat log
|
|
421
|
-
if (this.omegga.webserver) {
|
|
422
|
-
const user = { name: 'SERVER', id: '', web: true, color: 'ff00ff' };
|
|
423
|
-
// create database entry, send to web ui
|
|
424
|
-
this.omegga.webserver.io
|
|
425
|
-
.to('chat')
|
|
426
|
-
.emit(
|
|
427
|
-
'chat',
|
|
428
|
-
await this.omegga.webserver.database.addChatLog('msg', user, line)
|
|
429
|
-
);
|
|
430
|
-
}
|
|
431
|
-
} else {
|
|
432
|
-
err(
|
|
433
|
-
'Server is not started yet. type'.red,
|
|
434
|
-
'/help'.yellow,
|
|
435
|
-
'for more info'.red
|
|
436
|
-
);
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
// let readline render a log without interrupting user input
|
|
442
|
-
log(...args) {
|
|
443
|
-
process.stdout.clearLine();
|
|
444
|
-
process.stdout.cursorTo(0);
|
|
445
|
-
console.log(...args);
|
|
446
|
-
this.rl.prompt(true);
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
// let readline render a warning log without interrupting user input
|
|
450
|
-
warn(...args) {
|
|
451
|
-
process.stdout.clearLine();
|
|
452
|
-
process.stdout.cursorTo(0);
|
|
453
|
-
console.warn(...args);
|
|
454
|
-
this.rl.prompt(true);
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
// let readline render an error log without interrupting user input
|
|
458
|
-
error(...args) {
|
|
459
|
-
process.stdout.clearLine();
|
|
460
|
-
process.stdout.cursorTo(0);
|
|
461
|
-
console.error(...args);
|
|
462
|
-
this.rl.prompt(true);
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
module.exports = Terminal;
|
package/src/config/authorizer.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Determine if email+password combo is valid
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
const BrickadiaServer = require('../brickadia/server.js');
|
|
6
|
-
const config = require('../softconfig.js');
|
|
7
|
-
const { store } = require('../config/index.js');
|
|
8
|
-
|
|
9
|
-
const invalidRegExp =
|
|
10
|
-
/^(Error: AuthState is Invalid on dedicated server - exiting\.|Changing AuthState from \w+ to Invalid\.)$/;
|
|
11
|
-
const validRegExp = /^Changing AuthState from \w+ to ValidOnline\.$/;
|
|
12
|
-
|
|
13
|
-
module.exports = (email, password) =>
|
|
14
|
-
new Promise(resolve => {
|
|
15
|
-
// create a server with these credentials
|
|
16
|
-
const server = new BrickadiaServer(config.DATA_PATH, {
|
|
17
|
-
credentials: { email, password },
|
|
18
|
-
server: {
|
|
19
|
-
port: 7775,
|
|
20
|
-
__LEGACY: store.get('legacyBin'),
|
|
21
|
-
},
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
// wait for the invalid auth line or valid auth line, then kill the server
|
|
25
|
-
server.on('line', line => {
|
|
26
|
-
if (line.match(invalidRegExp)) {
|
|
27
|
-
server.stop();
|
|
28
|
-
resolve(false);
|
|
29
|
-
} else if (line.match(validRegExp)) {
|
|
30
|
-
server.stop();
|
|
31
|
-
resolve(true);
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
// start the server
|
|
36
|
-
server.start();
|
|
37
|
-
});
|
package/src/config/index.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
|
|
4
|
-
const soft = require('../softconfig.js');
|
|
5
|
-
|
|
6
|
-
const Configstore = require('configstore');
|
|
7
|
-
|
|
8
|
-
const store = new Configstore(
|
|
9
|
-
soft.PROJECT_NAME,
|
|
10
|
-
{
|
|
11
|
-
defaultOmegga: '.',
|
|
12
|
-
legacyBin: '',
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
globalConfigPath: true,
|
|
16
|
-
}
|
|
17
|
-
);
|
|
18
|
-
|
|
19
|
-
// find all format_EXT.js files in the formats path
|
|
20
|
-
const formats = fs
|
|
21
|
-
.readdirSync(path.join(__dirname, 'formats'))
|
|
22
|
-
// all formats match the format_EXT.js pattern
|
|
23
|
-
.filter(file => file.match(/format_[a-z]+\.js/))
|
|
24
|
-
// require all the formats
|
|
25
|
-
.map(file => require('./formats/' + file))
|
|
26
|
-
// format has a valid extension, reader, and writer
|
|
27
|
-
.filter(
|
|
28
|
-
format =>
|
|
29
|
-
format.extension &&
|
|
30
|
-
format.extension.match(/^[a-z]+$/) &&
|
|
31
|
-
format.encoding &&
|
|
32
|
-
format.encoding.match(/^(string|buffer)$/) &&
|
|
33
|
-
format.reader &&
|
|
34
|
-
typeof format.reader === 'function' &&
|
|
35
|
-
format.writer &&
|
|
36
|
-
typeof format.writer === 'function'
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
// create read/write funcs for the provided formats
|
|
40
|
-
module.exports = {
|
|
41
|
-
defaultConfig: {
|
|
42
|
-
omegga: {
|
|
43
|
-
webui: true,
|
|
44
|
-
port: process.env.OMEGGA_PORT
|
|
45
|
-
? Number(process.env.OMEGGA_PORT)
|
|
46
|
-
: soft.DEFAULT_PORT,
|
|
47
|
-
https: true,
|
|
48
|
-
},
|
|
49
|
-
server: {
|
|
50
|
-
port: process.env.BRICKADIA_PORT
|
|
51
|
-
? Number(process.env.BRICKADIA_PORT)
|
|
52
|
-
: 7777,
|
|
53
|
-
map: 'Plate',
|
|
54
|
-
branch: 'main-server',
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
// config store
|
|
59
|
-
store,
|
|
60
|
-
|
|
61
|
-
// Writes save data to a file
|
|
62
|
-
// function(path, blob) -> void
|
|
63
|
-
write: require('./writer.js')(formats),
|
|
64
|
-
|
|
65
|
-
// reads save data from a file
|
|
66
|
-
// function(path) -> config
|
|
67
|
-
read: require('./reader.js')(formats),
|
|
68
|
-
|
|
69
|
-
// open config at a specified path
|
|
70
|
-
find(dir = '.') {
|
|
71
|
-
// find the first config file matching these config file names
|
|
72
|
-
for (const f of soft.CONFIG_FILENAMES) {
|
|
73
|
-
for (const { extension } of formats) {
|
|
74
|
-
const file = path.join(dir, f + '.' + extension);
|
|
75
|
-
if (fs.existsSync(file)) return file;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
return undefined;
|
|
80
|
-
},
|
|
81
|
-
};
|
package/src/config/reader.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const validate = require('./validator.js');
|
|
3
|
-
|
|
4
|
-
// given a list of formats, generate a function to write to any of those formats
|
|
5
|
-
module.exports = formats => path => {
|
|
6
|
-
// find the config format that matches this extension
|
|
7
|
-
const ext = path.split('.').pop().toLowerCase();
|
|
8
|
-
const format = formats.find(f => f.extension === ext);
|
|
9
|
-
if (!format) throw 'missing format';
|
|
10
|
-
|
|
11
|
-
if (!fs.existsSync(path)) throw 'missing file';
|
|
12
|
-
|
|
13
|
-
// read the config file
|
|
14
|
-
const data = fs.readFileSync(path);
|
|
15
|
-
|
|
16
|
-
// parse the config file
|
|
17
|
-
const blob = format.reader(
|
|
18
|
-
format.encoding === 'string' ? data.toString() : data
|
|
19
|
-
);
|
|
20
|
-
|
|
21
|
-
// validate the config blob
|
|
22
|
-
const result = validate(blob);
|
|
23
|
-
if (!result.valid) throw result.errors;
|
|
24
|
-
|
|
25
|
-
// return the parsed config
|
|
26
|
-
return blob;
|
|
27
|
-
};
|
package/src/config/validator.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
const allowedKeys = ['omegga', 'credentials', 'server'];
|
|
2
|
-
|
|
3
|
-
// low effort js object validation
|
|
4
|
-
module.exports = obj => {
|
|
5
|
-
if (typeof obj !== 'object')
|
|
6
|
-
return { valid: false, errors: ['not an object'] };
|
|
7
|
-
|
|
8
|
-
if (Object.keys(obj).some(k => !allowedKeys.includes(k)))
|
|
9
|
-
return { valid: false, errors: ['contains invalid keys'] };
|
|
10
|
-
|
|
11
|
-
if (!obj.server || typeof obj.server !== 'object')
|
|
12
|
-
return { valid: false, errors: ['missing/invalid server category'] };
|
|
13
|
-
|
|
14
|
-
if (typeof obj.server.port !== 'number')
|
|
15
|
-
return { valid: false, errors: ['server.port must be a number'] };
|
|
16
|
-
|
|
17
|
-
if (obj.server.branch && typeof obj.server.branch !== 'string')
|
|
18
|
-
return { valid: false, errors: ['server.branch must be a string'] };
|
|
19
|
-
|
|
20
|
-
if (obj.omegga) {
|
|
21
|
-
if (typeof obj.omegga !== 'object')
|
|
22
|
-
return { valid: false, errors: ['invalid omegga category'] };
|
|
23
|
-
|
|
24
|
-
if (
|
|
25
|
-
typeof obj.omegga.port !== 'undefined' &&
|
|
26
|
-
typeof obj.omegga.port !== 'number'
|
|
27
|
-
)
|
|
28
|
-
return { valid: false, errors: ['omegga.port must be a nubmer'] };
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return { valid: true, errors: [] };
|
|
32
|
-
};
|
package/src/config/writer.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const validate = require('./validator.js');
|
|
3
|
-
|
|
4
|
-
// given a list of formats, generate a function for write to any of those formats
|
|
5
|
-
module.exports = formats => (path, blob) => {
|
|
6
|
-
// find the config format that matches this extension
|
|
7
|
-
const ext = path.split('.').pop().toLowerCase();
|
|
8
|
-
const format = formats.find(f => f.extension === ext);
|
|
9
|
-
if (!format) throw 'missing format';
|
|
10
|
-
|
|
11
|
-
// validate the config blob
|
|
12
|
-
const result = validate(blob);
|
|
13
|
-
if (!result.valid) throw result.errors;
|
|
14
|
-
|
|
15
|
-
// encode the config data into the format
|
|
16
|
-
const data = format.writer(blob);
|
|
17
|
-
|
|
18
|
-
// write the encoded config to file
|
|
19
|
-
fs.writeFileSync(path, data);
|
|
20
|
-
};
|