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
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
"help",
|
|
3
|
-
"tp",
|
|
4
|
-
"load",
|
|
5
|
-
"clearallbricks",
|
|
6
|
-
"clearbricks",
|
|
7
|
-
"brickcount",
|
|
8
|
-
"playercount",
|
|
9
|
-
"changemap",
|
|
10
|
-
"listplayers",
|
|
11
|
-
"listroles",
|
|
12
|
-
"listteams",
|
|
13
|
-
"grantrole",
|
|
14
|
-
"revokerole",
|
|
15
|
-
"kick",
|
|
16
|
-
"ban",
|
|
17
|
-
"unban",
|
|
18
|
-
"jointeam",
|
|
19
|
-
"leaveteam",
|
|
20
|
-
"clearcheckpoint",
|
|
21
|
-
"spectator",
|
|
22
|
-
"ghost",
|
|
23
|
-
"ping",
|
|
24
|
-
"gettransform",
|
|
25
|
-
"back"
|
|
26
|
-
]
|
package/src/lib.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Library module, includes all available resources
|
|
3
|
-
*/
|
|
4
|
-
module.exports = {
|
|
5
|
-
brickadia: {
|
|
6
|
-
// BrickadiaServer - manages the server child process
|
|
7
|
-
Server: require('./brickadia/server.js'),
|
|
8
|
-
|
|
9
|
-
// config writer for brickadia
|
|
10
|
-
config: require('./brickadia/config.js'),
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
// brickadia server wrapper, log parser, and plugin runner
|
|
14
|
-
omegga: require('./omegga/index.js'),
|
|
15
|
-
// the actual object can be required too
|
|
16
|
-
Omegga: require('./omegga/server.js'),
|
|
17
|
-
|
|
18
|
-
// utility functions
|
|
19
|
-
util: require('./util/index.js'),
|
|
20
|
-
|
|
21
|
-
// config
|
|
22
|
-
config: require('./config/index.js'),
|
|
23
|
-
};
|
package/src/main.js
DELETED
|
@@ -1,332 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
require('colors');
|
|
4
|
-
|
|
5
|
-
const pkg = require('../package');
|
|
6
|
-
const soft = require('./softconfig.js');
|
|
7
|
-
const Omegga = require('./omegga/server.js');
|
|
8
|
-
const config = require('./config/index.js');
|
|
9
|
-
const {
|
|
10
|
-
Terminal,
|
|
11
|
-
auth,
|
|
12
|
-
config: omeggaConfig,
|
|
13
|
-
pluginUtil,
|
|
14
|
-
} = require('./cli/index.js');
|
|
15
|
-
const file = require('./util/file.js');
|
|
16
|
-
|
|
17
|
-
const updateNotifier = require('update-notifier');
|
|
18
|
-
const notifier = updateNotifier({
|
|
19
|
-
isGlobal: true,
|
|
20
|
-
pkg: pkg,
|
|
21
|
-
updateCheckInterval: 1000 * 60 * 60 * 24,
|
|
22
|
-
}).notify();
|
|
23
|
-
|
|
24
|
-
/*
|
|
25
|
-
// TODO: let omegga bundle config (roles, bans, server config) to zip
|
|
26
|
-
// TODO: let omegga unbundle config from zip to current omegga dir
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
const err = (...args) => console.error('!>'.red, ...args);
|
|
30
|
-
const log = (...args) => console.log('>>'.green, ...args);
|
|
31
|
-
const verboseLog = (...args) => {
|
|
32
|
-
if (!global.VERBOSE) return;
|
|
33
|
-
if (Omegga.log) Omegga.log('V>'.magenta, ...args);
|
|
34
|
-
else console.log('V>'.magenta, ...args);
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
// write a default config file
|
|
38
|
-
const createDefaultConfig = () => {
|
|
39
|
-
log('Created default config file');
|
|
40
|
-
config.write(soft.CONFIG_FILENAMES[0] + '.yml', config.defaultConfig);
|
|
41
|
-
file.mkdir('data/Saved/Builds');
|
|
42
|
-
file.mkdir('plugins');
|
|
43
|
-
return config.defaultConfig;
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
const program = require('commander')
|
|
47
|
-
.description(pkg.description)
|
|
48
|
-
.version(pkg.version)
|
|
49
|
-
.option(
|
|
50
|
-
'-d, --debug',
|
|
51
|
-
'Print all console logs rather than just chat messages'
|
|
52
|
-
)
|
|
53
|
-
.option('-v, --verbose', 'Print extra messages for debugging purposes')
|
|
54
|
-
.action(async () => {
|
|
55
|
-
const { debug, verbose } = program.opts();
|
|
56
|
-
global.VERBOSE = verbose;
|
|
57
|
-
|
|
58
|
-
// default working directory is the one specified in config
|
|
59
|
-
let workDir = config.store.get('defaultOmegga');
|
|
60
|
-
verboseLog('Using working directory', workDir.yellow);
|
|
61
|
-
|
|
62
|
-
// check if a local install exists
|
|
63
|
-
const localInstall = fs.existsSync(soft.LOCAL_LAUNCHER);
|
|
64
|
-
|
|
65
|
-
// if there's a config in the current directory, use that one instead
|
|
66
|
-
if (config.find('.')) workDir = '.';
|
|
67
|
-
|
|
68
|
-
// check if configured path exists
|
|
69
|
-
if (!fs.existsSync(workDir)) {
|
|
70
|
-
err('configured omegga default path does not exist');
|
|
71
|
-
process.exit(1);
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
if (!fs.statSync(workDir).isDirectory) {
|
|
75
|
-
err('configured omegga default path is not a directory');
|
|
76
|
-
process.exit(1);
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// find the config for the working directory
|
|
81
|
-
const configFile = config.find(workDir);
|
|
82
|
-
let conf;
|
|
83
|
-
|
|
84
|
-
// create a default config file if it does not already exist, otherwise load in the existing one
|
|
85
|
-
if (!configFile) {
|
|
86
|
-
verboseLog('Creating a new config');
|
|
87
|
-
conf = createDefaultConfig();
|
|
88
|
-
} else {
|
|
89
|
-
verboseLog('Reading config file from', configFile.yellow);
|
|
90
|
-
conf = config.read(configFile);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
// if local install is provided
|
|
94
|
-
if (localInstall) {
|
|
95
|
-
verboseLog("Using omegga's brickadia-launcher");
|
|
96
|
-
conf.server.__LOCAL = true;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// check if the auth files don't exist
|
|
100
|
-
if (
|
|
101
|
-
!auth.exists(path.join(workDir, soft.DATA_PATH, 'Saved/Auth')) &&
|
|
102
|
-
!auth.exists()
|
|
103
|
-
) {
|
|
104
|
-
const success = await auth.prompt({
|
|
105
|
-
debug,
|
|
106
|
-
email: process.env.BRICKADIA_USER ?? null,
|
|
107
|
-
password: process.env.BRICKADIA_PASS ?? null,
|
|
108
|
-
branch: conf?.server?.branch ?? null,
|
|
109
|
-
});
|
|
110
|
-
if (!success) {
|
|
111
|
-
err('Start aborted - could not generate auth tokens');
|
|
112
|
-
process.exit(1);
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
// build options
|
|
118
|
-
const options = {
|
|
119
|
-
// default enable web ui (set to false)
|
|
120
|
-
noweb: typeof conf.omegga.webui === 'boolean' && !conf.omegga.webui,
|
|
121
|
-
// default enable https (set to true, will not be https if it can't generate)
|
|
122
|
-
https: typeof conf.omegga.https !== 'boolean' || conf.omegga.https,
|
|
123
|
-
port: conf.omegga.port || soft.DEFAULT_PORT,
|
|
124
|
-
debug,
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
verboseLog('Launching with options', options);
|
|
128
|
-
|
|
129
|
-
// setup the server
|
|
130
|
-
const server = new Omegga(workDir, conf, options);
|
|
131
|
-
verboseLog('Created omegga object');
|
|
132
|
-
|
|
133
|
-
if (verbose) {
|
|
134
|
-
server.on('*', ev => ev !== 'line' && verboseLog('EVENT'.green, ev));
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
// create a terminal
|
|
138
|
-
Omegga.setTerminal(new Terminal(server, options));
|
|
139
|
-
|
|
140
|
-
if (notifier.update) {
|
|
141
|
-
Omegga.log(
|
|
142
|
-
'>>'.green,
|
|
143
|
-
`Update is available (${('v' + notifier.update.latest).yellow})! Run`,
|
|
144
|
-
'npm i -g omegga'.yellow,
|
|
145
|
-
'to update!'
|
|
146
|
-
);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
Omegga.log(
|
|
150
|
-
'>>'.green,
|
|
151
|
-
`Launching brickadia server on port ${
|
|
152
|
-
('' + (conf.server.port || 7777)).green
|
|
153
|
-
}...`
|
|
154
|
-
);
|
|
155
|
-
|
|
156
|
-
// start the server
|
|
157
|
-
verboseLog('Starting Omegga');
|
|
158
|
-
server.start();
|
|
159
|
-
});
|
|
160
|
-
|
|
161
|
-
program
|
|
162
|
-
.command('init')
|
|
163
|
-
.description('Sets up the current directory as a brickadia server')
|
|
164
|
-
.action(() => {
|
|
165
|
-
const configFile = config.find('.');
|
|
166
|
-
if (configFile) {
|
|
167
|
-
err('Config file already exists:', configFile.yellow.underline);
|
|
168
|
-
process.exit(1);
|
|
169
|
-
return;
|
|
170
|
-
}
|
|
171
|
-
createDefaultConfig();
|
|
172
|
-
});
|
|
173
|
-
|
|
174
|
-
program
|
|
175
|
-
.command('config [field] [value]')
|
|
176
|
-
.description(
|
|
177
|
-
"Configure Omegga's default behavior.\n" +
|
|
178
|
-
'Type ' +
|
|
179
|
-
'omegga config list'.yellow.underline +
|
|
180
|
-
' for current settings and available fields'
|
|
181
|
-
)
|
|
182
|
-
.action((field, value) => {
|
|
183
|
-
if (!field) field = 'list';
|
|
184
|
-
omeggaConfig(field, value, program.opts());
|
|
185
|
-
});
|
|
186
|
-
|
|
187
|
-
program
|
|
188
|
-
.command('auth')
|
|
189
|
-
.option('-g, --global', 'Remove global auth files')
|
|
190
|
-
.option('-l, --local', 'Remove local auth files')
|
|
191
|
-
.option('-w, --workdir', 'Remove configured location auth files')
|
|
192
|
-
.option('-u, --email <email>', 'User email (must provide password)')
|
|
193
|
-
.option('-p, --pass <password>', 'User password (must provide email)')
|
|
194
|
-
.option('-v, --verbose', 'Print extra messages for debugging purposes')
|
|
195
|
-
.description(
|
|
196
|
-
'Generates server auth tokens from brickadia account email+password'
|
|
197
|
-
)
|
|
198
|
-
.action(
|
|
199
|
-
async ({
|
|
200
|
-
email,
|
|
201
|
-
pass: password,
|
|
202
|
-
local: localAuth,
|
|
203
|
-
workDir,
|
|
204
|
-
global: globalAuth,
|
|
205
|
-
}) => {
|
|
206
|
-
const { verbose, debug } = program.opts();
|
|
207
|
-
global.VERBOSE = verbose;
|
|
208
|
-
const workdirPath = path.join(
|
|
209
|
-
config.store.get('defaultOmegga'),
|
|
210
|
-
'data/Saved/Auth'
|
|
211
|
-
);
|
|
212
|
-
|
|
213
|
-
if (globalAuth || localAuth) {
|
|
214
|
-
if (globalAuth) {
|
|
215
|
-
log('Clearing auth files from', auth.AUTH_PATH.yellow);
|
|
216
|
-
auth.clean();
|
|
217
|
-
}
|
|
218
|
-
if (workDir) {
|
|
219
|
-
log('Clearing auth files from', workdirPath.yellow);
|
|
220
|
-
await file.rmdir(workdirPath);
|
|
221
|
-
}
|
|
222
|
-
if (localAuth) {
|
|
223
|
-
const localPath = path.resolve('data/Saved/Auth');
|
|
224
|
-
log('Clearing auth files from', localPath.yellow);
|
|
225
|
-
await file.rmdir(localPath);
|
|
226
|
-
}
|
|
227
|
-
return;
|
|
228
|
-
} else {
|
|
229
|
-
let branch;
|
|
230
|
-
|
|
231
|
-
// if there's a config in the current directory, use that one instead
|
|
232
|
-
if (config.find('.')) workDir = '.';
|
|
233
|
-
|
|
234
|
-
// check if configured path exists
|
|
235
|
-
if (fs.existsSync(workDir) && fs.statSync(workDir).isDirectory) {
|
|
236
|
-
// find the config for the working directory
|
|
237
|
-
const configFile = config.find(workDir);
|
|
238
|
-
try {
|
|
239
|
-
// read the config and extract the branch
|
|
240
|
-
const conf = config.read(configFile);
|
|
241
|
-
branch = conf?.server?.branch;
|
|
242
|
-
} catch (err) {
|
|
243
|
-
err('Error reading config file');
|
|
244
|
-
verboseLog(err);
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
// auth with that branch
|
|
249
|
-
auth.prompt({ email, password, debug, branch });
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
);
|
|
253
|
-
|
|
254
|
-
program
|
|
255
|
-
.command('info')
|
|
256
|
-
.alias('n')
|
|
257
|
-
.description(
|
|
258
|
-
'Shows server name, description, port, install info, and installed plugins'
|
|
259
|
-
)
|
|
260
|
-
.action(() => {
|
|
261
|
-
err('not implemented yet');
|
|
262
|
-
// TODO: implement config parsing
|
|
263
|
-
});
|
|
264
|
-
|
|
265
|
-
program
|
|
266
|
-
.command('install <pluginUrl...>')
|
|
267
|
-
.alias('i')
|
|
268
|
-
.description('Installs a plugin to the current brickadia server')
|
|
269
|
-
.option('-f, --force', 'Forcefully re-install existing plugin') // TODO: implement install --force
|
|
270
|
-
.option('-v, --verbose', 'Print extra messages for debugging purposes')
|
|
271
|
-
.action(plugins => {
|
|
272
|
-
if (!require('hasbin').sync('git')) {
|
|
273
|
-
err('git'.yellow, 'must be installed to install plugins.');
|
|
274
|
-
process.exit(1);
|
|
275
|
-
return;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
if (!config.find('.')) {
|
|
279
|
-
err(
|
|
280
|
-
'Not an omegga directory, run ',
|
|
281
|
-
'omegga init'.yellow,
|
|
282
|
-
'to setup one.'
|
|
283
|
-
);
|
|
284
|
-
process.exit(1);
|
|
285
|
-
return;
|
|
286
|
-
}
|
|
287
|
-
const { verbose, force } = program.opts();
|
|
288
|
-
global.VERBOSE = verbose;
|
|
289
|
-
pluginUtil.install(plugins, { verbose, force });
|
|
290
|
-
});
|
|
291
|
-
|
|
292
|
-
program
|
|
293
|
-
.command('update [pluginNames...]')
|
|
294
|
-
.alias('u')
|
|
295
|
-
.description('Updates all or selected installed plugins to latest versions')
|
|
296
|
-
.option('-f, --force', 'Forcefully re-upgrade existing plugin') // TODO: implement update --force
|
|
297
|
-
.option('-v, --verbose', 'Print extra messages for debugging purposes')
|
|
298
|
-
.action(plugins => {
|
|
299
|
-
if (!config.find('.')) {
|
|
300
|
-
err(
|
|
301
|
-
'Not an omegga directory, run ',
|
|
302
|
-
'omegga init'.yellow,
|
|
303
|
-
'to setup one.'
|
|
304
|
-
);
|
|
305
|
-
process.exit(1);
|
|
306
|
-
return;
|
|
307
|
-
}
|
|
308
|
-
const { verbose, force } = program.opts();
|
|
309
|
-
global.VERBOSE = verbose;
|
|
310
|
-
pluginUtil.update(plugins, { verbose, force });
|
|
311
|
-
});
|
|
312
|
-
|
|
313
|
-
program
|
|
314
|
-
.command('check [pluginNames...]')
|
|
315
|
-
.description('Checks plugins for compatibility issues')
|
|
316
|
-
.option('-v, --verbose', 'Print extra messages for debugging purposes')
|
|
317
|
-
.action(plugins => {
|
|
318
|
-
if (!config.find('.')) {
|
|
319
|
-
err(
|
|
320
|
-
'Not an omegga directory, run ',
|
|
321
|
-
'omegga init'.yellow,
|
|
322
|
-
'to setup one.'
|
|
323
|
-
);
|
|
324
|
-
process.exit(1);
|
|
325
|
-
return;
|
|
326
|
-
}
|
|
327
|
-
const { verbose } = program.opts();
|
|
328
|
-
global.VERBOSE = verbose;
|
|
329
|
-
pluginUtil.check(plugins, { verbose });
|
|
330
|
-
});
|
|
331
|
-
|
|
332
|
-
program.parse(process.argv);
|
package/src/omegga/auth.js
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
|
|
4
|
-
const Omegga = require('./server.js');
|
|
5
|
-
const soft = require('../softconfig.js');
|
|
6
|
-
const file = require('../util/file.js');
|
|
7
|
-
const { write: writeConfig } = require('../brickadia/config.js');
|
|
8
|
-
require('colors');
|
|
9
|
-
|
|
10
|
-
const verboseLog = (...args) => {
|
|
11
|
-
if (!global.VERBOSE) return;
|
|
12
|
-
if (Omegga.log) Omegga.log('V>'.magenta, ...args);
|
|
13
|
-
else console.log('V>'.magenta, ...args);
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
// remove the temporary install
|
|
17
|
-
async function removeTempDir() {
|
|
18
|
-
if (fs.existsSync(soft.TEMP_DIR_NAME)) {
|
|
19
|
-
verboseLog('Removing temporary auth directory');
|
|
20
|
-
|
|
21
|
-
// attempt to remove the temporary dir
|
|
22
|
-
try {
|
|
23
|
-
await file.rmdir(soft.TEMP_DIR_NAME);
|
|
24
|
-
} catch (e) {
|
|
25
|
-
// ignore fail - the directory probably doesn't exist
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// read the auth files into a buffer
|
|
31
|
-
function readAuthFiles() {
|
|
32
|
-
const files = {};
|
|
33
|
-
for (const f of soft.BRICKADIA_AUTH_FILES) {
|
|
34
|
-
files[f] = fs.readFileSync(
|
|
35
|
-
path.join(soft.TEMP_DIR_NAME, soft.DATA_PATH, 'Saved/Auth', f)
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
return files;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// write auth files object to a server path
|
|
42
|
-
function writeAuthFiles(dstDir, files) {
|
|
43
|
-
for (const f in files) {
|
|
44
|
-
fs.writeFileSync(path.join(dstDir, f), files[f]);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// from credentials, build brickadia auth tokens
|
|
49
|
-
async function genAuthFiles(email, password, { debug = false, branch }) {
|
|
50
|
-
verboseLog('Generating auth files');
|
|
51
|
-
|
|
52
|
-
// remove existing temporary install path
|
|
53
|
-
await removeTempDir();
|
|
54
|
-
|
|
55
|
-
if (fs.existsSync(soft.LOCAL_LAUNCHER)) {
|
|
56
|
-
verboseLog('Generating auth with local launcher');
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// dummy omegga config
|
|
60
|
-
const config = {
|
|
61
|
-
server: {
|
|
62
|
-
port: 7777,
|
|
63
|
-
publiclyListed: false,
|
|
64
|
-
name: 'omegga auth init',
|
|
65
|
-
__LOCAL: fs.existsSync(soft.LOCAL_LAUNCHER),
|
|
66
|
-
branch,
|
|
67
|
-
},
|
|
68
|
-
credentials: { email, password },
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
// dummy omegga launch options
|
|
72
|
-
const options = {
|
|
73
|
-
noauth: true,
|
|
74
|
-
noplugin: true,
|
|
75
|
-
noweb: true,
|
|
76
|
-
debug,
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
// create a dummy omegga
|
|
80
|
-
const omegga = new Omegga(soft.TEMP_DIR_NAME, config, options);
|
|
81
|
-
|
|
82
|
-
// create the unlisted server config
|
|
83
|
-
writeConfig(soft.TEMP_DIR_NAME, config);
|
|
84
|
-
|
|
85
|
-
omegga.start();
|
|
86
|
-
|
|
87
|
-
const success = await new Promise((resolve, reject) => {
|
|
88
|
-
let resolved = false;
|
|
89
|
-
// auth succeeded if the server starts
|
|
90
|
-
omegga.once('start', () => {
|
|
91
|
-
verboseLog('Auth succeeded');
|
|
92
|
-
resolved = true;
|
|
93
|
-
resolve(true);
|
|
94
|
-
|
|
95
|
-
// immediately stop the server
|
|
96
|
-
omegga.stop();
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
// auth failed if we get 'unauthorized'
|
|
100
|
-
omegga.once('unauthorized', () => {
|
|
101
|
-
verboseLog('Auth failed');
|
|
102
|
-
resolved = true;
|
|
103
|
-
resolve(false);
|
|
104
|
-
|
|
105
|
-
// immediately stop the server
|
|
106
|
-
omegga.stop();
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
let finished = false;
|
|
110
|
-
const finish =
|
|
111
|
-
name =>
|
|
112
|
-
(...args) => {
|
|
113
|
-
if (finished) return;
|
|
114
|
-
finished = true;
|
|
115
|
-
verboseLog('Brickadia', name, 'with code', ...args);
|
|
116
|
-
if (!resolved) reject('temp server could not start');
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
// if the server closes and the promise hasn't resolved, reject
|
|
120
|
-
omegga.once('closed', finish('closed'));
|
|
121
|
-
omegga.once('exit', finish('exited'));
|
|
122
|
-
omegga.once('server:stopped', finish('stopped'));
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
// read the auth files on success
|
|
126
|
-
const files = success ? readAuthFiles() : null;
|
|
127
|
-
|
|
128
|
-
// remove temp dir
|
|
129
|
-
removeTempDir();
|
|
130
|
-
|
|
131
|
-
// return auth files (or null)
|
|
132
|
-
return files;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
module.exports = {
|
|
136
|
-
genAuthFiles,
|
|
137
|
-
writeAuthFiles,
|
|
138
|
-
};
|