omegga 1.2.9 → 1.3.0

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.
Files changed (255) hide show
  1. package/README.md +20 -1
  2. package/dist/brickadia/config.js +26 -90
  3. package/dist/brickadia/config.js.map +1 -1
  4. package/dist/brickadia/server.js +294 -293
  5. package/dist/brickadia/server.js.map +1 -1
  6. package/dist/cli/auth.js +149 -177
  7. package/dist/cli/auth.js.map +1 -1
  8. package/dist/cli/config.js +64 -66
  9. package/dist/cli/config.js.map +1 -1
  10. package/dist/cli/index.js +14 -14
  11. package/dist/cli/index.js.map +1 -1
  12. package/dist/cli/installer.js +37 -43
  13. package/dist/cli/installer.js.map +1 -1
  14. package/dist/cli/plugin.js +651 -682
  15. package/dist/cli/plugin.js.map +1 -1
  16. package/dist/cli/terminal.js +811 -733
  17. package/dist/cli/terminal.js.map +1 -1
  18. package/dist/config/formats/format_js.js +6 -6
  19. package/dist/config/formats/format_js.js.map +1 -1
  20. package/dist/config/formats/format_yml.js +7 -10
  21. package/dist/config/formats/format_yml.js.map +1 -1
  22. package/dist/config/index.js +46 -68
  23. package/dist/config/index.js.map +1 -1
  24. package/dist/config/reader.js +16 -27
  25. package/dist/config/reader.js.map +1 -1
  26. package/dist/config/validator.js +23 -25
  27. package/dist/config/validator.js.map +1 -1
  28. package/dist/config/writer.js +11 -21
  29. package/dist/config/writer.js.map +1 -1
  30. package/dist/index.js +18 -64
  31. package/dist/index.js.map +1 -1
  32. package/dist/info/default_commands.json.js +39 -0
  33. package/dist/info/default_commands.json.js.map +1 -0
  34. package/dist/logger.js +61 -60
  35. package/dist/logger.js.map +1 -1
  36. package/dist/main.js +424 -471
  37. package/dist/main.js.map +1 -1
  38. package/dist/omegga/auth.js +101 -148
  39. package/dist/omegga/auth.js.map +1 -1
  40. package/dist/omegga/commandInjector.js +261 -251
  41. package/dist/omegga/commandInjector.js.map +1 -1
  42. package/dist/omegga/index.js +14 -52
  43. package/dist/omegga/index.js.map +1 -1
  44. package/dist/omegga/logWrangler.js +224 -275
  45. package/dist/omegga/logWrangler.js.map +1 -1
  46. package/dist/omegga/matchers/auth.js +36 -50
  47. package/dist/omegga/matchers/auth.js.map +1 -1
  48. package/dist/omegga/matchers/chat.js +49 -71
  49. package/dist/omegga/matchers/chat.js.map +1 -1
  50. package/dist/omegga/matchers/command.js +25 -36
  51. package/dist/omegga/matchers/command.js.map +1 -1
  52. package/dist/omegga/matchers/exit.js +15 -18
  53. package/dist/omegga/matchers/exit.js.map +1 -1
  54. package/dist/omegga/matchers/index.js +26 -40
  55. package/dist/omegga/matchers/index.js.map +1 -1
  56. package/dist/omegga/matchers/init.js +20 -23
  57. package/dist/omegga/matchers/init.js.map +1 -1
  58. package/dist/omegga/matchers/interact.js +58 -64
  59. package/dist/omegga/matchers/interact.js.map +1 -1
  60. package/dist/omegga/matchers/join.js +74 -95
  61. package/dist/omegga/matchers/join.js.map +1 -1
  62. package/dist/omegga/matchers/leave.js +43 -56
  63. package/dist/omegga/matchers/leave.js.map +1 -1
  64. package/dist/omegga/matchers/mapChange.js +26 -35
  65. package/dist/omegga/matchers/mapChange.js.map +1 -1
  66. package/dist/omegga/matchers/minigameJoin.js +24 -31
  67. package/dist/omegga/matchers/minigameJoin.js.map +1 -1
  68. package/dist/omegga/matchers/version.js +42 -49
  69. package/dist/omegga/matchers/version.js.map +1 -1
  70. package/dist/omegga/player.js +527 -527
  71. package/dist/omegga/player.js.map +1 -1
  72. package/dist/omegga/plugin/interface.js +91 -98
  73. package/dist/omegga/plugin/interface.js.map +1 -1
  74. package/dist/omegga/plugin/plugin_jsonrpc_stdio.js +524 -429
  75. package/dist/omegga/plugin/plugin_jsonrpc_stdio.js.map +1 -1
  76. package/dist/omegga/plugin/plugin_node_safe/proxyOmegga.js +282 -294
  77. package/dist/omegga/plugin/plugin_node_safe/proxyOmegga.js.map +1 -1
  78. package/dist/omegga/plugin/plugin_node_safe.js +365 -393
  79. package/dist/omegga/plugin/plugin_node_safe.js.map +1 -1
  80. package/dist/omegga/plugin/plugin_node_unsafe.js +119 -179
  81. package/dist/omegga/plugin/plugin_node_unsafe.js.map +1 -1
  82. package/dist/omegga/plugin.js +402 -347
  83. package/dist/omegga/plugin.js.map +1 -1
  84. package/dist/omegga/server.js +742 -774
  85. package/dist/omegga/server.js.map +1 -1
  86. package/dist/omegga/wrapper.js +64 -91
  87. package/dist/omegga/wrapper.js.map +1 -1
  88. package/dist/plugin.js +11 -31
  89. package/dist/plugin.js.map +1 -1
  90. package/dist/softconfig.js +121 -100
  91. package/dist/softconfig.js.map +1 -1
  92. package/dist/updater/steam.js +97 -112
  93. package/dist/updater/steam.js.map +1 -1
  94. package/dist/util/brdb.js +496 -528
  95. package/dist/util/brdb.js.map +1 -1
  96. package/dist/util/brick/checkBounds.js +11 -15
  97. package/dist/util/brick/checkBounds.js.map +1 -1
  98. package/dist/util/brick/constants.js +723 -174
  99. package/dist/util/brick/constants.js.map +1 -1
  100. package/dist/util/brick/displayName.js +204 -211
  101. package/dist/util/brick/displayName.js.map +1 -1
  102. package/dist/util/brick/getBounds.js +29 -41
  103. package/dist/util/brick/getBounds.js.map +1 -1
  104. package/dist/util/brick/getBrickSize.js +6 -7
  105. package/dist/util/brick/getBrickSize.js.map +1 -1
  106. package/dist/util/brick/getScaleAxis.js +24 -30
  107. package/dist/util/brick/getScaleAxis.js.map +1 -1
  108. package/dist/util/brick/index.js +8 -29
  109. package/dist/util/brick/index.js.map +1 -1
  110. package/dist/util/brick/rotate.js +29 -34
  111. package/dist/util/brick/rotate.js.map +1 -1
  112. package/dist/util/brick/setOwnership.js +13 -19
  113. package/dist/util/brick/setOwnership.js.map +1 -1
  114. package/dist/util/chat.js +53 -44
  115. package/dist/util/chat.js.map +1 -1
  116. package/dist/util/color.js +112 -124
  117. package/dist/util/color.js.map +1 -1
  118. package/dist/util/file.js +54 -98
  119. package/dist/util/file.js.map +1 -1
  120. package/dist/util/index.js +84 -106
  121. package/dist/util/index.js.map +1 -1
  122. package/dist/util/map.js +18 -20
  123. package/dist/util/map.js.map +1 -1
  124. package/dist/util/pattern.js +6 -9
  125. package/dist/util/pattern.js.map +1 -1
  126. package/dist/util/time.js +31 -34
  127. package/dist/util/time.js.map +1 -1
  128. package/dist/util/uuid.js +10 -8
  129. package/dist/util/uuid.js.map +1 -1
  130. package/dist/util/wsl.js +19 -25
  131. package/dist/util/wsl.js.map +1 -1
  132. package/dist/version.js +7 -9
  133. package/dist/version.js.map +1 -1
  134. package/dist/webserver/backend/api.js +784 -874
  135. package/dist/webserver/backend/api.js.map +1 -1
  136. package/dist/webserver/backend/calendar.js +14 -17
  137. package/dist/webserver/backend/calendar.js.map +1 -1
  138. package/dist/webserver/backend/database.js +563 -613
  139. package/dist/webserver/backend/database.js.map +1 -1
  140. package/dist/webserver/backend/index.js +153 -191
  141. package/dist/webserver/backend/index.js.map +1 -1
  142. package/dist/webserver/backend/metrics.js +219 -248
  143. package/dist/webserver/backend/metrics.js.map +1 -1
  144. package/dist/webserver/backend/util.js +47 -68
  145. package/dist/webserver/backend/util.js.map +1 -1
  146. package/dist/worker.js +322 -0
  147. package/dist/worker.js.map +1 -0
  148. package/package.json +14 -10
  149. package/templates/safe-ts/omegga.d.ts +1 -1
  150. package/vite.backend.config.mts +46 -0
  151. package/vite.frontend.config.mts +58 -0
  152. package/vitest.backend.config.mts +7 -0
  153. package/dist/brickadia/config.d.ts +0 -3
  154. package/dist/brickadia/presets.d.ts +0 -65
  155. package/dist/brickadia/presets.js +0 -3
  156. package/dist/brickadia/presets.js.map +0 -1
  157. package/dist/brickadia/server.d.ts +0 -36
  158. package/dist/brickadia/types.d.ts +0 -45
  159. package/dist/brickadia/types.js +0 -3
  160. package/dist/brickadia/types.js.map +0 -1
  161. package/dist/cli/auth.d.ts +0 -26
  162. package/dist/cli/config.d.ts +0 -10
  163. package/dist/cli/index.d.ts +0 -30
  164. package/dist/cli/installer.d.ts +0 -1
  165. package/dist/cli/plugin.d.ts +0 -22
  166. package/dist/cli/terminal.d.ts +0 -25
  167. package/dist/config/authorizer.d.ts +0 -2
  168. package/dist/config/authorizer.js +0 -38
  169. package/dist/config/authorizer.js.map +0 -1
  170. package/dist/config/formats/format_js.d.ts +0 -3
  171. package/dist/config/formats/format_yml.d.ts +0 -3
  172. package/dist/config/index.d.ts +0 -18
  173. package/dist/config/reader.d.ts +0 -3
  174. package/dist/config/types.d.ts +0 -50
  175. package/dist/config/types.js +0 -3
  176. package/dist/config/types.js.map +0 -1
  177. package/dist/config/validator.d.ts +0 -6
  178. package/dist/config/writer.d.ts +0 -3
  179. package/dist/index.d.ts +0 -22
  180. package/dist/info/default_commands.json +0 -29
  181. package/dist/logger.d.ts +0 -41
  182. package/dist/main.d.ts +0 -1
  183. package/dist/omegga/auth.d.ts +0 -9
  184. package/dist/omegga/commandInjector.d.ts +0 -35
  185. package/dist/omegga/index.d.ts +0 -7
  186. package/dist/omegga/logWrangler.d.ts +0 -32
  187. package/dist/omegga/matchers/auth.d.ts +0 -10
  188. package/dist/omegga/matchers/chat.d.ts +0 -10
  189. package/dist/omegga/matchers/command.d.ts +0 -7
  190. package/dist/omegga/matchers/exit.d.ts +0 -3
  191. package/dist/omegga/matchers/index.d.ts +0 -3
  192. package/dist/omegga/matchers/init.d.ts +0 -3
  193. package/dist/omegga/matchers/interact.d.ts +0 -4
  194. package/dist/omegga/matchers/join.d.ts +0 -4
  195. package/dist/omegga/matchers/leave.d.ts +0 -4
  196. package/dist/omegga/matchers/mapChange.d.ts +0 -3
  197. package/dist/omegga/matchers/minigameJoin.d.ts +0 -9
  198. package/dist/omegga/matchers/types.d.ts +0 -5
  199. package/dist/omegga/matchers/types.js +0 -3
  200. package/dist/omegga/matchers/types.js.map +0 -1
  201. package/dist/omegga/matchers/version.d.ts +0 -3
  202. package/dist/omegga/player.d.ts +0 -81
  203. package/dist/omegga/plugin/interface.d.ts +0 -30
  204. package/dist/omegga/plugin/plugin_jsonrpc_stdio.d.ts +0 -23
  205. package/dist/omegga/plugin/plugin_node_safe/proxyOmegga.d.ts +0 -145
  206. package/dist/omegga/plugin/plugin_node_safe/worker.d.ts +0 -1
  207. package/dist/omegga/plugin/plugin_node_safe/worker.js +0 -367
  208. package/dist/omegga/plugin/plugin_node_safe/worker.js.map +0 -1
  209. package/dist/omegga/plugin/plugin_node_safe.d.ts +0 -23
  210. package/dist/omegga/plugin/plugin_node_unsafe.d.ts +0 -13
  211. package/dist/omegga/plugin.d.ts +0 -63
  212. package/dist/omegga/server.d.ts +0 -166
  213. package/dist/omegga/types.d.ts +0 -49
  214. package/dist/omegga/types.js +0 -3
  215. package/dist/omegga/types.js.map +0 -1
  216. package/dist/omegga/wrapper.d.ts +0 -32
  217. package/dist/plugin.d.ts +0 -916
  218. package/dist/softconfig.d.ts +0 -67
  219. package/dist/tsconfig.tsbuildinfo +0 -1
  220. package/dist/updater/index.d.ts +0 -1
  221. package/dist/updater/index.js +0 -10
  222. package/dist/updater/index.js.map +0 -1
  223. package/dist/updater/steam.d.ts +0 -52
  224. package/dist/util/brdb.d.ts +0 -31
  225. package/dist/util/brick/checkBounds.d.ts +0 -8
  226. package/dist/util/brick/constants.d.ts +0 -18
  227. package/dist/util/brick/displayName.d.ts +0 -7
  228. package/dist/util/brick/getBounds.d.ts +0 -5
  229. package/dist/util/brick/getBrickSize.d.ts +0 -3
  230. package/dist/util/brick/getScaleAxis.d.ts +0 -3
  231. package/dist/util/brick/index.d.ts +0 -14
  232. package/dist/util/brick/rotate.d.ts +0 -16
  233. package/dist/util/brick/setOwnership.d.ts +0 -12
  234. package/dist/util/chat.d.ts +0 -23
  235. package/dist/util/color.d.ts +0 -13
  236. package/dist/util/file.d.ts +0 -5
  237. package/dist/util/index.d.ts +0 -183
  238. package/dist/util/map.d.ts +0 -6
  239. package/dist/util/pattern.d.ts +0 -1
  240. package/dist/util/time.d.ts +0 -39
  241. package/dist/util/uuid.d.ts +0 -3
  242. package/dist/util/wsl.d.ts +0 -2
  243. package/dist/version.d.ts +0 -2
  244. package/dist/webserver/backend/api.d.ts +0 -115
  245. package/dist/webserver/backend/calendar.d.ts +0 -5
  246. package/dist/webserver/backend/database.d.ts +0 -150
  247. package/dist/webserver/backend/index.d.ts +0 -30
  248. package/dist/webserver/backend/metrics.d.ts +0 -3
  249. package/dist/webserver/backend/types.d.ts +0 -114
  250. package/dist/webserver/backend/types.js +0 -3
  251. package/dist/webserver/backend/types.js.map +0 -1
  252. package/dist/webserver/backend/util.d.ts +0 -2
  253. package/dist/webserver/index.d.ts +0 -2
  254. package/dist/webserver/index.js +0 -9
  255. package/dist/webserver/index.js.map +0 -1
