omegga 0.1.80 → 0.1.84

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.
@@ -23,4 +23,4 @@ jobs:
23
23
  uses: wearerequired/lint-action@v1
24
24
  with:
25
25
  github_token: ${{ secrets.github_token }}
26
- eslint: true
26
+ prettier: true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omegga",
3
- "version": "0.1.80",
3
+ "version": "0.1.84",
4
4
  "description": "Brickadia server installer, manager, wrapper, configurator, and automator",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -13,11 +13,10 @@
13
13
  "brs-js": "^2.0.0",
14
14
  "child_process": "^1.0.2",
15
15
  "chokidar": "^3.4.2",
16
- "colors": "^1.4.0",
16
+ "colors": "1.4.0",
17
17
  "commander": "^5.1.0",
18
18
  "configstore": "^5.0.1",
19
19
  "disrequire": "^1.1.1",
20
- "eslint-plugin-prettier": "^4.0.0",
21
20
  "express": "^4.17.1",
22
21
  "express-session": "^1.17.1",
23
22
  "fibers": "^5.0.0",
@@ -26,9 +25,8 @@
26
25
  "js-yaml": "^3.14.0",
27
26
  "json-rpc-2.0": "^0.2.10",
28
27
  "lodash": "^4.17.20",
29
- "nedb": "^1.8.0",
30
- "nedb-promise": "^2.0.1",
31
- "nedb-session-store": "^1.1.2",
28
+ "nedb-promises": "^5.0.1",
29
+ "nedb-promises-session-store": "1.0.0",
32
30
  "npm": "^7.20.6",
33
31
  "password-prompt": "^1.1.2",
34
32
  "pem": "^1.14.4",
@@ -37,25 +35,21 @@
37
35
  "semver": "^7.3.4",
38
36
  "simple-git": "^2.31.0",
39
37
  "socket.io": "^2.3.0",
40
- "strip-ansi": "^6.0.0",
38
+ "strip-ansi": "^6.0.1",
41
39
  "update-notifier": "^5.0.0",
42
40
  "vm2": "3.9.2 || >3.9.4",
43
41
  "vue-grid-layout": "^2.3.9"
44
42
  },
45
43
  "devDependencies": {
46
44
  "@babel/core": "^7.13.8",
47
- "@babel/eslint-parser": "^7.13.8",
48
45
  "@babel/plugin-proposal-class-properties": "^7.13.0",
49
46
  "@tabler/icons": "^1.39.1",
50
47
  "@vue/babel-helper-vue-jsx-merge-props": "^1.2.1",
51
48
  "bufferutil": "^4.0.1",
52
49
  "css-loader": "^4.3.0",
53
- "eslint": "^7.10.0",
54
- "eslint-plugin-vue": "^7.0.1",
55
50
  "file-loader": "^6.1.0",
56
51
  "jsdoc-to-markdown": "^7.0.1",
57
52
  "mini-css-extract-plugin": "^1.0.0",
58
- "prettier-eslint": "^8.2.2",
59
53
  "sass": "^1.42.1",
60
54
  "sass-loader": "^12.1.0",
61
55
  "url-loader": "^4.1.1",
@@ -73,8 +67,8 @@
73
67
  },
74
68
  "scripts": {
75
69
  "start": "node index.js",
76
- "lint": "npx eslint \"src/\"",
77
- "lint:fix": "npx eslint \"src/\" --fix",
70
+ "lint": "npx prettier --check \"src/\"",
71
+ "lint:fix": "npx prettier \"src/\"",
78
72
  "watch": "npx webpack --watch",
79
73
  "dist": "MODE=production npx webpack",
80
74
  "build": "npx webpack"
@@ -220,9 +220,7 @@ class BrickadiaServer extends EventEmitter {
220
220
  }
221
221
 
222
222
  lineListener(line) {
223
- line = stripAnsi(line);
224
-
225
- this.emit('line', line);
223
+ this.emit('line', stripAnsi(line));
226
224
  }
227
225
  }
228
226
 
@@ -21,5 +21,6 @@
21
21
  "spectator",
22
22
  "ghost",
23
23
  "ping",
24
- "gettransform"
25
- ]
24
+ "gettransform",
25
+ "back"
26
+ ]
@@ -1,7 +1,7 @@
1
1
  const fs = require('fs');
2
2
  const path = require('path');
3
3
 
4
- const Datastore = require('nedb-promise');
4
+ const Datastore = require('nedb-promises');
5
5
 
6
6
  const soft = require('../softconfig.js');
7
7
 
