omegga 1.0.7 → 1.0.10

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 (51) hide show
  1. package/README.md +25 -28
  2. package/dist/brickadia/presets.d.ts +1 -1
  3. package/dist/brickadia/server.js.map +1 -1
  4. package/dist/cli/plugin.js +2 -2
  5. package/dist/cli/plugin.js.map +1 -1
  6. package/dist/cli/terminal.js +9 -1
  7. package/dist/cli/terminal.js.map +1 -1
  8. package/dist/omegga/matchers/interact.js +27 -1
  9. package/dist/omegga/matchers/interact.js.map +1 -1
  10. package/dist/omegga/matchers/version.js +2 -0
  11. package/dist/omegga/matchers/version.js.map +1 -1
  12. package/dist/omegga/player.d.ts +8 -0
  13. package/dist/omegga/player.js +58 -0
  14. package/dist/omegga/player.js.map +1 -1
  15. package/dist/omegga/plugin/plugin_node_safe/proxyOmegga.d.ts +3 -1
  16. package/dist/omegga/plugin/plugin_node_safe/proxyOmegga.js +8 -0
  17. package/dist/omegga/plugin/plugin_node_safe/proxyOmegga.js.map +1 -1
  18. package/dist/omegga/server.d.ts +3 -1
  19. package/dist/omegga/server.js +31 -2
  20. package/dist/omegga/server.js.map +1 -1
  21. package/dist/plugin.d.ts +76 -18
  22. package/dist/plugin.js.map +1 -1
  23. package/dist/util/index.d.ts +2 -2
  24. package/dist/util/time.d.ts +1 -1
  25. package/package.json +3 -3
  26. package/public/app.bundle.js +1124 -1114
  27. package/public/app.bundle.js.map +1 -1
  28. package/public/auth.bundle.js +207 -207
  29. package/public/auth.bundle.js.map +1 -1
  30. package/templates/rpc/.gitignore.rename +1 -0
  31. package/templates/rpc/README.md +3 -3
  32. package/templates/rpc/doc.json +2 -2
  33. package/templates/rust/.gitignore.rename +2 -0
  34. package/templates/rust/Cargo.toml +12 -0
  35. package/templates/rust/README.md +31 -0
  36. package/templates/rust/doc.json +7 -0
  37. package/templates/rust/omegga_plugin +14 -0
  38. package/templates/rust/plugin.json +4 -0
  39. package/templates/rust/setup.sh +3 -0
  40. package/templates/rust/src/main.rs +25 -0
  41. package/templates/safe/.gitignore.rename +3 -0
  42. package/templates/safe/README.md +3 -3
  43. package/templates/safe/doc.json +2 -2
  44. package/templates/safe-ts/README.md +3 -3
  45. package/templates/safe-ts/doc.json +2 -2
  46. package/templates/safe-ts/omegga.d.ts +83 -22
  47. package/templates/unsafe/.gitignore.rename +3 -0
  48. package/templates/unsafe/README.md +3 -3
  49. package/templates/unsafe/doc.json +2 -2
  50. package/public/app.bundle.js.LICENSE.txt +0 -16
  51. package/public/auth.bundle.js.LICENSE.txt +0 -5
@@ -0,0 +1 @@
1
+ disabled.omegga
@@ -3,9 +3,9 @@
3
3
  When uploading your plugin to github/gitlab
4
4
  start your repo name with "omegga-"
5
5
 
6
- example: https://github.com/{{author}}/omegga-{{shortName}}
6
+ example: https://github.com/{{author}}/omegga-{{name}}
7
7
 
8
- Your plugin will be installed via omegga install gh:{{author}}/{{shortName}}
8
+ Your plugin will be installed via omegga install gh:{{author}}/{{name}}
9
9
 
10
10
  -->
11
11
 
@@ -20,7 +20,7 @@ edit `omegga_plugin` to point to your plugin's executable.
20
20
 
21
21
  ## Install
22
22
 
23
- `omegga install gh:{{author}}/{{shortName}}`
23
+ `omegga install gh:{{author}}/{{name}}`
24
24
 
25
25
  _TODO: more steps...?_
26
26
 
