Spaces:
Runtime error
Runtime error
Update lineup_persistence.js
Browse files- lineup_persistence.js +11 -5
lineup_persistence.js
CHANGED
|
@@ -11,7 +11,8 @@ const storage = require('./storage');
|
|
| 11 |
const LINEUP_DATA_FILE = path.join(storage.PERSISTENT_DIR, 'lineup_persistence.json');
|
| 12 |
|
| 13 |
let guildLineups = new Map();
|
| 14 |
-
let
|
|
|
|
| 15 |
let lineupOwners = new Map();
|
| 16 |
let activeLineupMessages = new Map();
|
| 17 |
let managerBoards = new Map();
|
|
@@ -26,7 +27,8 @@ function save() {
|
|
| 26 |
try {
|
| 27 |
const data = {
|
| 28 |
guildLineups: {},
|
| 29 |
-
|
|
|
|
| 30 |
lineupOwners: Object.fromEntries(lineupOwners),
|
| 31 |
activeLineupMessages: Object.fromEntries(activeLineupMessages),
|
| 32 |
managerBoards: Object.fromEntries(managerBoards),
|
|
@@ -69,8 +71,12 @@ function load() {
|
|
| 69 |
}
|
| 70 |
}
|
| 71 |
|
| 72 |
-
if (data.
|
| 73 |
-
for (const [k, v] of Object.entries(data.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
}
|
| 75 |
|
| 76 |
if (data.lineupOwners) {
|
|
@@ -121,5 +127,5 @@ if (data.guildFriendlyPingType) {
|
|
| 121 |
load();
|
| 122 |
|
| 123 |
module.exports = {
|
| 124 |
-
guildLineups, guildLineupsB,
|
| 125 |
};
|
|
|
|
| 11 |
const LINEUP_DATA_FILE = path.join(storage.PERSISTENT_DIR, 'lineup_persistence.json');
|
| 12 |
|
| 13 |
let guildLineups = new Map();
|
| 14 |
+
let guildSelectedFormationA = new Map();
|
| 15 |
+
let guildSelectedFormationB = new Map();
|
| 16 |
let lineupOwners = new Map();
|
| 17 |
let activeLineupMessages = new Map();
|
| 18 |
let managerBoards = new Map();
|
|
|
|
| 27 |
try {
|
| 28 |
const data = {
|
| 29 |
guildLineups: {},
|
| 30 |
+
guildSelectedFormationA: Object.fromEntries(guildSelectedFormationA),
|
| 31 |
+
guildSelectedFormationB: Object.fromEntries(guildSelectedFormationB),
|
| 32 |
lineupOwners: Object.fromEntries(lineupOwners),
|
| 33 |
activeLineupMessages: Object.fromEntries(activeLineupMessages),
|
| 34 |
managerBoards: Object.fromEntries(managerBoards),
|
|
|
|
| 71 |
}
|
| 72 |
}
|
| 73 |
|
| 74 |
+
if (data.guildSelectedFormationA) {
|
| 75 |
+
for (const [k, v] of Object.entries(data.guildSelectedFormationA)) guildSelectedFormationA.set(k, v);
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
if (data.guildSelectedFormationB) {
|
| 79 |
+
for (const [k, v] of Object.entries(data.guildSelectedFormationB)) guildSelectedFormationB.set(k, v);
|
| 80 |
}
|
| 81 |
|
| 82 |
if (data.lineupOwners) {
|
|
|
|
| 127 |
load();
|
| 128 |
|
| 129 |
module.exports = {
|
| 130 |
+
guildLineups, guildLineupsB, guildSelectedFormationA, guildSelectedFormationB, lineupOwners, activeLineupMessages, managerBoards, guildCustomFormations, guildCustomFormationNames, guildPingType, guildFriendlyPingType, guildScrimMode, save
|
| 131 |
};
|