@@ -234,10 +234,11 @@ class PluginLoader {
234
234
  constructor(pluginsPath, omegga) {
235
235
  this.path = pluginsPath;
236
236
  this.omegga = omegga;
237
- this.store = new Datastore({
237
+ this.store = Datastore.create({
238
238
  filename: path.join(omegga.dataPath, soft.PLUGIN_STORE),
239
239
  autoload: true,
240
240
  });
241
+ this.store.persistence.setAutocompactionInterval(1000 * 60 * 5);
241
242
  this.formats = [];
242
243
  this.plugins = [];
243
244
 
@@ -520,7 +520,7 @@ module.exports = (server, io) => {
520
520
 
521
521
  log(
522
522
  'Clearing bricks for player',
523
- omegga.getNameCache()?.savedPlayerNames?.[id].yellow ??
523
+ omegga.getNameCache()?.savedPlayerNames?.[id]?.yellow ??
524
524
  'with id ' + id.yellow
525
525
  );
526
526
 
@@ -1,6 +1,6 @@
1
1
  const path = require('path');
2
2
 
3
- const Datastore = require('nedb-promise');
3
+ const Datastore = require('nedb-promises');
4
4
  const bcrypt = require('bcrypt');
5
5
  const chokidar = require('chokidar');
6
6
 
@@ -43,23 +43,23 @@ class Database extends EventEmitter {
43
43
 
44
44
  // create all the stores
45
45
  this.stores = {
46
- users: new Datastore({
46
+ users: Datastore.create({
47
47
  filename: path.join(omegga.dataPath, soft.USER_STORE),
48
48
  ...dbOpts,
49
49
  }),
50
- chat: new Datastore({
50
+ chat: Datastore.create({
51
51
  filename: path.join(omegga.dataPath, soft.CHAT_STORE),
52
52
  ...dbOpts,
53
53
  }),
54
- players: new Datastore({
54
+ players: Datastore.create({
55
55
  filename: path.join(omegga.dataPath, soft.PLAYER_STORE),
56
56
  ...dbOpts,
57
57
  }),
58
- status: new Datastore({
58
+ status: Datastore.create({
59
59
  filename: path.join(omegga.dataPath, soft.STATUS_STORE),
60
60
  ...dbOpts,
61
61
  }),
62
- server: new Datastore({
62
+ server: Datastore.create({
63
63
  filename: path.join(omegga.dataPath, soft.SERVER_STORE),
64
64
  ...dbOpts,
65
65
  }),
@@ -384,7 +384,7 @@ class Database extends EventEmitter {
384
384
  // get recent chat activity
385
385
  async getChats({ count = 50, sameServer, before, after } = {}) {
386
386
  return await this.stores.chat
387
- .cfind({
387
+ .find({
388
388
  type: 'chat',
389
389
  ...(sameServer ? { instanceId: await this.getInstanceId() } : {}),
390
390
  created: before
@@ -453,7 +453,7 @@ class Database extends EventEmitter {
453
453
  const [total, players, exactResult] = await Promise.all([
454
454
  this.stores.players.count(query),
455
455
  this.stores.players
456
- .cfind(query)
456
+ .find(query)
457
457
  // TODO: add other sorts and sort directions
458
458
  .sort({ [sort]: direction })
459
459
  .skip(count * page)
@@ -515,7 +515,7 @@ class Database extends EventEmitter {
515
515
  const [total, users] = await Promise.all([
516
516
  this.stores.users.count(query),
517
517
  this.stores.users
518
- .cfind(query)
518
+ .find(query)
519
519
  // TODO: add other sorts and sort directions
520
520
  .sort({ [sort]: direction })
521
521
  .skip(count * page)
@@ -535,17 +535,17 @@ class Database extends EventEmitter {
535
535
  const [player, banHistory, kickHistory, notes] = await Promise.all([
536
536
  this.stores.players.findOne({ type: 'userHistory', id }),
537
537
  this.stores.players
538
- .cfind({ type: 'banHistory', banned: id })
538
+ .find({ type: 'banHistory', banned: id })
539
539
  .sort({ created: -1 })
540
540
  .limit(25)
541
541
  .exec(),
542
542
  this.stores.players
543
- .cfind({ type: 'kickHistory', kicked: id })
543
+ .find({ type: 'kickHistory', kicked: id })
544
544
  .sort({ created: -1 })
545
545
  .limit(25)
546
546
  .exec(),
547
547
  this.stores.players
548
- .cfind({ type: 'note', id })
548
+ .find({ type: 'note', id })
549
549
  .sort({ created: -1 })
550
550
  .limit(25)
551
551
  .exec(),
@@ -4,7 +4,7 @@ const https = require('https');
4
4
 
5
5
  const express = require('express');
6
6
  const expressSession = require('express-session');
7
- const NedbStore = require('nedb-session-store')(expressSession);
7
+ const NedbStore = require('nedb-promises-session-store').default;
8
8
  const SocketIo = require('socket.io');
9
9
  const bodyParser = require('body-parser');
10
10
 
@@ -111,8 +111,9 @@ class Webserver {
111
111
  maxAge: 365 * 24 * 60 * 60 * 1000, // 1 year
112
112
  },
113
113
  // use a nedb database for session store
114
- store: new NedbStore({
114
+ store: NedbStore({
115
115
  filename: path.join(this.dataPath, soft.SESSION_STORE),
116
+ connect: expressSession,
116
117
  }),
117
118
  });
118
119
  this.app.use(session);
@@ -1,5 +1,4 @@
1
- <style lang="scss" scoped>
2
- </style>
1
+ <style lang="scss" scoped></style>
3
2
 
4
3
  <template>
5
4
  <page>
package/.eslintrc.yml DELETED
@@ -1,21 +0,0 @@
1
- env:
2
- node: true,
3
- es2021: true
4
- extends:
5
- - eslint:recommended
6
- parser: "@babel/eslint-parser"
7
- plugins: [prettier]
8
- parserOptions:
9
- ecmaVersion: 12
10
- requireConfigFile: false
11
- globals:
12
- Omegga: readonly
13
- VERBOSE: readonly
14
- rules:
15
- prettier/prettier: warn
16
- linebreak-style:
17
- - error
18
- - unix
19
- no-unused-vars:
20
- - error
21
- - argsIgnorePattern: ^_