omegga 1.2.8 → 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.
- package/README.md +20 -1
- package/dist/brickadia/config.js +26 -90
- package/dist/brickadia/config.js.map +1 -1
- package/dist/brickadia/server.js +294 -293
- package/dist/brickadia/server.js.map +1 -1
- package/dist/cli/auth.js +149 -177
- package/dist/cli/auth.js.map +1 -1
- package/dist/cli/config.js +64 -66
- package/dist/cli/config.js.map +1 -1
- package/dist/cli/index.js +14 -14
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/installer.js +37 -43
- package/dist/cli/installer.js.map +1 -1
- package/dist/cli/plugin.js +651 -682
- package/dist/cli/plugin.js.map +1 -1
- package/dist/cli/terminal.js +811 -733
- package/dist/cli/terminal.js.map +1 -1
- package/dist/config/formats/format_js.js +6 -6
- package/dist/config/formats/format_js.js.map +1 -1
- package/dist/config/formats/format_yml.js +7 -10
- package/dist/config/formats/format_yml.js.map +1 -1
- package/dist/config/index.js +46 -68
- package/dist/config/index.js.map +1 -1
- package/dist/config/reader.js +16 -27
- package/dist/config/reader.js.map +1 -1
- package/dist/config/validator.js +23 -25
- package/dist/config/validator.js.map +1 -1
- package/dist/config/writer.js +11 -21
- package/dist/config/writer.js.map +1 -1
- package/dist/index.js +18 -64
- package/dist/index.js.map +1 -1
- package/dist/info/default_commands.json.js +39 -0
- package/dist/info/default_commands.json.js.map +1 -0
- package/dist/logger.js +61 -60
- package/dist/logger.js.map +1 -1
- package/dist/main.js +424 -471
- package/dist/main.js.map +1 -1
- package/dist/omegga/auth.js +101 -148
- package/dist/omegga/auth.js.map +1 -1
- package/dist/omegga/commandInjector.js +261 -251
- package/dist/omegga/commandInjector.js.map +1 -1
- package/dist/omegga/index.js +14 -52
- package/dist/omegga/index.js.map +1 -1
- package/dist/omegga/logWrangler.js +224 -275
- package/dist/omegga/logWrangler.js.map +1 -1
- package/dist/omegga/matchers/auth.js +36 -50
- package/dist/omegga/matchers/auth.js.map +1 -1
- package/dist/omegga/matchers/chat.js +49 -71
- package/dist/omegga/matchers/chat.js.map +1 -1
- package/dist/omegga/matchers/command.js +25 -36
- package/dist/omegga/matchers/command.js.map +1 -1
- package/dist/omegga/matchers/exit.js +15 -18
- package/dist/omegga/matchers/exit.js.map +1 -1
- package/dist/omegga/matchers/index.js +26 -40
- package/dist/omegga/matchers/index.js.map +1 -1
- package/dist/omegga/matchers/init.js +20 -23
- package/dist/omegga/matchers/init.js.map +1 -1
- package/dist/omegga/matchers/interact.js +58 -64
- package/dist/omegga/matchers/interact.js.map +1 -1
- package/dist/omegga/matchers/join.js +74 -95
- package/dist/omegga/matchers/join.js.map +1 -1
- package/dist/omegga/matchers/leave.js +43 -56
- package/dist/omegga/matchers/leave.js.map +1 -1
- package/dist/omegga/matchers/mapChange.js +26 -35
- package/dist/omegga/matchers/mapChange.js.map +1 -1
- package/dist/omegga/matchers/minigameJoin.js +24 -31
- package/dist/omegga/matchers/minigameJoin.js.map +1 -1
- package/dist/omegga/matchers/version.js +42 -49
- package/dist/omegga/matchers/version.js.map +1 -1
- package/dist/omegga/player.js +527 -527
- package/dist/omegga/player.js.map +1 -1
- package/dist/omegga/plugin/interface.js +91 -98
- package/dist/omegga/plugin/interface.js.map +1 -1
- package/dist/omegga/plugin/plugin_jsonrpc_stdio.js +524 -429
- package/dist/omegga/plugin/plugin_jsonrpc_stdio.js.map +1 -1
- package/dist/omegga/plugin/plugin_node_safe/proxyOmegga.js +282 -294
- package/dist/omegga/plugin/plugin_node_safe/proxyOmegga.js.map +1 -1
- package/dist/omegga/plugin/plugin_node_safe.js +365 -393
- package/dist/omegga/plugin/plugin_node_safe.js.map +1 -1
- package/dist/omegga/plugin/plugin_node_unsafe.js +119 -179
- package/dist/omegga/plugin/plugin_node_unsafe.js.map +1 -1
- package/dist/omegga/plugin.js +402 -347
- package/dist/omegga/plugin.js.map +1 -1
- package/dist/omegga/server.js +742 -774
- package/dist/omegga/server.js.map +1 -1
- package/dist/omegga/wrapper.js +64 -91
- package/dist/omegga/wrapper.js.map +1 -1
- package/dist/plugin.js +11 -31
- package/dist/plugin.js.map +1 -1
- package/dist/softconfig.js +121 -100
- package/dist/softconfig.js.map +1 -1
- package/dist/updater/steam.js +97 -112
- package/dist/updater/steam.js.map +1 -1
- package/dist/util/brdb.js +496 -528
- package/dist/util/brdb.js.map +1 -1
- package/dist/util/brick/checkBounds.js +11 -15
- package/dist/util/brick/checkBounds.js.map +1 -1
- package/dist/util/brick/constants.js +723 -174
- package/dist/util/brick/constants.js.map +1 -1
- package/dist/util/brick/displayName.js +204 -211
- package/dist/util/brick/displayName.js.map +1 -1
- package/dist/util/brick/getBounds.js +29 -41
- package/dist/util/brick/getBounds.js.map +1 -1
- package/dist/util/brick/getBrickSize.js +6 -7
- package/dist/util/brick/getBrickSize.js.map +1 -1
- package/dist/util/brick/getScaleAxis.js +24 -30
- package/dist/util/brick/getScaleAxis.js.map +1 -1
- package/dist/util/brick/index.js +8 -29
- package/dist/util/brick/index.js.map +1 -1
- package/dist/util/brick/rotate.js +29 -34
- package/dist/util/brick/rotate.js.map +1 -1
- package/dist/util/brick/setOwnership.js +13 -19
- package/dist/util/brick/setOwnership.js.map +1 -1
- package/dist/util/chat.js +53 -44
- package/dist/util/chat.js.map +1 -1
- package/dist/util/color.js +112 -124
- package/dist/util/color.js.map +1 -1
- package/dist/util/file.js +54 -98
- package/dist/util/file.js.map +1 -1
- package/dist/util/index.js +84 -106
- package/dist/util/index.js.map +1 -1
- package/dist/util/map.js +18 -20
- package/dist/util/map.js.map +1 -1
- package/dist/util/pattern.js +6 -9
- package/dist/util/pattern.js.map +1 -1
- package/dist/util/time.js +31 -34
- package/dist/util/time.js.map +1 -1
- package/dist/util/uuid.js +10 -8
- package/dist/util/uuid.js.map +1 -1
- package/dist/util/wsl.js +19 -25
- package/dist/util/wsl.js.map +1 -1
- package/dist/version.js +7 -9
- package/dist/version.js.map +1 -1
- package/dist/webserver/backend/api.js +784 -874
- package/dist/webserver/backend/api.js.map +1 -1
- package/dist/webserver/backend/calendar.js +14 -17
- package/dist/webserver/backend/calendar.js.map +1 -1
- package/dist/webserver/backend/database.js +563 -613
- package/dist/webserver/backend/database.js.map +1 -1
- package/dist/webserver/backend/index.js +153 -191
- package/dist/webserver/backend/index.js.map +1 -1
- package/dist/webserver/backend/metrics.js +219 -248
- package/dist/webserver/backend/metrics.js.map +1 -1
- package/dist/webserver/backend/util.js +47 -68
- package/dist/webserver/backend/util.js.map +1 -1
- package/dist/worker.js +322 -0
- package/dist/worker.js.map +1 -0
- package/package.json +14 -10
- package/templates/safe-ts/omegga.d.ts +2 -2
- package/vite.backend.config.mts +46 -0
- package/vite.frontend.config.mts +58 -0
- package/vitest.backend.config.mts +7 -0
- package/dist/brickadia/config.d.ts +0 -3
- package/dist/brickadia/presets.d.ts +0 -65
- package/dist/brickadia/presets.js +0 -3
- package/dist/brickadia/presets.js.map +0 -1
- package/dist/brickadia/server.d.ts +0 -36
- package/dist/brickadia/types.d.ts +0 -45
- package/dist/brickadia/types.js +0 -3
- package/dist/brickadia/types.js.map +0 -1
- package/dist/cli/auth.d.ts +0 -26
- package/dist/cli/config.d.ts +0 -10
- package/dist/cli/index.d.ts +0 -30
- package/dist/cli/installer.d.ts +0 -1
- package/dist/cli/plugin.d.ts +0 -22
- package/dist/cli/terminal.d.ts +0 -25
- package/dist/config/authorizer.d.ts +0 -2
- package/dist/config/authorizer.js +0 -38
- package/dist/config/authorizer.js.map +0 -1
- package/dist/config/formats/format_js.d.ts +0 -3
- package/dist/config/formats/format_yml.d.ts +0 -3
- package/dist/config/index.d.ts +0 -18
- package/dist/config/reader.d.ts +0 -3
- package/dist/config/types.d.ts +0 -50
- package/dist/config/types.js +0 -3
- package/dist/config/types.js.map +0 -1
- package/dist/config/validator.d.ts +0 -6
- package/dist/config/writer.d.ts +0 -3
- package/dist/index.d.ts +0 -22
- package/dist/info/default_commands.json +0 -29
- package/dist/logger.d.ts +0 -41
- package/dist/main.d.ts +0 -1
- package/dist/omegga/auth.d.ts +0 -9
- package/dist/omegga/commandInjector.d.ts +0 -35
- package/dist/omegga/index.d.ts +0 -7
- package/dist/omegga/logWrangler.d.ts +0 -32
- package/dist/omegga/matchers/auth.d.ts +0 -10
- package/dist/omegga/matchers/chat.d.ts +0 -10
- package/dist/omegga/matchers/command.d.ts +0 -7
- package/dist/omegga/matchers/exit.d.ts +0 -3
- package/dist/omegga/matchers/index.d.ts +0 -3
- package/dist/omegga/matchers/init.d.ts +0 -3
- package/dist/omegga/matchers/interact.d.ts +0 -4
- package/dist/omegga/matchers/join.d.ts +0 -4
- package/dist/omegga/matchers/leave.d.ts +0 -4
- package/dist/omegga/matchers/mapChange.d.ts +0 -3
- package/dist/omegga/matchers/minigameJoin.d.ts +0 -9
- package/dist/omegga/matchers/types.d.ts +0 -5
- package/dist/omegga/matchers/types.js +0 -3
- package/dist/omegga/matchers/types.js.map +0 -1
- package/dist/omegga/matchers/version.d.ts +0 -3
- package/dist/omegga/player.d.ts +0 -81
- package/dist/omegga/plugin/interface.d.ts +0 -30
- package/dist/omegga/plugin/plugin_jsonrpc_stdio.d.ts +0 -23
- package/dist/omegga/plugin/plugin_node_safe/proxyOmegga.d.ts +0 -145
- package/dist/omegga/plugin/plugin_node_safe/worker.d.ts +0 -1
- package/dist/omegga/plugin/plugin_node_safe/worker.js +0 -367
- package/dist/omegga/plugin/plugin_node_safe/worker.js.map +0 -1
- package/dist/omegga/plugin/plugin_node_safe.d.ts +0 -23
- package/dist/omegga/plugin/plugin_node_unsafe.d.ts +0 -13
- package/dist/omegga/plugin.d.ts +0 -63
- package/dist/omegga/server.d.ts +0 -166
- package/dist/omegga/types.d.ts +0 -49
- package/dist/omegga/types.js +0 -3
- package/dist/omegga/types.js.map +0 -1
- package/dist/omegga/wrapper.d.ts +0 -32
- package/dist/plugin.d.ts +0 -916
- package/dist/softconfig.d.ts +0 -67
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/updater/index.d.ts +0 -1
- package/dist/updater/index.js +0 -10
- package/dist/updater/index.js.map +0 -1
- package/dist/updater/steam.d.ts +0 -52
- package/dist/util/brdb.d.ts +0 -31
- package/dist/util/brick/checkBounds.d.ts +0 -8
- package/dist/util/brick/constants.d.ts +0 -18
- package/dist/util/brick/displayName.d.ts +0 -7
- package/dist/util/brick/getBounds.d.ts +0 -5
- package/dist/util/brick/getBrickSize.d.ts +0 -3
- package/dist/util/brick/getScaleAxis.d.ts +0 -3
- package/dist/util/brick/index.d.ts +0 -14
- package/dist/util/brick/rotate.d.ts +0 -16
- package/dist/util/brick/setOwnership.d.ts +0 -12
- package/dist/util/chat.d.ts +0 -23
- package/dist/util/color.d.ts +0 -13
- package/dist/util/file.d.ts +0 -5
- package/dist/util/index.d.ts +0 -183
- package/dist/util/map.d.ts +0 -6
- package/dist/util/pattern.d.ts +0 -1
- package/dist/util/time.d.ts +0 -39
- package/dist/util/uuid.d.ts +0 -3
- package/dist/util/wsl.d.ts +0 -2
- package/dist/version.d.ts +0 -2
- package/dist/webserver/backend/api.d.ts +0 -115
- package/dist/webserver/backend/calendar.d.ts +0 -5
- package/dist/webserver/backend/database.d.ts +0 -150
- package/dist/webserver/backend/index.d.ts +0 -30
- package/dist/webserver/backend/metrics.d.ts +0 -3
- package/dist/webserver/backend/types.d.ts +0 -114
- package/dist/webserver/backend/types.js +0 -3
- package/dist/webserver/backend/types.js.map +0 -1
- package/dist/webserver/backend/util.d.ts +0 -2
- package/dist/webserver/index.d.ts +0 -2
- package/dist/webserver/index.js +0 -9
- package/dist/webserver/index.js.map +0 -1
package/dist/plugin.d.ts
DELETED
|
@@ -1,916 +0,0 @@
|
|
|
1
|
-
import { EnvironmentPreset } from "./brickadia/presets";
|
|
2
|
-
import { BRBanList, BRPlayerNameCache, BRRoleAssignments, BRRoleSetup } from "./brickadia/types";
|
|
3
|
-
import { ILogMinigame, IMinigameList, IPlayerPositions, IServerStatus } from "./omegga/types";
|
|
4
|
-
import { ReadSaveObject, WriteSaveObject } from 'brs-js';
|
|
5
|
-
export declare const _OMEGGA_UTILS_IMPORT: {
|
|
6
|
-
chat: {
|
|
7
|
-
EMOTES: string[];
|
|
8
|
-
sanitize: (str: string) => string;
|
|
9
|
-
parseLinks: (message: string) => string;
|
|
10
|
-
attr: (attr: string, param?: string) => ((message: string) => string);
|
|
11
|
-
attrParam: <T = string>(attr: string) => (message: string, param: T) => string;
|
|
12
|
-
color: (message: string, param: string) => string;
|
|
13
|
-
bold: (message: string) => string;
|
|
14
|
-
italic: (message: string) => string;
|
|
15
|
-
underline: (message: string) => string;
|
|
16
|
-
emoji: (message: string) => string;
|
|
17
|
-
code: (message: string) => string;
|
|
18
|
-
font: (message: string, param: string) => string;
|
|
19
|
-
size: (message: string, param: number) => string;
|
|
20
|
-
link: (message: string, param: string) => string;
|
|
21
|
-
red: (message: string) => string;
|
|
22
|
-
green: (message: string) => string;
|
|
23
|
-
blue: (message: string) => string;
|
|
24
|
-
yellow: (message: string) => string;
|
|
25
|
-
cyan: (message: string) => string;
|
|
26
|
-
magenta: (message: string) => string;
|
|
27
|
-
black: (message: string) => string;
|
|
28
|
-
white: (message: string) => string;
|
|
29
|
-
gray: (message: string) => string;
|
|
30
|
-
};
|
|
31
|
-
color: {
|
|
32
|
-
hsv: typeof import("./util/color").hsv;
|
|
33
|
-
linearRGB: (rgba: number[]) => number[];
|
|
34
|
-
sRGB: (linear: number[]) => number[];
|
|
35
|
-
rgbToHex: (r: number | [number, number, number] | {
|
|
36
|
-
r: number;
|
|
37
|
-
g: number;
|
|
38
|
-
b: number;
|
|
39
|
-
}, g?: number, b?: number) => string;
|
|
40
|
-
DEFAULT_COLORSET: number[][];
|
|
41
|
-
};
|
|
42
|
-
uuid: {
|
|
43
|
-
UUID_PATTERN: RegExp;
|
|
44
|
-
match: (str: string) => boolean;
|
|
45
|
-
random: typeof import("crypto").randomUUID;
|
|
46
|
-
};
|
|
47
|
-
pattern: {
|
|
48
|
-
explode: (str: string) => RegExp;
|
|
49
|
-
};
|
|
50
|
-
time: {
|
|
51
|
-
parseDuration: typeof import("./util/time").parseDuration;
|
|
52
|
-
parseBrickadiaTime: typeof import("./util/time").parseBrickadiaTime;
|
|
53
|
-
debounce: (<T extends (...args: any) => any>(func: T, wait: number | undefined, options?: import("./util/time").DebounceSettingsLeading) => import("./util/time").DebouncedFuncLeading<T>) | (<T extends (...args: any) => any>(func: T, wait?: number, options?: import("./util/time").DebounceSettings) => import("./util/time").DebouncedFunc<T>);
|
|
54
|
-
};
|
|
55
|
-
map: {
|
|
56
|
-
DEFAULT_MAPS: {
|
|
57
|
-
name: string;
|
|
58
|
-
brName: string;
|
|
59
|
-
}[];
|
|
60
|
-
brn2n: typeof import("./util/map").brn2n;
|
|
61
|
-
n2brn: typeof import("./util/map").n2brn;
|
|
62
|
-
};
|
|
63
|
-
brick: {
|
|
64
|
-
BRICK_CONSTANTS: {
|
|
65
|
-
rotationTable: number[];
|
|
66
|
-
translationTable: (([x, y, z]: [number, number, number]) => [number, number, number])[];
|
|
67
|
-
orientationMap: Record<string, [number, number]>;
|
|
68
|
-
DEFAULT_MATERIALS: string[];
|
|
69
|
-
brickSizeMap: Record<string, [number, number, number]>;
|
|
70
|
-
};
|
|
71
|
-
checkBounds: typeof import("./util/brick").checkBounds;
|
|
72
|
-
getBounds: typeof import("./util/brick").getBounds;
|
|
73
|
-
getBrickSize: typeof import("./util/brick").getBrickSize;
|
|
74
|
-
getScaleAxis: typeof import("./util/brick").getScaleAxis;
|
|
75
|
-
setOwnership: typeof import("./util/brick").setOwnership;
|
|
76
|
-
rotate: typeof import("./util/brick").rotate;
|
|
77
|
-
rotate_x: typeof import("./util/brick").rotate_x;
|
|
78
|
-
rotate_y: typeof import("./util/brick").rotate_y;
|
|
79
|
-
rotate_z: typeof import("./util/brick").rotate_z;
|
|
80
|
-
d2o: (direction: number, rotation: number) => number;
|
|
81
|
-
o2d: (orientation: number) => number[];
|
|
82
|
-
};
|
|
83
|
-
wsl: () => number;
|
|
84
|
-
brs: {
|
|
85
|
-
read(rawBytes: Uint8Array, options?: {
|
|
86
|
-
bricks?: boolean;
|
|
87
|
-
preview?: boolean;
|
|
88
|
-
}): ReadSaveObject;
|
|
89
|
-
write(save: WriteSaveObject, options?: {
|
|
90
|
-
compress?: boolean;
|
|
91
|
-
}): Uint8Array;
|
|
92
|
-
utils: any;
|
|
93
|
-
constants: {
|
|
94
|
-
MAGIC: Uint8Array;
|
|
95
|
-
LATEST_VERSION: number;
|
|
96
|
-
MAX_INT: number;
|
|
97
|
-
DEFAULT_UUID: import("brs-js").Uuid;
|
|
98
|
-
};
|
|
99
|
-
};
|
|
100
|
-
};
|
|
101
|
-
declare global {
|
|
102
|
-
export var Omegga: OmeggaLike;
|
|
103
|
-
export var Player: StaticPlayer;
|
|
104
|
-
export var OMEGGA_UTIL: typeof _OMEGGA_UTILS_IMPORT;
|
|
105
|
-
}
|
|
106
|
-
export * from "./brickadia/types";
|
|
107
|
-
export * from "./omegga/types";
|
|
108
|
-
export { OmeggaPlugin };
|
|
109
|
-
export type OL = OmeggaLike;
|
|
110
|
-
export type OP = OmeggaPlugin;
|
|
111
|
-
export type PC<T extends Record<string, unknown> = Record<string, unknown>> = PluginConfig<T>;
|
|
112
|
-
export type PS<T extends Record<string, unknown> = Record<string, unknown>> = PluginStore<T>;
|
|
113
|
-
export interface BrickBounds {
|
|
114
|
-
minBound: [number, number, number];
|
|
115
|
-
maxBound: [number, number, number];
|
|
116
|
-
center: [number, number, number];
|
|
117
|
-
}
|
|
118
|
-
/** Created when a player clicks on a brick with an interact component */
|
|
119
|
-
export interface BrickInteraction {
|
|
120
|
-
/** Brick name from catalog (Turkey Body, 4x Cube) */
|
|
121
|
-
brick_name: string;
|
|
122
|
-
/** Brick asset name */
|
|
123
|
-
brick_asset: string;
|
|
124
|
-
/** Brick size */
|
|
125
|
-
brick_size: [number, number, number];
|
|
126
|
-
/** Player information, id, name, controller, and pawn */
|
|
127
|
-
player: {
|
|
128
|
-
id: string;
|
|
129
|
-
name: string;
|
|
130
|
-
controller: string;
|
|
131
|
-
pawn: string;
|
|
132
|
-
};
|
|
133
|
-
/** Brick center position */
|
|
134
|
-
position: [number, number, number];
|
|
135
|
-
/** message sent from a brick click interaction */
|
|
136
|
-
message: string;
|
|
137
|
-
/** data parsed from the line (if it starts with json:) */
|
|
138
|
-
data: null | number | string | boolean | Record<string, unknown>;
|
|
139
|
-
/** True when there was a json payload */
|
|
140
|
-
json: boolean;
|
|
141
|
-
/** True when there was a parse error */
|
|
142
|
-
error: boolean;
|
|
143
|
-
}
|
|
144
|
-
/** AutoRestart options */
|
|
145
|
-
export type AutoRestartConfig = {
|
|
146
|
-
players: boolean;
|
|
147
|
-
announcement: boolean;
|
|
148
|
-
saveWorld: boolean;
|
|
149
|
-
};
|
|
150
|
-
export interface OmeggaPlayer {
|
|
151
|
-
/** player name */
|
|
152
|
-
name: string;
|
|
153
|
-
/** player display name */
|
|
154
|
-
displayName: string;
|
|
155
|
-
/** player uuid */
|
|
156
|
-
id: string;
|
|
157
|
-
/** player controller id */
|
|
158
|
-
controller: string;
|
|
159
|
-
/** player state id */
|
|
160
|
-
state: string;
|
|
161
|
-
/**
|
|
162
|
-
* Returns omegga
|
|
163
|
-
*/
|
|
164
|
-
getOmegga(): OmeggaLike;
|
|
165
|
-
/**
|
|
166
|
-
* Clone a player
|
|
167
|
-
*/
|
|
168
|
-
clone(): OmeggaPlayer;
|
|
169
|
-
/**
|
|
170
|
-
* Get raw player info (to feed into a constructor)
|
|
171
|
-
*/
|
|
172
|
-
raw(): [string, string, string, string, string];
|
|
173
|
-
/**
|
|
174
|
-
* True if the player is the host
|
|
175
|
-
*/
|
|
176
|
-
isHost(): boolean;
|
|
177
|
-
/**
|
|
178
|
-
* Clear player's bricks
|
|
179
|
-
* @param quiet clear bricks quietly
|
|
180
|
-
*/
|
|
181
|
-
clearBricks(quiet?: boolean): void;
|
|
182
|
-
/**
|
|
183
|
-
* Get player's roles, if any
|
|
184
|
-
*/
|
|
185
|
-
getRoles(): readonly string[];
|
|
186
|
-
/**
|
|
187
|
-
* Get player's permissions in a map like `{"Bricks.ClearOwn": true, ...}`
|
|
188
|
-
* @return permissions map
|
|
189
|
-
*/
|
|
190
|
-
getPermissions(): Record<string, boolean>;
|
|
191
|
-
/**
|
|
192
|
-
* Get player's name color
|
|
193
|
-
* @return 6 character hex string
|
|
194
|
-
*/
|
|
195
|
-
getNameColor(): string;
|
|
196
|
-
/**
|
|
197
|
-
* Get the player's pawn
|
|
198
|
-
* @return pawn
|
|
199
|
-
*/
|
|
200
|
-
getPawn(): Promise<string>;
|
|
201
|
-
/**
|
|
202
|
-
* Get player's position
|
|
203
|
-
* @return [x, y, z] coordinates
|
|
204
|
-
*/
|
|
205
|
-
getPosition(): Promise<[number, number, number]>;
|
|
206
|
-
/**
|
|
207
|
-
* Gets a user's ghost brick info (by uuid, name, controller, or player object)
|
|
208
|
-
* @return ghost brick data
|
|
209
|
-
*/
|
|
210
|
-
getGhostBrick(): Promise<{
|
|
211
|
-
targetGrid: string;
|
|
212
|
-
location: number[];
|
|
213
|
-
orientation: string;
|
|
214
|
-
}>;
|
|
215
|
-
/**
|
|
216
|
-
* gets a user's paint tool properties
|
|
217
|
-
*/
|
|
218
|
-
getPaint(): Promise<{
|
|
219
|
-
materialIndex: string;
|
|
220
|
-
materialAlpha: string;
|
|
221
|
-
material: string;
|
|
222
|
-
color: number[];
|
|
223
|
-
}>;
|
|
224
|
-
/**
|
|
225
|
-
* gets whether or not the player is crouching
|
|
226
|
-
*/
|
|
227
|
-
isCrouched(pawn?: string): Promise<boolean>;
|
|
228
|
-
/**
|
|
229
|
-
* gets whether or not the player is dead
|
|
230
|
-
*/
|
|
231
|
-
isDead(pawn?: string): Promise<boolean>;
|
|
232
|
-
/**
|
|
233
|
-
* Gets the bounds of the template in the user's clipboard (bounds of original selection box)
|
|
234
|
-
* @return template bounds
|
|
235
|
-
*/
|
|
236
|
-
getTemplateBounds(): Promise<BrickBounds>;
|
|
237
|
-
/**
|
|
238
|
-
* Get bricks inside template bounds
|
|
239
|
-
* @return BRS JS Save Data
|
|
240
|
-
*/
|
|
241
|
-
getTemplateBoundsData(): Promise<ReadSaveObject>;
|
|
242
|
-
/**
|
|
243
|
-
* Load bricks at ghost brick location
|
|
244
|
-
* @param saveData save data to load
|
|
245
|
-
*/
|
|
246
|
-
loadDataAtGhostBrick(saveData: WriteSaveObject, options?: {
|
|
247
|
-
rotate?: boolean;
|
|
248
|
-
offX?: number;
|
|
249
|
-
offY?: number;
|
|
250
|
-
offZ?: number;
|
|
251
|
-
quiet?: boolean;
|
|
252
|
-
}): Promise<void>;
|
|
253
|
-
/**
|
|
254
|
-
* Load bricks on this player's clipboard
|
|
255
|
-
* @param saveName Save to load
|
|
256
|
-
*/
|
|
257
|
-
loadBricks(saveName: string): void;
|
|
258
|
-
/**
|
|
259
|
-
* Load bricks on this player's clipboard passing save data
|
|
260
|
-
* @param saveData save data to load
|
|
261
|
-
*/
|
|
262
|
-
loadSaveData(saveData: WriteSaveObject, options?: {
|
|
263
|
-
rotate?: boolean;
|
|
264
|
-
offX?: number;
|
|
265
|
-
offY?: number;
|
|
266
|
-
offZ?: number;
|
|
267
|
-
quiet?: boolean;
|
|
268
|
-
}): Promise<void>;
|
|
269
|
-
/**
|
|
270
|
-
* Kills this player
|
|
271
|
-
*/
|
|
272
|
-
kill(): void;
|
|
273
|
-
/**
|
|
274
|
-
* Damages a player
|
|
275
|
-
* @param amount Amount to damage
|
|
276
|
-
*/
|
|
277
|
-
damage(amount: number): void;
|
|
278
|
-
/**
|
|
279
|
-
* Heal this player
|
|
280
|
-
* @param amount to heal
|
|
281
|
-
*/
|
|
282
|
-
heal(amount: number): void;
|
|
283
|
-
/**
|
|
284
|
-
* Gives a player an item
|
|
285
|
-
* @param item Item name (Weapon_Bow)
|
|
286
|
-
*/
|
|
287
|
-
giveItem(item: WeaponClass): void;
|
|
288
|
-
/**
|
|
289
|
-
* Removes an item from a player's inventory
|
|
290
|
-
* @param item Item name (Weapon_Bow)
|
|
291
|
-
*/
|
|
292
|
-
takeItem(item: WeaponClass): void;
|
|
293
|
-
/**
|
|
294
|
-
* Changes a player's team
|
|
295
|
-
* @param teamIndex Team index
|
|
296
|
-
*/
|
|
297
|
-
setTeam(teamIndex: number): void;
|
|
298
|
-
/**
|
|
299
|
-
* Changes a player's minigame
|
|
300
|
-
* @param index Minigame index
|
|
301
|
-
*/
|
|
302
|
-
setMinigame(index: number): void;
|
|
303
|
-
/**
|
|
304
|
-
* Changes a player's score
|
|
305
|
-
* @param minigameIndex minigame index
|
|
306
|
-
* @param score Score
|
|
307
|
-
*/
|
|
308
|
-
setScore(minigameIndex: number, score: number): void;
|
|
309
|
-
/**
|
|
310
|
-
* Fetch a player's score
|
|
311
|
-
* @param minigameIndex minigame index
|
|
312
|
-
*/
|
|
313
|
-
getScore(minigameIndex: number): Promise<number>;
|
|
314
|
-
}
|
|
315
|
-
export interface StaticPlayer {
|
|
316
|
-
/**
|
|
317
|
-
* get a player's roles, if any
|
|
318
|
-
* @param omegga omegga instance
|
|
319
|
-
* @param id player uuid
|
|
320
|
-
* @return list of roles
|
|
321
|
-
*/
|
|
322
|
-
getRoles(omegga: OmeggaLike, id: string): readonly string[];
|
|
323
|
-
/**
|
|
324
|
-
* get a player's permissions in a map like `{"Bricks.ClearOwn": true, ...}`
|
|
325
|
-
* @param omegga Omegga instance
|
|
326
|
-
* @param id player uuid
|
|
327
|
-
* @return permissions map
|
|
328
|
-
*/
|
|
329
|
-
getPermissions(omegga: OmeggaLike, id: string): Record<string, boolean>;
|
|
330
|
-
/**
|
|
331
|
-
* Kills a player
|
|
332
|
-
* @param omegga Omegga instance
|
|
333
|
-
* @param target Player or player name/id
|
|
334
|
-
*/
|
|
335
|
-
kill(omegga: OmeggaLike, target: string | OmeggaPlayer): void;
|
|
336
|
-
/**
|
|
337
|
-
* Damages a player
|
|
338
|
-
* @param omegga Omegga instance
|
|
339
|
-
* @param target Player or player name/id
|
|
340
|
-
* @param amount Damage amount
|
|
341
|
-
*/
|
|
342
|
-
damage(omegga: OmeggaLike, target: string | OmeggaPlayer, amount: number): void;
|
|
343
|
-
/**
|
|
344
|
-
* Heal a player
|
|
345
|
-
* @param omegga Omegga instance
|
|
346
|
-
* @param target Player or player name/id
|
|
347
|
-
* @param amount Heal amount
|
|
348
|
-
*/
|
|
349
|
-
heal(omegga: OmeggaLike, target: string | OmeggaPlayer, amount: number): void;
|
|
350
|
-
/**
|
|
351
|
-
* Gives a player an item
|
|
352
|
-
* @param omegga Omegga instance
|
|
353
|
-
* @param target Player or player name/id
|
|
354
|
-
* @param item Item name (Weapon_Bow)
|
|
355
|
-
*/
|
|
356
|
-
giveItem(omegga: OmeggaLike, target: string | OmeggaPlayer, item: WeaponClass): void;
|
|
357
|
-
/**
|
|
358
|
-
* Removes an item from a player's inventory
|
|
359
|
-
* @param omegga Omegga instance
|
|
360
|
-
* @param target Player or player name/id
|
|
361
|
-
* @param item Item name (Weapon_Bow)
|
|
362
|
-
*/
|
|
363
|
-
takeItem(omegga: OmeggaLike, target: string | OmeggaPlayer, item: WeaponClass): void;
|
|
364
|
-
/**
|
|
365
|
-
* Changes a player's team
|
|
366
|
-
* @param omegga Omegga instance
|
|
367
|
-
* @param target Player or player name/id
|
|
368
|
-
* @param teamIndex Team name? index?
|
|
369
|
-
*/
|
|
370
|
-
setTeam(omegga: OmeggaLike, target: string | OmeggaPlayer, teamIndex: number): void;
|
|
371
|
-
/**
|
|
372
|
-
* Changes a player's minigame
|
|
373
|
-
* @param omegga Omegga instance
|
|
374
|
-
* @param target Player or player name/id
|
|
375
|
-
* @param index Minigame index
|
|
376
|
-
*/
|
|
377
|
-
setMinigame(omegga: OmeggaLike, target: string | OmeggaPlayer, index: number): void;
|
|
378
|
-
/**
|
|
379
|
-
* Changes a player's score
|
|
380
|
-
* @param omegga Omegga instance
|
|
381
|
-
* @param target Player or player name/id
|
|
382
|
-
* @param minigameIndex minigame index
|
|
383
|
-
* @param score Score
|
|
384
|
-
*/
|
|
385
|
-
setScore(omegga: OmeggaLike, target: string | OmeggaPlayer, minigameIndex: number, score: number): void;
|
|
386
|
-
/**
|
|
387
|
-
* Fetches a player's score
|
|
388
|
-
* @param omegga Omegga instance
|
|
389
|
-
* @param target Player or player name/id
|
|
390
|
-
* @param minigameIndex minigame index
|
|
391
|
-
*/
|
|
392
|
-
getScore(omegga: OmeggaLike, target: string | OmeggaPlayer, minigameIndex: number): Promise<number>;
|
|
393
|
-
}
|
|
394
|
-
export interface InjectedCommands {
|
|
395
|
-
/** Get server status */
|
|
396
|
-
getServerStatus(this: OmeggaLike): Promise<IServerStatus>;
|
|
397
|
-
/** Get a list of minigames and their indices */
|
|
398
|
-
listMinigames(this: OmeggaLike): Promise<IMinigameList>;
|
|
399
|
-
/** Get all player positions and pawns */
|
|
400
|
-
getAllPlayerPositions(this: OmeggaLike): Promise<IPlayerPositions>;
|
|
401
|
-
/** Get minigames and members */
|
|
402
|
-
getMinigames(this: OmeggaLike): Promise<ILogMinigame[]>;
|
|
403
|
-
}
|
|
404
|
-
export interface MockEventEmitter {
|
|
405
|
-
addListener(event: string, listener: Function): this;
|
|
406
|
-
emit(event: string, ...args: any[]): boolean;
|
|
407
|
-
eventNames(): (string | symbol)[];
|
|
408
|
-
getMaxListeners(): number;
|
|
409
|
-
listenerCount(event: string): number;
|
|
410
|
-
listeners(event: string): Function[];
|
|
411
|
-
off(event: string, listener: Function): this;
|
|
412
|
-
on(event: string, listener: Function): this;
|
|
413
|
-
once(event: string, listener: Function): this;
|
|
414
|
-
prependListener(event: string, listener: Function): this;
|
|
415
|
-
prependOnceListener(event: string, listener: Function): this;
|
|
416
|
-
rawListeners(event: string): Function[];
|
|
417
|
-
removeAllListeners(event?: string): this;
|
|
418
|
-
removeListener(event: string, listener: Function): this;
|
|
419
|
-
setMaxListeners(maxListeners: number): this;
|
|
420
|
-
on(event: 'close', listener: () => void): this;
|
|
421
|
-
on(event: 'line', listener: (line: string) => void): this;
|
|
422
|
-
on(event: 'start', listener: (info: {
|
|
423
|
-
map: string;
|
|
424
|
-
}) => void): this;
|
|
425
|
-
on(event: 'version', listener: (version: number) => void): this;
|
|
426
|
-
on(event: 'unauthorized', listener: () => void): this;
|
|
427
|
-
on(event: 'join', listener: (player: OmeggaPlayer) => void): this;
|
|
428
|
-
on(event: 'leave', listener: (player: OmeggaPlayer) => void): this;
|
|
429
|
-
on(event: 'chat', listener: (name: string, message: string) => void): this;
|
|
430
|
-
on(event: 'mapchange', listener: (info: {
|
|
431
|
-
map: string;
|
|
432
|
-
}) => void): this;
|
|
433
|
-
on(event: 'autorestart', listener: (config: AutoRestartConfig) => void): this;
|
|
434
|
-
on(event: 'interact', listener: (interaction: BrickInteraction) => void): this;
|
|
435
|
-
on(event: 'minigamejoin', listener: (info: {
|
|
436
|
-
player: {
|
|
437
|
-
name: string;
|
|
438
|
-
id: string;
|
|
439
|
-
};
|
|
440
|
-
minigameName: string;
|
|
441
|
-
}) => void): this;
|
|
442
|
-
}
|
|
443
|
-
export interface OmeggaLike extends OmeggaCore, LogWrangling, InjectedCommands, MockEventEmitter {
|
|
444
|
-
writeln(line: string): void;
|
|
445
|
-
/** game CL version*/
|
|
446
|
-
version: number;
|
|
447
|
-
/** verbose logging is enabled*/
|
|
448
|
-
verbose: boolean;
|
|
449
|
-
/** list of players */
|
|
450
|
-
players: OmeggaPlayer[];
|
|
451
|
-
/** server host */
|
|
452
|
-
host?: {
|
|
453
|
-
id: string;
|
|
454
|
-
name: string;
|
|
455
|
-
};
|
|
456
|
-
/** server is started */
|
|
457
|
-
started: boolean;
|
|
458
|
-
/** server is starting */
|
|
459
|
-
starting: boolean;
|
|
460
|
-
/** server is stopping */
|
|
461
|
-
stopping: boolean;
|
|
462
|
-
/** current map */
|
|
463
|
-
currentMap: string;
|
|
464
|
-
/** path to config files */
|
|
465
|
-
configPath: string;
|
|
466
|
-
/** path to saves */
|
|
467
|
-
savePath: string;
|
|
468
|
-
/** path to worlds */
|
|
469
|
-
worldPath: string;
|
|
470
|
-
/** path to presets */
|
|
471
|
-
presetPath: string;
|
|
472
|
-
/** get a plugin's name, documentation, and loaded status
|
|
473
|
-
* If run in an unsafe plugin, the emitPlugin method sends events from
|
|
474
|
-
* an "unsafe" plugin
|
|
475
|
-
*/
|
|
476
|
-
getPlugin(name: string): Promise<PluginInterop>;
|
|
477
|
-
}
|
|
478
|
-
export interface OmeggaCore {
|
|
479
|
-
/**
|
|
480
|
-
* get a list of players
|
|
481
|
-
* @return list of players {id: uuid, name: name} objects
|
|
482
|
-
*/
|
|
483
|
-
getPlayers(): {
|
|
484
|
-
id: string;
|
|
485
|
-
name: string;
|
|
486
|
-
displayName: string;
|
|
487
|
-
controller: string;
|
|
488
|
-
state: string;
|
|
489
|
-
}[];
|
|
490
|
-
/**
|
|
491
|
-
* find a player by name, id, controller, or state
|
|
492
|
-
* @param target - name, id, controller, or state
|
|
493
|
-
*/
|
|
494
|
-
getPlayer(target: string): OmeggaPlayer | null;
|
|
495
|
-
/**
|
|
496
|
-
* find a player by rough name, prioritize exact matches and get fuzzier
|
|
497
|
-
* @param name player name, fuzzy
|
|
498
|
-
*/
|
|
499
|
-
findPlayerByName(name: string): OmeggaPlayer | null;
|
|
500
|
-
/**
|
|
501
|
-
* get the host's ID
|
|
502
|
-
* @return Host Id
|
|
503
|
-
*/
|
|
504
|
-
getHostId(): string;
|
|
505
|
-
/**
|
|
506
|
-
* broadcast messages to chat
|
|
507
|
-
* messages are broken by new line
|
|
508
|
-
* multiple arguments are additional lines
|
|
509
|
-
* all messages longer than 512 characters are deleted automatically, though omegga wouldn't have sent them anyway
|
|
510
|
-
* @param messages unescaped chat messages to send. may need to wrap messages with quotes
|
|
511
|
-
*/
|
|
512
|
-
broadcast(...messages: string[]): void;
|
|
513
|
-
/**
|
|
514
|
-
* whisper messages to a player's chat
|
|
515
|
-
* messages are broken by new line
|
|
516
|
-
* multiple arguments are additional lines
|
|
517
|
-
* all messages longer than 512 characters are deleted automatically, though omegga wouldn't have sent them anyway
|
|
518
|
-
* @param target - player identifier or player object
|
|
519
|
-
* @param messages - unescaped chat messages to send. may need to wrap messages with quotes
|
|
520
|
-
*/
|
|
521
|
-
whisper(target: string | OmeggaPlayer, ...messages: string[]): void;
|
|
522
|
-
/**
|
|
523
|
-
* prints text to the middle of a player's screen
|
|
524
|
-
* all messages longer than 512 characters are deleted automatically
|
|
525
|
-
* @param target - player identifier or player object
|
|
526
|
-
* @param message - unescaped chat messages to send. may need to wrap messages with quotes
|
|
527
|
-
*/
|
|
528
|
-
middlePrint(target: string | OmeggaPlayer, message: string): void;
|
|
529
|
-
/**
|
|
530
|
-
* Save a minigame preset based on a minigame index
|
|
531
|
-
* @param index minigame index
|
|
532
|
-
* @param name preset name
|
|
533
|
-
*/
|
|
534
|
-
saveMinigame(index: number, name: string): void;
|
|
535
|
-
/**
|
|
536
|
-
* Delete a minigame
|
|
537
|
-
* @param index minigame index
|
|
538
|
-
*/
|
|
539
|
-
deleteMinigame(index: number): void;
|
|
540
|
-
/**
|
|
541
|
-
* Reset a minigame
|
|
542
|
-
* @param index minigame index
|
|
543
|
-
*/
|
|
544
|
-
resetMinigame(index: number): void;
|
|
545
|
-
/**
|
|
546
|
-
* Force the next round in a minigame
|
|
547
|
-
* @param index minigame index
|
|
548
|
-
*/
|
|
549
|
-
nextRoundMinigame(index: number): void;
|
|
550
|
-
/**
|
|
551
|
-
* Load an Minigame preset
|
|
552
|
-
* @param presetName preset name
|
|
553
|
-
* @param owner owner id/name
|
|
554
|
-
*/
|
|
555
|
-
loadMinigame(presetName: string, owner?: string): void;
|
|
556
|
-
/**
|
|
557
|
-
* Get all presets in the minigame folder and child folders
|
|
558
|
-
*/
|
|
559
|
-
getMinigamePresets(): string[];
|
|
560
|
-
/**
|
|
561
|
-
* Reset the environment settings
|
|
562
|
-
*/
|
|
563
|
-
resetEnvironment(): void;
|
|
564
|
-
/**
|
|
565
|
-
* Save an environment preset
|
|
566
|
-
* @param presetName preset name
|
|
567
|
-
*/
|
|
568
|
-
saveEnvironment(presetName: string): Promise<void>;
|
|
569
|
-
/** Save a temporary environment preset and return its contents */
|
|
570
|
-
getEnvironmentData(): Promise<EnvironmentPreset>;
|
|
571
|
-
/**
|
|
572
|
-
* Read environment data as json
|
|
573
|
-
* @param presetName preset name
|
|
574
|
-
*/
|
|
575
|
-
readEnvironmentData(presetName: string): void;
|
|
576
|
-
/**
|
|
577
|
-
* Load an environment preset
|
|
578
|
-
* @param presetName preset name
|
|
579
|
-
*/
|
|
580
|
-
loadEnvironment(presetName: string): void;
|
|
581
|
-
/**
|
|
582
|
-
* Load some environment preset data
|
|
583
|
-
* @param preset preset data
|
|
584
|
-
*/
|
|
585
|
-
loadEnvironmentData(preset: EnvironmentPreset | EnvironmentPreset['data']['groups']): void;
|
|
586
|
-
/**
|
|
587
|
-
* Get all presets in the environment folder and child folders
|
|
588
|
-
*/
|
|
589
|
-
getEnvironmentPresets(): string[];
|
|
590
|
-
/**
|
|
591
|
-
* Clear a user's bricks (by uuid, name, controller, or player object)
|
|
592
|
-
* @param target player or player identifier
|
|
593
|
-
* @param quiet quietly clear bricks
|
|
594
|
-
*/
|
|
595
|
-
clearBricks(target: string | {
|
|
596
|
-
id: string;
|
|
597
|
-
}, quiet?: boolean): void;
|
|
598
|
-
/**
|
|
599
|
-
* Clear a region of bricks
|
|
600
|
-
* @param region region to clear
|
|
601
|
-
* @param options optional settings
|
|
602
|
-
*/
|
|
603
|
-
clearRegion(region: {
|
|
604
|
-
center: [number, number, number];
|
|
605
|
-
extent: [number, number, number];
|
|
606
|
-
}, options?: {
|
|
607
|
-
target?: string | OmeggaPlayer;
|
|
608
|
-
}): void;
|
|
609
|
-
/**
|
|
610
|
-
* Clear all bricks on the server
|
|
611
|
-
* @param quiet quietly clear bricks
|
|
612
|
-
*/
|
|
613
|
-
clearAllBricks(quiet?: boolean): void;
|
|
614
|
-
/**
|
|
615
|
-
* Save bricks under a filename
|
|
616
|
-
* @param saveName save file name
|
|
617
|
-
* @param region region of bricks to save
|
|
618
|
-
*/
|
|
619
|
-
saveBricks(saveName: string, region?: {
|
|
620
|
-
center: [number, number, number];
|
|
621
|
-
extent: [number, number, number];
|
|
622
|
-
}): void;
|
|
623
|
-
/**
|
|
624
|
-
* Save bricks under a filename, with a promise
|
|
625
|
-
* @param saveName save file name
|
|
626
|
-
* @param region region of bricks to save
|
|
627
|
-
*/
|
|
628
|
-
saveBricksAsync(saveName: string, region?: {
|
|
629
|
-
center: [number, number, number];
|
|
630
|
-
extent: [number, number, number];
|
|
631
|
-
}): Promise<void>;
|
|
632
|
-
/**
|
|
633
|
-
* Load bricks on the server
|
|
634
|
-
*/
|
|
635
|
-
loadBricks(saveName: string, options?: {
|
|
636
|
-
offX?: number;
|
|
637
|
-
offY?: number;
|
|
638
|
-
offZ?: number;
|
|
639
|
-
quiet?: boolean;
|
|
640
|
-
correctPalette?: boolean;
|
|
641
|
-
correctCustom?: boolean;
|
|
642
|
-
}): void;
|
|
643
|
-
/**
|
|
644
|
-
* Load bricks on the server into a player's clipbaord
|
|
645
|
-
*/
|
|
646
|
-
loadBricksOnPlayer(saveName: string, player: string | OmeggaPlayer, options?: {
|
|
647
|
-
offX?: number;
|
|
648
|
-
offY?: number;
|
|
649
|
-
offZ?: number;
|
|
650
|
-
correctPalette?: boolean;
|
|
651
|
-
correctCustom?: boolean;
|
|
652
|
-
}): void;
|
|
653
|
-
/**
|
|
654
|
-
* Get all saves in the save folder and child folders
|
|
655
|
-
*/
|
|
656
|
-
getSaves(): string[];
|
|
657
|
-
/**
|
|
658
|
-
* Checks if a save exists and returns an absolute path
|
|
659
|
-
* @param saveName Save filename
|
|
660
|
-
* @return Path to string
|
|
661
|
-
*/
|
|
662
|
-
getSavePath(saveName: string): string;
|
|
663
|
-
/**
|
|
664
|
-
* Get all worlds in the worlds folder and child folders
|
|
665
|
-
*/
|
|
666
|
-
getWorlds(): string[];
|
|
667
|
-
/**
|
|
668
|
-
* Checks if a world exists and returns an absolute path
|
|
669
|
-
* @param worldName World name
|
|
670
|
-
* @return Path to string
|
|
671
|
-
*/
|
|
672
|
-
getWorldPath(worldName: string): string;
|
|
673
|
-
/**
|
|
674
|
-
* Get a list of revisions for a world
|
|
675
|
-
* @param worldName World name
|
|
676
|
-
*/
|
|
677
|
-
getWorldRevisions(worldName: string): Promise<{
|
|
678
|
-
index: number;
|
|
679
|
-
date: Date;
|
|
680
|
-
note: string;
|
|
681
|
-
}[]>;
|
|
682
|
-
/**
|
|
683
|
-
* Load a world by its name
|
|
684
|
-
* @param worldName World name
|
|
685
|
-
*/
|
|
686
|
-
loadWorld(worldName: string): Promise<boolean>;
|
|
687
|
-
/**
|
|
688
|
-
* Load a world at a specific revision
|
|
689
|
-
* @param worldName World name
|
|
690
|
-
*/
|
|
691
|
-
loadWorldRevision(worldName: string, revision: number): Promise<boolean>;
|
|
692
|
-
/**
|
|
693
|
-
* Save a world as a new name
|
|
694
|
-
* @param worldName World name
|
|
695
|
-
*/
|
|
696
|
-
saveWorldAs(worldName: string): Promise<boolean>;
|
|
697
|
-
/**
|
|
698
|
-
* Save the current world
|
|
699
|
-
*/
|
|
700
|
-
saveWorld(): Promise<boolean>;
|
|
701
|
-
/**
|
|
702
|
-
* Create an empty world with the given name
|
|
703
|
-
*/
|
|
704
|
-
createEmptyWorld(worldName: string): Promise<boolean>;
|
|
705
|
-
/**
|
|
706
|
-
* unsafely load save data (wrap in try/catch)
|
|
707
|
-
* @param saveName save file name
|
|
708
|
-
* @param saveData BRS JS Save data
|
|
709
|
-
*/
|
|
710
|
-
writeSaveData(saveName: string, saveData: WriteSaveObject): void;
|
|
711
|
-
/**
|
|
712
|
-
* unsafely read save data (wrap in try/catch)
|
|
713
|
-
* @param saveName save file name
|
|
714
|
-
* @param nobricks only read save header data
|
|
715
|
-
* @return BRS JS Save Data
|
|
716
|
-
*/
|
|
717
|
-
readSaveData(saveName: string, nobricks?: boolean): ReadSaveObject;
|
|
718
|
-
/**
|
|
719
|
-
* load bricks from save data and resolve when game finishes loading
|
|
720
|
-
* @param saveData BRS JS Save data
|
|
721
|
-
*/
|
|
722
|
-
loadSaveData(saveData: WriteSaveObject, options?: {
|
|
723
|
-
offX?: number;
|
|
724
|
-
offY?: number;
|
|
725
|
-
offZ?: number;
|
|
726
|
-
quiet?: boolean;
|
|
727
|
-
correctPalette?: boolean;
|
|
728
|
-
correctCustom?: boolean;
|
|
729
|
-
}): Promise<void>;
|
|
730
|
-
/**
|
|
731
|
-
* load bricks from save data and resolve when game finishes loading
|
|
732
|
-
* @param saveData BRS JS Save data
|
|
733
|
-
* @param player Player name/id or player object
|
|
734
|
-
*/
|
|
735
|
-
loadSaveDataOnPlayer(saveData: WriteSaveObject, player: string | OmeggaPlayer, options?: {
|
|
736
|
-
offX?: number;
|
|
737
|
-
offY?: number;
|
|
738
|
-
offZ?: number;
|
|
739
|
-
correctPalette?: boolean;
|
|
740
|
-
correctCustom?: boolean;
|
|
741
|
-
}): Promise<void>;
|
|
742
|
-
/**
|
|
743
|
-
* get current bricks as save data
|
|
744
|
-
*/
|
|
745
|
-
getSaveData(region?: {
|
|
746
|
-
center: [number, number, number];
|
|
747
|
-
extent: [number, number, number];
|
|
748
|
-
}): Promise<ReadSaveObject>;
|
|
749
|
-
/**
|
|
750
|
-
* Change server map
|
|
751
|
-
* @param map Map name
|
|
752
|
-
*/
|
|
753
|
-
changeMap(map: string): Promise<boolean>;
|
|
754
|
-
/**
|
|
755
|
-
* Get up-to-date role setup from RoleSetup.json
|
|
756
|
-
*/
|
|
757
|
-
getRoleSetup(): BRRoleSetup;
|
|
758
|
-
/**
|
|
759
|
-
* Get up-to-date role assignments from RoleAssignment.json
|
|
760
|
-
*/
|
|
761
|
-
getRoleAssignments(): BRRoleAssignments;
|
|
762
|
-
/**
|
|
763
|
-
* Get up-to-date ban list from BanList.json
|
|
764
|
-
*/
|
|
765
|
-
getBanList(): BRBanList;
|
|
766
|
-
/**
|
|
767
|
-
* Get up-to-date name cache from PlayerNameCache.json
|
|
768
|
-
*/
|
|
769
|
-
getNameCache(): BRPlayerNameCache;
|
|
770
|
-
}
|
|
771
|
-
/** A simple document store for plugins */
|
|
772
|
-
export interface PluginStore<Storage extends Record<string, unknown> = Record<string, unknown>> {
|
|
773
|
-
/** Get a value from plugin storage */
|
|
774
|
-
get<T extends keyof Storage>(key: T): Promise<Storage[T]>;
|
|
775
|
-
/** Set a value to plugin storage */
|
|
776
|
-
set<T extends keyof Storage>(key: T, value: Storage[T]): Promise<void>;
|
|
777
|
-
/** Delete a value from plugin storage */
|
|
778
|
-
delete(key: string): Promise<void>;
|
|
779
|
-
/** Wipe all values in plugin storage */
|
|
780
|
-
wipe(): Promise<void>;
|
|
781
|
-
/** Count entries in plugin storage */
|
|
782
|
-
count(): Promise<number>;
|
|
783
|
-
/** Get a list of keys in plugin storage */
|
|
784
|
-
keys(): Promise<(keyof Storage)[]>;
|
|
785
|
-
}
|
|
786
|
-
/** A config representative of the config outlined in doc.json */
|
|
787
|
-
export type PluginConfig<T extends Record<string, unknown> = Record<string, unknown>> = T;
|
|
788
|
-
/** An omegga plugin */
|
|
789
|
-
export default abstract class OmeggaPlugin<Config extends Record<string, unknown> = Record<string, unknown>, Storage extends Record<string, unknown> = Record<string, unknown>> {
|
|
790
|
-
omegga: OmeggaLike;
|
|
791
|
-
config: PluginConfig<Config>;
|
|
792
|
-
store: PluginStore<Storage>;
|
|
793
|
-
constructor(omegga: OmeggaLike, config: PluginConfig<Config>, store: PluginStore<Storage>);
|
|
794
|
-
/** Run when plugin starts, returns /commands it uses */
|
|
795
|
-
abstract init(): Promise<void | {
|
|
796
|
-
registeredCommands?: string[];
|
|
797
|
-
}>;
|
|
798
|
-
/** Run when plugin is stopped */
|
|
799
|
-
abstract stop(): Promise<void>;
|
|
800
|
-
/** Run when another plugin tries to interact with this plugin
|
|
801
|
-
* @param event Event name
|
|
802
|
-
* @param from Name of origin plugin
|
|
803
|
-
* @return value other plugin expects
|
|
804
|
-
*/
|
|
805
|
-
abstract pluginEvent?(event: string, from: string, ...args: any[]): Promise<unknown>;
|
|
806
|
-
}
|
|
807
|
-
export interface LogWrangling {
|
|
808
|
-
/** Add a passive pattern on console output that invokes callback on match */
|
|
809
|
-
addMatcher<T>(pattern: IMatcher<T>['pattern'], callback: IMatcher<T>['callback']): void;
|
|
810
|
-
/** Run an active pattern on console output that resolves a match */
|
|
811
|
-
addWatcher<T = RegExpMatchArray>(pattern: IWatcher<T>['pattern'], options?: {
|
|
812
|
-
timeoutDelay?: number;
|
|
813
|
-
bundle?: boolean;
|
|
814
|
-
debounce?: boolean;
|
|
815
|
-
afterMatchDelay?: number;
|
|
816
|
-
last?: IWatcher<T>['last'];
|
|
817
|
-
exec?: () => void;
|
|
818
|
-
}): Promise<IWatcher<T>['matches']>;
|
|
819
|
-
/** Run a command and capture bundled output */
|
|
820
|
-
watchLogChunk<T = string>(cmd: string, pattern: IWatcher<T>['pattern'], options?: {
|
|
821
|
-
first?: 'index' | ((match: T) => boolean);
|
|
822
|
-
last?: IWatcher<T>['last'];
|
|
823
|
-
afterMatchDelay?: number;
|
|
824
|
-
timeoutDelay?: number;
|
|
825
|
-
}): Promise<IWatcher<T>['matches']>;
|
|
826
|
-
/** Run a command and capture bundled output for array functions */
|
|
827
|
-
watchLogArray<Item extends Record<string, string> = Record<string, string>, Member extends Record<string, string> = Record<string, string>>(cmd: string, itemPattern: RegExp, memberPattern: RegExp): Promise<{
|
|
828
|
-
item: Item;
|
|
829
|
-
members: Member[];
|
|
830
|
-
}[]>;
|
|
831
|
-
}
|
|
832
|
-
export type WatcherPattern<T> = (line: string, match: RegExpMatchArray) => T | RegExpMatchArray | '[OMEGGA_WATCHER_DONE]';
|
|
833
|
-
export type IMatcher<T> = {
|
|
834
|
-
pattern: RegExp;
|
|
835
|
-
callback: (match: RegExpMatchArray) => boolean;
|
|
836
|
-
} | {
|
|
837
|
-
pattern: (line: string, match: RegExpMatchArray) => T;
|
|
838
|
-
callback: (match: RegExpMatchArray) => T;
|
|
839
|
-
};
|
|
840
|
-
export type IWatcher<T> = {
|
|
841
|
-
bundle: boolean;
|
|
842
|
-
debounce: boolean;
|
|
843
|
-
timeoutDelay: number;
|
|
844
|
-
afterMatchDelay: number;
|
|
845
|
-
last: (match: T) => boolean;
|
|
846
|
-
callback: () => void;
|
|
847
|
-
resolve: (...args: any[]) => void;
|
|
848
|
-
remove: () => void;
|
|
849
|
-
done: () => void;
|
|
850
|
-
timeout: ReturnType<typeof setTimeout>;
|
|
851
|
-
} & ({
|
|
852
|
-
pattern: WatcherPattern<T>;
|
|
853
|
-
matches: T[];
|
|
854
|
-
} | {
|
|
855
|
-
pattern: RegExp;
|
|
856
|
-
matches: RegExpMatchArray[];
|
|
857
|
-
});
|
|
858
|
-
export declare type IPluginConfigDefinition = {
|
|
859
|
-
description: string;
|
|
860
|
-
} & ({
|
|
861
|
-
type: 'string' | 'password' | 'role';
|
|
862
|
-
default: string;
|
|
863
|
-
} | {
|
|
864
|
-
type: 'boolean';
|
|
865
|
-
default: boolean;
|
|
866
|
-
} | {
|
|
867
|
-
type: 'number';
|
|
868
|
-
default: number;
|
|
869
|
-
} | {
|
|
870
|
-
type: 'enum';
|
|
871
|
-
options: (string | number)[];
|
|
872
|
-
default: string | number;
|
|
873
|
-
} | {
|
|
874
|
-
type: 'players';
|
|
875
|
-
default: {
|
|
876
|
-
id: string;
|
|
877
|
-
name: string;
|
|
878
|
-
};
|
|
879
|
-
} | ({
|
|
880
|
-
type: 'list';
|
|
881
|
-
} & ({
|
|
882
|
-
itemType: 'string';
|
|
883
|
-
default: string[];
|
|
884
|
-
} | {
|
|
885
|
-
itemType: 'number';
|
|
886
|
-
default: number[];
|
|
887
|
-
} | {
|
|
888
|
-
itemType: 'enum';
|
|
889
|
-
options: (string | number)[];
|
|
890
|
-
default: string | number;
|
|
891
|
-
})));
|
|
892
|
-
export interface IPluginCommandArgument {
|
|
893
|
-
name: string;
|
|
894
|
-
description: string;
|
|
895
|
-
required?: boolean;
|
|
896
|
-
}
|
|
897
|
-
export interface IPluginCommand {
|
|
898
|
-
name: string;
|
|
899
|
-
description: string;
|
|
900
|
-
example?: string;
|
|
901
|
-
args: IPluginCommandArgument[];
|
|
902
|
-
}
|
|
903
|
-
export interface IPluginDocumentation {
|
|
904
|
-
name: string;
|
|
905
|
-
description: string;
|
|
906
|
-
author: string;
|
|
907
|
-
config: Record<string, IPluginConfigDefinition>;
|
|
908
|
-
commands: IPluginCommand[];
|
|
909
|
-
}
|
|
910
|
-
export interface PluginInterop {
|
|
911
|
-
name: string;
|
|
912
|
-
documentation: IPluginDocumentation;
|
|
913
|
-
loaded: boolean;
|
|
914
|
-
emitPlugin?(event: string, args: any[]): Promise<any>;
|
|
915
|
-
}
|
|
916
|
-
export type WeaponClass = 'Weapon_AntiMaterielRifle' | 'Weapon_ArmingSword' | 'Weapon_AssaultRifle' | 'Weapon_AutoShotgun' | 'Weapon_Battleaxe' | 'Weapon_Bazooka' | 'Weapon_Bow' | 'Weapon_BullpupRifle' | 'Weapon_BullpupSMG' | 'Weapon_ChargedLongsword' | 'Weapon_CrystalKalis' | 'Weapon_Derringer' | 'Weapon_FlintlockPistol' | 'Weapon_GrenadeLauncher' | 'Weapon_Handaxe' | 'Weapon_HealthPotion' | 'Weapon_HeavyAssaultRifle' | 'Weapon_HeavySMG' | 'Weapon_HeroSword' | 'Weapon_HighPowerPistol' | 'Weapon_HoloBlade' | 'Weapon_HuntingShotgun' | 'Weapon_Ikakalaka' | 'Weapon_ImpactGrenade' | 'Weapon_ImpactGrenadeLauncher' | 'Weapon_ImpulseGrenade' | 'Weapon_Khopesh' | 'Weapon_Knife' | 'Weapon_LeverActionRifle' | 'Weapon_LightMachineGun' | 'Weapon_LongSword' | 'Weapon_MagnumPistol' | 'Weapon_MicroSMG' | 'Weapon_Minigun' | 'Weapon_Pistol' | 'Weapon_PulseCarbine' | 'Weapon_QuadLauncher' | 'Weapon_Revolver' | 'Weapon_RocketJumper' | 'Weapon_RocketLauncher' | 'Weapon_Sabre' | 'Weapon_SemiAutoRifle' | 'Weapon_ServiceRifle' | 'Weapon_Shotgun' | 'Weapon_SlugShotgun' | 'Weapon_Sniper' | 'Weapon_Spatha' | 'Weapon_StandardSubmachineGun' | 'Weapon_StickGrenade' | 'Weapon_SubmachineGun' | 'Weapon_SuperShotgun' | 'Weapon_SuppressedAssaultRifle' | 'Weapon_SuppressedBullpupSMG' | 'Weapon_SuppressedPistol' | 'Weapon_SuppressedServiceRifle' | 'Weapon_TacticalShotgun' | 'Weapon_TacticalSMG' | 'Weapon_Tomahawk' | 'Weapon_TwinCannon' | 'Weapon_TypewriterSMG' | 'Weapon_Zweihander';
|