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
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import OmeggaPlugin, { OL, PS, PC } from 'omegga';
|
|
2
|
+
|
|
3
|
+
type Config = { foo: string };
|
|
4
|
+
type Storage = { bar: string };
|
|
5
|
+
|
|
6
|
+
export default class Plugin implements OmeggaPlugin<Config, Storage> {
|
|
7
|
+
omegga: OL;
|
|
8
|
+
config: PC<Config>;
|
|
9
|
+
store: PS<Storage>;
|
|
10
|
+
|
|
11
|
+
constructor(omegga: OL, config: PC<Config>, store: PS<Storage>) {
|
|
12
|
+
this.omegga = omegga;
|
|
13
|
+
this.config = config;
|
|
14
|
+
this.store = store;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
async init() {
|
|
18
|
+
// Write your plugin!
|
|
19
|
+
this.omegga.on('cmd:test', (speaker: string) => {
|
|
20
|
+
this.omegga.broadcast(`Hello, ${speaker}!`);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
return { registeredCommands: ['test'] };
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
async stop() {
|
|
27
|
+
// Anything that needs to be cleaned up...
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
|
|
3
|
+
When uploading your plugin to github/gitlab
|
|
4
|
+
start your repo name with "omegga-"
|
|
5
|
+
|
|
6
|
+
example: https://github.com/{{author}}/omegga-{{shortName}}
|
|
7
|
+
|
|
8
|
+
Your plugin will be installed via omegga install gh:{{author}}/{{shortName}}
|
|
9
|
+
|
|
10
|
+
-->
|
|
11
|
+
|
|
12
|
+
# {{name}}
|
|
13
|
+
|
|
14
|
+
An unsafe plugin for [omegga](https://github.com/brickadia-community/omegga).
|
|
15
|
+
|
|
16
|
+
This is an auto-generated README file. Please change it before publishing your plugin!
|
|
17
|
+
|
|
18
|
+
Be sure to edit the script in `setup.sh` to configure your plugin on install, or
|
|
19
|
+
remove it entirely if it is unnecessary.
|
|
20
|
+
|
|
21
|
+
## Install
|
|
22
|
+
|
|
23
|
+
`omegga install gh:{{author}}/{{shortName}}`
|
|
24
|
+
|
|
25
|
+
_TODO: more steps...?_
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
_TODO: include some usage information_
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module.exports = class Plugin {
|
|
2
|
+
constructor(omegga, config, store) {
|
|
3
|
+
this.omegga = omegga;
|
|
4
|
+
this.config = config;
|
|
5
|
+
this.store = store;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
async init() {
|
|
9
|
+
// Write your plugin!
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
async stop() {
|
|
13
|
+
// Anything that needs to be cleaned up...
|
|
14
|
+
}
|
|
15
|
+
}
|
package/.babelrc.json
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
name: Lint
|
|
2
|
-
|
|
3
|
-
on: push
|
|
4
|
-
|
|
5
|
-
jobs:
|
|
6
|
-
run-linters:
|
|
7
|
-
name: Run linters
|
|
8
|
-
runs-on: ubuntu-latest
|
|
9
|
-
|
|
10
|
-
steps:
|
|
11
|
-
- name: Check out Git repository
|
|
12
|
-
uses: actions/checkout@v2
|
|
13
|
-
|
|
14
|
-
- name: Set up Node.js
|
|
15
|
-
uses: actions/setup-node@v1
|
|
16
|
-
with:
|
|
17
|
-
node-version: 12
|
|
18
|
-
|
|
19
|
-
- name: Install Node.js dependencies
|
|
20
|
-
run: npm install
|
|
21
|
-
|
|
22
|
-
- name: Run linters
|
|
23
|
-
uses: wearerequired/lint-action@v1
|
|
24
|
-
with:
|
|
25
|
-
github_token: ${{ secrets.github_token }}
|
|
26
|
-
prettier: true
|
package/.prettierrc
DELETED
package/.vscode/extensions.json
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
# THIS FILE ONLY EXISTS FOR USERS WHO DO NOT HAVE ACCESS TO THE BRICKADIA LAUNCHER
|
|
4
|
-
# IT WILL BE DEPRECATED ONCE A5 COMES OUT
|
|
5
|
-
|
|
6
|
-
TAR_FILE=Brickadia_Alpha4_Patch1_CL3642_Linux.tar.xz
|
|
7
|
-
BRICKADIA_URL=https://static.brickadia.com/builds/CL3642/$TAR_FILE
|
|
8
|
-
LEGACY_PATH=$HOME/.config/omegga/Legacy
|
|
9
|
-
FILE=$LEGACY_PATH/$TAR_FILE
|
|
10
|
-
BINARY_PATH=$LEGACY_PATH/Brickadia/Binaries/Linux/BrickadiaServer-Linux-Shipping
|
|
11
|
-
FILEZ=$FILE.xz
|
|
12
|
-
|
|
13
|
-
if ! [[ $(which tar) && $(which wget) ]]; then
|
|
14
|
-
echo ">! Missing dependencies, please run:" >&2
|
|
15
|
-
echo " apt-get install wget tar" >&2
|
|
16
|
-
echo
|
|
17
|
-
exit 0
|
|
18
|
-
fi;
|
|
19
|
-
|
|
20
|
-
if ! [[ $(which omegga) ]]; then
|
|
21
|
-
echo ">! how on earth are you running this without omegga" >&2
|
|
22
|
-
exit 1
|
|
23
|
-
fi;
|
|
24
|
-
|
|
25
|
-
if [[ -f $BINARY_PATH ]]; then
|
|
26
|
-
echo ">> Legacy binary already installed!"
|
|
27
|
-
exit 0
|
|
28
|
-
fi
|
|
29
|
-
|
|
30
|
-
mkdir -p $LEGACY_PATH
|
|
31
|
-
|
|
32
|
-
if [[ -f $FILE ]]; then
|
|
33
|
-
echo ">> Legacy tar already downloaded!"
|
|
34
|
-
else
|
|
35
|
-
echo ">> Downloading Brickadia tar"
|
|
36
|
-
wget $BRICKADIA_URL -P $LEGACY_PATH
|
|
37
|
-
fi
|
|
38
|
-
|
|
39
|
-
if [[ -f $BINARY_PATH ]]; then
|
|
40
|
-
echo ">> Legacy binary already installed?!"
|
|
41
|
-
else
|
|
42
|
-
echo ">> Extracting Brickadia tar"
|
|
43
|
-
tar xJf $FILE -C $LEGACY_PATH
|
|
44
|
-
fi
|
package/src/brickadia/config.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
|
|
4
|
-
const file = require('../util/file.js');
|
|
5
|
-
|
|
6
|
-
const CONFIG_PATH = 'Saved/Config/LinuxServer';
|
|
7
|
-
const SERVER_SETTINGS = '/ServerSettings.ini';
|
|
8
|
-
|
|
9
|
-
// Function that writes config
|
|
10
|
-
module.exports = {
|
|
11
|
-
write(serverPath, config) {
|
|
12
|
-
const configPath = path.join(serverPath, CONFIG_PATH);
|
|
13
|
-
const settingsPath = path.join(configPath, SERVER_SETTINGS);
|
|
14
|
-
|
|
15
|
-
file.mkdir(configPath);
|
|
16
|
-
|
|
17
|
-
fs.writeFileSync(
|
|
18
|
-
settingsPath,
|
|
19
|
-
`[Server__BP_ServerSettings_General_C BP_ServerSettings_General_C]
|
|
20
|
-
MaxSelectedBricks=1000
|
|
21
|
-
MaxPlacedBricks=1000
|
|
22
|
-
SelectionTimeout=2.000000
|
|
23
|
-
PlaceTimeout=2.000000
|
|
24
|
-
ServerName=${config.server.name || ''}
|
|
25
|
-
ServerDescription=${config.server.description || ''}
|
|
26
|
-
ServerPassword=${config.server.password || ''}
|
|
27
|
-
MaxPlayers=${config.server.players || 20}
|
|
28
|
-
bPubliclyListed=${
|
|
29
|
-
typeof config.server.publiclyListed === 'undefined' ||
|
|
30
|
-
config.server.publiclyListed
|
|
31
|
-
? 'True'
|
|
32
|
-
: 'False'
|
|
33
|
-
}
|
|
34
|
-
WelcomeMessage="${config.server.welcomeMessage || ''}"
|
|
35
|
-
bGlobalRulesetSelfDamage=True
|
|
36
|
-
bGlobalRulesetPhysicsDamage=False`
|
|
37
|
-
);
|
|
38
|
-
},
|
|
39
|
-
read() {
|
|
40
|
-
// TODO: Implement server config reading
|
|
41
|
-
},
|
|
42
|
-
};
|
package/src/brickadia/server.js
DELETED
|
@@ -1,227 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Brickadia Server Wrapper
|
|
3
|
-
Manages IO with the game server
|
|
4
|
-
*/
|
|
5
|
-
const { EventEmitter } = require('events');
|
|
6
|
-
const { spawn } = require('child_process');
|
|
7
|
-
const readline = require('readline');
|
|
8
|
-
const path = require('path');
|
|
9
|
-
const stripAnsi = require('strip-ansi');
|
|
10
|
-
require('colors');
|
|
11
|
-
|
|
12
|
-
const verboseLog = (...args) => {
|
|
13
|
-
if (!global.VERBOSE) return;
|
|
14
|
-
if (Omegga.log) Omegga.log('V>'.magenta, ...args);
|
|
15
|
-
else console.log('V>'.magenta, ...args);
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
const errorLog = (...args) => {
|
|
19
|
-
if (Omegga.error) Omegga.error('!>'.red, ...args);
|
|
20
|
-
else console.error('!>'.red, ...args);
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const warnLog = (...args) => {
|
|
24
|
-
if (Omegga.error) Omegga.warn('W>'.yellow, ...args);
|
|
25
|
-
else console.warn('W>'.yellow, ...args);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
// list of errors that can be solved by yelling at the user
|
|
29
|
-
const knownErrors = [
|
|
30
|
-
{
|
|
31
|
-
name: 'MISSING_LIBGL',
|
|
32
|
-
solution: 'apt-get install libgl1-mesa-glx libglib2.0-0',
|
|
33
|
-
match:
|
|
34
|
-
/error while loading shared libraries: libGL\.so\.1: cannot open shared object file/,
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
name: 'MISSING_GLIB',
|
|
38
|
-
solution: 'apt-get install libgl1-mesa-glx libglib2.0-0',
|
|
39
|
-
match:
|
|
40
|
-
/error while loading shared libraries: libgthread-2\.0\.so\.0: cannot open shared object file/,
|
|
41
|
-
},
|
|
42
|
-
];
|
|
43
|
-
|
|
44
|
-
// Start a brickadia server
|
|
45
|
-
class BrickadiaServer extends EventEmitter {
|
|
46
|
-
#child = null;
|
|
47
|
-
#errInterface = null;
|
|
48
|
-
#outInterface = null;
|
|
49
|
-
|
|
50
|
-
constructor(dataPath, config) {
|
|
51
|
-
super();
|
|
52
|
-
this.config = config;
|
|
53
|
-
// use the data path if it's absolute, otherwise build an absolute path
|
|
54
|
-
this.path =
|
|
55
|
-
path.isAbsolute(dataPath) || dataPath.startsWith('/')
|
|
56
|
-
? dataPath
|
|
57
|
-
: path.join(process.cwd(), dataPath);
|
|
58
|
-
|
|
59
|
-
this.lineListener = this.lineListener.bind(this);
|
|
60
|
-
this.errorListener = this.errorListener.bind(this);
|
|
61
|
-
this.exitListener = this.exitListener.bind(this);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// start the server child process
|
|
65
|
-
start() {
|
|
66
|
-
const { email, password } = this.config.credentials || {};
|
|
67
|
-
verboseLog(
|
|
68
|
-
'Starting server',
|
|
69
|
-
(!email && !password ? 'without' : 'with').yellow,
|
|
70
|
-
'credentials'
|
|
71
|
-
);
|
|
72
|
-
verboseLog(
|
|
73
|
-
'Running',
|
|
74
|
-
(this.config.server.__LOCAL
|
|
75
|
-
? path.join(__dirname, '../../tools/brickadia.sh')
|
|
76
|
-
: 'brickadia launcher'
|
|
77
|
-
).yellow
|
|
78
|
-
);
|
|
79
|
-
if (typeof this.config.server.branch === 'string')
|
|
80
|
-
verboseLog('Using branch', this.config.server.branch.yellow);
|
|
81
|
-
|
|
82
|
-
// handle local launcher support
|
|
83
|
-
const launchArgs = [
|
|
84
|
-
this.config.server.__LOCAL
|
|
85
|
-
? path.join(__dirname, '../../tools/brickadia.sh')
|
|
86
|
-
: 'brickadia',
|
|
87
|
-
this.config.server.branch && `--branch=${this.config.server.branch}`,
|
|
88
|
-
'--server',
|
|
89
|
-
'--',
|
|
90
|
-
];
|
|
91
|
-
|
|
92
|
-
// Either unbuffer or stdbuf must be used because brickadia's output is buffered
|
|
93
|
-
// this means that multiple lines can be bundled together if the output buffer is not full
|
|
94
|
-
// unfortunately without stdbuf or unbuffer, the output would not happen immediately
|
|
95
|
-
this.#child = spawn(
|
|
96
|
-
'stdbuf',
|
|
97
|
-
[
|
|
98
|
-
'--output=L',
|
|
99
|
-
'--',
|
|
100
|
-
...launchArgs,
|
|
101
|
-
this.config.server.map && `${this.config.server.map}`,
|
|
102
|
-
'-NotInstalled',
|
|
103
|
-
'-log',
|
|
104
|
-
require('../util/wsl') === 1 ? '-OneThread' : null,
|
|
105
|
-
this.path ? `-UserDir="${this.path}"` : null,
|
|
106
|
-
email ? `-User="${email}"` : null, // remove email argument if not provided
|
|
107
|
-
password ? `-Password="${password}"` : null, // remove password argument if not provided
|
|
108
|
-
`-port="${this.config.server.port}"`,
|
|
109
|
-
].filter(Boolean)
|
|
110
|
-
); // remove unused arguments
|
|
111
|
-
|
|
112
|
-
verboseLog('Spawn process', this.#child ? this.#child.pid : 'failed'.red);
|
|
113
|
-
|
|
114
|
-
this.#child.stdin.setEncoding('utf8');
|
|
115
|
-
this.#outInterface = readline.createInterface({
|
|
116
|
-
input: this.#child.stdout,
|
|
117
|
-
terminal: false,
|
|
118
|
-
});
|
|
119
|
-
this.#errInterface = readline.createInterface({
|
|
120
|
-
input: this.#child.stderr,
|
|
121
|
-
terminal: false,
|
|
122
|
-
});
|
|
123
|
-
this.attachListeners();
|
|
124
|
-
verboseLog('Attached listeners');
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
// write a string to the child process
|
|
128
|
-
write(line) {
|
|
129
|
-
if (line.length >= 512) {
|
|
130
|
-
// show a warning
|
|
131
|
-
warnLog(
|
|
132
|
-
'WARNING'.yellow,
|
|
133
|
-
'The following line was called and is',
|
|
134
|
-
'longer than allowed limit'.red
|
|
135
|
-
);
|
|
136
|
-
warnLog(line.replace(/\n$/, ''));
|
|
137
|
-
// throw a fake error to get the line number
|
|
138
|
-
try {
|
|
139
|
-
throw new Error('Console Line Too Long');
|
|
140
|
-
} catch (err) {
|
|
141
|
-
warnLog(err);
|
|
142
|
-
}
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
if (this.#child) {
|
|
146
|
-
verboseLog('WRITE'.green, line.replace(/\n$/, ''));
|
|
147
|
-
this.#child.stdin.write(line);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
// write a line to the child process
|
|
152
|
-
writeln(line) {
|
|
153
|
-
this.write(line + '\n');
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
// forcibly kills the server
|
|
157
|
-
stop() {
|
|
158
|
-
if (!this.#child) {
|
|
159
|
-
verboseLog('Cannot stop server as no subprocess exists');
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
verboseLog('Forcibly stopping server');
|
|
164
|
-
// kill the process
|
|
165
|
-
this.#child.kill('SIGINT');
|
|
166
|
-
|
|
167
|
-
// ...kill it again just to make sure it's dead
|
|
168
|
-
spawn('kill', ['-9', this.#child.pid]);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
// detaches listeners
|
|
172
|
-
cleanup() {
|
|
173
|
-
if (!this.#child) return;
|
|
174
|
-
|
|
175
|
-
verboseLog('Cleaning up brickadia server');
|
|
176
|
-
|
|
177
|
-
// detach listener
|
|
178
|
-
this.detachListeners();
|
|
179
|
-
|
|
180
|
-
this.#child = null;
|
|
181
|
-
this.#outInterface = null;
|
|
182
|
-
this.#errInterface = null;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
// attaches proxy event listeners
|
|
186
|
-
attachListeners() {
|
|
187
|
-
this.#outInterface.on('line', this.lineListener);
|
|
188
|
-
this.#errInterface.on('line', this.errorListener);
|
|
189
|
-
this.#child.on('exit', this.exitListener);
|
|
190
|
-
this.#child.on('close', () => {});
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
// removes previously attached proxy event listeners
|
|
194
|
-
detachListeners() {
|
|
195
|
-
this.#outInterface.off('line', this.lineListener);
|
|
196
|
-
this.#errInterface.off('line', this.errorListener);
|
|
197
|
-
this.#child.off('exit', this.exitListener);
|
|
198
|
-
this.#child.removeAllListeners('close');
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
// -- listeners for basic events (line, err, exit)
|
|
202
|
-
errorListener(line) {
|
|
203
|
-
verboseLog('ERROR'.red, line);
|
|
204
|
-
this.emit('err', line);
|
|
205
|
-
for (const { match, solution, name, message } of knownErrors) {
|
|
206
|
-
if (line.match(match)) {
|
|
207
|
-
errorLog(
|
|
208
|
-
`Encountered ${name.red}. ${
|
|
209
|
-
solution ? 'Known fix:\n ' + solution : message || 'Unknown error.'
|
|
210
|
-
}`
|
|
211
|
-
);
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
exitListener(...args) {
|
|
217
|
-
verboseLog('Exit listener fired');
|
|
218
|
-
this.emit('closed', ...args);
|
|
219
|
-
this.cleanup();
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
lineListener(line) {
|
|
223
|
-
this.emit('line', stripAnsi(line));
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
module.exports = BrickadiaServer;
|
package/src/cli/auth.js
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
const passwordPrompt = require('password-prompt');
|
|
2
|
-
const readline = require('readline');
|
|
3
|
-
const path = require('path');
|
|
4
|
-
const fs = require('fs');
|
|
5
|
-
require('colors');
|
|
6
|
-
|
|
7
|
-
const { genAuthFiles, writeAuthFiles } = require('../omegga/auth.js');
|
|
8
|
-
const file = require('../util/file.js');
|
|
9
|
-
const soft = require('../softconfig.js');
|
|
10
|
-
|
|
11
|
-
const AUTH_PATH = path.join(soft.CONFIG_HOME, soft.CONFIG_AUTH_DIR);
|
|
12
|
-
|
|
13
|
-
// prompt user for email
|
|
14
|
-
const emailPrompt = text =>
|
|
15
|
-
new Promise(resolve => {
|
|
16
|
-
const rl = readline.createInterface({
|
|
17
|
-
input: process.stdin,
|
|
18
|
-
output: process.stdout,
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
rl.question(text, email => {
|
|
22
|
-
rl.close();
|
|
23
|
-
resolve(email);
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
// async function to prompt for credentials
|
|
28
|
-
async function prompt() {
|
|
29
|
-
console.log(
|
|
30
|
-
'>>'.green,
|
|
31
|
-
'Enter',
|
|
32
|
-
'Brickadia'.green.underline,
|
|
33
|
-
'credentials (not stored)'
|
|
34
|
-
);
|
|
35
|
-
return [
|
|
36
|
-
await emailPrompt(' ' + 'email'.yellow.underline + ': '),
|
|
37
|
-
await passwordPrompt(' ' + 'password'.yellow.underline + ': '),
|
|
38
|
-
];
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
async function authFromPrompt({ email, password, debug = false, branch }) {
|
|
42
|
-
let files;
|
|
43
|
-
|
|
44
|
-
if (!email || !password) {
|
|
45
|
-
// prompt for user credentials
|
|
46
|
-
try {
|
|
47
|
-
[email, password] = await prompt();
|
|
48
|
-
} catch (err) {
|
|
49
|
-
console.error('!>'.red, 'Error prompting credentials\n', err);
|
|
50
|
-
return false;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// generate auth tokens
|
|
55
|
-
console.log('>>'.green, 'Generating auth tokens...');
|
|
56
|
-
const timeout = setTimeout(() => {
|
|
57
|
-
console.log('>>'.green, 'Probably also installing the game...');
|
|
58
|
-
}, 10000);
|
|
59
|
-
try {
|
|
60
|
-
files = await genAuthFiles(email, password, { debug, branch });
|
|
61
|
-
clearTimeout(timeout);
|
|
62
|
-
} catch (err) {
|
|
63
|
-
clearTimeout(timeout);
|
|
64
|
-
console.error('!>'.red, 'Error generating tokens:', err);
|
|
65
|
-
return false;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
if (!files) {
|
|
69
|
-
console.error('!>'.red, 'Authentication Failed');
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// save the tokens to the config path (will be copied when omegga starts)
|
|
74
|
-
try {
|
|
75
|
-
console.log('>>'.green, 'Storing auth tokens...');
|
|
76
|
-
file.mkdir(AUTH_PATH);
|
|
77
|
-
writeAuthFiles(AUTH_PATH, files);
|
|
78
|
-
} catch (err) {
|
|
79
|
-
console.error('!>'.red, 'Error writing tokens to config\n', err);
|
|
80
|
-
return false;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
console.log('>>'.green, 'Auth tokens successfully generated!');
|
|
84
|
-
return true;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// check if auth files exist
|
|
88
|
-
function authExists(dir) {
|
|
89
|
-
return soft.BRICKADIA_AUTH_FILES.every(f =>
|
|
90
|
-
fs.existsSync(path.join(dir || AUTH_PATH, f))
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
// delete auth files stored in config
|
|
95
|
-
function deleteAuthFiles() {
|
|
96
|
-
file.rmdir(AUTH_PATH);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
module.exports = {
|
|
100
|
-
prompt: authFromPrompt,
|
|
101
|
-
exists: authExists,
|
|
102
|
-
clean: deleteAuthFiles,
|
|
103
|
-
AUTH_PATH,
|
|
104
|
-
};
|
package/src/cli/config.js
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
|
|
4
|
-
const { store } = require('../config/index.js');
|
|
5
|
-
|
|
6
|
-
const err = (...args) => console.error('!>'.red, ...args);
|
|
7
|
-
const log = (...args) => console.log('>>'.green, ...args);
|
|
8
|
-
|
|
9
|
-
const fields = {
|
|
10
|
-
default: {
|
|
11
|
-
desc: 'default omegga project directory when running omegga in a non-configured folder',
|
|
12
|
-
example: 'omegga config default $(pwd)',
|
|
13
|
-
default: '.',
|
|
14
|
-
get() {
|
|
15
|
-
let val = store.get('defaultOmegga') || '.';
|
|
16
|
-
if (val === '.') val += ' [current working dir]'.grey;
|
|
17
|
-
return val;
|
|
18
|
-
},
|
|
19
|
-
set(val) {
|
|
20
|
-
if (!val) {
|
|
21
|
-
val = '.';
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// check if the path is valid
|
|
25
|
-
if (val !== '.' && !path.isAbsolute(val)) {
|
|
26
|
-
err('setting must be an absolute path or "."');
|
|
27
|
-
process.exit(1);
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
if (!fs.existsSync(val)) {
|
|
31
|
-
err('given path does not exist');
|
|
32
|
-
process.exit(1);
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
if (!fs.statSync(val).isDirectory) {
|
|
36
|
-
err('given path is not for a directory');
|
|
37
|
-
process.exit(1);
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// update the setting
|
|
42
|
-
store.set('defaultOmegga', val);
|
|
43
|
-
log('Set', 'default'.green, 'to', val.green);
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
module.exports = (field, value, _opts = {}) => {
|
|
49
|
-
// list command lists all fields, current setting, and description
|
|
50
|
-
if (field === 'list') {
|
|
51
|
-
log('Configurable fields:');
|
|
52
|
-
const maxLen = Math.max(...Object.keys(fields).map(f => f.length));
|
|
53
|
-
for (const key in fields) {
|
|
54
|
-
const field = fields[key];
|
|
55
|
-
console.log(
|
|
56
|
-
'\n ' + key.yellow.underline,
|
|
57
|
-
'-'.padStart(maxLen - key.length + 1),
|
|
58
|
-
field.desc
|
|
59
|
-
);
|
|
60
|
-
console.log(' current'.brightGreen + ':', field.get());
|
|
61
|
-
console.log(' default:', field.default);
|
|
62
|
-
console.log(' example'.brightBlue + ':', field.example);
|
|
63
|
-
}
|
|
64
|
-
console.log();
|
|
65
|
-
} else if (fields[field]) {
|
|
66
|
-
// a valid field was entered - run the set command
|
|
67
|
-
fields[field].set(value);
|
|
68
|
-
} else {
|
|
69
|
-
// no valid field was entered
|
|
70
|
-
err(
|
|
71
|
-
'invalid field, run',
|
|
72
|
-
'omegga config list'.yellow.underline,
|
|
73
|
-
'for a list of available fields'
|
|
74
|
-
);
|
|
75
|
-
process.exit(1);
|
|
76
|
-
}
|
|
77
|
-
};
|