@@ -0,0 +1,58 @@
1
+ import react from '@vitejs/plugin-react-swc';
2
+ import { resolve } from 'path';
3
+ import { defineConfig, type PluginOption } from 'vite';
4
+ import { vitePluginNativeImportMaps } from 'vite-plugin-native-import-maps';
5
+ import sass from 'vite-plugin-sass';
6
+
7
+ // TODO: this might be useful for letting plugins import omegga components
8
+ // import dts from 'vite-plugin-dts';
9
+
10
+ // https://vite.dev/config/
11
+ export default defineConfig({
12
+ root: resolve(__dirname, 'frontend'),
13
+ plugins: [
14
+ sass(),
15
+ react(),
16
+ // dts(),
17
+ // Provide an import-map for plugins to provide custom ui
18
+ vitePluginNativeImportMaps({
19
+ shared: [
20
+ 'react',
21
+ 'react-dom',
22
+ 'react/jsx-runtime',
23
+ '@tabler/icons-react',
24
+ 'nanostores',
25
+ '@nanostores/react',
26
+ 'wouter',
27
+ { name: '@components', entry: 'frontend/src/components/index.ts' },
28
+ { name: '@utils', entry: 'frontend/src/utils.ts' },
29
+ { name: '@hooks', entry: 'frontend/src/hooks/index.ts' },
30
+ ],
31
+ sharedOutDir: 'shared',
32
+ log: true,
33
+ }) as PluginOption,
34
+ ],
35
+ publicDir: 'public',
36
+ resolve: {
37
+ alias: {
38
+ '@components': resolve(__dirname, 'frontend/src/components'),
39
+ '@utils': resolve(__dirname, 'frontend/src/utils'),
40
+ '@hooks': resolve(__dirname, 'frontend/src/hooks'),
41
+ },
42
+ },
43
+ assetsInclude: ['**/*.webp'],
44
+ build: {
45
+ sourcemap: true,
46
+ rollupOptions: {
47
+ input: {
48
+ auth: resolve(__dirname, 'frontend/auth.html'),
49
+ app: resolve(__dirname, 'frontend/app.html'),
50
+ },
51
+ external: ['@omegga'],
52
+ },
53
+ emptyOutDir: true,
54
+ outDir: resolve(__dirname, 'public'),
55
+ copyPublicDir: false,
56
+ chunkSizeWarningLimit: 8000,
57
+ },
58
+ });
@@ -0,0 +1,7 @@
1
+ import { defineConfig, mergeConfig } from 'vitest/config';
2
+ import viteConfig from './vite.backend.config.mjs';
3
+
4
+ export default mergeConfig(
5
+ viteConfig,
6
+ defineConfig({ test: { root: './src', environment: 'node' } }),
7
+ );
@@ -1,3 +0,0 @@
1
- import { IConfig } from "../config/types";
2
- export declare function write(serverPath: string, config: IConfig): void;
3
- export declare function read(): void;
@@ -1,65 +0,0 @@
1
- import { BRColor, BRVector } from './types';
2
- export type Preset<T extends string, D> = {
3
- formatVersion?: '1';
4
- presetVersion?: '1';
5
- type?: T;
6
- data?: D;
7
- };
8
- export type EnvironmentPreset = Preset<'Environment', {
9
- groups?: {
10
- Sky?: {
11
- timeOfDay?: number;
12
- timeChangeSpeed?: number;
13
- sunAngle?: number;
14
- sunScale?: number;
15
- sunHorizonScaleMultiplier?: number;
16
- sunlightColor?: BRColor;
17
- skyIntensity?: number;
18
- skyColor?: BRColor;
19
- moonScale?: number;
20
- moonlightIntensity?: number;
21
- moonlightColor?: BRColor;
22
- starsIntensity?: number;
23
- starsColor?: BRColor;
24
- auroraIntensity?: number;
25
- weatherIntensity?: number;
26
- rainSnow?: number;
27
- cloudCoverage?: number;
28
- cloudSpeedMultiplier?: number;
29
- precipitationParticleAmount?: number;
30
- bCloseLightning?: boolean;
31
- rainVolume?: number;
32
- closeThunderVolume?: number;
33
- distantThunderVolume?: number;
34
- windVolume?: number;
35
- clearFogDensity?: number;
36
- cloudyFogDensity?: number;
37
- clearFogHeightFalloff?: number;
38
- cloudyFogHeightFalloff?: number;
39
- fogColor?: BRColor;
40
- };
41
- GroundPlate?: {
42
- variance?: number;
43
- varianceBrickSize?: number;
44
- groundColor?: BRColor;
45
- groundAccentColor?: BRColor;
46
- isVisible?: boolean;
47
- bUseStudTexture?: boolean;
48
- };
49
- Water?: {
50
- waterHeight?: number;
51
- waterAbsorption?: BRVector;
52
- waterScattering?: BRVector;
53
- waterFogIntensity?: number;
54
- waterFogAmbientColor?: BRColor;
55
- waterFogAmbientScale?: number;
56
- waterFogScatteringColor?: BRColor;
57
- waterFogScatteringScale?: number;
58
- };
59
- Ambience?: {
60
- selectedAmbienceTypeInt?: number;
61
- ambienceVolume?: number;
62
- reverbEffect?: string;
63
- };
64
- };
65
- }>;
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=presets.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"presets.js","sourceRoot":"","sources":["../../src/brickadia/presets.ts"],"names":[],"mappings":""}
@@ -1,36 +0,0 @@
1
- import { IConfig } from "../config/types";
2
- import 'colors';
3
- import EventEmitter from 'events';
4
- /** Start a brickadia server */
5
- export default class BrickadiaServer extends EventEmitter {
6
- #private;
7
- config: IConfig;
8
- path: string;
9
- constructor(dataPath: string, config: IConfig);
10
- getActiveWorldFile(): string;
11
- /** A world specified by the active world file */
12
- getActiveWorld(): string | null;
13
- /** Set the world to use next startup */
14
- setActiveWorld(world: string | null): boolean;
15
- /** A world specified by the config */
16
- getConfigWorld(): string | null;
17
- /** A world specified by the BRICKADIA_WORLD env variable */
18
- getEnvWorld(): string | null;
19
- /** Check if a world exists */
20
- worldExists(world: string): boolean;
21
- /** Get the world that will be used next startup */
22
- getNextWorld(): {
23
- source: string;
24
- file: string;
25
- };
26
- start(): void;
27
- write(line: string): void;
28
- writeln(line: string): void;
29
- stop(): void;
30
- cleanup(): void;
31
- attachListeners(): void;
32
- detachListeners(): void;
33
- errorListener(line: string): void;
34
- exitListener(...args: any[]): void;
35
- lineListener(line: string): void;
36
- }
@@ -1,45 +0,0 @@
1
- export interface BRColor {
2
- r: number;
3
- b: number;
4
- g: number;
5
- a: number;
6
- }
7
- export interface BRVector {
8
- x: number;
9
- y: number;
10
- z: number;
11
- }
12
- export interface BRBanListEntry {
13
- bannerId: string;
14
- created: string;
15
- expires: string;
16
- reason: string;
17
- }
18
- export interface BRBanList {
19
- banList: Record<string, BRBanListEntry>;
20
- }
21
- export interface BRRolePermission {
22
- name: string;
23
- state: 'Allowed' | 'Unchanged' | 'Forbidden';
24
- }
25
- export interface BRRoleSetupEntry {
26
- name: string;
27
- permissions: BRRolePermission[];
28
- color: BRColor;
29
- bHasColor: boolean;
30
- }
31
- export interface BRRoleSetup {
32
- roles: BRRoleSetupEntry[];
33
- defaultRole: BRRoleSetupEntry;
34
- ownerRoleColor: BRColor;
35
- bOwnerRoleHasColor: boolean;
36
- version: string;
37
- }
38
- export interface BRRoleAssignments {
39
- savedPlayerRoles: Record<string, {
40
- roles: string[];
41
- }>;
42
- }
43
- export interface BRPlayerNameCache {
44
- savedPlayerNames: Record<string, string>;
45
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/brickadia/types.ts"],"names":[],"mappings":""}
@@ -1,26 +0,0 @@
1
- import 'colors';
2
- export declare const AUTH_PATH: string;
3
- declare function authFromPrompt({ email, password, debug, isSteam, branch, authDir, savedDir, launchArgs, }: {
4
- email?: string | null;
5
- password?: string | null;
6
- debug?: boolean;
7
- isSteam?: boolean;
8
- branch?: string;
9
- authDir?: string;
10
- savedDir?: string;
11
- launchArgs?: string;
12
- }): Promise<boolean>;
13
- declare function authExists(dir?: string): boolean;
14
- declare function deleteAuthFiles(dir?: string): void;
15
- export declare function getGlobalToken(): string;
16
- export declare const prompt: typeof authFromPrompt;
17
- export declare const exists: typeof authExists;
18
- export declare const clean: typeof deleteAuthFiles;
19
- declare const _default: {
20
- AUTH_PATH: string;
21
- prompt: typeof authFromPrompt;
22
- exists: typeof authExists;
23
- clean: typeof deleteAuthFiles;
24
- getGlobalToken: typeof getGlobalToken;
25
- };
26
- export default _default;
@@ -1,10 +0,0 @@
1
- interface IConfigField {
2
- desc: string;
3
- example: string;
4
- default: string;
5
- get(): string;
6
- set(value: string): void;
7
- }
8
- declare const fields: Record<string, IConfigField>;
9
- declare const _default: (field: keyof typeof fields | "list", value: string, _opts?: {}) => void;
10
- export default _default;
@@ -1,30 +0,0 @@
1
- import _Terminal from './terminal';
2
- export declare const auth: {
3
- AUTH_PATH: string;
4
- prompt: ({ email, password, debug, isSteam, branch, authDir, savedDir, launchArgs, }: {
5
- email?: string | null;
6
- password?: string | null;
7
- debug?: boolean;
8
- isSteam?: boolean;
9
- branch?: string;
10
- authDir?: string;
11
- savedDir?: string;
12
- launchArgs?: string;
13
- }) => Promise<boolean>;
14
- exists: (dir?: string) => boolean;
15
- clean: (dir?: string) => void;
16
- getGlobalToken: typeof import("./auth").getGlobalToken;
17
- };
18
- export declare const config: (field: string | "list", value: string, _opts?: {}) => void;
19
- export declare const pluginUtil: {
20
- install: typeof import("./plugin").install;
21
- update: typeof import("./plugin").update;
22
- check: typeof import("./plugin").check;
23
- init: () => Promise<void>;
24
- listConfig: (pluginName: string, json?: boolean) => Promise<void>;
25
- getConfig: (pluginName: string, configName: string, json?: boolean) => Promise<void>;
26
- setConfig: (pluginName: any, configName: string, valueString: string) => Promise<void>;
27
- resetAllConfigs: (pluginName: any, force: any) => Promise<void>;
28
- resetConfig: (pluginName: any, configName: string) => Promise<void>;
29
- };
30
- export declare const Terminal: typeof _Terminal;
@@ -1 +0,0 @@
1
- export declare function installLauncher(): Promise<void>;
@@ -1,22 +0,0 @@
1
- import 'colors';
2
- export declare function install(plugins: string[], _options: unknown): Promise<void>;
3
- export declare function update(pluginsNames: string[], _options: unknown): Promise<void>;
4
- export declare function check(pluginNames: string[], _options: unknown): Promise<void>;
5
- declare function init(): Promise<void>;
6
- declare function listConfig(pluginName: string, json?: boolean): Promise<void>;
7
- declare function getConfig(pluginName: string, configName: string, json?: boolean): Promise<void>;
8
- declare function setConfig(pluginName: any, configName: string, valueString: string): Promise<void>;
9
- declare function resetAllConfigs(pluginName: any, force: any): Promise<void>;
10
- declare function resetConfig(pluginName: any, configName: string): Promise<void>;
11
- declare const _default: {
12
- install: typeof install;
13
- update: typeof update;
14
- check: typeof check;
15
- init: typeof init;
16
- listConfig: typeof listConfig;
17
- getConfig: typeof getConfig;
18
- setConfig: typeof setConfig;
19
- resetAllConfigs: typeof resetAllConfigs;
20
- resetConfig: typeof resetConfig;
21
- };
22
- export default _default;
@@ -1,25 +0,0 @@
1
- import Omegga from "../omegga/server";
2
- import { IOmeggaOptions } from "../omegga/types";
3
- import readline from 'readline';
4
- declare global {
5
- interface String {
6
- brightRed: string;
7
- brightGreen: string;
8
- brightYellow: string;
9
- brightBlue: string;
10
- brightMagenta: string;
11
- brightCyan: string;
12
- brightWhite: string;
13
- }
14
- }
15
- export default class Terminal {
16
- options: IOmeggaOptions;
17
- omegga: Omegga;
18
- rl: readline.Interface;
19
- constructor(omegga: Omegga, options?: IOmeggaOptions);
20
- handleLine(line: string): Promise<void>;
21
- log(...args: any[]): void;
22
- debug(...args: any[]): void;
23
- warn(...args: any[]): void;
24
- error(...args: any[]): void;
25
- }
@@ -1,2 +0,0 @@
1
- declare const authorizer: (email: string, password: string) => Promise<unknown>;
2
- export default authorizer;
@@ -1,38 +0,0 @@
1
- "use strict";
2
- /*
3
- Determine if email+password combo is valid
4
- */
5
- var __importDefault = (this && this.__importDefault) || function (mod) {
6
- return (mod && mod.__esModule) ? mod : { "default": mod };
7
- };
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- const server_1 = __importDefault(require("../brickadia/server"));
10
- const _config_1 = require("./");
11
- const softconfig_1 = __importDefault(require("../softconfig"));
12
- const invalidRegExp = /^(Error: AuthState is Invalid on dedicated server - exiting\.|Changing AuthState from \w+ to Invalid\.)$/;
13
- const validRegExp = /^Changing AuthState from \w+ to ValidOnline\.$/;
14
- const authorizer = (email, password) => new Promise(resolve => {
15
- // create a server with these credentials
16
- const server = new server_1.default(softconfig_1.default.DATA_PATH, {
17
- credentials: { email, password },
18
- server: {
19
- port: 7775,
20
- __LEGACY: _config_1.store.get('legacyBin'),
21
- },
22
- });
23
- // wait for the invalid auth line or valid auth line, then kill the server
24
- server.on('line', line => {
25
- if (line.match(invalidRegExp)) {
26
- server.stop();
27
- resolve(false);
28
- }
29
- else if (line.match(validRegExp)) {
30
- server.stop();
31
- resolve(true);
32
- }
33
- });
34
- // start the server
35
- server.start();
36
- });
37
- exports.default = authorizer;
38
- //# sourceMappingURL=authorizer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"authorizer.js","sourceRoot":"","sources":["../../src/config/authorizer.ts"],"names":[],"mappings":";AAAA;;EAEE;;;;;AAEF,iEAAgD;AAChD,gCAAgC;AAChC,+DAAkC;AAElC,MAAM,aAAa,GACjB,0GAA0G,CAAC;AAC7G,MAAM,WAAW,GAAG,gDAAgD,CAAC;AAErE,MAAM,UAAU,GAAG,CAAC,KAAa,EAAE,QAAgB,EAAE,EAAE,CACrD,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE;IACpB,yCAAyC;IACzC,MAAM,MAAM,GAAG,IAAI,gBAAe,CAAC,oBAAM,CAAC,SAAS,EAAE;QACnD,WAAW,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE;QAChC,MAAM,EAAE;YACN,IAAI,EAAE,IAAI;YACV,QAAQ,EAAE,eAAK,CAAC,GAAG,CAAC,WAAW,CAAC;SACjC;KACF,CAAC,CAAC;IAEH,0EAA0E;IAC1E,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE;QACvB,IAAI,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC;YAC9B,MAAM,CAAC,IAAI,EAAE,CAAC;YACd,OAAO,CAAC,KAAK,CAAC,CAAC;QACjB,CAAC;aAAM,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC;YACnC,MAAM,CAAC,IAAI,EAAE,CAAC;YACd,OAAO,CAAC,IAAI,CAAC,CAAC;QAChB,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,mBAAmB;IACnB,MAAM,CAAC,KAAK,EAAE,CAAC;AACjB,CAAC,CAAC,CAAC;AAEL,kBAAe,UAAU,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { IConfigFormat } from "../types";
2
- declare const format_js: IConfigFormat;
3
- export default format_js;
@@ -1,3 +0,0 @@
1
- import type { IConfigFormat } from "../types";
2
- declare const format_yaml: IConfigFormat;
3
- export default format_yaml;
@@ -1,18 +0,0 @@
1
- import Configstore from 'configstore';
2
- import { IConfig, IConfigFormat } from './types';
3
- export * from './types';
4
- export declare const store: Configstore;
5
- export declare const defaultConfig: IConfig;
6
- export declare const write: (path: string, blob: IConfig) => void;
7
- export declare const read: (path?: string) => IConfig;
8
- export declare const find: (dir?: string) => string;
9
- export * from './types';
10
- declare const _default: {
11
- store: Configstore;
12
- write: (path: string, blob: IConfig) => void;
13
- read: (path?: string) => IConfig;
14
- find: (dir?: string) => string;
15
- defaultConfig: IConfig;
16
- formats: IConfigFormat[];
17
- };
18
- export default _default;
@@ -1,3 +0,0 @@
1
- import { IConfigFormat } from './types';
2
- declare const reader: (formats: IConfigFormat[]) => (path?: string) => import("./types").IConfig;
3
- export default reader;
@@ -1,50 +0,0 @@
1
- export interface IServerConfig {
2
- webui?: boolean;
3
- port?: number;
4
- https?: boolean;
5
- }
6
- export interface IBrickadiaConfig {
7
- port: number;
8
- /** Map to load on startup if a world is not specified */
9
- map?: string;
10
- /** World file name to load on startup */
11
- world?: string;
12
- /** old launcher branch name */
13
- branch?: string;
14
- /** Steam beta name */
15
- steambeta?: string;
16
- /** Steam beta password */
17
- steambetaPassword?: string;
18
- name?: string;
19
- description?: string;
20
- password?: string;
21
- players?: number;
22
- publiclyListed?: boolean;
23
- welcomeMessage?: string;
24
- authDir?: string;
25
- savedDir?: string;
26
- launchArgs?: string;
27
- __LOCAL?: boolean;
28
- __LEGACY?: string;
29
- }
30
- export interface IConfig {
31
- omegga?: IServerConfig;
32
- server: IBrickadiaConfig;
33
- credentials?: {
34
- email?: string;
35
- password?: string;
36
- token?: string;
37
- };
38
- /** Internal use - this is a steam install */
39
- __STEAM?: boolean;
40
- }
41
- export type IConfigFormat = {
42
- extension: string;
43
- writer: (blob: IConfig) => string;
44
- } & ({
45
- encoding: 'string';
46
- reader: (str: string) => IConfig;
47
- } | {
48
- encoding: 'buffer';
49
- reader: (str: Buffer) => IConfig;
50
- });
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/config/types.ts"],"names":[],"mappings":""}
@@ -1,6 +0,0 @@
1
- import { IConfig } from './types';
2
- declare const validate: (obj: Partial<IConfig>) => {
3
- valid: boolean;
4
- errors: string[];
5
- };
6
- export default validate;
@@ -1,3 +0,0 @@
1
- import { IConfig, IConfigFormat } from './types';
2
- declare const writer: (formats: IConfigFormat[]) => (path: string, blob: IConfig) => void;
3
- export default writer;
package/dist/index.d.ts DELETED
@@ -1,22 +0,0 @@
1
- export * from "./omegga/types";
2
- export * from "./config/types";
3
- export * from "./brickadia/types";
4
- export * from './plugin';
5
- /** BrickadiaServer - manages the server child process */
6
- import * as Server from "./brickadia/server";
7
- /** config writer for brickadia */
8
- import * as brConfig from "./brickadia/config";
9
- export declare const brickadia: {
10
- Server: typeof Server;
11
- config: typeof brConfig;
12
- };
13
- /** the actual object can be required too */
14
- import Omegga from "./omegga/server";
15
- export default Omegga;
16
- export { Omegga };
17
- /** brickadia server wrapper, log parser, and plugin runner */
18
- export * as omegga from './omegga';
19
- /** utility functions */
20
- export * as util from "./util";
21
- /** config */
22
- export * as config from "./config";
@@ -1,29 +0,0 @@
1
- [
2
- "back",
3
- "ban",
4
- "brickcount",
5
- "clearallbricks",
6
- "clearbricks",
7
- "clearcheckpoint",
8
- "destroyallgrids",
9
- "gettransform",
10
- "ghost",
11
- "grantrole",
12
- "help",
13
- "jointeam",
14
- "kick",
15
- "leaveteam",
16
- "listautosaves",
17
- "listplayers",
18
- "listroles",
19
- "listteams",
20
- "load",
21
- "loadautosave",
22
- "ping",
23
- "playercount",
24
- "revokerole",
25
- "spectate",
26
- "spectator",
27
- "tp",
28
- "unban"
29
- ]
package/dist/logger.d.ts DELETED
@@ -1,41 +0,0 @@
1
- import type Terminal from "./cli/terminal";
2
- export default class Logger {
3
- static VERBOSE: boolean;
4
- static terminal: Terminal;
5
- /**
6
- * Send a console log to the readline terminal or stdout
7
- */
8
- static log(...args: any[]): void;
9
- /**
10
- * Send a prefixed console log to the readline terminal or stdout
11
- */
12
- static logp(...args: any[]): void;
13
- /**
14
- * Send a console debug to the readline terminal or stdout
15
- */
16
- static debug(...args: any[]): void;
17
- /**
18
- * Send a console error to the readline terminal or stderr
19
- */
20
- static error(...args: any[]): void;
21
- /**
22
- * Send a prefixed console error to the readline terminal or stderr
23
- */
24
- static errorp(...args: any[]): void;
25
- /**
26
- * Send a console warn to the readline terminal or stdout
27
- */
28
- static warn(...args: any[]): void;
29
- /**
30
- * Send a prefixed console warn to the readline terminal or stdout
31
- */
32
- static warnp(...args: any[]): void;
33
- /**
34
- * Send a console log when omegga is launched when --verbose
35
- */
36
- static verbose(...args: any[]): void;
37
- /**
38
- * Send a console log to the readline terminal or console
39
- */
40
- static setTerminal(term: Terminal): void;
41
- }
package/dist/main.d.ts DELETED
@@ -1 +0,0 @@
1
- import 'colors';
@@ -1,9 +0,0 @@
1
- import 'colors';
2
- export declare function writeAuthFiles(dstDir: string, files: Record<string, Buffer>): void;
3
- export declare function genAuthFiles(email: string, password: string, { debug, authDir, savedDir, branch, launchArgs, }: {
4
- debug?: boolean;
5
- branch?: string;
6
- authDir?: string;
7
- savedDir?: string;
8
- launchArgs?: string;
9
- }): Promise<Record<string, Buffer<ArrayBufferLike>>>;
@@ -1,35 +0,0 @@
1
- import type LogWrangler from './logWrangler';
2
- import { InjectedCommands } from "../plugin";
3
- export type PawnDataField<F, T = string> = {
4
- /**
5
- * The command to execute and listen to.
6
- */
7
- command: string;
8
- /**
9
- * The game object name, like `BP_FigureV2_C`.
10
- */
11
- object: string;
12
- /**
13
- * What object should be matched, like `/(?<pawn>BP_FigureV2_C_\d+)/`.
14
- */
15
- objectMatcher: RegExp;
16
- /**
17
- * The field on the game object, like `bIsDead`.
18
- */
19
- objectField: string;
20
- /**
21
- * The regex that should match the value of the game object field.
22
- * If `valueTransform` is not specified, `value` becomes the first capture group.
23
- */
24
- valueMatcher: RegExp;
25
- /**
26
- * An optional closure to transform what `valueMatcher` matched.
27
- */
28
- valueTransform?: (match: RegExpMatchArray) => T;
29
- /**
30
- * The field on the final object.
31
- */
32
- field: F;
33
- };
34
- declare const _default: <T extends InjectedCommands>(obj: T, logWrangler: LogWrangler) => void;
35
- export default _default;