omegga 1.17.0 → 1.17.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +15 -0
- package/dist/main.js.map +1 -1
- package/package.json +14 -3
- package/.nvmrc +0 -1
- package/CHANGELOG.md +0 -885
- package/book/.nojekyll +0 -1
- package/book/404.html +0 -246
- package/book/CNAME +0 -1
- package/book/api/events.html +0 -358
- package/book/api/index.html +0 -282
- package/book/api/log-parsing.html +0 -416
- package/book/api/omegga.html +0 -980
- package/book/api/player.html +0 -762
- package/book/api/plugin.html +0 -449
- package/book/api/types.html +0 -614
- package/book/assets/fonts/GlacialIndifferenceBold.ttf +0 -0
- package/book/assets/fonts/GlacialIndifferenceRegular.ttf +0 -0
- package/book/assets/logo.png +0 -0
- package/book/ayu-highlight-3fdfc3ac.css +0 -77
- package/book/book-609e4cb8.js +0 -870
- package/book/clipboard-1626706a.min.js +0 -7
- package/book/config.html +0 -326
- package/book/containers.html +0 -338
- package/book/css/chrome-d279d366.css +0 -770
- package/book/css/general-e96d0476.css +0 -464
- package/book/css/print-9e4910d8.css +0 -50
- package/book/css/variables-8adf115d.css +0 -383
- package/book/elasticlunr-ef4e11c1.min.js +0 -10
- package/book/env.html +0 -283
- package/book/favicon-8114d1fc.png +0 -0
- package/book/favicon-de23e50b.svg +0 -22
- package/book/fonts/OPEN-SANS-LICENSE.txt +0 -202
- package/book/fonts/SOURCE-CODE-PRO-LICENSE.txt +0 -93
- package/book/fonts/fonts-9644e21d.css +0 -100
- package/book/fonts/open-sans-v17-all-charsets-300-7736aa35.woff2 +0 -0
- package/book/fonts/open-sans-v17-all-charsets-300italic-2c7b95c0.woff2 +0 -0
- package/book/fonts/open-sans-v17-all-charsets-600-486c6759.woff2 +0 -0
- package/book/fonts/open-sans-v17-all-charsets-600italic-1a3e8659.woff2 +0 -0
- package/book/fonts/open-sans-v17-all-charsets-700-c22fe8c7.woff2 +0 -0
- package/book/fonts/open-sans-v17-all-charsets-700italic-238ae959.woff2 +0 -0
- package/book/fonts/open-sans-v17-all-charsets-800-3d2c812a.woff2 +0 -0
- package/book/fonts/open-sans-v17-all-charsets-800italic-ba1521ec.woff2 +0 -0
- package/book/fonts/open-sans-v17-all-charsets-italic-6c9463f7.woff2 +0 -0
- package/book/fonts/open-sans-v17-all-charsets-regular-2e3b1d34.woff2 +0 -0
- package/book/fonts/source-code-pro-v11-all-charsets-500-2bdd9410.woff2 +0 -0
- package/book/guides/https.html +0 -352
- package/book/guides/index.html +0 -276
- package/book/guides/pterodactyl.html +0 -397
- package/book/guides/remote.html +0 -328
- package/book/guides/wires.html +0 -518
- package/book/highlight-493f70e1.css +0 -83
- package/book/highlight-abc7f01d.js +0 -54
- package/book/index.html +0 -299
- package/book/install/index.html +0 -287
- package/book/install/linux.html +0 -407
- package/book/install/wsl.html +0 -286
- package/book/mark-09e88c2c.min.js +0 -7
- package/book/metrics.html +0 -662
- package/book/permissions.html +0 -532
- package/book/plugins/index.html +0 -521
- package/book/plugins/installing.html +0 -284
- package/book/plugins/jsonrpc.html +0 -519
- package/book/plugins/safe.html +0 -368
- package/book/plugins/unsafe.html +0 -317
- package/book/print.html +0 -4852
- package/book/running.html +0 -283
- package/book/searcher-09f2665d.js +0 -558
- package/book/searchindex-3480b9e2.js +0 -1
- package/book/theme/omegga-3aa7cb40.css +0 -196
- package/book/theme/wirescript-hljs-69fbef4b.js +0 -75
- package/book/toc-faa8fb01.js +0 -455
- package/book/toc.html +0 -32
- package/book/tomorrow-night-4c0ae647.css +0 -104
- package/book/troubleshooting.html +0 -330
- package/book/uninstall.html +0 -275
- package/docs/CNAME +0 -1
- package/docs/README.md +0 -44
- package/docs/SUMMARY.md +0 -33
- package/docs/api/README.md +0 -21
- package/docs/api/events.md +0 -109
- package/docs/api/log-parsing.md +0 -162
- package/docs/api/omegga.md +0 -785
- package/docs/api/player.md +0 -525
- package/docs/api/plugin.md +0 -284
- package/docs/api/types.md +0 -339
- package/docs/assets/fonts/GlacialIndifferenceBold.ttf +0 -0
- package/docs/assets/fonts/GlacialIndifferenceRegular.ttf +0 -0
- package/docs/assets/logo.png +0 -0
- package/docs/config.md +0 -76
- package/docs/containers.md +0 -110
- package/docs/env.md +0 -27
- package/docs/guides/README.md +0 -14
- package/docs/guides/https.md +0 -121
- package/docs/guides/pterodactyl.md +0 -155
- package/docs/guides/remote.md +0 -81
- package/docs/guides/wires.md +0 -292
- package/docs/install/README.md +0 -27
- package/docs/install/linux.md +0 -156
- package/docs/install/wsl.md +0 -40
- package/docs/metrics.md +0 -451
- package/docs/permissions.md +0 -264
- package/docs/plugins/README.md +0 -280
- package/docs/plugins/installing.md +0 -47
- package/docs/plugins/jsonrpc.md +0 -258
- package/docs/plugins/safe.md +0 -136
- package/docs/plugins/unsafe.md +0 -68
- package/docs/running.md +0 -43
- package/docs/troubleshooting.md +0 -38
- package/docs/uninstall.md +0 -22
- package/drizzle.config.ts +0 -7
- package/drizzle.plugin.config.ts +0 -7
- package/eslint.config.mjs +0 -135
- package/public/assets/IconCheck-DOe3u7iH.js.map +0 -1
- package/public/assets/IconLockOpen-Bs7Tsf6u.js.map +0 -1
- package/public/assets/IconShieldCheck-Bjlm8mX2.js.map +0 -1
- package/public/assets/IconWorld-DgiOjCuo.js.map +0 -1
- package/public/assets/IconWorldPlus-DJJNrT87.js.map +0 -1
- package/public/assets/IconX-CvmO0bbE.js.map +0 -1
- package/public/assets/_commonjsHelpers-CE1G-McA.js.map +0 -1
- package/public/assets/app-Mh--ChqF.js.map +0 -1
- package/public/assets/auth-DQtYicf-.js.map +0 -1
- package/public/assets/client-BT1QYH0O.js.map +0 -1
- package/public/assets/index-2cgXLhrt.js.map +0 -1
- package/public/assets/index-B0LowBt1.js.map +0 -1
- package/public/assets/index-BDkarAkX.js.map +0 -1
- package/public/assets/index-BTSbuqTr.js.map +0 -1
- package/public/assets/index-CJ4e7_2M.js.map +0 -1
- package/public/assets/index-CSV4ZXsq.js.map +0 -1
- package/public/assets/index-CrN8I5Az.js.map +0 -1
- package/public/assets/index-CtCtK5BX.js.map +0 -1
- package/public/assets/index-D0OPOe3j.js.map +0 -1
- package/public/assets/jsx-runtime-BX5r4UiA.js.map +0 -1
- package/public/assets/jsx-runtime-DldvXD6N.js.map +0 -1
- package/public/assets/shared/@components-DBMXoJMT.js.map +0 -1
- package/public/assets/shared/@hooks-DlZ8TOOZ.js.map +0 -1
- package/public/assets/shared/@nanostores_react-DJPF1Eqx.js.map +0 -1
- package/public/assets/shared/@tabler_icons-react-i-Q2c_A_.js.map +0 -1
- package/public/assets/shared/@utils-BA2UvC9c.js.map +0 -1
- package/public/assets/shared/nanostores-BFqqIY_c.js.map +0 -1
- package/public/assets/shared/react-dom-8Rcmh_FG.js.map +0 -1
- package/public/assets/shared/react-iXLZ_Bod.js.map +0 -1
- package/public/assets/shared/react_jsx-runtime-BwhiLcBy.js.map +0 -1
- package/public/assets/shared/wouter-CUC1caxu.js.map +0 -1
- package/public/assets/user-XF1UyJMA.js.map +0 -1
- package/public/assets/utils-Ds3ldd-U.js.map +0 -1
- package/server/data/nedb-imported.marker +0 -1
- package/server/data/omegga-plugins.db +0 -0
- package/server/data/omegga-plugins.db-shm +0 -0
- package/server/data/omegga-plugins.db-wal +0 -0
- package/server/data/omegga-sessions.db +0 -0
- package/server/data/omegga-sessions.db-shm +0 -0
- package/server/data/omegga-sessions.db-wal +0 -0
- package/server/data/omegga.db +0 -0
- package/server/data/omegga.db-shm +0 -0
- package/server/data/omegga.db-wal +0 -0
- package/server/data/web_session_token +0 -1
- package/server/fakegame/Binaries/Linux/BrickadiaServer-Linux-Shipping +0 -11
- package/server/omegga-config.yml +0 -7
- package/theme/omegga.css +0 -196
- package/theme/wirescript-hljs.js +0 -75
- package/tools/tag.sh +0 -48
|
@@ -1,519 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE HTML>
|
|
2
|
-
<html lang="en" class="navy sidebar-visible" dir="ltr">
|
|
3
|
-
<head>
|
|
4
|
-
<!-- Book generated using mdBook -->
|
|
5
|
-
<meta charset="UTF-8">
|
|
6
|
-
<title>JSON RPC plugins - Omegga</title>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
<!-- Custom HTML head -->
|
|
10
|
-
|
|
11
|
-
<meta name="description" content="Brickadia server installer, updater, manager, wrapper, configurator, and automator">
|
|
12
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
13
|
-
<meta name="theme-color" content="#ffffff">
|
|
14
|
-
|
|
15
|
-
<link rel="icon" href="../favicon-de23e50b.svg">
|
|
16
|
-
<link rel="shortcut icon" href="../favicon-8114d1fc.png">
|
|
17
|
-
<link rel="stylesheet" href="../css/variables-8adf115d.css">
|
|
18
|
-
<link rel="stylesheet" href="../css/general-e96d0476.css">
|
|
19
|
-
<link rel="stylesheet" href="../css/chrome-d279d366.css">
|
|
20
|
-
<link rel="stylesheet" href="../css/print-9e4910d8.css" media="print">
|
|
21
|
-
|
|
22
|
-
<!-- Fonts -->
|
|
23
|
-
<link rel="stylesheet" href="../fonts/fonts-9644e21d.css">
|
|
24
|
-
|
|
25
|
-
<!-- Highlight.js Stylesheets -->
|
|
26
|
-
<link rel="stylesheet" id="mdbook-highlight-css" href="../highlight-493f70e1.css">
|
|
27
|
-
<link rel="stylesheet" id="mdbook-tomorrow-night-css" href="../tomorrow-night-4c0ae647.css">
|
|
28
|
-
<link rel="stylesheet" id="mdbook-ayu-highlight-css" href="../ayu-highlight-3fdfc3ac.css">
|
|
29
|
-
|
|
30
|
-
<!-- Custom theme stylesheets -->
|
|
31
|
-
<link rel="stylesheet" href="../theme/omegga-3aa7cb40.css">
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
<!-- Provide site root and default themes to javascript -->
|
|
35
|
-
<script>
|
|
36
|
-
const path_to_root = "../";
|
|
37
|
-
const default_light_theme = "navy";
|
|
38
|
-
const default_dark_theme = "navy";
|
|
39
|
-
window.path_to_searchindex_js = "../searchindex-3480b9e2.js";
|
|
40
|
-
</script>
|
|
41
|
-
<!-- Start loading toc.js asap -->
|
|
42
|
-
<script src="../toc-faa8fb01.js"></script>
|
|
43
|
-
</head>
|
|
44
|
-
<body>
|
|
45
|
-
<div id="mdbook-help-container">
|
|
46
|
-
<div id="mdbook-help-popup">
|
|
47
|
-
<h2 class="mdbook-help-title">Keyboard shortcuts</h2>
|
|
48
|
-
<div>
|
|
49
|
-
<p>Press <kbd>←</kbd> or <kbd>→</kbd> to navigate between chapters</p>
|
|
50
|
-
<p>Press <kbd>S</kbd> or <kbd>/</kbd> to search in the book</p>
|
|
51
|
-
<p>Press <kbd>?</kbd> to show this help</p>
|
|
52
|
-
<p>Press <kbd>Esc</kbd> to hide this help</p>
|
|
53
|
-
</div>
|
|
54
|
-
</div>
|
|
55
|
-
</div>
|
|
56
|
-
<div id="mdbook-body-container">
|
|
57
|
-
<!-- Work around some values being stored in localStorage wrapped in quotes -->
|
|
58
|
-
<script>
|
|
59
|
-
try {
|
|
60
|
-
let theme = localStorage.getItem('mdbook-theme');
|
|
61
|
-
let sidebar = localStorage.getItem('mdbook-sidebar');
|
|
62
|
-
|
|
63
|
-
if (theme.startsWith('"') && theme.endsWith('"')) {
|
|
64
|
-
localStorage.setItem('mdbook-theme', theme.slice(1, theme.length - 1));
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
if (sidebar.startsWith('"') && sidebar.endsWith('"')) {
|
|
68
|
-
localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1));
|
|
69
|
-
}
|
|
70
|
-
} catch (e) { }
|
|
71
|
-
</script>
|
|
72
|
-
|
|
73
|
-
<!-- Set the theme before any content is loaded, prevents flash -->
|
|
74
|
-
<script>
|
|
75
|
-
const default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? default_dark_theme : default_light_theme;
|
|
76
|
-
let theme;
|
|
77
|
-
try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
|
|
78
|
-
if (theme === null || theme === undefined) { theme = default_theme; }
|
|
79
|
-
const html = document.documentElement;
|
|
80
|
-
html.classList.remove('navy')
|
|
81
|
-
html.classList.add(theme);
|
|
82
|
-
html.classList.add("js");
|
|
83
|
-
</script>
|
|
84
|
-
|
|
85
|
-
<input type="checkbox" id="mdbook-sidebar-toggle-anchor" class="hidden">
|
|
86
|
-
|
|
87
|
-
<!-- Hide / unhide sidebar before it is displayed -->
|
|
88
|
-
<script>
|
|
89
|
-
let sidebar = null;
|
|
90
|
-
const sidebar_toggle = document.getElementById("mdbook-sidebar-toggle-anchor");
|
|
91
|
-
if (document.body.clientWidth >= 1080) {
|
|
92
|
-
try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
|
|
93
|
-
sidebar = sidebar || 'visible';
|
|
94
|
-
} else {
|
|
95
|
-
sidebar = 'hidden';
|
|
96
|
-
sidebar_toggle.checked = false;
|
|
97
|
-
}
|
|
98
|
-
if (sidebar === 'visible') {
|
|
99
|
-
sidebar_toggle.checked = true;
|
|
100
|
-
} else {
|
|
101
|
-
html.classList.remove('sidebar-visible');
|
|
102
|
-
}
|
|
103
|
-
</script>
|
|
104
|
-
|
|
105
|
-
<nav id="mdbook-sidebar" class="sidebar" aria-label="Table of contents">
|
|
106
|
-
<!-- populated by js -->
|
|
107
|
-
<mdbook-sidebar-scrollbox class="sidebar-scrollbox"></mdbook-sidebar-scrollbox>
|
|
108
|
-
<noscript>
|
|
109
|
-
<iframe class="sidebar-iframe-outer" src="../toc.html"></iframe>
|
|
110
|
-
</noscript>
|
|
111
|
-
<div id="mdbook-sidebar-resize-handle" class="sidebar-resize-handle">
|
|
112
|
-
<div class="sidebar-resize-indicator"></div>
|
|
113
|
-
</div>
|
|
114
|
-
</nav>
|
|
115
|
-
|
|
116
|
-
<div id="mdbook-page-wrapper" class="page-wrapper">
|
|
117
|
-
|
|
118
|
-
<div class="page">
|
|
119
|
-
<div id="mdbook-menu-bar-hover-placeholder"></div>
|
|
120
|
-
<div id="mdbook-menu-bar" class="menu-bar sticky">
|
|
121
|
-
<div class="left-buttons">
|
|
122
|
-
<label id="mdbook-sidebar-toggle" class="icon-button" for="mdbook-sidebar-toggle-anchor" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="mdbook-sidebar">
|
|
123
|
-
<span class=fa-svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M0 96C0 78.3 14.3 64 32 64H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z"/></svg></span>
|
|
124
|
-
</label>
|
|
125
|
-
<button id="mdbook-theme-toggle" class="icon-button" type="button" title="Change theme" aria-label="Change theme" aria-haspopup="true" aria-expanded="false" aria-controls="mdbook-theme-list">
|
|
126
|
-
<span class=fa-svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M371.3 367.1c27.3-3.9 51.9-19.4 67.2-42.9L600.2 74.1c12.6-19.5 9.4-45.3-7.6-61.2S549.7-4.4 531.1 9.6L294.4 187.2c-24 18-38.2 46.1-38.4 76.1L371.3 367.1zm-19.6 25.4l-116-104.4C175.9 290.3 128 339.6 128 400c0 3.9 .2 7.8 .6 11.6c1.8 17.5-10.2 36.4-27.8 36.4H96c-17.7 0-32 14.3-32 32s14.3 32 32 32H240c61.9 0 112-50.1 112-112c0-2.5-.1-5-.2-7.5z"/></svg></span>
|
|
127
|
-
</button>
|
|
128
|
-
<ul id="mdbook-theme-list" class="theme-popup" aria-label="Themes" role="menu">
|
|
129
|
-
<li role="none"><button role="menuitem" class="theme" id="mdbook-theme-default_theme">Auto</button></li>
|
|
130
|
-
<li role="none"><button role="menuitem" class="theme" id="mdbook-theme-light">Light</button></li>
|
|
131
|
-
<li role="none"><button role="menuitem" class="theme" id="mdbook-theme-rust">Rust</button></li>
|
|
132
|
-
<li role="none"><button role="menuitem" class="theme" id="mdbook-theme-coal">Coal</button></li>
|
|
133
|
-
<li role="none"><button role="menuitem" class="theme" id="mdbook-theme-navy">Navy</button></li>
|
|
134
|
-
<li role="none"><button role="menuitem" class="theme" id="mdbook-theme-ayu">Ayu</button></li>
|
|
135
|
-
</ul>
|
|
136
|
-
<button id="mdbook-search-toggle" class="icon-button" type="button" title="Search (`/`)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="/ s" aria-controls="mdbook-searchbar">
|
|
137
|
-
<span class=fa-svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352c79.5 0 144-64.5 144-144s-64.5-144-144-144S64 128.5 64 208s64.5 144 144 144z"/></svg></span>
|
|
138
|
-
</button>
|
|
139
|
-
</div>
|
|
140
|
-
|
|
141
|
-
<h1 class="menu-title">Omegga</h1>
|
|
142
|
-
|
|
143
|
-
<div class="right-buttons">
|
|
144
|
-
<a href="../print.html" title="Print this book" aria-label="Print this book">
|
|
145
|
-
<span class=fa-svg id="print-button"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M128 0C92.7 0 64 28.7 64 64v96h64V64H354.7L384 93.3V160h64V93.3c0-17-6.7-33.3-18.7-45.3L400 18.7C388 6.7 371.7 0 354.7 0H128zM384 352v32 64H128V384 368 352H384zm64 32h32c17.7 0 32-14.3 32-32V256c0-35.3-28.7-64-64-64H64c-35.3 0-64 28.7-64 64v96c0 17.7 14.3 32 32 32H64v64c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V384zm-16-88c-13.3 0-24-10.7-24-24s10.7-24 24-24s24 10.7 24 24s-10.7 24-24 24z"/></svg></span>
|
|
146
|
-
</a>
|
|
147
|
-
<a href="https://github.com/brickadia-community/omegga" title="Git repository" aria-label="Git repository">
|
|
148
|
-
<span class=fa-svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"/></svg></span>
|
|
149
|
-
</a>
|
|
150
|
-
<a href="https://github.com/brickadia-community/omegga/edit/master/docs/docs/plugins/jsonrpc.md" title="Suggest an edit" aria-label="Suggest an edit" rel="edit">
|
|
151
|
-
<span class=fa-svg id="git-edit-button"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M421.7 220.3l-11.3 11.3-22.6 22.6-205 205c-6.6 6.6-14.8 11.5-23.8 14.1L30.8 511c-8.4 2.5-17.5 .2-23.7-6.1S-1.5 489.7 1 481.2L38.7 353.1c2.6-9 7.5-17.2 14.1-23.8l205-205 22.6-22.6 11.3-11.3 33.9 33.9 62.1 62.1 33.9 33.9zM96 353.9l-9.3 9.3c-.9 .9-1.6 2.1-2 3.4l-25.3 86 86-25.3c1.3-.4 2.5-1.1 3.4-2l9.3-9.3H112c-8.8 0-16-7.2-16-16V353.9zM453.3 19.3l39.4 39.4c25 25 25 65.5 0 90.5l-14.5 14.5-22.6 22.6-11.3 11.3-33.9-33.9-62.1-62.1L314.3 67.7l11.3-11.3 22.6-22.6 14.5-14.5c25-25 65.5-25 90.5 0z"/></svg></span>
|
|
152
|
-
</a>
|
|
153
|
-
|
|
154
|
-
</div>
|
|
155
|
-
</div>
|
|
156
|
-
|
|
157
|
-
<div id="mdbook-search-wrapper" class="hidden">
|
|
158
|
-
<form id="mdbook-searchbar-outer" class="searchbar-outer">
|
|
159
|
-
<div class="search-wrapper">
|
|
160
|
-
<input type="search" id="mdbook-searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="mdbook-searchresults-outer" aria-describedby="searchresults-header">
|
|
161
|
-
<div class="spinner-wrapper">
|
|
162
|
-
<span class=fa-svg id="fa-spin"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M304 48c0-26.5-21.5-48-48-48s-48 21.5-48 48s21.5 48 48 48s48-21.5 48-48zm0 416c0-26.5-21.5-48-48-48s-48 21.5-48 48s21.5 48 48 48s48-21.5 48-48zM48 304c26.5 0 48-21.5 48-48s-21.5-48-48-48s-48 21.5-48 48s21.5 48 48 48zm464-48c0-26.5-21.5-48-48-48s-48 21.5-48 48s21.5 48 48 48s48-21.5 48-48zM142.9 437c18.7-18.7 18.7-49.1 0-67.9s-49.1-18.7-67.9 0s-18.7 49.1 0 67.9s49.1 18.7 67.9 0zm0-294.2c18.7-18.7 18.7-49.1 0-67.9S93.7 56.2 75 75s-18.7 49.1 0 67.9s49.1 18.7 67.9 0zM369.1 437c18.7 18.7 49.1 18.7 67.9 0s18.7-49.1 0-67.9s-49.1-18.7-67.9 0s-18.7 49.1 0 67.9z"/></svg></span>
|
|
163
|
-
</div>
|
|
164
|
-
</div>
|
|
165
|
-
</form>
|
|
166
|
-
<div id="mdbook-searchresults-outer" class="searchresults-outer hidden">
|
|
167
|
-
<div id="mdbook-searchresults-header" class="searchresults-header"></div>
|
|
168
|
-
<ul id="mdbook-searchresults">
|
|
169
|
-
</ul>
|
|
170
|
-
</div>
|
|
171
|
-
</div>
|
|
172
|
-
|
|
173
|
-
<!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
|
|
174
|
-
<script>
|
|
175
|
-
document.getElementById('mdbook-sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
|
|
176
|
-
document.getElementById('mdbook-sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
|
|
177
|
-
Array.from(document.querySelectorAll('#mdbook-sidebar a')).forEach(function(link) {
|
|
178
|
-
link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1);
|
|
179
|
-
});
|
|
180
|
-
</script>
|
|
181
|
-
|
|
182
|
-
<div id="mdbook-content" class="content">
|
|
183
|
-
<main>
|
|
184
|
-
<h1 id="json-rpc-plugins"><a class="header" href="#json-rpc-plugins">JSON RPC Plugins</a></h1>
|
|
185
|
-
<p>JSON RPC Plugins let you use any language you desire, as long as you can run it from a single executable file. They follow the <a href="https://www.jsonrpc.org/specification">JSON-RPC 2.0 Specification</a></p>
|
|
186
|
-
<p>The server communicates with the plugin by sending messages to <code>stdin</code> and expects responses in <code>stdout</code>. All <code>stderr</code> is printed to the console.</p>
|
|
187
|
-
<p>Register custom <code>/commands</code> by returning <code>{registeredCommands: ['foo', 'bar']}</code> (registers command <code>/foo</code> and <code>/bar</code>) in the <code>init</code> method.</p>
|
|
188
|
-
<h2 id="omegga-methods-you-can-access-these"><a class="header" href="#omegga-methods-you-can-access-these">Omegga Methods (You can access these)</a></h2>
|
|
189
|
-
<div class="table-wrapper">
|
|
190
|
-
<table>
|
|
191
|
-
<thead>
|
|
192
|
-
<tr><th>Method</th><th>Arguments</th><th>Description</th><th>Returns</th></tr>
|
|
193
|
-
</thead>
|
|
194
|
-
<tbody>
|
|
195
|
-
<tr><td><code>log</code></td><td>line (string)</td><td>Prints message to omegga console</td><td></td></tr>
|
|
196
|
-
<tr><td><code>error</code></td><td>line (string)</td><td>Same as <code>log</code> but with different colors</td><td></td></tr>
|
|
197
|
-
<tr><td><code>info</code></td><td>line (string)</td><td>Same as <code>log</code> but with different colors</td><td></td></tr>
|
|
198
|
-
<tr><td><code>debug</code></td><td>line (string)</td><td>Same as <code>log</code> but with different colors</td><td></td></tr>
|
|
199
|
-
<tr><td><code>warn</code></td><td>line (string)</td><td>Same as <code>log</code> but with different colors</td><td></td></tr>
|
|
200
|
-
<tr><td><code>trace</code></td><td>line (string)</td><td>Same as <code>log</code> but with different colors</td><td></td></tr>
|
|
201
|
-
<tr><td><code>store.get</code></td><td>key (string)</td><td>Get an object from plugin store</td><td>Object</td></tr>
|
|
202
|
-
<tr><td><code>store.set</code></td><td>[key (string), value (any)]</td><td>Store an object in plugin store</td><td></td></tr>
|
|
203
|
-
<tr><td><code>store.delete</code></td><td>key (string)</td><td>Remove an object from plugin store</td><td></td></tr>
|
|
204
|
-
<tr><td><code>store.wipe</code></td><td><em>none</em></td><td>Remove all objects from plugin store</td><td></td></tr>
|
|
205
|
-
<tr><td><code>store.count</code></td><td><em>none</em></td><td>Count number of objects in plugin store</td><td>Integer</td></tr>
|
|
206
|
-
<tr><td><code>store.keys</code></td><td><em>none</em></td><td>Get keys for all objects in plugin store</td><td>List of Strings</td></tr>
|
|
207
|
-
<tr><td><code>exec</code></td><td>cmd (string)</td><td>Writes a console command to Brickadia</td><td></td></tr>
|
|
208
|
-
<tr><td><code>writeln</code></td><td>cmd (string)</td><td>Same as <code>exec</code></td><td></td></tr>
|
|
209
|
-
<tr><td><code>broadcast</code></td><td>line (string)</td><td>Broadcasts a message to the server</td><td></td></tr>
|
|
210
|
-
<tr><td><code>whisper</code></td><td>{target: string, line: string}</td><td>Sends a message to a specific client</td><td></td></tr>
|
|
211
|
-
<tr><td><code>middlePrint</code></td><td>{target: string, line: string}</td><td>Sends a middle print message to a specific client</td><td></td></tr>
|
|
212
|
-
<tr><td><code>getPlayers</code></td><td><em>none</em></td><td>Online players</td><td>List of Players</td></tr>
|
|
213
|
-
<tr><td><code>getAllPlayerPositions</code></td><td><em>none</em></td><td>An array of objects with fields <code>pos</code> and <code>player</code>.</td><td>List of { <em>Player Object</em>(…), <em>Position</em>(…), isDead(bool) }</td></tr>
|
|
214
|
-
<tr><td><code>getRoleSetup</code></td><td><em>none</em></td><td>Server roles</td><td><em>JSON Data</em></td></tr>
|
|
215
|
-
<tr><td><code>getBanList</code></td><td><em>none</em></td><td>List of bans</td><td><em>JSON Data</em></td></tr>
|
|
216
|
-
<tr><td><code>getSaves</code></td><td><em>none</em></td><td>Saves in the saves directory</td><td>List Strings</td></tr>
|
|
217
|
-
<tr><td><code>getSavePath</code></td><td>name (string)</td><td>The path to a specific save</td><td>String</td></tr>
|
|
218
|
-
<tr><td><code>getSaveData</code></td><td><em>none</em></td><td>Current save as brs-js data</td><td><em>BRS Object</em></td></tr>
|
|
219
|
-
<tr><td><code>clearBricks</code></td><td>{target: string, quiet: bool}</td><td>Clears a specific player’s bricks</td><td></td></tr>
|
|
220
|
-
<tr><td><code>clearAllBricks</code></td><td>quiet</td><td>Clears all bricks on the server</td><td></td></tr>
|
|
221
|
-
<tr><td><code>saveBricks</code></td><td>name (string)</td><td>Save bricks to a save named <code>name</code></td><td></td></tr>
|
|
222
|
-
<tr><td><code>loadBricks</code></td><td>{name: string, offX, offY, offY, quiet: bool}</td><td>Load bricks of save named <code>name</code></td><td></td></tr>
|
|
223
|
-
<tr><td><code>loadBricksOnPlayer</code></td><td>{name: string, player: string, offX, offY, offY}</td><td>Load bricks of save named <code>name</code> on player clipboard</td><td></td></tr>
|
|
224
|
-
<tr><td><code>readSaveData</code></td><td>name (string)</td><td>Parses save into a brs-js save object, returns the object</td><td><em>BRS Object</em></td></tr>
|
|
225
|
-
<tr><td><code>loadSaveData</code></td><td>{data: object, offX, offY, offY, quiet: bool}</td><td>Builds brs file from data, loads the file</td><td></td></tr>
|
|
226
|
-
<tr><td><code>loadSaveDataOnPlayer</code></td><td>{data: object, player: string, offX, offY, offY}</td><td>Builds brs file from data, loads the file onto a player’s clipboard</td><td></td></tr>
|
|
227
|
-
<tr><td><code>changeMap</code></td><td>map (string)</td><td>Change map to specified map name, returns success</td><td>Boolean</td></tr>
|
|
228
|
-
<tr><td><code>player.get</code></td><td>target (string)</td><td>Gets the player by their name or UUID.</td><td><code>{name, id, controller, state, host: bool}</code></td></tr>
|
|
229
|
-
<tr><td><code>player.getRoles</code></td><td>target (string)</td><td>Target’s roles</td><td>List of Strings</td></tr>
|
|
230
|
-
<tr><td><code>player.getPermissions</code></td><td>target (string)</td><td>Target’s permissions</td><td>Record<string, boolean></td></tr>
|
|
231
|
-
<tr><td><code>player.getNameColor</code></td><td>target (string)</td><td>Target’s name color</td><td><em>RGB Hex String</em></td></tr>
|
|
232
|
-
<tr><td><code>player.getPosition</code></td><td>target (string)</td><td>Target’s position</td><td>[number, number, number] or null</td></tr>
|
|
233
|
-
<tr><td><code>player.getPawn</code></td><td>target (string)</td><td>Target’s pawn name</td><td>string or null</td></tr>
|
|
234
|
-
<tr><td><code>player.getGhostBrick</code></td><td>target (string)</td><td>Target’s ghost brick</td><td>{targetGrid, location, orientation}</td></tr>
|
|
235
|
-
<tr><td><code>player.getPaint</code></td><td>target (string)</td><td>Target’s current paint selection</td><td>{materialIndex, materialAlpha, material, color}</td></tr>
|
|
236
|
-
<tr><td><code>player.isCrouched</code></td><td>target (string)</td><td>Check if target is crouched</td><td>boolean</td></tr>
|
|
237
|
-
<tr><td><code>player.isDead</code></td><td>target (string)</td><td>Check if target is dead</td><td>boolean</td></tr>
|
|
238
|
-
<tr><td><code>player.getTemplateBounds</code></td><td>target (string)</td><td>Target’s template/selection bounds</td><td>{minBound, maxBound, center}</td></tr>
|
|
239
|
-
<tr><td><code>player.getTemplateBoundsData</code></td><td>target (string)</td><td>Target’s template/selection as brs-js save data</td><td><em>BRS Object</em></td></tr>
|
|
240
|
-
<tr><td><code>player.clearBricks</code></td><td>{target, quiet}</td><td>Clears target’s bricks</td><td></td></tr>
|
|
241
|
-
<tr><td><code>player.loadBricks</code></td><td>{target, saveName}</td><td>Loads save file to target’s clipboard</td><td></td></tr>
|
|
242
|
-
<tr><td><code>player.loadSaveData</code></td><td>{target, data, offX, offY, offZ}</td><td>Loads brs-js save data to target’s clipboard</td><td></td></tr>
|
|
243
|
-
<tr><td><code>player.loadDataAtGhostBrick</code></td><td>{target, data, rotate=true, offX, offY, offZ, quiet}</td><td>Loads brs-js save data at target’s selection bounds</td><td></td></tr>
|
|
244
|
-
<tr><td><code>player.kill</code></td><td>target (string)</td><td>Kills the target player</td><td></td></tr>
|
|
245
|
-
<tr><td><code>player.damage</code></td><td>{target, amount}</td><td>Damages target by amount</td><td></td></tr>
|
|
246
|
-
<tr><td><code>player.heal</code></td><td>{target, amount}</td><td>Heals target by amount</td><td></td></tr>
|
|
247
|
-
<tr><td><code>player.giveItem</code></td><td>{target, item}</td><td>Gives target an item</td><td></td></tr>
|
|
248
|
-
<tr><td><code>player.takeItem</code></td><td>{target, item}</td><td>Removes item from target</td><td></td></tr>
|
|
249
|
-
<tr><td><code>player.setTeam</code></td><td>{target, teamIndex}</td><td>Sets target’s team</td><td></td></tr>
|
|
250
|
-
<tr><td><code>player.setMinigame</code></td><td>{target, index}</td><td>Adds target to minigame at index</td><td></td></tr>
|
|
251
|
-
<tr><td><code>player.setScore</code></td><td>{target, minigameIndex, score}</td><td>Sets target’s score in minigame</td><td></td></tr>
|
|
252
|
-
<tr><td><code>player.getScore</code></td><td>target (string)</td><td>Gets target’s score in minigame</td><td>number</td></tr>
|
|
253
|
-
<tr><td><code>player.setLeaderboard</code></td><td>{target, key, value}</td><td>Sets leaderboard value for target</td><td></td></tr>
|
|
254
|
-
<tr><td><code>player.getLeaderboard</code></td><td>target (string)</td><td>Gets leaderboard value for target</td><td>number or null</td></tr>
|
|
255
|
-
<tr><td><code>plugin.get</code></td><td>target (string)</td><td>Gets info on the target plugin</td><td>Object</td></tr>
|
|
256
|
-
<tr><td><code>plugin.emit</code></td><td>[target (string), event (string), …args (any)]</td><td>Emit a custom event to the target plugin</td><td></td></tr>
|
|
257
|
-
</tbody>
|
|
258
|
-
</table>
|
|
259
|
-
</div>
|
|
260
|
-
<h2 id="plugin-methods-you-implement-these"><a class="header" href="#plugin-methods-you-implement-these">Plugin Methods (You implement these)</a></h2>
|
|
261
|
-
<div class="table-wrapper">
|
|
262
|
-
<table>
|
|
263
|
-
<thead>
|
|
264
|
-
<tr><th>Method</th><th>Arguments</th><th>Description</th><th>Required</th></tr>
|
|
265
|
-
</thead>
|
|
266
|
-
<tbody>
|
|
267
|
-
<tr><td><code>init</code></td><td>config object</td><td>Returns a start result, called on plugin start</td><td>☑</td></tr>
|
|
268
|
-
<tr><td><code>stop</code></td><td><em>none</em></td><td>Returns <em>something</em>, called on plugin stop</td><td>☑</td></tr>
|
|
269
|
-
<tr><td><code>bootstrap</code></td><td>[{ omegga info (<code>host</code>, <code>version</code>, etc) }]</td><td>Run when plugin is started for base data</td><td></td></tr>
|
|
270
|
-
<tr><td><code>plugin:players:raw</code></td><td>[[… [player <code>username</code>, <code>displayName</code>, <code>id</code>, <code>controller</code>, <code>state</code>]]]</td><td>Lists players on the server</td><td></td></tr>
|
|
271
|
-
<tr><td><code>plugin:emit</code></td><td>[event, from, …args]</td><td>Fired when another plugin sends an event</td><td></td></tr>
|
|
272
|
-
<tr><td><code>line</code></td><td>[brickadiaLog string]</td><td>A brickadia console log</td><td></td></tr>
|
|
273
|
-
<tr><td><code>start</code></td><td>[{map}]</td><td>On brickadia server start</td><td></td></tr>
|
|
274
|
-
<tr><td><code>host</code></td><td>[{name, id}]</td><td>When the host is detected</td><td></td></tr>
|
|
275
|
-
<tr><td><code>version</code></td><td>[-1 or the CL number]</td><td>When the version is detected</td><td></td></tr>
|
|
276
|
-
<tr><td><code>unauthorized</code></td><td><em>none</em></td><td>On brickadia server fails an auth check</td><td></td></tr>
|
|
277
|
-
<tr><td><code>join</code></td><td>[{name, id, state, controller}]</td><td>Run when a player joins</td><td></td></tr>
|
|
278
|
-
<tr><td><code>leave</code></td><td>[{name, id, state, controller}]</td><td>Run when a player leaves</td><td></td></tr>
|
|
279
|
-
<tr><td><code>cmd:command</code></td><td>[playerName, …args]</td><td>Runs when a player runs a <code>/command args</code></td><td></td></tr>
|
|
280
|
-
<tr><td><code>chatcmd:command</code></td><td>[playerName, …args]</td><td>Runs when a player runs a <code>!command args</code></td><td></td></tr>
|
|
281
|
-
<tr><td><code>chat</code></td><td>[playerName, message]</td><td>Runs when a player sends a chat message</td><td></td></tr>
|
|
282
|
-
<tr><td><code>interact</code></td><td>{brick_asset: string;player: { id: string; name: string; controller: string; pawn: string };position: [number, number, number];}</td><td>Runs when a player clicks a brick with an interact component. <code>data</code> is parsed JSON if <code>line</code> (from interact component) starts with “json:{“your”: “json”}`. Uses interact log field</td><td></td></tr>
|
|
283
|
-
<tr><td><code>event:NAME</code></td><td>[>player from click<, …args]</td><td>Runs when an interact component has `event:NAME: arg1,arg2,arg,3,</td><td></td></tr>
|
|
284
|
-
<tr><td><code>mapchange</code></td><td>[{map}]</td><td>Runs when the map changes</td><td></td></tr>
|
|
285
|
-
<tr><td><code>autorestart</code></td><td>[autorestart config]</td><td>Runs server has an autorestart scheduled</td><td></td></tr>
|
|
286
|
-
<tr><td><code>minigamejoin</code></td><td>{player: {name, id}; minigameName: string}</td><td><strong>Deprecated as of EA3.</strong> Runs when a player joins a minigame. Note that minigameName is not unique between minigames. minigameName will be null if player leaves all minigames. This will run before <code>join</code></td><td></td></tr>
|
|
287
|
-
<tr><td><code>wirelog</code></td><td>[raw string]</td><td>Runs when a <code>[Wire Graph]</code> log line is emitted. <code>raw</code> is the text after the <code>[Wire Graph] </code> prefix</td><td></td></tr>
|
|
288
|
-
<tr><td><code>wirecmd:command</code></td><td>[…args]</td><td>Runs when a <code>[Wire Graph]</code> log starts with <code>command args</code>. <code>command</code> is lowercased; args are the remaining space-separated words</td><td></td></tr>
|
|
289
|
-
</tbody>
|
|
290
|
-
</table>
|
|
291
|
-
</div>
|
|
292
|
-
<h2 id="folder-structure"><a class="header" href="#folder-structure">Folder Structure</a></h2>
|
|
293
|
-
<p>In a <code>plugins</code> directory create the following folder structure:</p>
|
|
294
|
-
<ul>
|
|
295
|
-
<li><code>plugins/myPlugin</code> - plugin folder (required)</li>
|
|
296
|
-
<li><code>plugins/myPlugin/doc.json</code></li>
|
|
297
|
-
<li><code>plugins/myPlugin/omegga_plugin</code> - executable plugin file (required)</li>
|
|
298
|
-
</ul>
|
|
299
|
-
<h2 id="omegga_plugin-example-node-javascript"><a class="header" href="#omegga_plugin-example-node-javascript"><code>omegga_plugin</code> (example, node javascript)</a></h2>
|
|
300
|
-
<pre><code class="language-javascript">#!/usr/bin/env node
|
|
301
|
-
|
|
302
|
-
const readline = require('readline');
|
|
303
|
-
const { EventEmitter } = require('events');
|
|
304
|
-
const {
|
|
305
|
-
JSONRPCServer,
|
|
306
|
-
JSONRPCServerAndClient,
|
|
307
|
-
JSONRPCClient,
|
|
308
|
-
} = require('json-rpc-2.0');
|
|
309
|
-
|
|
310
|
-
// events
|
|
311
|
-
const ev = new EventEmitter();
|
|
312
|
-
|
|
313
|
-
// stdio handling
|
|
314
|
-
const rl = readline.createInterface({
|
|
315
|
-
input: process.stdin,
|
|
316
|
-
output: process.stdout,
|
|
317
|
-
terminal: false,
|
|
318
|
-
});
|
|
319
|
-
|
|
320
|
-
// rpc "server and client" for responding/receiving messages
|
|
321
|
-
const rpc = new JSONRPCServerAndClient(
|
|
322
|
-
new JSONRPCServer(),
|
|
323
|
-
// the client outputs JSON to console
|
|
324
|
-
new JSONRPCClient(async blob => console.log(JSON.stringify(blob)))
|
|
325
|
-
);
|
|
326
|
-
|
|
327
|
-
// on stdin, pass into rpc
|
|
328
|
-
rl.on('line', line => {
|
|
329
|
-
try {
|
|
330
|
-
rpc.receiveAndSend(JSON.parse(line));
|
|
331
|
-
} catch (e) {
|
|
332
|
-
console.error(e);
|
|
333
|
-
}
|
|
334
|
-
});
|
|
335
|
-
|
|
336
|
-
// regexes for matching brickadia console logs
|
|
337
|
-
const GENERIC_LINE_REGEX =
|
|
338
|
-
/^(\[(?<date>\d{4}\.\d\d.\d\d-\d\d.\d\d.\d\d:\d{3})\]\[\s*(?<counter>\d+)\])?(?<generator>\w+): (?<data>.+)$/;
|
|
339
|
-
const LOG_LINE_REGEX =
|
|
340
|
-
/\[(?<date>\d{4}\.\d\d.\d\d-\d\d.\d\d.\d\d:\d{3})\]\[\s*(?<counter>\d+)\](?<rest>.*)$/;
|
|
341
|
-
|
|
342
|
-
ev.on('line', line => {
|
|
343
|
-
const logMatch = line.match(LOG_LINE_REGEX);
|
|
344
|
-
if (!logMatch) return;
|
|
345
|
-
const {
|
|
346
|
-
groups: { rest },
|
|
347
|
-
} = logMatch;
|
|
348
|
-
const dataMatch = rest.match(GENERIC_LINE_REGEX);
|
|
349
|
-
if (dataMatch) ev.emit('logData', dataMatch.groups);
|
|
350
|
-
else ev.emit('logLine', rest);
|
|
351
|
-
});
|
|
352
|
-
|
|
353
|
-
// list of players
|
|
354
|
-
let players;
|
|
355
|
-
|
|
356
|
-
// get a player by name
|
|
357
|
-
const getPlayer = name => players.find(p => p.name === name);
|
|
358
|
-
|
|
359
|
-
// watch console logs for a pattern, then remove the listener
|
|
360
|
-
function watch(exec, pattern) {
|
|
361
|
-
return new Promise(resolve => {
|
|
362
|
-
function listener(line) {
|
|
363
|
-
const match = line.match(pattern);
|
|
364
|
-
// listener removes itself on a match
|
|
365
|
-
if (match) {
|
|
366
|
-
ev.off('logLine', listener);
|
|
367
|
-
resolve(match.groups);
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
// add the listener
|
|
371
|
-
ev.on('logLine', listener);
|
|
372
|
-
|
|
373
|
-
// run the console command
|
|
374
|
-
rpc.notify('writeln', exec);
|
|
375
|
-
});
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
// get a player's position
|
|
379
|
-
async function getPlayerPos(name) {
|
|
380
|
-
const player = getPlayer(name);
|
|
381
|
-
if (!player) return;
|
|
382
|
-
|
|
383
|
-
// get player position from player controller
|
|
384
|
-
const pawnRegExp = new RegExp(
|
|
385
|
-
`BP_PlayerController_C .+?PersistentLevel\\.${player.controller}\.Pawn = BP_FigureV2_C'.+?:PersistentLevel.(?<pawn>BP_FigureV2_C_\\d+)'`
|
|
386
|
-
);
|
|
387
|
-
const { pawn } = await watch(
|
|
388
|
-
`GetAll BP_PlayerController_C Pawn Name=${player.controller}`,
|
|
389
|
-
pawnRegExp
|
|
390
|
-
);
|
|
391
|
-
|
|
392
|
-
// get player position from pawn
|
|
393
|
-
const posRegExp = new RegExp(
|
|
394
|
-
`CapsuleComponent .+?PersistentLevel\\.${pawn}\\.CollisionCylinder\\.RelativeLocation = \\(X=(?<x>[\\d\\.-]+),Y=(?<y>[\\d\\.-]+),Z=(?<z>[\\d\\.-]+)\\)`
|
|
395
|
-
);
|
|
396
|
-
const { x, y, z } = await watch(
|
|
397
|
-
`GetAll SceneComponent RelativeLocation Name=CollisionCylinder Outer=${pawn}`,
|
|
398
|
-
posRegExp
|
|
399
|
-
);
|
|
400
|
-
|
|
401
|
-
return [x, y, z].map(Number);
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
// emit a console log
|
|
405
|
-
const log = (...args) => rpc.notify('log', args.join(' '));
|
|
406
|
-
|
|
407
|
-
// when available players updates - plugin:players:raw is emitted
|
|
408
|
-
rpc.addMethod('plugin:players:raw', ([playerArr]) => {
|
|
409
|
-
// update the players list
|
|
410
|
-
players = playerArr.map(p => ({
|
|
411
|
-
name: p[0],
|
|
412
|
-
id: p[1],
|
|
413
|
-
controller: p[2],
|
|
414
|
-
state: p[3],
|
|
415
|
-
}));
|
|
416
|
-
});
|
|
417
|
-
|
|
418
|
-
// ping command
|
|
419
|
-
rpc.addMethod('chatcmd:ping', ([name, ...args]) => {
|
|
420
|
-
rpc.notify('broadcast', `pong @ ${name} + ${args.length} args`);
|
|
421
|
-
});
|
|
422
|
-
|
|
423
|
-
// player position command
|
|
424
|
-
rpc.addMethod('chatcmd:pos', async ([name]) => {
|
|
425
|
-
log('player', name, 'requests position');
|
|
426
|
-
const [x, y, z] = await getPlayerPos(name);
|
|
427
|
-
rpc.notify('broadcast', `<b>${name}</> is at ${x} ${y} ${z}`);
|
|
428
|
-
});
|
|
429
|
-
|
|
430
|
-
// pass lines into the event emitter
|
|
431
|
-
rpc.addMethod('line', ([line]) => {
|
|
432
|
-
ev.emit('line', line);
|
|
433
|
-
});
|
|
434
|
-
|
|
435
|
-
// receive config object in init
|
|
436
|
-
rpc.addMethod('init', async ([config]) => ({ registeredCommands: [] }));
|
|
437
|
-
rpc.addMethod('stop', async () => 'ok');
|
|
438
|
-
</code></pre>
|
|
439
|
-
<h2 id="see-also"><a class="header" href="#see-also">See also</a></h2>
|
|
440
|
-
<ul>
|
|
441
|
-
<li><a href="../plugins/">Plugin structure</a> for <code>doc.json</code>, <code>plugin.json</code>, config, and the store</li>
|
|
442
|
-
<li><a href="../api/events.html">Events</a> for what each event carries</li>
|
|
443
|
-
<li><a href="../metrics.html#plugin-metrics">Plugin metrics</a> for exporting your own Prometheus metrics</li>
|
|
444
|
-
</ul>
|
|
445
|
-
|
|
446
|
-
</main>
|
|
447
|
-
|
|
448
|
-
<nav class="nav-wrapper" aria-label="Page navigation">
|
|
449
|
-
<!-- Mobile navigation buttons -->
|
|
450
|
-
<a rel="prev" href="../plugins/unsafe.html" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
|
|
451
|
-
<span class=fa-svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 246.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z"/></svg></span>
|
|
452
|
-
</a>
|
|
453
|
-
|
|
454
|
-
<a rel="next prefetch" href="../api/index.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
|
|
455
|
-
<span class=fa-svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M278.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-160 160c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L210.7 256 73.4 118.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l160 160z"/></svg></span>
|
|
456
|
-
</a>
|
|
457
|
-
|
|
458
|
-
<div style="clear: both"></div>
|
|
459
|
-
</nav>
|
|
460
|
-
</div>
|
|
461
|
-
</div>
|
|
462
|
-
|
|
463
|
-
<nav class="nav-wide-wrapper" aria-label="Page navigation">
|
|
464
|
-
<a rel="prev" href="../plugins/unsafe.html" class="nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
|
|
465
|
-
<span class=fa-svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 246.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z"/></svg></span>
|
|
466
|
-
</a>
|
|
467
|
-
|
|
468
|
-
<a rel="next prefetch" href="../api/index.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
|
|
469
|
-
<span class=fa-svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M278.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-160 160c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L210.7 256 73.4 118.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l160 160z"/></svg></span>
|
|
470
|
-
</a>
|
|
471
|
-
</nav>
|
|
472
|
-
|
|
473
|
-
</div>
|
|
474
|
-
|
|
475
|
-
<template id=fa-eye><span class=fa-svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M288 32c-80.8 0-145.5 36.8-192.6 80.6C48.6 156 17.3 208 2.5 243.7c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32zM432 256c0 79.5-64.5 144-144 144s-144-64.5-144-144s64.5-144 144-144s144 64.5 144 144zM288 192c0 35.3-28.7 64-64 64c-11.5 0-22.3-3-31.6-8.4c-.2 2.8-.4 5.5-.4 8.4c0 53 43 96 96 96s96-43 96-96s-43-96-96-96c-2.8 0-5.6 .1-8.4 .4c5.3 9.3 8.4 20.1 8.4 31.6z"/></svg></span></template>
|
|
476
|
-
<template id=fa-eye-slash><span class=fa-svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L525.6 386.7c39.6-40.6 66.4-86.1 79.9-118.4c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C465.5 68.8 400.8 32 320 32c-68.2 0-125 26.3-169.3 60.8L38.8 5.1zM223.1 149.5C248.6 126.2 282.7 112 320 112c79.5 0 144 64.5 144 144c0 24.9-6.3 48.3-17.4 68.7L408 294.5c5.2-11.8 8-24.8 8-38.5c0-53-43-96-96-96c-2.8 0-5.6 .1-8.4 .4c5.3 9.3 8.4 20.1 8.4 31.6c0 10.2-2.4 19.8-6.6 28.3l-90.3-70.8zm223.1 298L373 389.9c-16.4 6.5-34.3 10.1-53 10.1c-79.5 0-144-64.5-144-144c0-6.9 .5-13.6 1.4-20.2L83.1 161.5C60.3 191.2 44 220.8 34.5 243.7c-3.3 7.9-3.3 16.7 0 24.6c14.9 35.7 46.2 87.7 93 131.1C174.5 443.2 239.2 480 320 480c47.8 0 89.9-12.9 126.2-32.5z"/></svg></span></template>
|
|
477
|
-
<template id=fa-copy><span class=fa-svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M502.6 70.63l-61.25-61.25C435.4 3.371 427.2 0 418.7 0H255.1c-35.35 0-64 28.66-64 64l.0195 256C192 355.4 220.7 384 256 384h192c35.2 0 64-28.8 64-64V93.25C512 84.77 508.6 76.63 502.6 70.63zM464 320c0 8.836-7.164 16-16 16H255.1c-8.838 0-16-7.164-16-16L239.1 64.13c0-8.836 7.164-16 16-16h128L384 96c0 17.67 14.33 32 32 32h47.1V320zM272 448c0 8.836-7.164 16-16 16H63.1c-8.838 0-16-7.164-16-16L47.98 192.1c0-8.836 7.164-16 16-16H160V128H63.99c-35.35 0-64 28.65-64 64l.0098 256C.002 483.3 28.66 512 64 512h192c35.2 0 64-28.8 64-64v-32h-47.1L272 448z"/></svg></span></template>
|
|
478
|
-
<template id=fa-play><span class=fa-svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M73 39c-14.8-9.1-33.4-9.4-48.5-.9S0 62.6 0 80V432c0 17.4 9.4 33.4 24.5 41.9s33.7 8.1 48.5-.9L361 297c14.3-8.7 23-24.2 23-41s-8.7-32.2-23-41L73 39z"/></svg></span></template>
|
|
479
|
-
<template id=fa-clock-rotate-left><span class=fa-svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M75 75L41 41C25.9 25.9 0 36.6 0 57.9V168c0 13.3 10.7 24 24 24H134.1c21.4 0 32.1-25.9 17-41l-30.8-30.8C155 85.5 203 64 256 64c106 0 192 86 192 192s-86 192-192 192c-40.8 0-78.6-12.7-109.7-34.4c-14.5-10.1-34.4-6.6-44.6 7.9s-6.6 34.4 7.9 44.6C151.2 495 201.7 512 256 512c141.4 0 256-114.6 256-256S397.4 0 256 0C185.3 0 121.3 28.7 75 75zm181 53c-13.3 0-24 10.7-24 24V256c0 6.4 2.5 12.5 7 17l72 72c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-65-65V152c0-13.3-10.7-24-24-24z"/></svg></span></template>
|
|
480
|
-
|
|
481
|
-
<!-- Livereload script (if served using the cli tool) -->
|
|
482
|
-
<script>
|
|
483
|
-
const wsProtocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
|
|
484
|
-
const wsAddress = wsProtocol + "//" + location.host + "/" + "__livereload";
|
|
485
|
-
const socket = new WebSocket(wsAddress);
|
|
486
|
-
socket.onmessage = function (event) {
|
|
487
|
-
if (event.data === "reload") {
|
|
488
|
-
socket.close();
|
|
489
|
-
location.reload();
|
|
490
|
-
}
|
|
491
|
-
};
|
|
492
|
-
|
|
493
|
-
window.onbeforeunload = function() {
|
|
494
|
-
socket.close();
|
|
495
|
-
}
|
|
496
|
-
</script>
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
<script>
|
|
500
|
-
window.playground_copyable = true;
|
|
501
|
-
</script>
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
<script src="../elasticlunr-ef4e11c1.min.js"></script>
|
|
505
|
-
<script src="../mark-09e88c2c.min.js"></script>
|
|
506
|
-
<script src="../searcher-09f2665d.js"></script>
|
|
507
|
-
|
|
508
|
-
<script src="../clipboard-1626706a.min.js"></script>
|
|
509
|
-
<script src="../highlight-abc7f01d.js"></script>
|
|
510
|
-
<script src="../book-609e4cb8.js"></script>
|
|
511
|
-
|
|
512
|
-
<!-- Custom JS scripts -->
|
|
513
|
-
<script src="../theme/wirescript-hljs-69fbef4b.js"></script>
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
</div>
|
|
518
|
-
</body>
|
|
519
|
-
</html>
|