@@ -1,7 +1,7 @@
1
1
  {
2
- "name": "{{shortName}}",
2
+ "name": "{{name}}",
3
3
  "description": "An RPC Omegga plugin.",
4
4
  "author": "{{author}}",
5
5
  "config": {},
6
6
  "commands": []
7
- }
7
+ }
@@ -0,0 +1,2 @@
1
+ disabled.omegga
2
+ /target
@@ -0,0 +1,12 @@
1
+ # Generated by omegga init-plugin
2
+
3
+ [package]
4
+ name = "omegga-{{name}}"
5
+ version = "0.1.0"
6
+ edition = "2021"
7
+
8
+ # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
9
+
10
+ [dependencies]
11
+ omegga = "1.0"
12
+ tokio = "1.17"
@@ -0,0 +1,31 @@
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-{{name}}
7
+
8
+ Your plugin will be installed via omegga install gh:{{author}}/{{name}}
9
+
10
+ -->
11
+
12
+ # {{name}}
13
+
14
+ A Rust 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, and
19
+ edit `omegga_plugin` to point to your plugin's executable.
20
+
21
+ ## Install
22
+
23
+ [Rust](https://rust-lang.org/) must be installed.
24
+
25
+ `omegga install gh:{{author}}/{{name}}`
26
+
27
+ _TODO: more steps...?_
28
+
29
+ ## Usage
30
+
31
+ _TODO: include some usage information_
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "{{name}}",
3
+ "description": "A Rust Omegga plugin.",
4
+ "author": "{{author}}",
5
+ "config": {},
6
+ "commands": []
7
+ }
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env bash
2
+ FILE={{name}}
3
+ BASE=$(dirname "$0")
4
+ DEBUG=./target/debug/
5
+ RELEASE=./target/release/
6
+
7
+ cd $BASE
8
+ if test -f "$DEBUG$FILE"; then
9
+ $DEBUG$FILE
10
+ elif test -f "$RELEASE$FILE"; then
11
+ $RELEASE$FILE
12
+ else
13
+ echo "The rust plugin {{name}} is not built! Please build it first."
14
+ fi
@@ -0,0 +1,4 @@
1
+ {
2
+ "formatVersion": 1,
3
+ "omeggaVersion": ">={{omeggaVersion}}"
4
+ }
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # This script will be run when the plugin is installed...
@@ -0,0 +1,25 @@
1
+ use omegga::{events::Event, Omegga};
2
+
3
+ #[tokio::main]
4
+ async fn main() {
5
+ let omegga = Omegga::new();
6
+ let mut events = omegga.spawn();
7
+
8
+ // Write your plugin!
9
+ while let Some(event) = events.recv().await {
10
+ match event {
11
+ // Handle init/stop...
12
+ Event::Init { id, .. } => omegga.register_commands(id, &["test"]),
13
+ Event::Stop { id, .. } => omegga.write_response(id, None, None),
14
+
15
+ // Listen for any commands we care about...
16
+ Event::Command {
17
+ player, command, ..
18
+ } => match command.as_str() {
19
+ "test" => omegga.broadcast(format!("Hello, {player}!")),
20
+ _ => (),
21
+ },
22
+ _ => (),
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,3 @@
1
+ .build/
2
+ node_modules/
3
+ disabled.omegga
@@ -3,9 +3,9 @@
3
3
  When uploading your plugin to github/gitlab
4
4
  start your repo name with "omegga-"
5
5
 
6
- example: https://github.com/{{author}}/omegga-{{shortName}}
6
+ example: https://github.com/{{author}}/omegga-{{name}}
7
7
 
8
- Your plugin will be installed via omegga install gh:{{author}}/{{shortName}}
8
+ Your plugin will be installed via omegga install gh:{{author}}/{{name}}
9
9
 
10
10
  -->
11
11
 
@@ -20,7 +20,7 @@ remove it entirely if it is unnecessary.
20
20
 
21
21
  ## Install
22
22
 
23
- `omegga install gh:{{author}}/{{shortName}}`
23
+ `omegga install gh:{{author}}/{{name}}`
24
24
 
25
25
  _TODO: more steps...?_
26
26
 
@@ -1,7 +1,7 @@
1
1
  {
2
- "name": "{{shortName}}",
2
+ "name": "{{name}}",
3
3
  "description": "A safe Omegga plugin.",
4
4
  "author": "{{author}}",
5
5
  "config": {},
6
6
  "commands": []
7
- }
7
+ }
@@ -3,9 +3,9 @@
3
3
  When uploading your plugin to github/gitlab
4
4
  start your repo name with "omegga-"
5
5
 
6
- example: https://github.com/{{author}}/omegga-{{shortName}}
6
+ example: https://github.com/{{author}}/omegga-{{name}}
7
7
 
8
- Your plugin will be installed via omegga install gh:{{author}}/{{shortName}}
8
+ Your plugin will be installed via omegga install gh:{{author}}/{{name}}
9
9
 
10
10
  -->
11
11
 
@@ -20,7 +20,7 @@ remove it entirely if it is unnecessary.
20
20
 
21
21
  ## Install
22
22
 
23
- `omegga install gh:{{author}}/{{shortName}}`
23
+ `omegga install gh:{{author}}/{{name}}`
24
24
 
25
25
  _TODO: more steps...?_
26
26
 
@@ -1,7 +1,7 @@
1
1
  {
2
- "name": "{{shortName}}",
2
+ "name": "{{name}}",
3
3
  "description": "A typed safe Omegga plugin.",
4
4
  "author": "{{author}}",
5
5
  "config": {},
6
6
  "commands": []
7
- }
7
+ }
@@ -66,7 +66,7 @@ export declare type EnvironmentPreset = Preset<"Environment", {
66
66
  starsIntensity?: number;
67
67
  starsColor?: BRColor;
68
68
  auroraIntensity?: number;
69
- weatherIntensity?: BRColor;
69
+ weatherIntensity?: number;
70
70
  rainSnow?: number;
71
71
  cloudCoverage?: number;
72
72
  cloudSpeedMultiplier?: number;
@@ -176,8 +176,9 @@ export declare type UnrealRotator = [
176
176
  number,
177
177
  number
178
178
  ];
179
- export declare type UnrealType = UnrealClass | UnrealObject | UnrealBoolean | UnrealFloat | UnrealColor | UnrealByte | UnrealRotator;
180
- export declare type UnrealTypeFromString<T> = T extends "Class" ? UnrealClass : T extends "Object" ? UnrealObject : T extends "Boolean" ? UnrealBoolean : T extends "Float" ? UnrealFloat : T extends "Color" ? UnrealColor : T extends "Byte" ? UnrealByte : T extends "Rotator" ? UnrealRotator : UnrealType;
179
+ export declare type UnrealString = string;
180
+ export declare type UnrealType = UnrealClass | UnrealObject | UnrealBoolean | UnrealFloat | UnrealColor | UnrealByte | UnrealRotator | UnrealString;
181
+ export declare type UnrealTypeFromString<T> = T extends "Class" ? UnrealClass : T extends "Object" ? UnrealObject : T extends "Boolean" ? UnrealBoolean : T extends "Float" ? UnrealFloat : T extends "Color" ? UnrealColor : T extends "Byte" ? UnrealByte : T extends "Rotator" ? UnrealRotator : T extends "String" ? UnrealString : UnrealType;
181
182
  export interface User {
182
183
  id: Uuid;
183
184
  name: string;
@@ -277,6 +278,8 @@ export declare type KnownComponents = {
277
278
  brick_indices?: number[];
278
279
  properties: {
279
280
  bPlayInteractSound: "Boolean";
281
+ Message: "String";
282
+ ConsoleTag: "String";
280
283
  };
281
284
  };
282
285
  BCD_AudioEmitter: {
@@ -388,7 +391,7 @@ export interface Brick {
388
391
  material_index?: number;
389
392
  physical_index?: number;
390
393
  material_intensity?: number;
391
- color?: ColorRgb | number;
394
+ color?: ColorRgb | number | UnrealColor | number[];
392
395
  owner_index?: number;
393
396
  components?: Components<DefinedComponents>;
394
397
  }
@@ -529,7 +532,7 @@ export declare const _OMEGGA_UTILS_IMPORT: {
529
532
  time: {
530
533
  parseDuration: typeof parseDuration;
531
534
  parseBrickadiaTime: typeof parseBrickadiaTime;
532
- debounce: (<T_1 extends (...args: any) => any>(func: T_1, wait: number, options: DebounceSettingsLeading) => DebouncedFuncLeading<T_1>) | (<T_2 extends (...args: any) => any>(func: T_2, wait?: number, options?: DebounceSettings) => DebouncedFunc<T_2>);
535
+ debounce: (<T_1 extends (...args: any) => any>(func: T_1, wait: number, options?: DebounceSettingsLeading) => DebouncedFuncLeading<T_1>) | (<T_2 extends (...args: any) => any>(func: T_2, wait?: number, options?: DebounceSettings) => DebouncedFunc<T_2>);
533
536
  };
534
537
  map: {
535
538
  DEFAULT_MAPS: {
@@ -538,10 +541,7 @@ export declare const _OMEGGA_UTILS_IMPORT: {
538
541
  }[];
539
542
  brn2n: typeof brn2n;
540
543
  n2brn: typeof n2brn;
541
- }; /**
542
- * Get player's permissions in a map like `{"Bricks.ClearOwn": true, ...}`
543
- * @return permissions map
544
- */
544
+ };
545
545
  brick: {
546
546
  BRICK_CONSTANTS: {
547
547
  rotationTable: number[];
@@ -565,12 +565,12 @@ export declare const _OMEGGA_UTILS_IMPORT: {
565
565
  number
566
566
  ]>;
567
567
  };
568
- checkBounds: typeof checkBounds;
568
+ checkBounds: typeof checkBounds; /** message sent from a brick click interaction */
569
569
  getBounds: typeof getBounds;
570
570
  getBrickSize: typeof getBrickSize;
571
571
  getScaleAxis: typeof getScaleAxis;
572
572
  setOwnership: typeof setOwnership;
573
- rotate: typeof rotate;
573
+ rotate: typeof rotate; /** data parsed from the line (if it starts with json:) */
574
574
  rotate_x: typeof rotate_x;
575
575
  rotate_y: typeof rotate_y;
576
576
  rotate_z: typeof rotate_z;
@@ -588,17 +588,13 @@ export declare const _OMEGGA_UTILS_IMPORT: {
588
588
  }): Uint8Array;
589
589
  utils: any;
590
590
  constants: {
591
- /**
592
- * True if the player is the host
593
- */
594
591
  MAGIC: Uint8Array;
595
592
  LATEST_VERSION: number;
596
- MAX_INT: number; /**
597
- * Clear player's bricks
598
- * @param quiet clear bricks quietly
599
- */
593
+ MAX_INT: number;
600
594
  DEFAULT_UUID: string;
601
- };
595
+ }; /**
596
+ * Returns omegga
597
+ */
602
598
  };
603
599
  };
604
600
  declare global {
@@ -628,7 +624,7 @@ export interface BrickBounds {
628
624
  ];
629
625
  }
630
626
  /** Created when a player clicks on a brick with an interact component */
631
- export declare type BrickInteraction = {
627
+ export interface BrickInteraction {
632
628
  /** Brick name from catalog (Turkey Body, 4x Cube) */
633
629
  brick_name: string;
634
630
  /** Player information, id, name, controller, and pawn */
@@ -644,7 +640,15 @@ export declare type BrickInteraction = {
644
640
  number,
645
641
  number
646
642
  ];
647
- };
643
+ /** message sent from a brick click interaction */
644
+ message: string;
645
+ /** data parsed from the line (if it starts with json:) */
646
+ data: null | number | string | boolean | Record<string, unknown>;
647
+ /** True when there was a json payload */
648
+ json: boolean;
649
+ /** True when there was a parse error */
650
+ error: boolean;
651
+ }
648
652
  /** AutoRestart options */
649
653
  export declare type AutoRestartConfig = {
650
654
  players: boolean;
@@ -803,6 +807,27 @@ export interface OmeggaPlayer {
803
807
  * @param item Item name (Weapon_Bow)
804
808
  */
805
809
  takeItem(item: WeaponClass): void;
810
+ /**
811
+ * Changes a player's team
812
+ * @param teamIndex Team index
813
+ */
814
+ setTeam(teamIndex: number): void;
815
+ /**
816
+ * Changes a player's minigame
817
+ * @param index Minigame index
818
+ */
819
+ setMinigame(index: number): void;
820
+ /**
821
+ * Changes a player's score
822
+ * @param minigameIndex minigame index
823
+ * @param score Score
824
+ */
825
+ setScore(minigameIndex: number, score: number): void;
826
+ /**
827
+ * Fetch a player's score
828
+ * @param minigameIndex minigame index
829
+ */
830
+ getScore(minigameIndex: number): Promise<number>;
806
831
  }
807
832
  export interface StaticPlayer {
808
833
  /**
@@ -853,6 +878,35 @@ export interface StaticPlayer {
853
878
  * @param item Item name (Weapon_Bow)
854
879
  */
855
880
  takeItem(omegga: OmeggaLike, target: string | OmeggaPlayer, item: WeaponClass): void;
881
+ /**
882
+ * Changes a player's team
883
+ * @param omegga Omegga instance
884
+ * @param target Player or player name/id
885
+ * @param teamIndex Team name? index?
886
+ */
887
+ setTeam(omegga: OmeggaLike, target: string | OmeggaPlayer, teamIndex: number): void;
888
+ /**
889
+ * Changes a player's minigame
890
+ * @param omegga Omegga instance
891
+ * @param target Player or player name/id
892
+ * @param index Minigame index
893
+ */
894
+ setMinigame(omegga: OmeggaLike, target: string | OmeggaPlayer, index: number): void;
895
+ /**
896
+ * Changes a player's score
897
+ * @param omegga Omegga instance
898
+ * @param target Player or player name/id
899
+ * @param minigameIndex minigame index
900
+ * @param score Score
901
+ */
902
+ setScore(omegga: OmeggaLike, target: string | OmeggaPlayer, minigameIndex: number, score: number): void;
903
+ /**
904
+ * Fetches a player's score
905
+ * @param omegga Omegga instance
906
+ * @param target Player or player name/id
907
+ * @param minigameIndex minigame index
908
+ */
909
+ getScore(omegga: OmeggaLike, target: string | OmeggaPlayer, minigameIndex: number): Promise<number>;
856
910
  }
857
911
  export interface InjectedCommands {
858
912
  /** Get server status */
@@ -1018,7 +1072,14 @@ export interface OmeggaCore {
1018
1072
  * Save an environment preset
1019
1073
  * @param presetName preset name
1020
1074
  */
1021
- saveEnvironment(presetName: string): void;
1075
+ saveEnvironment(presetName: string): Promise<void>;
1076
+ /** Save a temporary environment preset and return its contents */
1077
+ getEnvironmentData(): Promise<EnvironmentPreset>;
1078
+ /**
1079
+ * Read environment data as json
1080
+ * @param presetName preset name
1081
+ */
1082
+ readEnvironmentData(presetName: string): void;
1022
1083
  /**
1023
1084
  * Load an environment preset
1024
1085
  * @param presetName preset name
@@ -0,0 +1,3 @@
1
+ .build/
2
+ node_modules/
3
+ disabled.omegga
@@ -3,9 +3,9 @@
3
3
  When uploading your plugin to github/gitlab
4
4
  start your repo name with "omegga-"
5
5
 
6
- example: https://github.com/{{author}}/omegga-{{shortName}}
6
+ example: https://github.com/{{author}}/omegga-{{name}}
7
7
 
8
- Your plugin will be installed via omegga install gh:{{author}}/{{shortName}}
8
+ Your plugin will be installed via omegga install gh:{{author}}/{{name}}
9
9
 
10
10
  -->
11
11
 
@@ -20,7 +20,7 @@ remove it entirely if it is unnecessary.
20
20
 
21
21
  ## Install
22
22
 
23
- `omegga install gh:{{author}}/{{shortName}}`
23
+ `omegga install gh:{{author}}/{{name}}`
24
24
 
25
25
  _TODO: more steps...?_
26
26
 
@@ -1,7 +1,7 @@
1
1
  {
2
- "name": "{{shortName}}",
2
+ "name": "{{name}}",
3
3
  "description": "A safe Omegga plugin.",
4
4
  "author": "{{author}}",
5
5
  "config": {},
6
6
  "commands": []
7
- }
7
+ }
@@ -1,16 +0,0 @@
1
- /*!
2
- * The buffer module from node.js, for the browser.
3
- *
4
- * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
5
- * @license MIT
6
- */
7
-
8
- /*!
9
- * Vue.js v2.6.14
10
- * (c) 2014-2021 Evan You
11
- * Released under the MIT License.
12
- */
13
-
14
- /*! https://mths.be/utf8js v2.1.2 by @mathias */
15
-
16
- /*! vue-grid-layout - 2.3.12 | (c) 2015, 2021 Gustavo Santos (JBay Solutions) <gustavo.santos@jbaysolutions.com> (http://www.jbaysolutions.com) | https://github.com/jbaysolutions/vue-grid-layout */
@@ -1,5 +0,0 @@
1
- /*!
2
- * Vue.js v2.6.14
3
- * (c) 2014-2021 Evan You
4
- * Released under the MIT License.
5
- */