@opfr/services 1.5.1 → 1.6.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/dist/index.es.js +631 -1255
- package/dist/index.umd.js +1 -1
- package/dist/services/entities/definition/model.d.ts +12 -2
- package/dist/services/entities/definition/model.d.ts.map +1 -1
- package/dist/services/entities/definition/schema.d.ts +20 -2
- package/dist/services/entities/definition/schema.d.ts.map +1 -1
- package/dist/services/entities/helper.d.ts +5 -20
- package/dist/services/entities/helper.d.ts.map +1 -1
- package/dist/services/entities/process/findMany.d.ts +2 -1
- package/dist/services/entities/process/findMany.d.ts.map +1 -1
- package/dist/services/entities/process/findOne.d.ts +3 -1
- package/dist/services/entities/process/findOne.d.ts.map +1 -1
- package/dist/services/entities/types.d.ts +5 -1
- package/dist/services/entities/types.d.ts.map +1 -1
- package/dist/services/index.d.ts +0 -2
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/user/definition/schema.d.ts.map +1 -1
- package/dist/services/user-inventory/definition/schema.d.ts.map +1 -1
- package/dist/services/user-inventory/helper.d.ts +1 -3
- package/dist/services/user-inventory/helper.d.ts.map +1 -1
- package/dist/services/user-meta/definition/schema.d.ts.map +1 -1
- package/dist/services/user-meta/helper.d.ts +1 -1
- package/dist/services/user-meta/helper.d.ts.map +1 -1
- package/dist/services/user-meta/types.d.ts +2 -4
- package/dist/services/user-meta/types.d.ts.map +1 -1
- package/dist/services/user-ornament/definition/schema.d.ts.map +1 -1
- package/dist/services/user-quest/definition/schema.d.ts.map +1 -1
- package/dist/services/user-stats/casino/definition/schema.d.ts.map +1 -1
- package/dist/services/user-stats/economy/definition/schema.d.ts.map +1 -1
- package/dist/services/user-stats/engagement/definition/schema.d.ts.map +1 -1
- package/dist/services/user-stats/flags/definition/schema.d.ts.map +1 -1
- package/dist/services/user-stats/frequency/definition/schema.d.ts.map +1 -1
- package/dist/services/user-stats/inventory/definition/schema.d.ts.map +1 -1
- package/dist/services/user-stats/inventory/helper.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/services/shop/definition/model.d.ts +0 -4
- package/dist/services/shop/definition/model.d.ts.map +0 -1
- package/dist/services/shop/definition/schema.d.ts +0 -13
- package/dist/services/shop/definition/schema.d.ts.map +0 -1
- package/dist/services/shop/helper.d.ts +0 -14
- package/dist/services/shop/helper.d.ts.map +0 -1
- package/dist/services/shop/index.d.ts +0 -4
- package/dist/services/shop/index.d.ts.map +0 -1
- package/dist/services/shop/items/background.d.ts +0 -18
- package/dist/services/shop/items/background.d.ts.map +0 -1
- package/dist/services/shop/items/boostXp.d.ts +0 -18
- package/dist/services/shop/items/boostXp.d.ts.map +0 -1
- package/dist/services/shop/items/bottle.d.ts +0 -18
- package/dist/services/shop/items/bottle.d.ts.map +0 -1
- package/dist/services/shop/items/chest.d.ts +0 -18
- package/dist/services/shop/items/chest.d.ts.map +0 -1
- package/dist/services/shop/items/default.d.ts +0 -21
- package/dist/services/shop/items/default.d.ts.map +0 -1
- package/dist/services/shop/items/equipments.d.ts +0 -18
- package/dist/services/shop/items/equipments.d.ts.map +0 -1
- package/dist/services/shop/items/index.d.ts +0 -10
- package/dist/services/shop/items/index.d.ts.map +0 -1
- package/dist/services/shop/items/object.d.ts +0 -18
- package/dist/services/shop/items/object.d.ts.map +0 -1
- package/dist/services/shop/items/repair.d.ts +0 -18
- package/dist/services/shop/items/repair.d.ts.map +0 -1
- package/dist/services/shop/items/store.d.ts +0 -18
- package/dist/services/shop/items/store.d.ts.map +0 -1
- package/dist/services/shop/items/title.d.ts +0 -18
- package/dist/services/shop/items/title.d.ts.map +0 -1
- package/dist/services/shop/process/create.d.ts +0 -4
- package/dist/services/shop/process/create.d.ts.map +0 -1
- package/dist/services/shop/process/findOne.d.ts +0 -5
- package/dist/services/shop/process/findOne.d.ts.map +0 -1
- package/dist/services/shop/process/updateOne.d.ts +0 -5
- package/dist/services/shop/process/updateOne.d.ts.map +0 -1
- package/dist/services/shop/service.d.ts +0 -19
- package/dist/services/shop/service.d.ts.map +0 -1
- package/dist/services/shop/types.d.ts +0 -5
- package/dist/services/shop/types.d.ts.map +0 -1
- package/dist/services/user-shop/definition/model.d.ts +0 -4
- package/dist/services/user-shop/definition/model.d.ts.map +0 -1
- package/dist/services/user-shop/definition/schema.d.ts +0 -13
- package/dist/services/user-shop/definition/schema.d.ts.map +0 -1
- package/dist/services/user-shop/helper.d.ts +0 -9
- package/dist/services/user-shop/helper.d.ts.map +0 -1
- package/dist/services/user-shop/index.d.ts +0 -3
- package/dist/services/user-shop/index.d.ts.map +0 -1
- package/dist/services/user-shop/process/create.d.ts +0 -4
- package/dist/services/user-shop/process/create.d.ts.map +0 -1
- package/dist/services/user-shop/process/findOne.d.ts +0 -5
- package/dist/services/user-shop/process/findOne.d.ts.map +0 -1
- package/dist/services/user-shop/process/updateOne.d.ts +0 -5
- package/dist/services/user-shop/process/updateOne.d.ts.map +0 -1
- package/dist/services/user-shop/service.d.ts +0 -14
- package/dist/services/user-shop/service.d.ts.map +0 -1
- package/dist/services/user-shop/types.d.ts +0 -9
- package/dist/services/user-shop/types.d.ts.map +0 -1
package/dist/index.es.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Schema as
|
|
2
|
-
import { QuestStatus as
|
|
3
|
-
import
|
|
4
|
-
import * as
|
|
5
|
-
import { filterNullAndUndefined as
|
|
1
|
+
import { Schema as u, models as c, model as d, connect as Fe, Types as Ne } from "mongoose";
|
|
2
|
+
import { QuestStatus as v, DEFAULT_FACTION as He, GAME_TYPES as Ke, EFFECT_KEYS as je, EQUIPMENT_SLOT as he, CHARACTERISTICS as Pe, getComputedCharacteristicValue as ze, getCurrentLevel as Le, HP_PER_VITALITY as Qe, DEFAULT_MAX_HP as Ge, transformToDBBuff as We, RANK_IDS_WITHOUT_BASIC as le } from "@opfr/definitions";
|
|
3
|
+
import Ye from "node-cache";
|
|
4
|
+
import * as ge from "events";
|
|
5
|
+
import { filterNullAndUndefined as H, recordToArray as B, arrayToRecord as we, mergeObjects as K, seededRandom as Ve, sortBy as ie, randomBetween as Se, hasExpire as re, isString as Xe, capitalizeAllWords as Je, pickNthByOdds as pe, pickFrom as Ze, sameDay as be, yesterday as j, exclude as N } from "@opfr/utils-lang";
|
|
6
6
|
const P = "___ALL_ENTITIES___";
|
|
7
|
-
class
|
|
7
|
+
class y {
|
|
8
8
|
cache;
|
|
9
9
|
constructor(e) {
|
|
10
|
-
this.cache = new
|
|
10
|
+
this.cache = new Ye({
|
|
11
11
|
stdTTL: e,
|
|
12
12
|
checkperiod: e * 0.2,
|
|
13
13
|
useClones: !1
|
|
@@ -35,7 +35,7 @@ class f {
|
|
|
35
35
|
this.cache.flushAll();
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
class
|
|
38
|
+
class m extends y {
|
|
39
39
|
async getAll() {
|
|
40
40
|
const e = this.cache.get(P);
|
|
41
41
|
if (e)
|
|
@@ -52,14 +52,14 @@ class w extends f {
|
|
|
52
52
|
}), a;
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
},
|
|
55
|
+
const $e = new ge.EventEmitter(), h = (n, e, t) => {
|
|
56
|
+
$e.emit(n, e, t);
|
|
57
|
+
}, pr = (n) => {
|
|
58
58
|
for (const [e, t] of Object.entries(n))
|
|
59
|
-
|
|
59
|
+
$e.on(e, (a, r) => {
|
|
60
60
|
t(a, r);
|
|
61
61
|
});
|
|
62
|
-
},
|
|
62
|
+
}, g = {
|
|
63
63
|
USER: "middleware/quest/USER",
|
|
64
64
|
USER_INVENTORY: "middleware/quest/USER_INVENTORY",
|
|
65
65
|
USER_META: "middleware/quest/USER_META",
|
|
@@ -71,10 +71,10 @@ const De = new $e.EventEmitter(), S = (n, e, t) => {
|
|
|
71
71
|
USER_STATS_FLAGS: "middleware/quest/USER_STATS_FLAGS",
|
|
72
72
|
USER_STATS_FREQUENCY: "middleware/quest/USER_STATS_FREQUENCY",
|
|
73
73
|
USER_STATS_INVENTORY: "middleware/quest/USER_STATS_INVENTORY"
|
|
74
|
-
},
|
|
74
|
+
}, Ue = new u(
|
|
75
75
|
{
|
|
76
76
|
user: {
|
|
77
|
-
type:
|
|
77
|
+
type: u.Types.ObjectId,
|
|
78
78
|
required: !0,
|
|
79
79
|
ref: "User",
|
|
80
80
|
index: !0
|
|
@@ -84,22 +84,22 @@ const De = new $e.EventEmitter(), S = (n, e, t) => {
|
|
|
84
84
|
required: !0,
|
|
85
85
|
index: !0
|
|
86
86
|
},
|
|
87
|
-
status: { type: String, default:
|
|
87
|
+
status: { type: String, default: v.IN_PROGRESS, index: 1 },
|
|
88
88
|
lastCompletionDate: Date,
|
|
89
89
|
streak: Number
|
|
90
90
|
},
|
|
91
91
|
{ minimize: !1 }
|
|
92
92
|
);
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
Ue.post("findOneAndUpdate", function(n) {
|
|
94
|
+
n && h(
|
|
95
|
+
g.USER_QUEST,
|
|
96
96
|
n.user._id,
|
|
97
97
|
n
|
|
98
98
|
);
|
|
99
99
|
});
|
|
100
|
-
const
|
|
100
|
+
const R = c?.UserQuest || d("UserQuest", Ue), et = new u({
|
|
101
101
|
user: {
|
|
102
|
-
type:
|
|
102
|
+
type: u.Types.ObjectId,
|
|
103
103
|
required: !0,
|
|
104
104
|
unique: !0,
|
|
105
105
|
ref: "User"
|
|
@@ -117,9 +117,9 @@ const q = d?.UserQuest || p("UserQuest", Te), it = new o({
|
|
|
117
117
|
blackJack: { type: Date, default: /* @__PURE__ */ new Date(0) },
|
|
118
118
|
rps: { type: Date, default: /* @__PURE__ */ new Date(0) }
|
|
119
119
|
}
|
|
120
|
-
}),
|
|
120
|
+
}), z = c?.UserCooldown || d("UserCooldown", et), tt = new u({
|
|
121
121
|
user: {
|
|
122
|
-
type:
|
|
122
|
+
type: u.Types.ObjectId,
|
|
123
123
|
required: !0,
|
|
124
124
|
unique: !0,
|
|
125
125
|
ref: "User"
|
|
@@ -133,17 +133,17 @@ const q = d?.UserQuest || p("UserQuest", Te), it = new o({
|
|
|
133
133
|
},
|
|
134
134
|
previousCompletedQuest: { type: [String], default: [] },
|
|
135
135
|
previousMessageSent: { type: Number, default: 0 }
|
|
136
|
-
}),
|
|
136
|
+
}), L = c?.UserDailyReport || d("UserDailyReport", tt), nt = new u({
|
|
137
137
|
user: {
|
|
138
|
-
type:
|
|
138
|
+
type: u.Types.ObjectId,
|
|
139
139
|
required: !0,
|
|
140
140
|
unique: !0,
|
|
141
141
|
ref: "User"
|
|
142
142
|
},
|
|
143
143
|
encyclopedia: { type: [String], default: [] }
|
|
144
|
-
}),
|
|
144
|
+
}), Q = c?.UserEncyclopedia || d("UserEncyclopedia", nt), at = new u({
|
|
145
145
|
user: {
|
|
146
|
-
type:
|
|
146
|
+
type: u.Types.ObjectId,
|
|
147
147
|
required: !0,
|
|
148
148
|
unique: !0,
|
|
149
149
|
ref: "User",
|
|
@@ -158,10 +158,10 @@ const q = d?.UserQuest || p("UserQuest", Te), it = new o({
|
|
|
158
158
|
},
|
|
159
159
|
default: null
|
|
160
160
|
}
|
|
161
|
-
}),
|
|
161
|
+
}), G = c?.UserGames || d("UserGames", at), Ee = new u(
|
|
162
162
|
{
|
|
163
163
|
user: {
|
|
164
|
-
type:
|
|
164
|
+
type: u.Types.ObjectId,
|
|
165
165
|
required: !0,
|
|
166
166
|
unique: !0,
|
|
167
167
|
ref: "User"
|
|
@@ -180,23 +180,23 @@ const q = d?.UserQuest || p("UserQuest", Te), it = new o({
|
|
|
180
180
|
},
|
|
181
181
|
{ minimize: !1 }
|
|
182
182
|
);
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
183
|
+
Ee.post("findOneAndUpdate", function(n) {
|
|
184
|
+
n && h(
|
|
185
|
+
g.USER_INVENTORY,
|
|
186
186
|
n.user._id,
|
|
187
187
|
n
|
|
188
188
|
);
|
|
189
189
|
});
|
|
190
|
-
const
|
|
191
|
-
|
|
192
|
-
},
|
|
190
|
+
const W = c?.UserInventory || d("UserInventory", Ee), rt = new ge.EventEmitter(), st = (n, e) => {
|
|
191
|
+
rt.emit(n, e);
|
|
192
|
+
}, T = {
|
|
193
193
|
multiplier: { type: Number, default: 0 },
|
|
194
194
|
origin: String,
|
|
195
195
|
expireAt: { type: Date, default: null },
|
|
196
196
|
startAt: { type: Date, default: null }
|
|
197
|
-
},
|
|
197
|
+
}, De = new u({
|
|
198
198
|
user: {
|
|
199
|
-
type:
|
|
199
|
+
type: u.Types.ObjectId,
|
|
200
200
|
required: !0,
|
|
201
201
|
unique: !0,
|
|
202
202
|
ref: "User"
|
|
@@ -216,38 +216,40 @@ const V = d?.UserInventory || p("UserInventory", Oe), lt = new $e.EventEmitter()
|
|
|
216
216
|
buffs: {
|
|
217
217
|
cooldown: {
|
|
218
218
|
casino: {
|
|
219
|
-
type: [
|
|
219
|
+
type: [T],
|
|
220
220
|
default: []
|
|
221
221
|
},
|
|
222
222
|
work: {
|
|
223
|
-
type: [
|
|
223
|
+
type: [T],
|
|
224
224
|
default: []
|
|
225
225
|
}
|
|
226
226
|
},
|
|
227
227
|
berry: {
|
|
228
228
|
work: {
|
|
229
|
-
type: [
|
|
229
|
+
type: [T],
|
|
230
230
|
default: []
|
|
231
231
|
},
|
|
232
232
|
global: {
|
|
233
|
-
type: [
|
|
233
|
+
type: [T],
|
|
234
234
|
default: []
|
|
235
235
|
}
|
|
236
236
|
},
|
|
237
237
|
drop: {
|
|
238
238
|
work: {
|
|
239
|
-
type: [
|
|
239
|
+
type: [T],
|
|
240
240
|
default: []
|
|
241
241
|
}
|
|
242
242
|
},
|
|
243
243
|
xp: {
|
|
244
244
|
global: {
|
|
245
|
-
type: [
|
|
245
|
+
type: [T],
|
|
246
246
|
default: []
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
249
|
},
|
|
250
250
|
hp: { type: Number, default: 100 },
|
|
251
|
+
energyMax: { type: Number, default: 10 },
|
|
252
|
+
energy: { type: Number, default: 10 },
|
|
251
253
|
workUnluckyStreak: { type: Number, default: 0 },
|
|
252
254
|
characteristics: {
|
|
253
255
|
vitality: { type: Number, default: 0 },
|
|
@@ -257,10 +259,6 @@ const V = d?.UserInventory || p("UserInventory", Oe), lt = new $e.EventEmitter()
|
|
|
257
259
|
intelligence: { type: Number, default: 0 },
|
|
258
260
|
wisdom: { type: Number, default: 0 }
|
|
259
261
|
},
|
|
260
|
-
resetCharacteristics: {
|
|
261
|
-
free: { type: Boolean, default: !0 },
|
|
262
|
-
nextAvailable: { type: Date, default: null }
|
|
263
|
-
},
|
|
264
262
|
scrolls: {
|
|
265
263
|
vitality: { type: Number, default: 0 },
|
|
266
264
|
strength: { type: Number, default: 0 },
|
|
@@ -270,16 +268,16 @@ const V = d?.UserInventory || p("UserInventory", Oe), lt = new $e.EventEmitter()
|
|
|
270
268
|
wisdom: { type: Number, default: 0 }
|
|
271
269
|
}
|
|
272
270
|
});
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
271
|
+
De.post("findOneAndUpdate", async function(n) {
|
|
272
|
+
n && (h(
|
|
273
|
+
g.USER_META,
|
|
276
274
|
n.user._id,
|
|
277
275
|
n
|
|
278
|
-
), n.hp <= 0 &&
|
|
276
|
+
), n.hp <= 0 && st("death", n.user._id));
|
|
279
277
|
});
|
|
280
|
-
const
|
|
278
|
+
const I = c?.UserMeta || d("UserMeta", De), Ie = new u({
|
|
281
279
|
user: {
|
|
282
|
-
type:
|
|
280
|
+
type: u.Types.ObjectId,
|
|
283
281
|
required: !0,
|
|
284
282
|
unique: !0,
|
|
285
283
|
ref: "User"
|
|
@@ -294,16 +292,16 @@ const O = d?.UserMeta || p("UserMeta", ve), Be = new o({
|
|
|
294
292
|
unlockedBags: { type: [String], default: ["default"] },
|
|
295
293
|
selectedBag: { type: String, default: "default" }
|
|
296
294
|
});
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
295
|
+
Ie.post("findOneAndUpdate", function(n) {
|
|
296
|
+
n && h(
|
|
297
|
+
g.USER_ORNAMENT,
|
|
300
298
|
n.user._id,
|
|
301
299
|
n
|
|
302
300
|
);
|
|
303
301
|
});
|
|
304
|
-
const
|
|
302
|
+
const Y = c?.UserOrnament || d("UserOrnament", Ie), it = new u({
|
|
305
303
|
user: {
|
|
306
|
-
type:
|
|
304
|
+
type: u.Types.ObjectId,
|
|
307
305
|
required: !0,
|
|
308
306
|
unique: !0,
|
|
309
307
|
ref: "User"
|
|
@@ -327,21 +325,9 @@ const X = d?.UserOrnament || p("UserOrnament", Be), pt = new o({
|
|
|
327
325
|
rps: { type: Boolean, default: !1 }
|
|
328
326
|
}
|
|
329
327
|
}
|
|
330
|
-
}),
|
|
331
|
-
{
|
|
332
|
-
user: {
|
|
333
|
-
type: o.Types.ObjectId,
|
|
334
|
-
required: !0,
|
|
335
|
-
unique: !0,
|
|
336
|
-
ref: "User"
|
|
337
|
-
},
|
|
338
|
-
lastShopId: o.Types.ObjectId,
|
|
339
|
-
limit: { type: o.Types.Mixed, default: {} }
|
|
340
|
-
},
|
|
341
|
-
{ minimize: !1 }
|
|
342
|
-
), J = d?.UserShop || p("UserShop", yt), Me = new o({
|
|
328
|
+
}), C = c?.UserSettings || d("UserSettings", it), Te = new u({
|
|
343
329
|
user: {
|
|
344
|
-
type:
|
|
330
|
+
type: u.Types.ObjectId,
|
|
345
331
|
required: !0,
|
|
346
332
|
unique: !0,
|
|
347
333
|
ref: "User"
|
|
@@ -374,16 +360,16 @@ const X = d?.UserOrnament || p("UserOrnament", Be), pt = new o({
|
|
|
374
360
|
guessInOneTryCount: { type: Number, default: 0 }
|
|
375
361
|
}
|
|
376
362
|
});
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
363
|
+
Te.post("findOneAndUpdate", function(n) {
|
|
364
|
+
n && h(
|
|
365
|
+
g.USER_STATS_CASINO,
|
|
380
366
|
n.user._id,
|
|
381
367
|
n
|
|
382
368
|
);
|
|
383
369
|
});
|
|
384
|
-
const
|
|
370
|
+
const M = c?.UserStatsCasino || d("UserStatsCasino", Te), Oe = new u({
|
|
385
371
|
user: {
|
|
386
|
-
type:
|
|
372
|
+
type: u.Types.ObjectId,
|
|
387
373
|
required: !0,
|
|
388
374
|
unique: !0,
|
|
389
375
|
ref: "User"
|
|
@@ -391,16 +377,16 @@ const k = d?.UserStatsCasino || p("UserStatsCasino", Me), ke = new o({
|
|
|
391
377
|
workCount: { type: Number, default: 0 },
|
|
392
378
|
totalSpentInShop: { type: Number, default: 0 }
|
|
393
379
|
});
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
380
|
+
Oe.post("findOneAndUpdate", function(n) {
|
|
381
|
+
n && h(
|
|
382
|
+
g.USER_STATS_ECONOMY,
|
|
397
383
|
n.user._id,
|
|
398
384
|
n
|
|
399
385
|
);
|
|
400
386
|
});
|
|
401
|
-
const
|
|
387
|
+
const V = c?.UserStatsEconomy || d("UserStatsEconomy", Oe), ve = new u({
|
|
402
388
|
user: {
|
|
403
|
-
type:
|
|
389
|
+
type: u.Types.ObjectId,
|
|
404
390
|
required: !0,
|
|
405
391
|
unique: !0,
|
|
406
392
|
ref: "User"
|
|
@@ -410,19 +396,19 @@ const Z = d?.UserStatsEconomy || p("UserStatsEconomy", ke), Ae = new o({
|
|
|
410
396
|
randomMessageClaimed: { type: Number, default: 0 },
|
|
411
397
|
writeDifferentChatIds: { type: [String], default: [] }
|
|
412
398
|
});
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
399
|
+
ve.post("findOneAndUpdate", function(n) {
|
|
400
|
+
n && h(
|
|
401
|
+
g.USER_STATS_ENGAGEMENT,
|
|
416
402
|
n.user._id,
|
|
417
403
|
n
|
|
418
404
|
);
|
|
419
405
|
});
|
|
420
|
-
const
|
|
406
|
+
const X = c?.UserStatsEngagement || d(
|
|
421
407
|
"UserStatsEngagement",
|
|
422
|
-
|
|
423
|
-
),
|
|
408
|
+
ve
|
|
409
|
+
), Me = new u({
|
|
424
410
|
user: {
|
|
425
|
-
type:
|
|
411
|
+
type: u.Types.ObjectId,
|
|
426
412
|
required: !0,
|
|
427
413
|
unique: !0,
|
|
428
414
|
ref: "User"
|
|
@@ -439,16 +425,16 @@ const ee = d?.UserStatsEngagement || p(
|
|
|
439
425
|
loseEverything: { type: Boolean, default: !1 }
|
|
440
426
|
}
|
|
441
427
|
});
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
428
|
+
Me.post("findOneAndUpdate", function(n) {
|
|
429
|
+
n && h(
|
|
430
|
+
g.USER_STATS_FLAGS,
|
|
445
431
|
n.user._id,
|
|
446
432
|
n
|
|
447
433
|
);
|
|
448
434
|
});
|
|
449
|
-
const
|
|
435
|
+
const J = c?.UserStatsFlags || d("UserStatsFlags", Me), ke = new u({
|
|
450
436
|
user: {
|
|
451
|
-
type:
|
|
437
|
+
type: u.Types.ObjectId,
|
|
452
438
|
required: !0,
|
|
453
439
|
unique: !0,
|
|
454
440
|
ref: "User"
|
|
@@ -458,19 +444,19 @@ const te = d?.UserStatsFlags || p("UserStatsFlags", qe), Re = new o({
|
|
|
458
444
|
lastTimeRead: { type: Date, default: /* @__PURE__ */ new Date(), index: !0 }
|
|
459
445
|
}
|
|
460
446
|
});
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
447
|
+
ke.post("findOneAndUpdate", function(n) {
|
|
448
|
+
n && h(
|
|
449
|
+
g.USER_STATS_FREQUENCY,
|
|
464
450
|
n.user._id,
|
|
465
451
|
n
|
|
466
452
|
);
|
|
467
453
|
});
|
|
468
|
-
const
|
|
454
|
+
const D = c?.UserStatsFrequency || d(
|
|
469
455
|
"UserStatsFrequency",
|
|
470
|
-
|
|
471
|
-
),
|
|
456
|
+
ke
|
|
457
|
+
), Ae = new u({
|
|
472
458
|
user: {
|
|
473
|
-
type:
|
|
459
|
+
type: u.Types.ObjectId,
|
|
474
460
|
required: !0,
|
|
475
461
|
unique: !0,
|
|
476
462
|
ref: "User"
|
|
@@ -495,39 +481,39 @@ const T = d?.UserStatsFrequency || p(
|
|
|
495
481
|
totalCrafted: { type: Number, default: 0 }
|
|
496
482
|
}
|
|
497
483
|
});
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
484
|
+
Ae.post("findOneAndUpdate", function(n) {
|
|
485
|
+
n && h(
|
|
486
|
+
g.USER_STATS_INVENTORY,
|
|
501
487
|
n.user._id,
|
|
502
488
|
n
|
|
503
489
|
);
|
|
504
490
|
});
|
|
505
|
-
const
|
|
491
|
+
const k = c?.UserStatsInventory || d(
|
|
506
492
|
"UserStatsInventory",
|
|
507
|
-
|
|
508
|
-
),
|
|
493
|
+
Ae
|
|
494
|
+
), ue = new u({
|
|
509
495
|
discordId: { type: String, required: !0, unique: !0 },
|
|
510
496
|
scam: { type: Boolean, default: !1 },
|
|
511
497
|
birthday: { type: Date, default: null, index: 1 },
|
|
512
|
-
faction: { type: String, default:
|
|
498
|
+
faction: { type: String, default: He, index: 1 },
|
|
513
499
|
canChangeFaction: { type: Boolean, default: !1 },
|
|
514
500
|
canChooseFaction: { type: Boolean, default: !1 }
|
|
515
501
|
});
|
|
516
|
-
|
|
517
|
-
|
|
502
|
+
ue.post("findOneAndUpdate", function(n) {
|
|
503
|
+
n && h(g.USER, n._id, n);
|
|
518
504
|
});
|
|
519
|
-
|
|
505
|
+
ue.post("deleteOne", async function() {
|
|
520
506
|
const n = this.getQuery()._id;
|
|
521
|
-
await
|
|
507
|
+
await z.deleteOne({ user: n }), await L.deleteOne({ user: n }), await Q.deleteOne({ user: n }), await G.deleteOne({ user: n }), await W.deleteOne({ user: n }), await I.deleteOne({ user: n }), await Y.deleteOne({ user: n }), await R.deleteMany({ user: n }), await C.deleteOne({ user: n }), await M.deleteOne({ user: n }), await V.deleteOne({ user: n }), await X.deleteOne({ user: n }), await J.deleteOne({ user: n }), await D.deleteOne({ user: n }), await k.deleteOne({ user: n });
|
|
522
508
|
});
|
|
523
|
-
const
|
|
524
|
-
class
|
|
509
|
+
const w = c?.User || d("User", ue);
|
|
510
|
+
class ut extends m {
|
|
525
511
|
getByObjectId(e) {
|
|
526
512
|
return this.update({ _id: e }, {});
|
|
527
513
|
}
|
|
528
514
|
getNextBirthdays() {
|
|
529
515
|
const e = /* @__PURE__ */ new Date(), t = e.getFullYear();
|
|
530
|
-
return
|
|
516
|
+
return w.aggregate([
|
|
531
517
|
{
|
|
532
518
|
$match: {
|
|
533
519
|
birthday: { $ne: null }
|
|
@@ -578,7 +564,7 @@ class ft extends w {
|
|
|
578
564
|
]);
|
|
579
565
|
}
|
|
580
566
|
getFactionRanking(e) {
|
|
581
|
-
return
|
|
567
|
+
return w.aggregate([
|
|
582
568
|
{ $match: { faction: e } },
|
|
583
569
|
{
|
|
584
570
|
$lookup: {
|
|
@@ -601,7 +587,7 @@ class ft extends w {
|
|
|
601
587
|
]);
|
|
602
588
|
}
|
|
603
589
|
getGlobalRanking() {
|
|
604
|
-
return
|
|
590
|
+
return w.aggregate([
|
|
605
591
|
{
|
|
606
592
|
$lookup: {
|
|
607
593
|
from: "usermetas",
|
|
@@ -623,7 +609,7 @@ class ft extends w {
|
|
|
623
609
|
]);
|
|
624
610
|
}
|
|
625
611
|
getBerryRanking() {
|
|
626
|
-
return
|
|
612
|
+
return w.aggregate([
|
|
627
613
|
{
|
|
628
614
|
$lookup: {
|
|
629
615
|
from: "usermetas",
|
|
@@ -645,10 +631,10 @@ class ft extends w {
|
|
|
645
631
|
]);
|
|
646
632
|
}
|
|
647
633
|
getQuestRanking() {
|
|
648
|
-
return
|
|
634
|
+
return R.aggregate([
|
|
649
635
|
{
|
|
650
636
|
$match: {
|
|
651
|
-
status:
|
|
637
|
+
status: v.COMPLETED
|
|
652
638
|
}
|
|
653
639
|
},
|
|
654
640
|
{
|
|
@@ -692,7 +678,7 @@ class ft extends w {
|
|
|
692
678
|
}
|
|
693
679
|
getTodayAllBirthday() {
|
|
694
680
|
const e = /* @__PURE__ */ new Date();
|
|
695
|
-
return
|
|
681
|
+
return w.aggregate([
|
|
696
682
|
{ $match: { birthday: { $ne: null } } },
|
|
697
683
|
{
|
|
698
684
|
$addFields: {
|
|
@@ -739,18 +725,18 @@ class ft extends w {
|
|
|
739
725
|
);
|
|
740
726
|
}
|
|
741
727
|
}
|
|
742
|
-
const
|
|
728
|
+
const ot = (n, e) => w.find(n, {}, e).lean(), p = (n) => n.toObject({ flattenMaps: !0, flattenObjectIds: !1 }), ct = (n) => w.create({
|
|
743
729
|
discordId: n
|
|
744
730
|
});
|
|
745
|
-
async function
|
|
746
|
-
const a = await
|
|
747
|
-
return !a && e ?
|
|
731
|
+
async function dt(n, { upsert: e = !0, ...t }) {
|
|
732
|
+
const a = await w.findOne({ discordId: n }, {}, t).lean();
|
|
733
|
+
return !a && e ? p(await ct(n)) : a;
|
|
748
734
|
}
|
|
749
|
-
const
|
|
735
|
+
const lt = (n, e) => w.findOneAndUpdate(n, e, {
|
|
750
736
|
upsert: !0,
|
|
751
737
|
returnDocument: "after"
|
|
752
738
|
}).lean();
|
|
753
|
-
class
|
|
739
|
+
class pt extends ut {
|
|
754
740
|
constructor() {
|
|
755
741
|
super(3600);
|
|
756
742
|
}
|
|
@@ -761,19 +747,19 @@ class St extends ft {
|
|
|
761
747
|
return e;
|
|
762
748
|
}
|
|
763
749
|
fetchFromDb(e, t) {
|
|
764
|
-
return
|
|
750
|
+
return dt(e, t);
|
|
765
751
|
}
|
|
766
752
|
fetchManyFromDb(e, t) {
|
|
767
|
-
return
|
|
753
|
+
return ot(e, t);
|
|
768
754
|
}
|
|
769
755
|
updateInDb(e, t) {
|
|
770
|
-
return
|
|
756
|
+
return lt(e, t);
|
|
771
757
|
}
|
|
772
758
|
}
|
|
773
|
-
const
|
|
759
|
+
const yt = new pt(), yr = ["work", ...Ke], ft = new u(
|
|
774
760
|
{
|
|
775
761
|
user: {
|
|
776
|
-
type:
|
|
762
|
+
type: u.Types.ObjectId,
|
|
777
763
|
ref: "User",
|
|
778
764
|
required: !0,
|
|
779
765
|
index: !0
|
|
@@ -782,12 +768,12 @@ const bt = new St(), Cr = ["work", ...Le], $t = new o(
|
|
|
782
768
|
type: { type: String, required: !0 }
|
|
783
769
|
},
|
|
784
770
|
{ minimize: !1 }
|
|
785
|
-
),
|
|
786
|
-
await
|
|
787
|
-
},
|
|
788
|
-
await
|
|
771
|
+
), _ = c?.Reminder || d("Reminder", ft), mt = async (n) => {
|
|
772
|
+
await _.deleteMany(n);
|
|
773
|
+
}, ht = async (n, e) => {
|
|
774
|
+
await _.deleteOne({ user: n, type: e });
|
|
789
775
|
};
|
|
790
|
-
class
|
|
776
|
+
class gt extends m {
|
|
791
777
|
getAllPassedReminder() {
|
|
792
778
|
return this.getMany({ date: { $lte: /* @__PURE__ */ new Date() } });
|
|
793
779
|
}
|
|
@@ -806,29 +792,29 @@ class Ut extends w {
|
|
|
806
792
|
]);
|
|
807
793
|
}
|
|
808
794
|
async removeReminder(e, t) {
|
|
809
|
-
await
|
|
795
|
+
await ht(e, t), this.invalidate({ user: e, type: t });
|
|
810
796
|
}
|
|
811
797
|
async deleteSelectedReminders(e) {
|
|
812
798
|
const t = e.map((a) => a._id);
|
|
813
|
-
await
|
|
799
|
+
await mt({ _id: { $in: t } }), e.forEach((a) => {
|
|
814
800
|
this.invalidate({ user: a.user, type: a.type });
|
|
815
801
|
});
|
|
816
802
|
}
|
|
817
803
|
}
|
|
818
|
-
function
|
|
819
|
-
return
|
|
804
|
+
function wt(n, e) {
|
|
805
|
+
return _.find(n, {}, e).lean();
|
|
820
806
|
}
|
|
821
|
-
async function
|
|
822
|
-
const e = await
|
|
807
|
+
async function St(n) {
|
|
808
|
+
const e = await _.findOne(n).lean();
|
|
823
809
|
return e || null;
|
|
824
810
|
}
|
|
825
|
-
async function
|
|
826
|
-
return
|
|
811
|
+
async function bt(n, e, t) {
|
|
812
|
+
return _.findOneAndUpdate(n, e, {
|
|
827
813
|
...t,
|
|
828
814
|
returnDocument: "after"
|
|
829
815
|
}).lean();
|
|
830
816
|
}
|
|
831
|
-
class
|
|
817
|
+
class $t extends gt {
|
|
832
818
|
constructor() {
|
|
833
819
|
super(300);
|
|
834
820
|
}
|
|
@@ -842,44 +828,44 @@ class vt extends Ut {
|
|
|
842
828
|
return `${e.toString()}/${t}`;
|
|
843
829
|
}
|
|
844
830
|
fetchFromDb(e) {
|
|
845
|
-
return
|
|
831
|
+
return St(e);
|
|
846
832
|
}
|
|
847
833
|
fetchManyFromDb(e, t) {
|
|
848
|
-
return
|
|
834
|
+
return wt(e, t);
|
|
849
835
|
}
|
|
850
836
|
updateInDb(e, t, a = { upsert: !1 }) {
|
|
851
|
-
return
|
|
837
|
+
return bt(e, t, a);
|
|
852
838
|
}
|
|
853
839
|
}
|
|
854
|
-
const
|
|
840
|
+
const Ut = new $t(), Et = new u(
|
|
855
841
|
{
|
|
856
842
|
panoplyId: { unique: !0, index: 1, required: !0, type: String },
|
|
857
843
|
name: { required: !0, type: String },
|
|
858
844
|
equipments: {
|
|
859
845
|
required: !0,
|
|
860
|
-
type: [{ type:
|
|
846
|
+
type: [{ type: u.Types.ObjectId, ref: "Entities" }]
|
|
861
847
|
},
|
|
862
848
|
fullBonusStr: { type: String },
|
|
863
849
|
halfBonusStr: { type: String },
|
|
864
|
-
fullBonus:
|
|
865
|
-
halfBonus:
|
|
850
|
+
fullBonus: u.Types.Mixed,
|
|
851
|
+
halfBonus: u.Types.Mixed
|
|
866
852
|
},
|
|
867
853
|
{ minimize: !1 }
|
|
868
|
-
),
|
|
869
|
-
async function
|
|
870
|
-
const e = await
|
|
854
|
+
), F = c?.Panoplies || d("Panoplies", Et), Dt = (n, e) => F.find(n, {}, e).lean(), It = async (n, e) => F.find(n, {}, e).populate("equipments");
|
|
855
|
+
async function Tt(n) {
|
|
856
|
+
const e = await F.findOne({ panoplyId: n }).lean();
|
|
871
857
|
return e || null;
|
|
872
858
|
}
|
|
873
|
-
const
|
|
874
|
-
class
|
|
859
|
+
const Ot = async (n) => F.findOne(n).populate("equipments");
|
|
860
|
+
class vt extends m {
|
|
875
861
|
getAllPopulated() {
|
|
876
|
-
return
|
|
862
|
+
return It({}, {});
|
|
877
863
|
}
|
|
878
864
|
getPopulated(e) {
|
|
879
|
-
return
|
|
865
|
+
return Ot({ panoplyId: e });
|
|
880
866
|
}
|
|
881
867
|
hasPanoply(e, t) {
|
|
882
|
-
const a =
|
|
868
|
+
const a = H(Object.values(e)), r = t.equipments.filter(
|
|
883
869
|
(s) => a.find((i) => i.entityId === s.entityId)
|
|
884
870
|
).length;
|
|
885
871
|
if (r === t.equipments.length)
|
|
@@ -890,18 +876,18 @@ class xt extends w {
|
|
|
890
876
|
async getPanoplyBonus(e) {
|
|
891
877
|
const t = [], a = await this.getAllPopulated();
|
|
892
878
|
for (const r of a) {
|
|
893
|
-
const s =
|
|
894
|
-
(
|
|
879
|
+
const s = H(Object.values(e)), i = r.equipments.filter(
|
|
880
|
+
(o) => s.find(({ entityId: l }) => l === o.entityId)
|
|
895
881
|
);
|
|
896
882
|
i.length === r.equipments.length ? t.push([r, "full"]) : i.length >= r.equipments.length / 2 ? t.push([r, "half"]) : i.length >= 1 && t.push([r, null]);
|
|
897
883
|
}
|
|
898
884
|
return t;
|
|
899
885
|
}
|
|
900
886
|
}
|
|
901
|
-
const
|
|
887
|
+
const Mt = async (n, e) => F.findOneAndUpdate(n, e, {
|
|
902
888
|
returnDocument: "after"
|
|
903
889
|
}).lean();
|
|
904
|
-
class
|
|
890
|
+
class kt extends vt {
|
|
905
891
|
constructor() {
|
|
906
892
|
super(3600);
|
|
907
893
|
}
|
|
@@ -912,52 +898,69 @@ class Ct extends xt {
|
|
|
912
898
|
return e;
|
|
913
899
|
}
|
|
914
900
|
updateInDb(e, t) {
|
|
915
|
-
return
|
|
901
|
+
return Mt(e, t);
|
|
916
902
|
}
|
|
917
903
|
fetchFromDb(e) {
|
|
918
|
-
return
|
|
904
|
+
return Tt(e);
|
|
919
905
|
}
|
|
920
906
|
fetchManyFromDb(e, t) {
|
|
921
|
-
return
|
|
907
|
+
return Dt(e, t);
|
|
922
908
|
}
|
|
923
909
|
}
|
|
924
|
-
const
|
|
925
|
-
|
|
910
|
+
const A = new kt(), At = new u(
|
|
911
|
+
{
|
|
912
|
+
type: {
|
|
913
|
+
type: String,
|
|
914
|
+
enum: je,
|
|
915
|
+
required: !0
|
|
916
|
+
},
|
|
917
|
+
params: { type: u.Types.Mixed }
|
|
918
|
+
},
|
|
919
|
+
{ _id: !1 }
|
|
920
|
+
), Rt = new u(
|
|
921
|
+
{
|
|
922
|
+
entityId: { unique: !0, required: !0, type: String }
|
|
923
|
+
},
|
|
924
|
+
{
|
|
925
|
+
minimize: !1,
|
|
926
|
+
discriminatorKey: "type"
|
|
927
|
+
}
|
|
928
|
+
), qt = new u({
|
|
929
|
+
category: { required: !0, type: String },
|
|
930
|
+
subtype: { type: String },
|
|
931
|
+
rankId: String,
|
|
932
|
+
effects: { type: [At], default: [] },
|
|
933
|
+
usage: {
|
|
934
|
+
_id: !1,
|
|
935
|
+
type: {
|
|
936
|
+
mode: String,
|
|
937
|
+
craft: Boolean
|
|
938
|
+
},
|
|
939
|
+
default: void 0
|
|
940
|
+
}
|
|
941
|
+
}), xt = new u({
|
|
942
|
+
category: { required: !0, type: String },
|
|
943
|
+
characteristics: {
|
|
944
|
+
_id: !1,
|
|
945
|
+
type: Object
|
|
946
|
+
},
|
|
947
|
+
panoply: String
|
|
948
|
+
}), q = c?.Entities || d("Entities", Rt), Bt = q.discriminator("item", qt);
|
|
949
|
+
q.discriminator("equipment", xt);
|
|
950
|
+
const Ct = async (n, e) => q.find(n, {}, e).lean(), _t = async (n, e) => Bt.find(n, {}, e).lean();
|
|
951
|
+
class Ft extends m {
|
|
926
952
|
isEntity(e) {
|
|
927
953
|
return !!e && "entityId" in e;
|
|
928
954
|
}
|
|
929
955
|
isItem(e) {
|
|
930
|
-
return e.
|
|
956
|
+
return e.type === "item";
|
|
931
957
|
}
|
|
932
958
|
isEquipment(e) {
|
|
933
|
-
return e.
|
|
959
|
+
return e.type === "equipment";
|
|
934
960
|
}
|
|
935
961
|
async isEntityId(e, t = () => !0) {
|
|
936
962
|
return (await this.getAll()).filter(t).map(({ entityId: r }) => r).includes(e);
|
|
937
963
|
}
|
|
938
|
-
async getSomeStoreItems(e) {
|
|
939
|
-
const t = (await this.getAll()).filter(this.isStoreItem);
|
|
940
|
-
return H(
|
|
941
|
-
le(
|
|
942
|
-
e,
|
|
943
|
-
t,
|
|
944
|
-
(a) => a.entityId,
|
|
945
|
-
(a) => a.shop.odd ?? 0
|
|
946
|
-
),
|
|
947
|
-
(a) => a.shop.price
|
|
948
|
-
);
|
|
949
|
-
}
|
|
950
|
-
async getSomeRepairItems(e) {
|
|
951
|
-
const t = (await this.getAll()).filter(this.isRepairItem);
|
|
952
|
-
return ge(t).slice(0, e);
|
|
953
|
-
}
|
|
954
|
-
async getSomeObjectItems(e) {
|
|
955
|
-
const t = (await this.getAll()).filter(this.isObjectItem);
|
|
956
|
-
return ge(t.filter((a) => !!a.shop?.price)).slice(
|
|
957
|
-
0,
|
|
958
|
-
e
|
|
959
|
-
);
|
|
960
|
-
}
|
|
961
964
|
async idArrayToEntities(e) {
|
|
962
965
|
return (await this.getAll()).filter(
|
|
963
966
|
(t) => e.includes(t.entityId)
|
|
@@ -968,22 +971,27 @@ class Nt extends w {
|
|
|
968
971
|
}
|
|
969
972
|
async recordToEntityTuple(e) {
|
|
970
973
|
const t = await this.getAll();
|
|
971
|
-
return
|
|
972
|
-
const i = t.find(({ entityId:
|
|
974
|
+
return B(e).reduce((a, [r, s]) => {
|
|
975
|
+
const i = t.find(({ entityId: o }) => o === r);
|
|
973
976
|
return i && a.push([i, s]), a;
|
|
974
977
|
}, []);
|
|
975
978
|
}
|
|
976
979
|
async getAllEntitiesLimit() {
|
|
977
980
|
const e = await this.getAll();
|
|
978
|
-
return
|
|
981
|
+
return we(
|
|
979
982
|
e.map((t) => [t.entityId, t.shop?.limit ?? 0])
|
|
980
983
|
);
|
|
981
984
|
}
|
|
982
985
|
async getAllEntitiesBy(e) {
|
|
983
986
|
return (await this.getAll()).filter(e);
|
|
984
987
|
}
|
|
988
|
+
async getAllItemsBy(e) {
|
|
989
|
+
return (await _t({}, {})).filter(e);
|
|
990
|
+
}
|
|
985
991
|
async fromDBToEquipableEquipment(e) {
|
|
986
|
-
const a = (await this.getAll()).filter(
|
|
992
|
+
const a = (await this.getAll()).filter(
|
|
993
|
+
(r) => this.isEquipment(r)
|
|
994
|
+
).find(
|
|
987
995
|
({ entityId: r }) => r === e.entityId
|
|
988
996
|
);
|
|
989
997
|
if (!a)
|
|
@@ -999,82 +1007,50 @@ class Nt extends w {
|
|
|
999
1007
|
intelligence: 0,
|
|
1000
1008
|
wisdom: 0
|
|
1001
1009
|
};
|
|
1002
|
-
const a = await
|
|
1003
|
-
for (const r of
|
|
1010
|
+
const a = await A.getAllPopulated();
|
|
1011
|
+
for (const r of he) {
|
|
1004
1012
|
const s = e[r];
|
|
1005
|
-
s && (t =
|
|
1013
|
+
s && (t = K(
|
|
1006
1014
|
t,
|
|
1007
1015
|
(await this.fromDBToEquipableEquipment(s)).characteristics,
|
|
1008
|
-
(i,
|
|
1016
|
+
(i, o) => i + o
|
|
1009
1017
|
));
|
|
1010
1018
|
}
|
|
1011
1019
|
for (const r of a) {
|
|
1012
|
-
const s =
|
|
1013
|
-
s && !("target" in s) && (t =
|
|
1020
|
+
const s = A.hasPanoply(e, r);
|
|
1021
|
+
s && !("target" in s) && (t = K(
|
|
1014
1022
|
t,
|
|
1015
1023
|
s,
|
|
1016
|
-
(i,
|
|
1024
|
+
(i, o) => i + o
|
|
1017
1025
|
));
|
|
1018
1026
|
}
|
|
1019
1027
|
return t;
|
|
1020
1028
|
}
|
|
1021
|
-
filterCraftEntities(e) {
|
|
1022
|
-
return e.filter((t) => t.usage?.craft);
|
|
1023
|
-
}
|
|
1024
|
-
filterDismantleEntities(e) {
|
|
1025
|
-
return e.filter((t) => t.usage?.dismantle);
|
|
1026
|
-
}
|
|
1027
1029
|
filterUsableEntities(e) {
|
|
1028
|
-
return e.filter(
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
return e.filter((t) => t.usage?.enchant);
|
|
1032
|
-
}
|
|
1033
|
-
hasCraftEntities(e) {
|
|
1034
|
-
return !!e.find((t) => t.usage?.craft);
|
|
1035
|
-
}
|
|
1036
|
-
hasDismantleEntities(e) {
|
|
1037
|
-
return !!e.find((t) => t.usage?.dismantle);
|
|
1038
|
-
}
|
|
1039
|
-
hasEnchantableEntities(e) {
|
|
1040
|
-
return !!e.find((t) => t.usage?.enchant);
|
|
1030
|
+
return e.filter(
|
|
1031
|
+
(t) => this.isConsumableItem(t) && t.usage?.mode
|
|
1032
|
+
);
|
|
1041
1033
|
}
|
|
1042
1034
|
hasUsableEntities(e) {
|
|
1043
|
-
return !!e.find(
|
|
1035
|
+
return !!e.find(
|
|
1036
|
+
(t) => this.isConsumableItem(t) && t.usage?.mode
|
|
1037
|
+
);
|
|
1044
1038
|
}
|
|
1045
1039
|
isChestItem(e) {
|
|
1046
|
-
return e.
|
|
1040
|
+
return this.isItem(e) && e.category === "chest";
|
|
1047
1041
|
}
|
|
1048
|
-
|
|
1049
|
-
return e.
|
|
1042
|
+
isConsumableItem(e) {
|
|
1043
|
+
return this.isItem(e) && e.category === "consumable";
|
|
1050
1044
|
}
|
|
1051
|
-
|
|
1052
|
-
return e.
|
|
1053
|
-
}
|
|
1054
|
-
isRepairItem(e) {
|
|
1055
|
-
return e.type === "repair";
|
|
1056
|
-
}
|
|
1057
|
-
isStoreItem(e) {
|
|
1058
|
-
return e.type === "store";
|
|
1059
|
-
}
|
|
1060
|
-
isObjectItem(e) {
|
|
1061
|
-
return e.type === "object";
|
|
1062
|
-
}
|
|
1063
|
-
isScrollItem(e) {
|
|
1064
|
-
return e.type === "scroll";
|
|
1065
|
-
}
|
|
1066
|
-
isCookedMeal(e) {
|
|
1067
|
-
return e.type === "cookedMeal";
|
|
1068
|
-
}
|
|
1069
|
-
isAlcoholItem(e) {
|
|
1070
|
-
return e.type === "alcohol";
|
|
1045
|
+
isResourceItem(e) {
|
|
1046
|
+
return this.isItem(e) && e.category === "resource";
|
|
1071
1047
|
}
|
|
1072
1048
|
isSameEquipment(e, t) {
|
|
1073
1049
|
return e.entityId === t.entityId && e.seed === t.seed;
|
|
1074
1050
|
}
|
|
1075
1051
|
seedEquipment(e, t) {
|
|
1076
|
-
const a =
|
|
1077
|
-
|
|
1052
|
+
const a = Ve(t), r = ie(
|
|
1053
|
+
B(e.characteristics),
|
|
1078
1054
|
([s]) => s
|
|
1079
1055
|
);
|
|
1080
1056
|
return {
|
|
@@ -1083,7 +1059,7 @@ class Nt extends w {
|
|
|
1083
1059
|
characteristics: Object.fromEntries(
|
|
1084
1060
|
r.map(([s, i]) => [
|
|
1085
1061
|
s,
|
|
1086
|
-
Array.isArray(i) ?
|
|
1062
|
+
Array.isArray(i) ? Se(i[0], i[1] + 1, a) : i
|
|
1087
1063
|
])
|
|
1088
1064
|
)
|
|
1089
1065
|
};
|
|
@@ -1093,128 +1069,32 @@ class Nt extends w {
|
|
|
1093
1069
|
(a) => a && this.isSameEquipment(a, t)
|
|
1094
1070
|
);
|
|
1095
1071
|
}
|
|
1096
|
-
calcILvl(e) {
|
|
1097
|
-
return Object.values(e.characteristics).reduce((a, r) => a + r, 0) + e.level;
|
|
1098
|
-
}
|
|
1099
1072
|
}
|
|
1100
|
-
const
|
|
1101
|
-
{
|
|
1102
|
-
type: {
|
|
1103
|
-
type: String,
|
|
1104
|
-
enum: Qe,
|
|
1105
|
-
required: !0
|
|
1106
|
-
},
|
|
1107
|
-
params: { type: o.Types.Mixed }
|
|
1108
|
-
},
|
|
1109
|
-
{ _id: !1 }
|
|
1110
|
-
), zt = new o(
|
|
1111
|
-
{
|
|
1112
|
-
entityId: { unique: !0, required: !0, type: String },
|
|
1113
|
-
type: { required: !0, type: String },
|
|
1114
|
-
name: {
|
|
1115
|
-
required: !0,
|
|
1116
|
-
_id: !1,
|
|
1117
|
-
type: {
|
|
1118
|
-
key: { required: !0, type: String },
|
|
1119
|
-
context: String
|
|
1120
|
-
}
|
|
1121
|
-
},
|
|
1122
|
-
description: {
|
|
1123
|
-
_id: !1,
|
|
1124
|
-
type: {
|
|
1125
|
-
key: { required: !0, type: String },
|
|
1126
|
-
context: String
|
|
1127
|
-
}
|
|
1128
|
-
},
|
|
1129
|
-
image: { required: !0, type: String },
|
|
1130
|
-
emojis: { required: !0, type: String },
|
|
1131
|
-
category: { required: !0, type: String },
|
|
1132
|
-
effects: { type: [Ft], default: [] },
|
|
1133
|
-
rankId: String,
|
|
1134
|
-
usage: {
|
|
1135
|
-
_id: !1,
|
|
1136
|
-
type: {
|
|
1137
|
-
mode: String,
|
|
1138
|
-
craft: Boolean,
|
|
1139
|
-
enchant: String,
|
|
1140
|
-
dismantle: {
|
|
1141
|
-
type: [{ type: { entityId: String, quantity: Number }, _id: !1 }],
|
|
1142
|
-
default: void 0
|
|
1143
|
-
}
|
|
1144
|
-
},
|
|
1145
|
-
default: void 0
|
|
1146
|
-
},
|
|
1147
|
-
shop: {
|
|
1148
|
-
default: void 0,
|
|
1149
|
-
_id: !1,
|
|
1150
|
-
type: {
|
|
1151
|
-
price: { required: !0, type: Number },
|
|
1152
|
-
limit: Number,
|
|
1153
|
-
size: Number,
|
|
1154
|
-
odd: Number
|
|
1155
|
-
}
|
|
1156
|
-
},
|
|
1157
|
-
bottle: {
|
|
1158
|
-
default: void 0,
|
|
1159
|
-
_id: !1,
|
|
1160
|
-
type: {
|
|
1161
|
-
xp: {
|
|
1162
|
-
type: o.Types.Union,
|
|
1163
|
-
of: [Number, [Number]],
|
|
1164
|
-
required: !0
|
|
1165
|
-
},
|
|
1166
|
-
buffs: {
|
|
1167
|
-
required: !0,
|
|
1168
|
-
default: [],
|
|
1169
|
-
type: [
|
|
1170
|
-
{
|
|
1171
|
-
target: { type: String, required: !0 },
|
|
1172
|
-
multiplier: { type: Number, required: !0 },
|
|
1173
|
-
origin: { type: String, required: !0 },
|
|
1174
|
-
startIn: { type: Number, default: null },
|
|
1175
|
-
endIn: { type: Number, default: null },
|
|
1176
|
-
_id: !1
|
|
1177
|
-
}
|
|
1178
|
-
]
|
|
1179
|
-
},
|
|
1180
|
-
hp: Number,
|
|
1181
|
-
tier: Number
|
|
1182
|
-
}
|
|
1183
|
-
},
|
|
1184
|
-
ms: Number,
|
|
1185
|
-
characteristics: {
|
|
1186
|
-
_id: !1,
|
|
1187
|
-
type: Object
|
|
1188
|
-
},
|
|
1189
|
-
level: Number,
|
|
1190
|
-
panoply: String
|
|
1191
|
-
},
|
|
1192
|
-
{ minimize: !1 }
|
|
1193
|
-
), ne = d?.Entities || p("Entities", zt), jt = async (n) => await ne.create({
|
|
1073
|
+
const Nt = async (n) => await q.create({
|
|
1194
1074
|
...n
|
|
1195
|
-
})
|
|
1196
|
-
async function
|
|
1197
|
-
const e = await
|
|
1075
|
+
});
|
|
1076
|
+
async function Ht(n) {
|
|
1077
|
+
const e = await q.findOne({ entityId: n }).lean();
|
|
1198
1078
|
return e || null;
|
|
1199
1079
|
}
|
|
1200
|
-
const
|
|
1080
|
+
const Kt = (n, e) => q.findOneAndUpdate(n, e, {
|
|
1201
1081
|
returnDocument: "after"
|
|
1202
1082
|
}).lean();
|
|
1203
|
-
class
|
|
1083
|
+
class jt extends Ft {
|
|
1204
1084
|
constructor() {
|
|
1205
1085
|
super(3600);
|
|
1206
1086
|
}
|
|
1207
1087
|
createInDb(e) {
|
|
1208
|
-
return
|
|
1088
|
+
return Nt(e);
|
|
1209
1089
|
}
|
|
1210
1090
|
updateInDb(e, t) {
|
|
1211
|
-
return
|
|
1091
|
+
return Kt(e, t);
|
|
1212
1092
|
}
|
|
1213
1093
|
fetchFromDb(e) {
|
|
1214
|
-
return
|
|
1094
|
+
return Ht(e);
|
|
1215
1095
|
}
|
|
1216
1096
|
fetchManyFromDb(e, t) {
|
|
1217
|
-
return
|
|
1097
|
+
return Ct(e, t);
|
|
1218
1098
|
}
|
|
1219
1099
|
normalizeKey(e) {
|
|
1220
1100
|
return e;
|
|
@@ -1223,8 +1103,8 @@ class Lt extends Nt {
|
|
|
1223
1103
|
return e.entityId;
|
|
1224
1104
|
}
|
|
1225
1105
|
}
|
|
1226
|
-
const
|
|
1227
|
-
class
|
|
1106
|
+
const f = new jt();
|
|
1107
|
+
class Pt extends y {
|
|
1228
1108
|
hasAlreadyFoundEntity(e, t) {
|
|
1229
1109
|
return e.encyclopedia.includes(t);
|
|
1230
1110
|
}
|
|
@@ -1234,23 +1114,23 @@ class Qt extends f {
|
|
|
1234
1114
|
});
|
|
1235
1115
|
}
|
|
1236
1116
|
}
|
|
1237
|
-
const
|
|
1117
|
+
const zt = async (n) => await Q.create({
|
|
1238
1118
|
user: n
|
|
1239
1119
|
});
|
|
1240
|
-
async function
|
|
1241
|
-
const e = await
|
|
1242
|
-
return e ||
|
|
1120
|
+
async function Lt(n) {
|
|
1121
|
+
const e = await Q.findOne({ user: n }).lean();
|
|
1122
|
+
return e || p(await zt(n));
|
|
1243
1123
|
}
|
|
1244
|
-
const
|
|
1124
|
+
const Qt = (n, e) => Q.findOneAndUpdate({ user: n }, e, {
|
|
1245
1125
|
upsert: !0,
|
|
1246
1126
|
returnDocument: "after"
|
|
1247
1127
|
}).lean();
|
|
1248
|
-
class
|
|
1128
|
+
class Gt extends Pt {
|
|
1249
1129
|
constructor() {
|
|
1250
1130
|
super(300);
|
|
1251
1131
|
}
|
|
1252
1132
|
fetchFromDb(e) {
|
|
1253
|
-
return
|
|
1133
|
+
return Lt(e);
|
|
1254
1134
|
}
|
|
1255
1135
|
getKey({ user: e }) {
|
|
1256
1136
|
return e;
|
|
@@ -1259,22 +1139,11 @@ class Vt extends Qt {
|
|
|
1259
1139
|
return e.toString();
|
|
1260
1140
|
}
|
|
1261
1141
|
updateInDb(e, t) {
|
|
1262
|
-
return
|
|
1142
|
+
return Qt(e, t);
|
|
1263
1143
|
}
|
|
1264
1144
|
}
|
|
1265
|
-
const
|
|
1266
|
-
class
|
|
1267
|
-
getPanoplyEffectiveBonus(e, t) {
|
|
1268
|
-
const a = _(
|
|
1269
|
-
Object.values(e.equippedItems)
|
|
1270
|
-
), r = t.equipments.filter(
|
|
1271
|
-
(s) => a.find((i) => i.entityId === s.entityId)
|
|
1272
|
-
).length;
|
|
1273
|
-
if (r === t.equipments.length)
|
|
1274
|
-
return t.fullBonus;
|
|
1275
|
-
if (r >= t.equipments.length / 2)
|
|
1276
|
-
return t.halfBonus;
|
|
1277
|
-
}
|
|
1145
|
+
const se = new Gt();
|
|
1146
|
+
class Wt extends y {
|
|
1278
1147
|
async getUserEquipmentsCharacteristics(e) {
|
|
1279
1148
|
let t = {
|
|
1280
1149
|
vitality: 0,
|
|
@@ -1284,31 +1153,22 @@ class Xt extends f {
|
|
|
1284
1153
|
intelligence: 0,
|
|
1285
1154
|
wisdom: 0
|
|
1286
1155
|
};
|
|
1287
|
-
const a
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
if (!s)
|
|
1156
|
+
for (const a of he) {
|
|
1157
|
+
const r = e.equippedItems?.[a];
|
|
1158
|
+
if (!r)
|
|
1291
1159
|
continue;
|
|
1292
|
-
const
|
|
1293
|
-
t =
|
|
1160
|
+
const s = await f.fromDBToEquipableEquipment(r);
|
|
1161
|
+
t = K(
|
|
1294
1162
|
t,
|
|
1295
|
-
|
|
1296
|
-
(
|
|
1163
|
+
s.characteristics,
|
|
1164
|
+
(i, o) => i + o
|
|
1297
1165
|
);
|
|
1298
1166
|
}
|
|
1299
|
-
for (const r of a) {
|
|
1300
|
-
const s = this.getPanoplyEffectiveBonus(e, r);
|
|
1301
|
-
s && !("target" in s) && (t = C(
|
|
1302
|
-
t,
|
|
1303
|
-
s,
|
|
1304
|
-
(i, c) => i + c
|
|
1305
|
-
));
|
|
1306
|
-
}
|
|
1307
1167
|
return t;
|
|
1308
1168
|
}
|
|
1309
1169
|
async hasInventoryRequirements(e, t) {
|
|
1310
1170
|
const a = await this.get(e);
|
|
1311
|
-
return
|
|
1171
|
+
return B(t).reduce(
|
|
1312
1172
|
(r, [s, i]) => r && (a.itemList[s] ?? 0) >= (i ?? 0),
|
|
1313
1173
|
!0
|
|
1314
1174
|
);
|
|
@@ -1319,29 +1179,15 @@ class Xt extends f {
|
|
|
1319
1179
|
async getItemList(e) {
|
|
1320
1180
|
return (await this.get(e)).itemList;
|
|
1321
1181
|
}
|
|
1322
|
-
async calcBottleMultiplier(e, { bottle: { buffs: t } }) {
|
|
1323
|
-
const a = await this.get(e), s = (await E.getPanoplyBonus(
|
|
1324
|
-
a.equippedItems
|
|
1325
|
-
)).find(
|
|
1326
|
-
([i, c]) => i.panoplyId === "herbalist" && c !== null
|
|
1327
|
-
);
|
|
1328
|
-
return s && s[1] === "full" ? t.map((i) => ({
|
|
1329
|
-
...i,
|
|
1330
|
-
multiplier: i.multiplier * 1.25
|
|
1331
|
-
})) : s && s[1] === "half" ? t.map((i) => ({
|
|
1332
|
-
...i,
|
|
1333
|
-
multiplier: i.multiplier * 1.1
|
|
1334
|
-
})) : t;
|
|
1335
|
-
}
|
|
1336
1182
|
async calcMinStreakForWorkLoot(e) {
|
|
1337
|
-
const t = await this.get(e), a = (await
|
|
1183
|
+
const t = await this.get(e), a = (await A.getPanoplyBonus(t.equippedItems)).find(
|
|
1338
1184
|
([r, s]) => r.panoplyId === "marine" && s !== null
|
|
1339
1185
|
);
|
|
1340
1186
|
return a && a[1] === "full" ? 10 : a && a[1] === "half" ? 20 : 1 / 0;
|
|
1341
1187
|
}
|
|
1342
1188
|
async hasRevolutionaryBuff(e) {
|
|
1343
1189
|
const t = await this.get(e);
|
|
1344
|
-
return (await
|
|
1190
|
+
return (await A.getPanoplyBonus(t.equippedItems)).find(
|
|
1345
1191
|
([r, s]) => r.panoplyId === "revolutionary" && s !== null
|
|
1346
1192
|
)?.[1] ?? null;
|
|
1347
1193
|
}
|
|
@@ -1351,16 +1197,16 @@ class Xt extends f {
|
|
|
1351
1197
|
async addItem(e, t, a) {
|
|
1352
1198
|
await this.update(e, {
|
|
1353
1199
|
$inc: { [`itemList.${t}`]: a }
|
|
1354
|
-
}), await
|
|
1200
|
+
}), await se.addEntities(e, [t]);
|
|
1355
1201
|
}
|
|
1356
1202
|
async addItems(e, t) {
|
|
1357
1203
|
await this.update(e, {
|
|
1358
1204
|
$inc: Object.fromEntries(
|
|
1359
1205
|
Object.entries(t).filter(([, a]) => (a ?? 0) > 0).map(([a, r]) => [`itemList.${a}`, r])
|
|
1360
1206
|
)
|
|
1361
|
-
}), await
|
|
1207
|
+
}), await se.addEntities(
|
|
1362
1208
|
e,
|
|
1363
|
-
|
|
1209
|
+
B(t).filter(([, a]) => a > 0).map(([a]) => a)
|
|
1364
1210
|
);
|
|
1365
1211
|
}
|
|
1366
1212
|
async removeItem(e, t, a) {
|
|
@@ -1390,7 +1236,7 @@ class Xt extends f {
|
|
|
1390
1236
|
async addEquipments(e, t) {
|
|
1391
1237
|
await this.update(e, {
|
|
1392
1238
|
$push: { equipmentList: { $each: t } }
|
|
1393
|
-
}), await
|
|
1239
|
+
}), await se.addEntities(
|
|
1394
1240
|
e,
|
|
1395
1241
|
t.map((a) => a.entityId)
|
|
1396
1242
|
);
|
|
@@ -1409,34 +1255,34 @@ class Xt extends f {
|
|
|
1409
1255
|
a?.equipmentSave[t] && await this.equip(e, a.equipmentSave[t]);
|
|
1410
1256
|
}
|
|
1411
1257
|
async equip(e, t) {
|
|
1412
|
-
const a = await
|
|
1413
|
-
|
|
1258
|
+
const a = await E.getMaxHp(e), r = Object.fromEntries(
|
|
1259
|
+
B(t).map(([s, i]) => [
|
|
1414
1260
|
`equippedItems.${s}`,
|
|
1415
1261
|
i
|
|
1416
1262
|
])
|
|
1417
1263
|
);
|
|
1418
1264
|
await this.update(e, {
|
|
1419
1265
|
$set: r
|
|
1420
|
-
}), await
|
|
1266
|
+
}), await E.updateHp(e, a);
|
|
1421
1267
|
}
|
|
1422
1268
|
async unequip(e, t) {
|
|
1423
|
-
const a = await
|
|
1269
|
+
const a = await E.getMaxHp(e);
|
|
1424
1270
|
await this.update(e, {
|
|
1425
1271
|
$set: {
|
|
1426
1272
|
[`equippedItems.${t}`]: null
|
|
1427
1273
|
}
|
|
1428
|
-
}), await
|
|
1274
|
+
}), await E.updateHp(e, a);
|
|
1429
1275
|
}
|
|
1430
1276
|
async craftItem(e, t, a, r) {
|
|
1431
|
-
for (const { entityId:
|
|
1432
|
-
await this.removeItem(e,
|
|
1277
|
+
for (const { entityId: o, size: l } of t.entities)
|
|
1278
|
+
await this.removeItem(e, o, l * a);
|
|
1433
1279
|
const { entityId: s, size: i } = t.result;
|
|
1434
|
-
await
|
|
1280
|
+
await f.isEntityId(s, f.isEquipment) ? await this.addEquipments(e, [{ entityId: s, seed: r }]) : await f.isEntityId(s, f.isItem) && await this.addItem(e, s, i * a);
|
|
1435
1281
|
}
|
|
1436
1282
|
async dismantleEntity(e, t, a, r, s) {
|
|
1437
|
-
|
|
1438
|
-
for (const { entityId: i, quantity:
|
|
1439
|
-
await
|
|
1283
|
+
f.isEquipment(t) ? await this.removeEquipment(e, t.entityId, s) : f.isItem(t) && await this.removeItem(e, t.entityId, r);
|
|
1284
|
+
for (const { entityId: i, quantity: o } of a)
|
|
1285
|
+
await f.isEntityId(i, f.isItem) && await this.addItem(e, i, r * o);
|
|
1440
1286
|
await this.removeItem(e, "tools", 1);
|
|
1441
1287
|
}
|
|
1442
1288
|
async enchantItem(e, t, a, r, s) {
|
|
@@ -1446,23 +1292,23 @@ class Xt extends f {
|
|
|
1446
1292
|
await this.update(e, { $addToSet: { recipes: t } });
|
|
1447
1293
|
}
|
|
1448
1294
|
}
|
|
1449
|
-
const
|
|
1295
|
+
const Yt = (n) => W.create({
|
|
1450
1296
|
user: n
|
|
1451
1297
|
});
|
|
1452
|
-
async function
|
|
1453
|
-
const e = await
|
|
1454
|
-
return e ||
|
|
1298
|
+
async function Vt(n) {
|
|
1299
|
+
const e = await W.findOne({ user: n }).lean();
|
|
1300
|
+
return e || p(await Yt(n));
|
|
1455
1301
|
}
|
|
1456
|
-
const
|
|
1302
|
+
const Xt = (n, e) => W.findOneAndUpdate({ user: n }, e, {
|
|
1457
1303
|
upsert: !0,
|
|
1458
1304
|
returnDocument: "after"
|
|
1459
1305
|
}).lean();
|
|
1460
|
-
class
|
|
1306
|
+
class Jt extends Wt {
|
|
1461
1307
|
constructor() {
|
|
1462
1308
|
super(300);
|
|
1463
1309
|
}
|
|
1464
1310
|
fetchFromDb(e) {
|
|
1465
|
-
return
|
|
1311
|
+
return Vt(e);
|
|
1466
1312
|
}
|
|
1467
1313
|
normalizeKey(e) {
|
|
1468
1314
|
return e.toString();
|
|
@@ -1471,17 +1317,17 @@ class tn extends Xt {
|
|
|
1471
1317
|
return e;
|
|
1472
1318
|
}
|
|
1473
1319
|
updateInDb(e, t) {
|
|
1474
|
-
return
|
|
1320
|
+
return Xt(e, t);
|
|
1475
1321
|
}
|
|
1476
1322
|
}
|
|
1477
|
-
const
|
|
1478
|
-
class
|
|
1323
|
+
const U = new Jt();
|
|
1324
|
+
class Zt extends m {
|
|
1479
1325
|
async getTotalCharacteristics(e) {
|
|
1480
1326
|
const { characteristics: t, scrolls: a } = await this.get(e);
|
|
1481
|
-
return
|
|
1482
|
-
|
|
1327
|
+
return we(
|
|
1328
|
+
Pe.map((r) => [
|
|
1483
1329
|
r,
|
|
1484
|
-
|
|
1330
|
+
ze(t[r]) + a[r]
|
|
1485
1331
|
])
|
|
1486
1332
|
);
|
|
1487
1333
|
}
|
|
@@ -1533,7 +1379,7 @@ class nn extends w {
|
|
|
1533
1379
|
t.booster ? 0.25 : 0
|
|
1534
1380
|
);
|
|
1535
1381
|
return r + s + t.buffs.xp.global.reduce(
|
|
1536
|
-
(i, { expireAt:
|
|
1382
|
+
(i, { expireAt: o, startAt: l, multiplier: S }) => l && l > /* @__PURE__ */ new Date() || o && re(o) ? i : i + S,
|
|
1537
1383
|
0
|
|
1538
1384
|
);
|
|
1539
1385
|
}
|
|
@@ -1542,7 +1388,7 @@ class nn extends w {
|
|
|
1542
1388
|
return t < 10 ? 10 * a : t > 300 ? 300 * a : t * a;
|
|
1543
1389
|
}
|
|
1544
1390
|
async getXpDeathPenalties(e) {
|
|
1545
|
-
const t = await this.get(e), a =
|
|
1391
|
+
const t = await this.get(e), a = Le(t.xp.amount);
|
|
1546
1392
|
return a <= 10 ? 5e3 : a <= 20 ? 1e4 : a <= 30 ? 2e4 : a <= 40 ? 3e4 : a <= 50 ? 5e4 : a <= 60 ? 75e3 : a <= 70 ? 15e4 : a <= 80 ? 25e4 : a <= 90 ? 4e5 : a <= 100 ? 75e4 : 14e6;
|
|
1547
1393
|
}
|
|
1548
1394
|
async calcXp(e, t, a) {
|
|
@@ -1555,32 +1401,32 @@ class nn extends w {
|
|
|
1555
1401
|
}
|
|
1556
1402
|
async calcBuffMultiplier(e, t, a) {
|
|
1557
1403
|
return (await this.get(e)).buffs[t][a].reduce(
|
|
1558
|
-
(i, { expireAt:
|
|
1404
|
+
(i, { expireAt: o, startAt: l, multiplier: S }) => i + (/* @__PURE__ */ new Date() >= (l ?? /* @__PURE__ */ new Date()) && (!o || !re(o)) ? S : 0),
|
|
1559
1405
|
1
|
|
1560
1406
|
);
|
|
1561
1407
|
}
|
|
1562
1408
|
async getMaxHp(e) {
|
|
1563
|
-
const t = await
|
|
1409
|
+
const t = await U.get(e), { vitality: a } = await this.getTotalCharacteristics(e), r = await U.getUserEquipmentsCharacteristics(
|
|
1564
1410
|
t
|
|
1565
1411
|
);
|
|
1566
|
-
return (a + r.vitality) *
|
|
1412
|
+
return (a + r.vitality) * Qe + Ge;
|
|
1567
1413
|
}
|
|
1568
1414
|
async getHpRatio(e) {
|
|
1569
1415
|
const t = await this.get(e), a = await this.getMaxHp(e);
|
|
1570
1416
|
return Math.min(t.hp / a, 1);
|
|
1571
1417
|
}
|
|
1572
1418
|
async hasCharacteristicRequirement(e, t) {
|
|
1573
|
-
const a = await
|
|
1419
|
+
const a = await U.get(e), r = await U.getUserEquipmentsCharacteristics(
|
|
1574
1420
|
a
|
|
1575
|
-
), s =
|
|
1421
|
+
), s = K(
|
|
1576
1422
|
await this.getTotalCharacteristics(e),
|
|
1577
1423
|
r,
|
|
1578
|
-
(i,
|
|
1424
|
+
(i, o) => i + o
|
|
1579
1425
|
);
|
|
1580
1426
|
if ("sum" in t) {
|
|
1581
1427
|
let i = 0;
|
|
1582
|
-
for (const
|
|
1583
|
-
i += s[
|
|
1428
|
+
for (const o of t.characteristics)
|
|
1429
|
+
i += s[o] ?? 0;
|
|
1584
1430
|
return i >= t.sum;
|
|
1585
1431
|
} else {
|
|
1586
1432
|
for (const i of Object.keys(
|
|
@@ -1595,8 +1441,8 @@ class nn extends w {
|
|
|
1595
1441
|
const t = await this.get(e);
|
|
1596
1442
|
for (const a of Object.values(t.buffs))
|
|
1597
1443
|
for (const r of Object.values(a))
|
|
1598
|
-
for (const { multiplier: s, startAt: i, expireAt:
|
|
1599
|
-
if (s < 0 && (!
|
|
1444
|
+
for (const { multiplier: s, startAt: i, expireAt: o } of r)
|
|
1445
|
+
if (s < 0 && (!o || !re(o)) && (i ?? /* @__PURE__ */ new Date()) <= /* @__PURE__ */ new Date())
|
|
1600
1446
|
return !0;
|
|
1601
1447
|
return !1;
|
|
1602
1448
|
}
|
|
@@ -1652,7 +1498,7 @@ class nn extends w {
|
|
|
1652
1498
|
await this.updateBuff(e, r);
|
|
1653
1499
|
return;
|
|
1654
1500
|
}
|
|
1655
|
-
const a =
|
|
1501
|
+
const a = We(t);
|
|
1656
1502
|
await this.update(e, [
|
|
1657
1503
|
{
|
|
1658
1504
|
$set: {
|
|
@@ -1747,15 +1593,15 @@ class nn extends w {
|
|
|
1747
1593
|
});
|
|
1748
1594
|
}
|
|
1749
1595
|
async updatePanoplyBuff(e, t, a, r) {
|
|
1750
|
-
const s = await
|
|
1751
|
-
(
|
|
1596
|
+
const s = await f.fromDBToEquipableEquipment(t), i = H(Object.values(a)), l = (await A.getAllPopulated()).find(
|
|
1597
|
+
($) => $.panoplyId === s.panoply
|
|
1752
1598
|
);
|
|
1753
|
-
if (!
|
|
1599
|
+
if (!l)
|
|
1754
1600
|
return;
|
|
1755
|
-
const
|
|
1756
|
-
(
|
|
1757
|
-
).length,
|
|
1758
|
-
|
|
1601
|
+
const S = l.equipments.filter(
|
|
1602
|
+
($) => (i.find((ae) => $.entityId === ae.entityId) || !r && s.entityId === $.entityId) && (r ? s.entityId !== $.entityId : !0)
|
|
1603
|
+
).length, x = S === l.equipments.length ? l.fullBonus : S >= l.equipments.length / 2 ? l.halfBonus : void 0;
|
|
1604
|
+
l.halfBonus && "target" in l.halfBonus && await this.removeBuff(e, l.halfBonus), l.fullBonus && "target" in l.fullBonus && await this.removeBuff(e, l.fullBonus), x && "target" in x && await this.updateBuff(e, x);
|
|
1759
1605
|
}
|
|
1760
1606
|
async gainHp(e, t) {
|
|
1761
1607
|
const a = await this.get(e), s = await this.getMaxHp(e) - a.hp;
|
|
@@ -1803,8 +1649,8 @@ class nn extends w {
|
|
|
1803
1649
|
$inc: r
|
|
1804
1650
|
}), await this.updateHp(e, a);
|
|
1805
1651
|
}
|
|
1806
|
-
async resetCharacteristics(e
|
|
1807
|
-
const
|
|
1652
|
+
async resetCharacteristics(e) {
|
|
1653
|
+
const t = await this.getMaxHp(e), a = {
|
|
1808
1654
|
vitality: 0,
|
|
1809
1655
|
strength: 0,
|
|
1810
1656
|
agility: 0,
|
|
@@ -1812,22 +1658,14 @@ class nn extends w {
|
|
|
1812
1658
|
intelligence: 0,
|
|
1813
1659
|
wisdom: 0
|
|
1814
1660
|
};
|
|
1815
|
-
|
|
1816
|
-
$set: {
|
|
1817
|
-
characteristics: r,
|
|
1818
|
-
"resetCharacteristics.free": !1
|
|
1819
|
-
}
|
|
1820
|
-
}) : await this.update(e, {
|
|
1661
|
+
await this.update(e, {
|
|
1821
1662
|
$set: {
|
|
1822
|
-
characteristics:
|
|
1823
|
-
"resetCharacteristics.nextAvailable": new Date(
|
|
1824
|
-
Date.now() + 720 * 60 * 60 * 1e3
|
|
1825
|
-
)
|
|
1663
|
+
characteristics: a
|
|
1826
1664
|
},
|
|
1827
1665
|
$inc: {
|
|
1828
1666
|
berry: -1e8
|
|
1829
1667
|
}
|
|
1830
|
-
}), await this.updateHp(e,
|
|
1668
|
+
}), await this.updateHp(e, t);
|
|
1831
1669
|
}
|
|
1832
1670
|
async updateLastMessageWithXpDate(e) {
|
|
1833
1671
|
await this.update(e, { $set: { "xp.lastMessageWithXp": /* @__PURE__ */ new Date() } });
|
|
@@ -1868,18 +1706,18 @@ class nn extends w {
|
|
|
1868
1706
|
return await this.addBerry(e, r), r;
|
|
1869
1707
|
}
|
|
1870
1708
|
}
|
|
1871
|
-
const
|
|
1709
|
+
const en = (n) => I.find(n).lean(), tn = async (n) => await I.create({
|
|
1872
1710
|
user: n
|
|
1873
1711
|
});
|
|
1874
|
-
async function
|
|
1875
|
-
const e = await
|
|
1876
|
-
return e ||
|
|
1712
|
+
async function nn(n) {
|
|
1713
|
+
const e = await I.findOne({ user: n }).lean();
|
|
1714
|
+
return e || p(await tn(n));
|
|
1877
1715
|
}
|
|
1878
|
-
const
|
|
1716
|
+
const an = (n, e) => I.findOneAndUpdate({ user: n }, e, {
|
|
1879
1717
|
returnDocument: "after",
|
|
1880
1718
|
upsert: !0
|
|
1881
1719
|
}).lean();
|
|
1882
|
-
class
|
|
1720
|
+
class rn extends Zt {
|
|
1883
1721
|
constructor() {
|
|
1884
1722
|
super(300);
|
|
1885
1723
|
}
|
|
@@ -1890,17 +1728,17 @@ class on extends nn {
|
|
|
1890
1728
|
return e;
|
|
1891
1729
|
}
|
|
1892
1730
|
fetchFromDb(e) {
|
|
1893
|
-
return
|
|
1731
|
+
return nn(e);
|
|
1894
1732
|
}
|
|
1895
1733
|
fetchManyFromDb(e) {
|
|
1896
|
-
return
|
|
1734
|
+
return en(e);
|
|
1897
1735
|
}
|
|
1898
1736
|
updateInDb(e, t) {
|
|
1899
|
-
return
|
|
1737
|
+
return an(e, t);
|
|
1900
1738
|
}
|
|
1901
1739
|
}
|
|
1902
|
-
const
|
|
1903
|
-
class
|
|
1740
|
+
const E = new rn();
|
|
1741
|
+
class sn extends m {
|
|
1904
1742
|
async updateSendDailyQuest(e, t) {
|
|
1905
1743
|
await this.update(e, { $set: { sendDailyQuest: t } });
|
|
1906
1744
|
}
|
|
@@ -1919,18 +1757,18 @@ class cn extends w {
|
|
|
1919
1757
|
});
|
|
1920
1758
|
}
|
|
1921
1759
|
}
|
|
1922
|
-
const
|
|
1760
|
+
const un = (n) => C.find(n).lean(), on = async (n) => await C.create({
|
|
1923
1761
|
user: n
|
|
1924
1762
|
});
|
|
1925
|
-
async function
|
|
1926
|
-
const e = await
|
|
1927
|
-
return e ||
|
|
1763
|
+
async function cn(n) {
|
|
1764
|
+
const e = await C.findOne({ user: n }).lean();
|
|
1765
|
+
return e || p(await on(n));
|
|
1928
1766
|
}
|
|
1929
|
-
const
|
|
1767
|
+
const dn = (n, e) => C.findOneAndUpdate({ user: n }, e, {
|
|
1930
1768
|
returnDocument: "after",
|
|
1931
1769
|
upsert: !0
|
|
1932
1770
|
}).lean();
|
|
1933
|
-
class
|
|
1771
|
+
class ln extends sn {
|
|
1934
1772
|
constructor() {
|
|
1935
1773
|
super(3600);
|
|
1936
1774
|
}
|
|
@@ -1941,17 +1779,17 @@ class fn extends cn {
|
|
|
1941
1779
|
return e.user;
|
|
1942
1780
|
}
|
|
1943
1781
|
fetchFromDb(e) {
|
|
1944
|
-
return
|
|
1782
|
+
return cn(e);
|
|
1945
1783
|
}
|
|
1946
1784
|
fetchManyFromDb(e) {
|
|
1947
|
-
return
|
|
1785
|
+
return un(e);
|
|
1948
1786
|
}
|
|
1949
1787
|
updateInDb(e, t) {
|
|
1950
|
-
return
|
|
1788
|
+
return dn(e, t);
|
|
1951
1789
|
}
|
|
1952
1790
|
}
|
|
1953
|
-
const
|
|
1954
|
-
class
|
|
1791
|
+
const Re = new ln();
|
|
1792
|
+
class pn extends y {
|
|
1955
1793
|
async getCommandCooldown(e, t) {
|
|
1956
1794
|
return (await this.get(e)).commands[t];
|
|
1957
1795
|
}
|
|
@@ -1960,33 +1798,33 @@ class mn extends f {
|
|
|
1960
1798
|
$set: {
|
|
1961
1799
|
lockUserCommand: new Date(Date.now() + 2 * 3600 * 1e3)
|
|
1962
1800
|
}
|
|
1963
|
-
}), await
|
|
1801
|
+
}), await E.gainHp(e, 1);
|
|
1964
1802
|
}
|
|
1965
1803
|
async useCommand(e, t, a) {
|
|
1966
|
-
const { reminder: r } = await
|
|
1804
|
+
const { reminder: r } = await Re.get(e);
|
|
1967
1805
|
await this.update(e, {
|
|
1968
1806
|
$set: {
|
|
1969
1807
|
[`commands.${t}`]: new Date(Date.now() + a)
|
|
1970
1808
|
}
|
|
1971
|
-
}), r.commands[t] && await
|
|
1809
|
+
}), r.commands[t] && await Ut.addReminder(
|
|
1972
1810
|
e,
|
|
1973
1811
|
`commands/${t}`,
|
|
1974
1812
|
new Date(Date.now() + a)
|
|
1975
1813
|
);
|
|
1976
1814
|
}
|
|
1977
1815
|
}
|
|
1978
|
-
const
|
|
1816
|
+
const yn = async (n) => await z.create({
|
|
1979
1817
|
user: n
|
|
1980
1818
|
});
|
|
1981
|
-
async function
|
|
1982
|
-
const e = await
|
|
1983
|
-
return e ||
|
|
1819
|
+
async function fn(n) {
|
|
1820
|
+
const e = await z.findOne({ user: n }).lean();
|
|
1821
|
+
return e || p(await yn(n));
|
|
1984
1822
|
}
|
|
1985
|
-
const
|
|
1823
|
+
const mn = (n, e) => z.findOneAndUpdate({ user: n }, e, {
|
|
1986
1824
|
returnDocument: "after",
|
|
1987
1825
|
upsert: !0
|
|
1988
1826
|
}).lean();
|
|
1989
|
-
class
|
|
1827
|
+
class hn extends pn {
|
|
1990
1828
|
constructor() {
|
|
1991
1829
|
super(300);
|
|
1992
1830
|
}
|
|
@@ -1997,14 +1835,14 @@ class Sn extends mn {
|
|
|
1997
1835
|
return e.user;
|
|
1998
1836
|
}
|
|
1999
1837
|
fetchFromDb(e) {
|
|
2000
|
-
return
|
|
1838
|
+
return fn(e);
|
|
2001
1839
|
}
|
|
2002
1840
|
updateInDb(e, t) {
|
|
2003
|
-
return
|
|
1841
|
+
return mn(e, t);
|
|
2004
1842
|
}
|
|
2005
1843
|
}
|
|
2006
|
-
const
|
|
2007
|
-
class
|
|
1844
|
+
const fr = new hn();
|
|
1845
|
+
class gn extends m {
|
|
2008
1846
|
async isOrnamentIds(e, t = () => !0) {
|
|
2009
1847
|
const r = (await this.getAll()).filter(t).map(({ ornamentId: s }) => s);
|
|
2010
1848
|
return e.every((s) => r.includes(s));
|
|
@@ -2028,28 +1866,28 @@ class bn extends w {
|
|
|
2028
1866
|
return this.isTitle(e) && "price" in e;
|
|
2029
1867
|
}
|
|
2030
1868
|
async getAllBackgrounds() {
|
|
2031
|
-
return (await this.getAll()).filter(this.isBackground);
|
|
1869
|
+
return (await this.getAll()).filter((e) => this.isBackground(e));
|
|
2032
1870
|
}
|
|
2033
1871
|
async getAllTitles() {
|
|
2034
|
-
return (await this.getAll()).filter(this.isTitle);
|
|
1872
|
+
return (await this.getAll()).filter((e) => this.isTitle(e));
|
|
2035
1873
|
}
|
|
2036
1874
|
async getAllFactionTitles() {
|
|
2037
|
-
return (await this.getAll()).filter(this.isFactionTitle);
|
|
1875
|
+
return (await this.getAll()).filter((e) => this.isFactionTitle(e));
|
|
2038
1876
|
}
|
|
2039
1877
|
async getAllQuestTitles() {
|
|
2040
|
-
return (await this.getAll()).filter(this.isQuestTitle);
|
|
1878
|
+
return (await this.getAll()).filter((e) => this.isQuestTitle(e));
|
|
2041
1879
|
}
|
|
2042
1880
|
async getAllShopTitles() {
|
|
2043
|
-
return (await this.getAll()).filter(this.isShopTitle);
|
|
1881
|
+
return (await this.getAll()).filter((e) => this.isShopTitle(e));
|
|
2044
1882
|
}
|
|
2045
1883
|
formatBackgroundId(e) {
|
|
2046
|
-
const t =
|
|
2047
|
-
return t === "background_default" ? "par défaut" : `"${
|
|
1884
|
+
const t = Xe(e) ? e : e.ornamentId;
|
|
1885
|
+
return t === "background_default" ? "par défaut" : `"${Je(t.split("_").join(" "))}"`;
|
|
2048
1886
|
}
|
|
2049
1887
|
async getSomeShopTitles(e) {
|
|
2050
1888
|
const t = await this.getAllShopTitles();
|
|
2051
|
-
return
|
|
2052
|
-
|
|
1889
|
+
return ie(
|
|
1890
|
+
pe(
|
|
2053
1891
|
e,
|
|
2054
1892
|
t,
|
|
2055
1893
|
(a) => a.ornamentId,
|
|
@@ -2060,8 +1898,8 @@ class bn extends w {
|
|
|
2060
1898
|
}
|
|
2061
1899
|
async getSomeBackgrounds(e) {
|
|
2062
1900
|
const t = await this.getAllBackgrounds();
|
|
2063
|
-
return
|
|
2064
|
-
|
|
1901
|
+
return ie(
|
|
1902
|
+
pe(
|
|
2065
1903
|
e,
|
|
2066
1904
|
t,
|
|
2067
1905
|
(a) => a.ornamentId,
|
|
@@ -2071,19 +1909,19 @@ class bn extends w {
|
|
|
2071
1909
|
);
|
|
2072
1910
|
}
|
|
2073
1911
|
pickEachRarityOrnament(e, t) {
|
|
2074
|
-
if (t.length !==
|
|
1912
|
+
if (t.length !== le.length)
|
|
2075
1913
|
throw new RangeError(
|
|
2076
1914
|
"pickEachRarityOrnament - must give same number of odds than ranks"
|
|
2077
1915
|
);
|
|
2078
|
-
return
|
|
1916
|
+
return H(
|
|
2079
1917
|
t.map((a, r) => {
|
|
2080
|
-
const s =
|
|
2081
|
-
return Math.random() > a || !i || !i.length ? null :
|
|
1918
|
+
const s = le[r], i = e[s];
|
|
1919
|
+
return Math.random() > a || !i || !i.length ? null : Ze(i);
|
|
2082
1920
|
})
|
|
2083
1921
|
);
|
|
2084
1922
|
}
|
|
2085
1923
|
}
|
|
2086
|
-
const
|
|
1924
|
+
const wn = new u(
|
|
2087
1925
|
{
|
|
2088
1926
|
ornamentId: { unique: !0, index: 1, required: !0, type: String },
|
|
2089
1927
|
type: { required: !0, type: String },
|
|
@@ -2097,26 +1935,26 @@ const $n = new o(
|
|
|
2097
1935
|
strength: Number
|
|
2098
1936
|
},
|
|
2099
1937
|
{ minimize: !1 }
|
|
2100
|
-
),
|
|
2101
|
-
async function
|
|
2102
|
-
const e = await
|
|
1938
|
+
), oe = c?.Ornaments || d("Ornaments", wn), Sn = async (n, e) => oe.find(n, {}, e).lean();
|
|
1939
|
+
async function bn(n) {
|
|
1940
|
+
const e = await oe.findOne({ ornamentId: n }).lean();
|
|
2103
1941
|
return e || null;
|
|
2104
1942
|
}
|
|
2105
|
-
const
|
|
1943
|
+
const $n = (n, e) => oe.findOneAndUpdate(n, e, {
|
|
2106
1944
|
returnDocument: "after"
|
|
2107
1945
|
}).lean();
|
|
2108
|
-
class
|
|
1946
|
+
class Un extends gn {
|
|
2109
1947
|
constructor() {
|
|
2110
1948
|
super(3600);
|
|
2111
1949
|
}
|
|
2112
1950
|
updateInDb(e, t) {
|
|
2113
|
-
return
|
|
1951
|
+
return $n(e, t);
|
|
2114
1952
|
}
|
|
2115
1953
|
fetchFromDb(e) {
|
|
2116
|
-
return
|
|
1954
|
+
return bn(e);
|
|
2117
1955
|
}
|
|
2118
1956
|
fetchManyFromDb(e, t) {
|
|
2119
|
-
return
|
|
1957
|
+
return Sn(e, t);
|
|
2120
1958
|
}
|
|
2121
1959
|
getKey(e) {
|
|
2122
1960
|
return e.ornamentId;
|
|
@@ -2125,13 +1963,13 @@ class Dn extends bn {
|
|
|
2125
1963
|
return e;
|
|
2126
1964
|
}
|
|
2127
1965
|
}
|
|
2128
|
-
const
|
|
2129
|
-
class
|
|
1966
|
+
const b = new Un();
|
|
1967
|
+
class En extends y {
|
|
2130
1968
|
async unlockTitle(e, t) {
|
|
2131
|
-
await
|
|
1969
|
+
await b.isOrnamentIds([t], b.isTitle) && await this.update(e, { $addToSet: { unlockedTitles: t } });
|
|
2132
1970
|
}
|
|
2133
1971
|
async unlockTitles(e, t) {
|
|
2134
|
-
await
|
|
1972
|
+
await b.isOrnamentIds(t, b.isTitle) && await this.update(e, {
|
|
2135
1973
|
$addToSet: { unlockedTitles: { $each: t } }
|
|
2136
1974
|
});
|
|
2137
1975
|
}
|
|
@@ -2139,17 +1977,17 @@ class Tn extends f {
|
|
|
2139
1977
|
await this.update(e, { $set: { selectedTitle: t } });
|
|
2140
1978
|
}
|
|
2141
1979
|
async unlockBackground(e, t) {
|
|
2142
|
-
await
|
|
1980
|
+
await b.isOrnamentIds(
|
|
2143
1981
|
[t],
|
|
2144
|
-
|
|
1982
|
+
b.isBackground
|
|
2145
1983
|
) && await this.update(e, {
|
|
2146
1984
|
$addToSet: { unlockedBackgrounds: t }
|
|
2147
1985
|
});
|
|
2148
1986
|
}
|
|
2149
1987
|
async unlockBackgrounds(e, t) {
|
|
2150
|
-
await
|
|
1988
|
+
await b.isOrnamentIds(
|
|
2151
1989
|
t,
|
|
2152
|
-
|
|
1990
|
+
b.isBackground
|
|
2153
1991
|
) && await this.update(e, {
|
|
2154
1992
|
$addToSet: { unlockedBackgrounds: { $each: t } }
|
|
2155
1993
|
});
|
|
@@ -2195,18 +2033,18 @@ class Tn extends f {
|
|
|
2195
2033
|
});
|
|
2196
2034
|
}
|
|
2197
2035
|
}
|
|
2198
|
-
const
|
|
2036
|
+
const Dn = async (n) => await Y.create({
|
|
2199
2037
|
user: n
|
|
2200
2038
|
});
|
|
2201
|
-
async function
|
|
2202
|
-
const e = await
|
|
2203
|
-
return e ||
|
|
2039
|
+
async function In(n) {
|
|
2040
|
+
const e = await Y.findOne({ user: n }).lean();
|
|
2041
|
+
return e || p(await Dn(n));
|
|
2204
2042
|
}
|
|
2205
|
-
const
|
|
2043
|
+
const Tn = async (n, e) => Y.findOneAndUpdate({ user: n }, e, {
|
|
2206
2044
|
upsert: !0,
|
|
2207
2045
|
returnDocument: "after"
|
|
2208
2046
|
}).lean();
|
|
2209
|
-
class
|
|
2047
|
+
class On extends En {
|
|
2210
2048
|
constructor() {
|
|
2211
2049
|
super(300);
|
|
2212
2050
|
}
|
|
@@ -2217,14 +2055,14 @@ class Mn extends Tn {
|
|
|
2217
2055
|
return e;
|
|
2218
2056
|
}
|
|
2219
2057
|
fetchFromDb(e) {
|
|
2220
|
-
return
|
|
2058
|
+
return In(e);
|
|
2221
2059
|
}
|
|
2222
2060
|
updateInDb(e, t) {
|
|
2223
|
-
return
|
|
2061
|
+
return Tn(e, t);
|
|
2224
2062
|
}
|
|
2225
2063
|
}
|
|
2226
|
-
const
|
|
2227
|
-
class
|
|
2064
|
+
const ye = new On();
|
|
2065
|
+
class vn extends m {
|
|
2228
2066
|
async getStatus(e, t) {
|
|
2229
2067
|
return (await this.get({ user: e, questId: t })).status;
|
|
2230
2068
|
}
|
|
@@ -2233,17 +2071,17 @@ class kn extends w {
|
|
|
2233
2071
|
}
|
|
2234
2072
|
async isStreaking(e, t) {
|
|
2235
2073
|
const { lastCompletionDate: a } = await this.get({ user: e, questId: t });
|
|
2236
|
-
return !!a &&
|
|
2074
|
+
return !!a && be(j(), a);
|
|
2237
2075
|
}
|
|
2238
2076
|
async getStreakMultiplier(e, t) {
|
|
2239
2077
|
const a = await this.get({ user: e, questId: t });
|
|
2240
2078
|
return await this.isStreaking(e, t) ? 1 + Math.min(2, (a.streak ?? 0) / 10) : 1;
|
|
2241
2079
|
}
|
|
2242
2080
|
async getCompletedCount(e) {
|
|
2243
|
-
return (await this.getMany({ user: e, status:
|
|
2081
|
+
return (await this.getMany({ user: e, status: v.COMPLETED })).length;
|
|
2244
2082
|
}
|
|
2245
2083
|
async completeQuest(e, t = !1) {
|
|
2246
|
-
const a =
|
|
2084
|
+
const a = j();
|
|
2247
2085
|
a.setHours(0, 0, 0, 0);
|
|
2248
2086
|
const r = /* @__PURE__ */ new Date();
|
|
2249
2087
|
return r.setHours(0, 0, 0, 0), this.update(
|
|
@@ -2266,7 +2104,7 @@ class kn extends w {
|
|
|
2266
2104
|
}
|
|
2267
2105
|
} : {},
|
|
2268
2106
|
lastCompletionDate: /* @__PURE__ */ new Date(),
|
|
2269
|
-
status:
|
|
2107
|
+
status: v.COMPLETED
|
|
2270
2108
|
}
|
|
2271
2109
|
}
|
|
2272
2110
|
],
|
|
@@ -2274,24 +2112,24 @@ class kn extends w {
|
|
|
2274
2112
|
);
|
|
2275
2113
|
}
|
|
2276
2114
|
}
|
|
2277
|
-
function
|
|
2278
|
-
return
|
|
2115
|
+
function Mn(n) {
|
|
2116
|
+
return R.find(n).lean();
|
|
2279
2117
|
}
|
|
2280
|
-
const
|
|
2118
|
+
const kn = async (n) => await R.create({
|
|
2281
2119
|
...n
|
|
2282
2120
|
});
|
|
2283
|
-
async function
|
|
2284
|
-
const e = await
|
|
2285
|
-
return e ||
|
|
2121
|
+
async function An(n) {
|
|
2122
|
+
const e = await R.findOne(n).lean();
|
|
2123
|
+
return e || p(await kn(n));
|
|
2286
2124
|
}
|
|
2287
|
-
function
|
|
2288
|
-
return
|
|
2125
|
+
function Rn(n, e, t) {
|
|
2126
|
+
return R.findOneAndUpdate(n, e, {
|
|
2289
2127
|
upsert: !0,
|
|
2290
2128
|
...t,
|
|
2291
2129
|
returnDocument: "after"
|
|
2292
2130
|
}).lean();
|
|
2293
2131
|
}
|
|
2294
|
-
class
|
|
2132
|
+
class qn extends vn {
|
|
2295
2133
|
constructor() {
|
|
2296
2134
|
super(3600);
|
|
2297
2135
|
}
|
|
@@ -2305,17 +2143,17 @@ class _n extends kn {
|
|
|
2305
2143
|
return { user: e, questId: t };
|
|
2306
2144
|
}
|
|
2307
2145
|
fetchFromDb(e) {
|
|
2308
|
-
return
|
|
2146
|
+
return An(e);
|
|
2309
2147
|
}
|
|
2310
2148
|
fetchManyFromDb(e) {
|
|
2311
|
-
return
|
|
2149
|
+
return Mn(e);
|
|
2312
2150
|
}
|
|
2313
2151
|
updateInDb(e, t, a) {
|
|
2314
|
-
return
|
|
2152
|
+
return Rn(e, t, a);
|
|
2315
2153
|
}
|
|
2316
2154
|
}
|
|
2317
|
-
const
|
|
2318
|
-
class
|
|
2155
|
+
const fe = new qn();
|
|
2156
|
+
class xn extends y {
|
|
2319
2157
|
async randomMessageIncrement(e) {
|
|
2320
2158
|
await this.update(e, { $inc: { randomMessageClaimed: 1 } });
|
|
2321
2159
|
}
|
|
@@ -2333,18 +2171,18 @@ class Cn extends f {
|
|
|
2333
2171
|
await this.update(e, { $inc: { totalMinutesInVoice: t } });
|
|
2334
2172
|
}
|
|
2335
2173
|
}
|
|
2336
|
-
const
|
|
2174
|
+
const Bn = async (n) => await X.create({
|
|
2337
2175
|
user: n
|
|
2338
2176
|
});
|
|
2339
|
-
async function
|
|
2340
|
-
const e = await
|
|
2341
|
-
return e ||
|
|
2177
|
+
async function Cn(n) {
|
|
2178
|
+
const e = await X.findOne({ user: n }).lean();
|
|
2179
|
+
return e || p(await Bn(n));
|
|
2342
2180
|
}
|
|
2343
|
-
const
|
|
2181
|
+
const _n = (n, e) => X.findOneAndUpdate({ user: n }, e, {
|
|
2344
2182
|
upsert: !0,
|
|
2345
2183
|
returnDocument: "after"
|
|
2346
2184
|
}).lean();
|
|
2347
|
-
class
|
|
2185
|
+
class Fn extends xn {
|
|
2348
2186
|
constructor() {
|
|
2349
2187
|
super(300);
|
|
2350
2188
|
}
|
|
@@ -2357,19 +2195,19 @@ class jn extends Cn {
|
|
|
2357
2195
|
return e;
|
|
2358
2196
|
}
|
|
2359
2197
|
fetchFromDb(e) {
|
|
2360
|
-
return
|
|
2198
|
+
return Cn(e);
|
|
2361
2199
|
}
|
|
2362
2200
|
updateInDb(e, t) {
|
|
2363
|
-
return
|
|
2201
|
+
return _n(e, t);
|
|
2364
2202
|
}
|
|
2365
2203
|
}
|
|
2366
|
-
const
|
|
2367
|
-
class
|
|
2204
|
+
const me = new Fn();
|
|
2205
|
+
class Nn extends y {
|
|
2368
2206
|
async updateDailyReport(e) {
|
|
2369
|
-
const t = await
|
|
2207
|
+
const t = await E.get(e), a = await ye.get(e), r = await fe.getMany({
|
|
2370
2208
|
user: e,
|
|
2371
|
-
status:
|
|
2372
|
-
}), s = await
|
|
2209
|
+
status: v.COMPLETED
|
|
2210
|
+
}), s = await me.get(e);
|
|
2373
2211
|
await this.update(e, {
|
|
2374
2212
|
$set: {
|
|
2375
2213
|
xpYesterday: t.xp.amount,
|
|
@@ -2391,29 +2229,29 @@ class Hn extends f {
|
|
|
2391
2229
|
xpYesterday: r,
|
|
2392
2230
|
berryYesterday: s,
|
|
2393
2231
|
previousMessageSent: i
|
|
2394
|
-
} = await this.get(e),
|
|
2232
|
+
} = await this.get(e), o = await E.get(e), l = await fe.getMany({
|
|
2395
2233
|
user: e,
|
|
2396
|
-
status:
|
|
2397
|
-
}),
|
|
2234
|
+
status: v.COMPLETED
|
|
2235
|
+
}), S = await ye.get(e), x = await me.get(e), { berry: $, xp: ae } = o, { voice: de, amount: qe } = ae, { unlockedBadges: xe, unlockedBackgrounds: Be, unlockedTitles: Ce } = S;
|
|
2398
2236
|
return {
|
|
2399
|
-
berry:
|
|
2400
|
-
xp:
|
|
2401
|
-
message:
|
|
2402
|
-
voice:
|
|
2403
|
-
quest:
|
|
2404
|
-
|
|
2237
|
+
berry: $ - s,
|
|
2238
|
+
xp: qe - r,
|
|
2239
|
+
message: x.messageSent - i,
|
|
2240
|
+
voice: be(de.lastConnection, j()) ? de.minutesInVoiceToday : 0,
|
|
2241
|
+
quest: N(
|
|
2242
|
+
l.map(({ questId: _e }) => _e),
|
|
2405
2243
|
a
|
|
2406
2244
|
),
|
|
2407
|
-
badge:
|
|
2408
|
-
title:
|
|
2409
|
-
background:
|
|
2410
|
-
|
|
2245
|
+
badge: N(xe, t.unlockedBadges),
|
|
2246
|
+
title: N(Ce, t.unlockedTitles),
|
|
2247
|
+
background: N(
|
|
2248
|
+
Be,
|
|
2411
2249
|
t.unlockedBackgrounds
|
|
2412
2250
|
)
|
|
2413
2251
|
};
|
|
2414
2252
|
}
|
|
2415
2253
|
async getAllDailyReportsToSend() {
|
|
2416
|
-
const e = await
|
|
2254
|
+
const e = await Re.getUsersWithDailyReportEnable(), t = await yt.getMany({
|
|
2417
2255
|
_id: { $in: e.map(({ user: a }) => a) },
|
|
2418
2256
|
faction: { $ne: "citizen" }
|
|
2419
2257
|
});
|
|
@@ -2426,18 +2264,18 @@ class Hn extends f {
|
|
|
2426
2264
|
);
|
|
2427
2265
|
}
|
|
2428
2266
|
}
|
|
2429
|
-
const
|
|
2267
|
+
const Hn = (n) => L.create({
|
|
2430
2268
|
user: n
|
|
2431
2269
|
});
|
|
2432
|
-
async function
|
|
2433
|
-
const e = await
|
|
2434
|
-
return e ||
|
|
2270
|
+
async function Kn(n) {
|
|
2271
|
+
const e = await L.findOne({ user: n }).lean();
|
|
2272
|
+
return e || p(await Hn(n));
|
|
2435
2273
|
}
|
|
2436
|
-
const
|
|
2274
|
+
const jn = (n, e) => L.findOneAndUpdate({ user: n }, e, {
|
|
2437
2275
|
upsert: !0,
|
|
2438
2276
|
returnDocument: "after"
|
|
2439
2277
|
}).lean();
|
|
2440
|
-
class
|
|
2278
|
+
class Pn extends Nn {
|
|
2441
2279
|
constructor() {
|
|
2442
2280
|
super(60);
|
|
2443
2281
|
}
|
|
@@ -2448,14 +2286,14 @@ class Qn extends Hn {
|
|
|
2448
2286
|
return e.user;
|
|
2449
2287
|
}
|
|
2450
2288
|
fetchFromDb(e) {
|
|
2451
|
-
return
|
|
2289
|
+
return Kn(e);
|
|
2452
2290
|
}
|
|
2453
2291
|
updateInDb(e, t) {
|
|
2454
|
-
return
|
|
2292
|
+
return jn(e, t);
|
|
2455
2293
|
}
|
|
2456
2294
|
}
|
|
2457
|
-
const
|
|
2458
|
-
class
|
|
2295
|
+
const mr = new Pn();
|
|
2296
|
+
class zn extends y {
|
|
2459
2297
|
async setGuessGame(e, t, a, r) {
|
|
2460
2298
|
await this.update(e, {
|
|
2461
2299
|
$set: {
|
|
@@ -2486,18 +2324,18 @@ class Wn extends f {
|
|
|
2486
2324
|
});
|
|
2487
2325
|
}
|
|
2488
2326
|
}
|
|
2489
|
-
const
|
|
2327
|
+
const Ln = async (n) => await G.create({
|
|
2490
2328
|
user: n
|
|
2491
2329
|
});
|
|
2492
|
-
async function
|
|
2493
|
-
const e = await
|
|
2494
|
-
return e ||
|
|
2330
|
+
async function Qn(n) {
|
|
2331
|
+
const e = await G.findOne({ user: n }).lean();
|
|
2332
|
+
return e || p(await Ln(n));
|
|
2495
2333
|
}
|
|
2496
|
-
const
|
|
2334
|
+
const Gn = (n, e) => G.findOneAndUpdate({ user: n }, e, {
|
|
2497
2335
|
upsert: !0,
|
|
2498
2336
|
returnDocument: "after"
|
|
2499
2337
|
}).lean();
|
|
2500
|
-
class
|
|
2338
|
+
class Wn extends zn {
|
|
2501
2339
|
constructor() {
|
|
2502
2340
|
super(300);
|
|
2503
2341
|
}
|
|
@@ -2508,15 +2346,15 @@ class Xn extends Wn {
|
|
|
2508
2346
|
return e;
|
|
2509
2347
|
}
|
|
2510
2348
|
fetchFromDb(e) {
|
|
2511
|
-
return
|
|
2349
|
+
return Qn(e);
|
|
2512
2350
|
}
|
|
2513
2351
|
updateInDb(e, t) {
|
|
2514
|
-
return
|
|
2352
|
+
return Gn(e, t);
|
|
2515
2353
|
}
|
|
2516
2354
|
}
|
|
2517
|
-
const
|
|
2355
|
+
const hr = new Wn(), Yn = new u({
|
|
2518
2356
|
user: {
|
|
2519
|
-
type:
|
|
2357
|
+
type: u.Types.ObjectId,
|
|
2520
2358
|
required: !0,
|
|
2521
2359
|
unique: !0,
|
|
2522
2360
|
ref: "User"
|
|
@@ -2524,10 +2362,10 @@ const zr = new Xn(), Jn = new o({
|
|
|
2524
2362
|
xp: { type: Number, default: 0 },
|
|
2525
2363
|
berry: { type: Number, default: 0 },
|
|
2526
2364
|
faction: { type: Number, default: 0 }
|
|
2527
|
-
}),
|
|
2528
|
-
class
|
|
2365
|
+
}), O = c?.UserRank || d("UserRank", Yn);
|
|
2366
|
+
class Vn extends y {
|
|
2529
2367
|
async computeAllXpRanks() {
|
|
2530
|
-
const t = (await
|
|
2368
|
+
const t = (await I.aggregate([
|
|
2531
2369
|
{
|
|
2532
2370
|
$setWindowFields: {
|
|
2533
2371
|
sortBy: { "xp.amount": -1 },
|
|
@@ -2542,10 +2380,10 @@ class Zn extends f {
|
|
|
2542
2380
|
upsert: !0
|
|
2543
2381
|
}
|
|
2544
2382
|
}));
|
|
2545
|
-
t.length > 0 && await
|
|
2383
|
+
t.length > 0 && await O.bulkWrite(t), this.clearAll();
|
|
2546
2384
|
}
|
|
2547
2385
|
async computeAllBerryRanks() {
|
|
2548
|
-
const t = (await
|
|
2386
|
+
const t = (await I.aggregate([
|
|
2549
2387
|
{
|
|
2550
2388
|
$setWindowFields: {
|
|
2551
2389
|
sortBy: { berry: -1 },
|
|
@@ -2560,10 +2398,10 @@ class Zn extends f {
|
|
|
2560
2398
|
upsert: !0
|
|
2561
2399
|
}
|
|
2562
2400
|
}));
|
|
2563
|
-
t.length > 0 && await
|
|
2401
|
+
t.length > 0 && await O.bulkWrite(t), this.clearAll();
|
|
2564
2402
|
}
|
|
2565
2403
|
async computeAllFactionRanks() {
|
|
2566
|
-
const t = (await
|
|
2404
|
+
const t = (await w.aggregate([
|
|
2567
2405
|
{
|
|
2568
2406
|
$lookup: {
|
|
2569
2407
|
from: "usermetas",
|
|
@@ -2588,7 +2426,7 @@ class Zn extends f {
|
|
|
2588
2426
|
upsert: !0
|
|
2589
2427
|
}
|
|
2590
2428
|
}));
|
|
2591
|
-
t.length > 0 && await
|
|
2429
|
+
t.length > 0 && await O.bulkWrite(t), this.clearAll();
|
|
2592
2430
|
}
|
|
2593
2431
|
async computeAllRanks() {
|
|
2594
2432
|
await Promise.all([
|
|
@@ -2598,18 +2436,18 @@ class Zn extends f {
|
|
|
2598
2436
|
]);
|
|
2599
2437
|
}
|
|
2600
2438
|
}
|
|
2601
|
-
const
|
|
2439
|
+
const Xn = async (n) => await O.create({
|
|
2602
2440
|
user: n
|
|
2603
2441
|
});
|
|
2604
|
-
async function
|
|
2605
|
-
const e = await
|
|
2606
|
-
return e ||
|
|
2442
|
+
async function Jn(n) {
|
|
2443
|
+
const e = await O.findOne({ user: n }).lean();
|
|
2444
|
+
return e || p(await Xn(n));
|
|
2607
2445
|
}
|
|
2608
|
-
const
|
|
2446
|
+
const Zn = (n, e) => O.findOneAndUpdate({ user: n }, e, {
|
|
2609
2447
|
returnDocument: "after",
|
|
2610
2448
|
upsert: !0
|
|
2611
2449
|
}).lean();
|
|
2612
|
-
class
|
|
2450
|
+
class ea extends Vn {
|
|
2613
2451
|
constructor() {
|
|
2614
2452
|
super(300);
|
|
2615
2453
|
}
|
|
@@ -2620,86 +2458,14 @@ class aa extends Zn {
|
|
|
2620
2458
|
return e.user;
|
|
2621
2459
|
}
|
|
2622
2460
|
fetchFromDb(e) {
|
|
2623
|
-
return
|
|
2461
|
+
return Jn(e);
|
|
2624
2462
|
}
|
|
2625
2463
|
updateInDb(e, t) {
|
|
2626
|
-
return
|
|
2627
|
-
}
|
|
2628
|
-
}
|
|
2629
|
-
const jr = new aa();
|
|
2630
|
-
class ra extends f {
|
|
2631
|
-
async isBuyLimitReached(e, t, a) {
|
|
2632
|
-
const r = await l.getAllEntitiesLimit();
|
|
2633
|
-
if (await l.isEntityId(t, l.isEquipment))
|
|
2634
|
-
return !1;
|
|
2635
|
-
const s = await this.get(e), i = s.limit?.[t];
|
|
2636
|
-
let c = r[t];
|
|
2637
|
-
const u = await m.hasRevolutionaryBuff(e);
|
|
2638
|
-
return s.lastShopId !== a ? !1 : (u === "half" && t === "chest_2" && (c += 2), u === "full" && t === "chest_3" && (c += 1), !!(c && i && i >= c));
|
|
2639
|
-
}
|
|
2640
|
-
async getShopItemRest(e, t, a, r = Ze) {
|
|
2641
|
-
const s = await l.getAllEntitiesLimit();
|
|
2642
|
-
if (await l.isEntityId(t, l.isEquipment))
|
|
2643
|
-
return r;
|
|
2644
|
-
let i = s[t];
|
|
2645
|
-
const c = await this.get(e), u = c.limit?.[t], h = await m.hasRevolutionaryBuff(e);
|
|
2646
|
-
return h === "half" && t === "chest_2" && (i += 2), h === "full" && t === "chest_3" && (i += 1), i ? c.lastShopId !== a ? i : u ? i - u : Math.min(i, r) : r;
|
|
2647
|
-
}
|
|
2648
|
-
async increaseBuyLimit(e, t, a, r) {
|
|
2649
|
-
await this.update(e, [
|
|
2650
|
-
{
|
|
2651
|
-
$set: {
|
|
2652
|
-
limit: {
|
|
2653
|
-
$cond: {
|
|
2654
|
-
if: { $eq: ["$lastShopId", t] },
|
|
2655
|
-
then: {
|
|
2656
|
-
$setField: {
|
|
2657
|
-
field: a,
|
|
2658
|
-
input: { $ifNull: ["$limit", {}] },
|
|
2659
|
-
value: {
|
|
2660
|
-
$add: [{ $ifNull: [`$limit.${a}`, 0] }, r]
|
|
2661
|
-
}
|
|
2662
|
-
}
|
|
2663
|
-
},
|
|
2664
|
-
else: {
|
|
2665
|
-
[a]: r
|
|
2666
|
-
}
|
|
2667
|
-
}
|
|
2668
|
-
},
|
|
2669
|
-
lastShopId: t
|
|
2670
|
-
}
|
|
2671
|
-
}
|
|
2672
|
-
]);
|
|
2464
|
+
return Zn(e, t);
|
|
2673
2465
|
}
|
|
2674
2466
|
}
|
|
2675
|
-
const
|
|
2676
|
-
|
|
2677
|
-
}), ia = async (n) => {
|
|
2678
|
-
const e = await J.findOne({ user: n }).lean();
|
|
2679
|
-
return e || y(await sa(n));
|
|
2680
|
-
}, ua = (n, e) => J.findOneAndUpdate({ user: n }, e, {
|
|
2681
|
-
upsert: !0,
|
|
2682
|
-
returnDocument: "after"
|
|
2683
|
-
}).lean();
|
|
2684
|
-
class oa extends ra {
|
|
2685
|
-
constructor() {
|
|
2686
|
-
super(300);
|
|
2687
|
-
}
|
|
2688
|
-
normalizeKey(e) {
|
|
2689
|
-
return e.toString();
|
|
2690
|
-
}
|
|
2691
|
-
getKey({ user: e }) {
|
|
2692
|
-
return e;
|
|
2693
|
-
}
|
|
2694
|
-
fetchFromDb(e) {
|
|
2695
|
-
return ia(e);
|
|
2696
|
-
}
|
|
2697
|
-
updateInDb(e, t) {
|
|
2698
|
-
return ua(e, t);
|
|
2699
|
-
}
|
|
2700
|
-
}
|
|
2701
|
-
const Hr = new oa();
|
|
2702
|
-
class ca extends f {
|
|
2467
|
+
const gr = new ea();
|
|
2468
|
+
class ta extends y {
|
|
2703
2469
|
async didSevenDoubleAtDoQ(e) {
|
|
2704
2470
|
await this.update(e, {
|
|
2705
2471
|
$inc: { "doubleOrQuit.sevenDoubleInARowCount": 1 }
|
|
@@ -2723,10 +2489,10 @@ class ca extends f {
|
|
|
2723
2489
|
await this.update(e, { $inc: { drawCount: 1 } });
|
|
2724
2490
|
}
|
|
2725
2491
|
async bet666(e) {
|
|
2726
|
-
const t =
|
|
2492
|
+
const t = j();
|
|
2727
2493
|
t.setHours(0, 0, 0, 0);
|
|
2728
2494
|
const a = /* @__PURE__ */ new Date();
|
|
2729
|
-
a.setHours(0, 0, 0, 0), await
|
|
2495
|
+
a.setHours(0, 0, 0, 0), await M.updateOne(
|
|
2730
2496
|
{
|
|
2731
2497
|
user: e,
|
|
2732
2498
|
"bet666.last": {
|
|
@@ -2735,7 +2501,7 @@ class ca extends f {
|
|
|
2735
2501
|
}
|
|
2736
2502
|
},
|
|
2737
2503
|
{ $inc: { "bet666.count": 1 }, $set: { "bet666.last": /* @__PURE__ */ new Date() } }
|
|
2738
|
-
), await
|
|
2504
|
+
), await M.updateOne(
|
|
2739
2505
|
{
|
|
2740
2506
|
user: e,
|
|
2741
2507
|
"bet666.last": {
|
|
@@ -2778,18 +2544,18 @@ class ca extends f {
|
|
|
2778
2544
|
await this.update(e, { $inc: { "dice.drawWithDoubleSixCount": 1 } });
|
|
2779
2545
|
}
|
|
2780
2546
|
}
|
|
2781
|
-
const
|
|
2547
|
+
const na = async (n) => await M.create({
|
|
2782
2548
|
user: n
|
|
2783
2549
|
});
|
|
2784
|
-
async function
|
|
2785
|
-
const e = await
|
|
2786
|
-
return e ||
|
|
2550
|
+
async function aa(n) {
|
|
2551
|
+
const e = await M.findOne({ user: n }).lean();
|
|
2552
|
+
return e || p(await na(n));
|
|
2787
2553
|
}
|
|
2788
|
-
const
|
|
2554
|
+
const ra = (n, e) => M.findOneAndUpdate({ user: n }, e, {
|
|
2789
2555
|
upsert: !0,
|
|
2790
2556
|
returnDocument: "after"
|
|
2791
2557
|
}).lean();
|
|
2792
|
-
class
|
|
2558
|
+
class sa extends ta {
|
|
2793
2559
|
constructor() {
|
|
2794
2560
|
super(300);
|
|
2795
2561
|
}
|
|
@@ -2800,14 +2566,14 @@ class ya extends ca {
|
|
|
2800
2566
|
return e;
|
|
2801
2567
|
}
|
|
2802
2568
|
fetchFromDb(e) {
|
|
2803
|
-
return
|
|
2569
|
+
return aa(e);
|
|
2804
2570
|
}
|
|
2805
2571
|
updateInDb(e, t) {
|
|
2806
|
-
return
|
|
2572
|
+
return ra(e, t);
|
|
2807
2573
|
}
|
|
2808
2574
|
}
|
|
2809
|
-
const
|
|
2810
|
-
class
|
|
2575
|
+
const wr = new sa();
|
|
2576
|
+
class ia extends y {
|
|
2811
2577
|
async workIncrement(e) {
|
|
2812
2578
|
await this.update(e, { $inc: { workCount: 1 } });
|
|
2813
2579
|
}
|
|
@@ -2819,18 +2585,18 @@ class fa extends f {
|
|
|
2819
2585
|
});
|
|
2820
2586
|
}
|
|
2821
2587
|
}
|
|
2822
|
-
const
|
|
2588
|
+
const ua = (n) => V.create({
|
|
2823
2589
|
user: n
|
|
2824
2590
|
});
|
|
2825
|
-
async function
|
|
2826
|
-
const e = await
|
|
2827
|
-
return e ||
|
|
2591
|
+
async function oa(n) {
|
|
2592
|
+
const e = await V.findOne({ user: n }).lean();
|
|
2593
|
+
return e || p(await ua(n));
|
|
2828
2594
|
}
|
|
2829
|
-
const
|
|
2595
|
+
const ca = (n, e) => V.findOneAndUpdate({ user: n }, e, {
|
|
2830
2596
|
upsert: !0,
|
|
2831
2597
|
returnDocument: "after"
|
|
2832
2598
|
}).lean();
|
|
2833
|
-
class
|
|
2599
|
+
class da extends ia {
|
|
2834
2600
|
constructor() {
|
|
2835
2601
|
super(300);
|
|
2836
2602
|
}
|
|
@@ -2841,14 +2607,14 @@ class wa extends fa {
|
|
|
2841
2607
|
return e;
|
|
2842
2608
|
}
|
|
2843
2609
|
fetchFromDb(e) {
|
|
2844
|
-
return
|
|
2610
|
+
return oa(e);
|
|
2845
2611
|
}
|
|
2846
2612
|
updateInDb(e, t) {
|
|
2847
|
-
return
|
|
2613
|
+
return ca(e, t);
|
|
2848
2614
|
}
|
|
2849
2615
|
}
|
|
2850
|
-
const
|
|
2851
|
-
class
|
|
2616
|
+
const Sr = new da();
|
|
2617
|
+
class la extends y {
|
|
2852
2618
|
async hasReportedSomeone(e) {
|
|
2853
2619
|
await this.update(e, { $set: { reportedSomeone: !0 } });
|
|
2854
2620
|
}
|
|
@@ -2879,18 +2645,18 @@ class ba extends f {
|
|
|
2879
2645
|
await this.update(e, { $set: { "gamblingFlags.lose10M": !0 } });
|
|
2880
2646
|
}
|
|
2881
2647
|
}
|
|
2882
|
-
const
|
|
2648
|
+
const pa = async (n) => await J.create({
|
|
2883
2649
|
user: n
|
|
2884
2650
|
});
|
|
2885
|
-
async function
|
|
2886
|
-
const e = await
|
|
2887
|
-
return e ||
|
|
2651
|
+
async function ya(n) {
|
|
2652
|
+
const e = await J.findOne({ user: n }).lean();
|
|
2653
|
+
return e || p(await pa(n));
|
|
2888
2654
|
}
|
|
2889
|
-
const
|
|
2655
|
+
const fa = (n, e) => J.findOneAndUpdate({ user: n }, e, {
|
|
2890
2656
|
upsert: !0,
|
|
2891
2657
|
returnDocument: "after"
|
|
2892
2658
|
}).lean();
|
|
2893
|
-
class
|
|
2659
|
+
class ma extends la {
|
|
2894
2660
|
constructor() {
|
|
2895
2661
|
super(300);
|
|
2896
2662
|
}
|
|
@@ -2901,17 +2667,17 @@ class Ua extends ba {
|
|
|
2901
2667
|
return e;
|
|
2902
2668
|
}
|
|
2903
2669
|
fetchFromDb(e) {
|
|
2904
|
-
return
|
|
2670
|
+
return ya(e);
|
|
2905
2671
|
}
|
|
2906
2672
|
updateInDb(e, t) {
|
|
2907
|
-
return
|
|
2673
|
+
return fa(e, t);
|
|
2908
2674
|
}
|
|
2909
2675
|
}
|
|
2910
|
-
const
|
|
2911
|
-
class
|
|
2676
|
+
const br = new ma();
|
|
2677
|
+
class ha extends y {
|
|
2912
2678
|
async readEdito(e) {
|
|
2913
2679
|
const t = /* @__PURE__ */ new Date();
|
|
2914
|
-
t.setHours(0, 0, 0, 0), await
|
|
2680
|
+
t.setHours(0, 0, 0, 0), await D.updateOne(
|
|
2915
2681
|
{
|
|
2916
2682
|
user: e,
|
|
2917
2683
|
"edito.lastTimeRead": {
|
|
@@ -2922,7 +2688,7 @@ class Da extends f {
|
|
|
2922
2688
|
$inc: { "edito.readToday": 1 },
|
|
2923
2689
|
$set: { "edito.lastTimeRead": /* @__PURE__ */ new Date() }
|
|
2924
2690
|
}
|
|
2925
|
-
), await
|
|
2691
|
+
), await D.updateOne(
|
|
2926
2692
|
{
|
|
2927
2693
|
user: e,
|
|
2928
2694
|
"edito.lastTimeRead": {
|
|
@@ -2936,7 +2702,7 @@ class Da extends f {
|
|
|
2936
2702
|
}
|
|
2937
2703
|
async getTotalEditoReadToday() {
|
|
2938
2704
|
const e = /* @__PURE__ */ new Date();
|
|
2939
|
-
return e.setHours(0, 0, 0, 0), (await
|
|
2705
|
+
return e.setHours(0, 0, 0, 0), (await D.aggregate([
|
|
2940
2706
|
{
|
|
2941
2707
|
$match: {
|
|
2942
2708
|
"edito.lastTimeRead": { $gte: e },
|
|
@@ -2947,18 +2713,18 @@ class Da extends f {
|
|
|
2947
2713
|
]))[0]?.total ?? 0;
|
|
2948
2714
|
}
|
|
2949
2715
|
}
|
|
2950
|
-
const
|
|
2716
|
+
const ga = async (n) => await D.create({
|
|
2951
2717
|
user: n
|
|
2952
2718
|
});
|
|
2953
|
-
async function
|
|
2954
|
-
const e = await
|
|
2955
|
-
return e ||
|
|
2719
|
+
async function wa(n) {
|
|
2720
|
+
const e = await D.findOne({ user: n }).lean();
|
|
2721
|
+
return e || p(await ga(n));
|
|
2956
2722
|
}
|
|
2957
|
-
const
|
|
2723
|
+
const Sa = (n, e) => D.findOneAndUpdate({ user: n }, e, {
|
|
2958
2724
|
upsert: !0,
|
|
2959
2725
|
returnDocument: "after"
|
|
2960
2726
|
}).lean();
|
|
2961
|
-
class
|
|
2727
|
+
class ba extends ha {
|
|
2962
2728
|
constructor() {
|
|
2963
2729
|
super(300);
|
|
2964
2730
|
}
|
|
@@ -2969,20 +2735,18 @@ class Ba extends Da {
|
|
|
2969
2735
|
return e;
|
|
2970
2736
|
}
|
|
2971
2737
|
fetchFromDb(e) {
|
|
2972
|
-
return
|
|
2738
|
+
return wa(e);
|
|
2973
2739
|
}
|
|
2974
2740
|
updateInDb(e, t) {
|
|
2975
|
-
return
|
|
2741
|
+
return Sa(e, t);
|
|
2976
2742
|
}
|
|
2977
2743
|
}
|
|
2978
|
-
const
|
|
2979
|
-
class
|
|
2744
|
+
const $r = new ba();
|
|
2745
|
+
class $a extends y {
|
|
2980
2746
|
async updateCraftStats(e, t, a) {
|
|
2981
|
-
const r = await
|
|
2982
|
-
!r || !
|
|
2747
|
+
const r = await f.get(a);
|
|
2748
|
+
!r || !f.isItem(r) || await this.update(e, {
|
|
2983
2749
|
$inc: {
|
|
2984
|
-
"crafts.cookedMeal": l.isCookedMeal(r) ? t : 0,
|
|
2985
|
-
"crafts.scrolls": l.isScrollItem(r) ? t : 0,
|
|
2986
2750
|
"crafts.totalCrafted": t
|
|
2987
2751
|
}
|
|
2988
2752
|
});
|
|
@@ -2999,7 +2763,7 @@ class Ma extends f {
|
|
|
2999
2763
|
}
|
|
3000
2764
|
async incrementBottleUsedToday(e, t) {
|
|
3001
2765
|
const a = /* @__PURE__ */ new Date();
|
|
3002
|
-
a.setHours(0, 0, 0, 0), await
|
|
2766
|
+
a.setHours(0, 0, 0, 0), await k.updateOne(
|
|
3003
2767
|
{
|
|
3004
2768
|
user: e,
|
|
3005
2769
|
"bottle.lastUsed": {
|
|
@@ -3010,7 +2774,7 @@ class Ma extends f {
|
|
|
3010
2774
|
$inc: { "bottle.usedToday": t },
|
|
3011
2775
|
$set: { "bottle.lastUsed": /* @__PURE__ */ new Date() }
|
|
3012
2776
|
}
|
|
3013
|
-
), await
|
|
2777
|
+
), await k.updateOne(
|
|
3014
2778
|
{
|
|
3015
2779
|
user: e,
|
|
3016
2780
|
"bottle.lastUsed": {
|
|
@@ -3036,18 +2800,18 @@ class Ma extends f {
|
|
|
3036
2800
|
});
|
|
3037
2801
|
}
|
|
3038
2802
|
}
|
|
3039
|
-
const
|
|
2803
|
+
const Ua = async (n) => await k.create({
|
|
3040
2804
|
user: n
|
|
3041
2805
|
});
|
|
3042
|
-
async function
|
|
3043
|
-
const e = await
|
|
3044
|
-
return e ||
|
|
2806
|
+
async function Ea(n) {
|
|
2807
|
+
const e = await k.findOne({ user: n }).lean();
|
|
2808
|
+
return e || p(await Ua(n));
|
|
3045
2809
|
}
|
|
3046
|
-
const
|
|
2810
|
+
const Da = (n, e) => k.findOneAndUpdate({ user: n }, e, {
|
|
3047
2811
|
upsert: !0,
|
|
3048
2812
|
returnDocument: "after"
|
|
3049
2813
|
}).lean();
|
|
3050
|
-
class
|
|
2814
|
+
class Ia extends $a {
|
|
3051
2815
|
constructor() {
|
|
3052
2816
|
super(300);
|
|
3053
2817
|
}
|
|
@@ -3058,16 +2822,16 @@ class Ra extends Ma {
|
|
|
3058
2822
|
return e;
|
|
3059
2823
|
}
|
|
3060
2824
|
fetchFromDb(e) {
|
|
3061
|
-
return
|
|
2825
|
+
return Ea(e);
|
|
3062
2826
|
}
|
|
3063
2827
|
updateInDb(e, t) {
|
|
3064
|
-
return
|
|
2828
|
+
return Da(e, t);
|
|
3065
2829
|
}
|
|
3066
2830
|
}
|
|
3067
|
-
const
|
|
3068
|
-
class
|
|
2831
|
+
const Ur = new Ia();
|
|
2832
|
+
class Ta extends m {
|
|
3069
2833
|
async maxCraftQuantity(e, t) {
|
|
3070
|
-
const a = await
|
|
2834
|
+
const a = await U.get(e);
|
|
3071
2835
|
let r = 1 / 0;
|
|
3072
2836
|
for (const s of t)
|
|
3073
2837
|
r = Math.min(
|
|
@@ -3079,7 +2843,7 @@ class xa extends w {
|
|
|
3079
2843
|
return r;
|
|
3080
2844
|
}
|
|
3081
2845
|
async hasEnoughItemsForRecipe(e, t, a) {
|
|
3082
|
-
const r = await
|
|
2846
|
+
const r = await U.get(e);
|
|
3083
2847
|
for (const s of t.entities)
|
|
3084
2848
|
if ((r.itemList[s.entityId] ?? 0) < s.size * a)
|
|
3085
2849
|
return !1;
|
|
@@ -3098,57 +2862,57 @@ class xa extends w {
|
|
|
3098
2862
|
return !!(await this.getAll()).find((a) => a.craftId === e);
|
|
3099
2863
|
}
|
|
3100
2864
|
async getRecipeResult(e, t) {
|
|
3101
|
-
const a = await
|
|
2865
|
+
const a = await U.get(e), r = (await A.getPanoplyBonus(a.equippedItems)).find(
|
|
3102
2866
|
([s, i]) => s.panoplyId === "little_blacksmith" && i !== null
|
|
3103
2867
|
);
|
|
3104
2868
|
return r?.[1] === "full" && t === "chest_3" ? "chest_blacksmith_3" : r?.[1] === "half" && t === "chest_2" ? "chest_blacksmith_2" : r?.[1] === "half" && t === "chest_1" ? "chest_blacksmith_1" : t;
|
|
3105
2869
|
}
|
|
3106
2870
|
}
|
|
3107
|
-
const
|
|
2871
|
+
const Oa = new u(
|
|
3108
2872
|
{
|
|
3109
2873
|
entityId: { type: String, required: !0 },
|
|
3110
2874
|
size: { type: Number, required: !0 }
|
|
3111
2875
|
},
|
|
3112
2876
|
{ _id: !1 }
|
|
3113
|
-
),
|
|
2877
|
+
), va = new u(
|
|
3114
2878
|
{
|
|
3115
2879
|
entityId: { type: String, required: !0 },
|
|
3116
2880
|
size: { type: Number, required: !0 }
|
|
3117
2881
|
},
|
|
3118
2882
|
{ _id: !1 }
|
|
3119
|
-
),
|
|
2883
|
+
), Ma = new u(
|
|
3120
2884
|
{
|
|
3121
2885
|
craftId: { type: String, unique: !0, required: !0 },
|
|
3122
2886
|
name: { type: String, required: !0 },
|
|
3123
|
-
entities: { type: [
|
|
3124
|
-
result: { type:
|
|
2887
|
+
entities: { type: [Oa], required: !0 },
|
|
2888
|
+
result: { type: va, required: !0 }
|
|
3125
2889
|
},
|
|
3126
2890
|
{ minimize: !1 }
|
|
3127
|
-
),
|
|
2891
|
+
), Z = c?.Recipes || d("Recipes", Ma), ka = async (n) => await Z.create({
|
|
3128
2892
|
...n
|
|
3129
|
-
}),
|
|
3130
|
-
async function
|
|
3131
|
-
const e = await
|
|
2893
|
+
}), Aa = async (n, e) => Z.find(n, {}, e).lean();
|
|
2894
|
+
async function Ra(n) {
|
|
2895
|
+
const e = await Z.findOne({ craftId: n }).lean();
|
|
3132
2896
|
return e || null;
|
|
3133
2897
|
}
|
|
3134
|
-
const
|
|
2898
|
+
const qa = (n, e) => Z.findOneAndUpdate(n, e, {
|
|
3135
2899
|
returnDocument: "after"
|
|
3136
2900
|
}).lean();
|
|
3137
|
-
class
|
|
2901
|
+
class xa extends Ta {
|
|
3138
2902
|
constructor() {
|
|
3139
2903
|
super(3600);
|
|
3140
2904
|
}
|
|
3141
2905
|
createInDb(e) {
|
|
3142
|
-
return
|
|
2906
|
+
return ka(e);
|
|
3143
2907
|
}
|
|
3144
2908
|
updateInDb(e, t) {
|
|
3145
|
-
return
|
|
2909
|
+
return qa(e, t);
|
|
3146
2910
|
}
|
|
3147
2911
|
fetchFromDb(e) {
|
|
3148
|
-
return
|
|
2912
|
+
return Ra(e);
|
|
3149
2913
|
}
|
|
3150
2914
|
fetchManyFromDb(e, t) {
|
|
3151
|
-
return
|
|
2915
|
+
return Aa(e, t);
|
|
3152
2916
|
}
|
|
3153
2917
|
normalizeKey(e) {
|
|
3154
2918
|
return e;
|
|
@@ -3157,14 +2921,14 @@ class Ka extends xa {
|
|
|
3157
2921
|
return e.craftId;
|
|
3158
2922
|
}
|
|
3159
2923
|
}
|
|
3160
|
-
const
|
|
2924
|
+
const Er = new xa(), Ba = new u({
|
|
3161
2925
|
bannedUserId: { type: String, index: !0, required: !0 },
|
|
3162
2926
|
authorId: { type: String, required: !0 },
|
|
3163
2927
|
unbannedTimestamp: { type: Date, index: 1 },
|
|
3164
2928
|
reason: { type: String, required: !0 },
|
|
3165
2929
|
guildId: { type: String, required: !0 }
|
|
3166
|
-
}),
|
|
3167
|
-
class
|
|
2930
|
+
}), ee = c?.Bans || d("Bans", Ba), Ca = (n, e) => ee.deleteOne({ bannedUserId: n, guildId: e });
|
|
2931
|
+
class _a extends m {
|
|
3168
2932
|
async getUnbanUsers() {
|
|
3169
2933
|
return this.getMany({
|
|
3170
2934
|
unbannedTimestamp: { $lte: /* @__PURE__ */ new Date(), $ne: null }
|
|
@@ -3178,14 +2942,14 @@ class Qa extends w {
|
|
|
3178
2942
|
return !!(a && (!a.unbannedTimestamp || a.unbannedTimestamp > /* @__PURE__ */ new Date()));
|
|
3179
2943
|
}
|
|
3180
2944
|
async deleteBan(e, t) {
|
|
3181
|
-
await
|
|
2945
|
+
await Ca(e, t), this.invalidate({ bannedUserId: e, guildId: t });
|
|
3182
2946
|
}
|
|
3183
2947
|
}
|
|
3184
|
-
const
|
|
2948
|
+
const Fa = (n) => ee.find(n).lean(), Na = (n) => ee.findOne(n).lean(), Ha = (n, e) => ee.findOneAndUpdate(n, e, {
|
|
3185
2949
|
returnDocument: "after",
|
|
3186
2950
|
upsert: !0
|
|
3187
2951
|
}).lean();
|
|
3188
|
-
class
|
|
2952
|
+
class Ka extends _a {
|
|
3189
2953
|
constructor() {
|
|
3190
2954
|
super(3600 * 36);
|
|
3191
2955
|
}
|
|
@@ -3196,23 +2960,23 @@ class Va extends Qa {
|
|
|
3196
2960
|
return { bannedUserId: e, guildId: t };
|
|
3197
2961
|
}
|
|
3198
2962
|
fetchFromDb(e) {
|
|
3199
|
-
return
|
|
2963
|
+
return Na(e);
|
|
3200
2964
|
}
|
|
3201
2965
|
fetchManyFromDb(e) {
|
|
3202
|
-
return
|
|
2966
|
+
return Fa(e);
|
|
3203
2967
|
}
|
|
3204
2968
|
updateInDb(e, t) {
|
|
3205
|
-
return
|
|
2969
|
+
return Ha(e, t);
|
|
3206
2970
|
}
|
|
3207
2971
|
}
|
|
3208
|
-
const
|
|
2972
|
+
const Dr = new Ka(), ja = new u({
|
|
3209
2973
|
senderId: {
|
|
3210
|
-
type:
|
|
2974
|
+
type: u.Types.ObjectId,
|
|
3211
2975
|
required: !0,
|
|
3212
2976
|
ref: "User"
|
|
3213
2977
|
},
|
|
3214
2978
|
receiverId: {
|
|
3215
|
-
type:
|
|
2979
|
+
type: u.Types.ObjectId,
|
|
3216
2980
|
required: !0,
|
|
3217
2981
|
index: !0,
|
|
3218
2982
|
ref: "User"
|
|
@@ -3222,36 +2986,36 @@ const Gr = new Va(), Xa = new o({
|
|
|
3222
2986
|
meta: {
|
|
3223
2987
|
rps: { type: String, default: void 0 }
|
|
3224
2988
|
}
|
|
3225
|
-
}),
|
|
2989
|
+
}), te = c?.Invitation || d("Invitation", ja), Pa = (n) => te.create({
|
|
3226
2990
|
...n
|
|
3227
|
-
}),
|
|
3228
|
-
await
|
|
2991
|
+
}), za = async (n) => {
|
|
2992
|
+
await te.deleteMany({
|
|
3229
2993
|
...n
|
|
3230
2994
|
});
|
|
3231
2995
|
};
|
|
3232
|
-
class
|
|
2996
|
+
class La extends y {
|
|
3233
2997
|
async sendInvitation({
|
|
3234
2998
|
senderId: e,
|
|
3235
2999
|
receiverId: t,
|
|
3236
3000
|
gameMode: a,
|
|
3237
3001
|
...r
|
|
3238
3002
|
}) {
|
|
3239
|
-
return await this.get({ senderId: e, gameMode: a, receiverId: t }) ? null : await
|
|
3003
|
+
return await this.get({ senderId: e, gameMode: a, receiverId: t }) ? null : await Pa({ ...r, senderId: e, gameMode: a, receiverId: t });
|
|
3240
3004
|
}
|
|
3241
3005
|
async deleteInvitation({
|
|
3242
3006
|
senderId: e,
|
|
3243
3007
|
receiverId: t,
|
|
3244
3008
|
gameMode: a
|
|
3245
3009
|
}) {
|
|
3246
|
-
await
|
|
3010
|
+
await za({ senderId: e, gameMode: a, receiverId: t }), this.invalidate({ senderId: e, gameMode: a, receiverId: t });
|
|
3247
3011
|
}
|
|
3248
3012
|
}
|
|
3249
|
-
const
|
|
3013
|
+
const Qa = (n) => te.findOne({
|
|
3250
3014
|
...n
|
|
3251
|
-
}).lean(),
|
|
3015
|
+
}).lean(), Ga = (n, e) => te.findOneAndUpdate(n, e, {
|
|
3252
3016
|
returnDocument: "after"
|
|
3253
3017
|
}).lean();
|
|
3254
|
-
class
|
|
3018
|
+
class Wa extends La {
|
|
3255
3019
|
constructor() {
|
|
3256
3020
|
super(3600);
|
|
3257
3021
|
}
|
|
@@ -3266,16 +3030,16 @@ class ar extends er {
|
|
|
3266
3030
|
return { gameMode: t, receiverId: e, senderId: a };
|
|
3267
3031
|
}
|
|
3268
3032
|
fetchFromDb(e) {
|
|
3269
|
-
return
|
|
3033
|
+
return Qa(e);
|
|
3270
3034
|
}
|
|
3271
3035
|
updateInDb(e, t) {
|
|
3272
|
-
return
|
|
3036
|
+
return Ga(e, t);
|
|
3273
3037
|
}
|
|
3274
3038
|
}
|
|
3275
|
-
const
|
|
3276
|
-
class
|
|
3039
|
+
const Ir = new Wa();
|
|
3040
|
+
class Ya extends y {
|
|
3277
3041
|
async randomizeEditoPrice(e) {
|
|
3278
|
-
const t =
|
|
3042
|
+
const t = Se(100, 1001);
|
|
3279
3043
|
return await this.update({ guildId: e }, { $set: { "edito.price": t } }), t;
|
|
3280
3044
|
}
|
|
3281
3045
|
async setEditoMessageId(e, t) {
|
|
@@ -3319,7 +3083,7 @@ class rr extends f {
|
|
|
3319
3083
|
);
|
|
3320
3084
|
}
|
|
3321
3085
|
}
|
|
3322
|
-
const
|
|
3086
|
+
const Va = new u({
|
|
3323
3087
|
guildId: { type: String, required: !0, unique: !0 },
|
|
3324
3088
|
ranking: {
|
|
3325
3089
|
messageId: { type: String, default: null }
|
|
@@ -3367,16 +3131,16 @@ const sr = new o({
|
|
|
3367
3131
|
default: []
|
|
3368
3132
|
}
|
|
3369
3133
|
}
|
|
3370
|
-
}),
|
|
3134
|
+
}), ce = c?.Settings || d("Settings", Va), Xa = (n) => ce.create({
|
|
3371
3135
|
guildId: n
|
|
3372
|
-
}),
|
|
3373
|
-
const e = await
|
|
3374
|
-
return e ||
|
|
3375
|
-
},
|
|
3136
|
+
}), Ja = async (n) => {
|
|
3137
|
+
const e = await ce.findOne({ guildId: n }).lean();
|
|
3138
|
+
return e || p(await Xa(n));
|
|
3139
|
+
}, Za = (n, e) => ce.findOneAndUpdate(n, e, {
|
|
3376
3140
|
upsert: !0,
|
|
3377
3141
|
returnDocument: "after"
|
|
3378
3142
|
}).lean();
|
|
3379
|
-
class
|
|
3143
|
+
class er extends Ya {
|
|
3380
3144
|
constructor() {
|
|
3381
3145
|
super(3600 * 24 * 30);
|
|
3382
3146
|
}
|
|
@@ -3387,414 +3151,37 @@ class cr extends rr {
|
|
|
3387
3151
|
return e;
|
|
3388
3152
|
}
|
|
3389
3153
|
fetchFromDb(e) {
|
|
3390
|
-
return
|
|
3391
|
-
}
|
|
3392
|
-
updateInDb(e, t) {
|
|
3393
|
-
return or(e, t);
|
|
3394
|
-
}
|
|
3395
|
-
}
|
|
3396
|
-
const Vr = new cr();
|
|
3397
|
-
class I {
|
|
3398
|
-
toDBShopItem() {
|
|
3399
|
-
return {
|
|
3400
|
-
price: this.price,
|
|
3401
|
-
size: this.size,
|
|
3402
|
-
id: "entityId" in this.data ? this.data.entityId : this.data.ornamentId,
|
|
3403
|
-
currency: this.currency
|
|
3404
|
-
};
|
|
3405
|
-
}
|
|
3406
|
-
async onBuy(e, t) {
|
|
3407
|
-
this.currency === "berry" ? (await U.updateUserBerry(
|
|
3408
|
-
e,
|
|
3409
|
-
-1 * this.price * t,
|
|
3410
|
-
!1
|
|
3411
|
-
), await Sa.updateTotalSpentInShop(
|
|
3412
|
-
e,
|
|
3413
|
-
this.price * t
|
|
3414
|
-
)) : await m.removeItem(
|
|
3415
|
-
e,
|
|
3416
|
-
this.currency,
|
|
3417
|
-
this.price * t
|
|
3418
|
-
);
|
|
3419
|
-
}
|
|
3420
|
-
isBackground() {
|
|
3421
|
-
return !1;
|
|
3422
|
-
}
|
|
3423
|
-
isChest() {
|
|
3424
|
-
return !1;
|
|
3425
|
-
}
|
|
3426
|
-
isTitle() {
|
|
3427
|
-
return !1;
|
|
3428
|
-
}
|
|
3429
|
-
isBoostXp() {
|
|
3430
|
-
return !1;
|
|
3431
|
-
}
|
|
3432
|
-
isRepair() {
|
|
3433
|
-
return !1;
|
|
3434
|
-
}
|
|
3435
|
-
isStore() {
|
|
3436
|
-
return !1;
|
|
3437
|
-
}
|
|
3438
|
-
isObject() {
|
|
3439
|
-
return !1;
|
|
3440
|
-
}
|
|
3441
|
-
isBottle() {
|
|
3442
|
-
return !1;
|
|
3443
|
-
}
|
|
3444
|
-
isEquipment() {
|
|
3445
|
-
return !1;
|
|
3446
|
-
}
|
|
3447
|
-
}
|
|
3448
|
-
class lr extends I {
|
|
3449
|
-
price;
|
|
3450
|
-
size;
|
|
3451
|
-
currency;
|
|
3452
|
-
data;
|
|
3453
|
-
constructor({
|
|
3454
|
-
price: e,
|
|
3455
|
-
item: t,
|
|
3456
|
-
size: a,
|
|
3457
|
-
currency: r
|
|
3458
|
-
}) {
|
|
3459
|
-
super(), this.data = t, this.price = e, this.size = a, this.currency = r;
|
|
3460
|
-
}
|
|
3461
|
-
async onBuy(e, t) {
|
|
3462
|
-
await super.onBuy(e, t), await L.unlockBackground(e, this.data.ornamentId);
|
|
3463
|
-
}
|
|
3464
|
-
isBackground() {
|
|
3465
|
-
return !0;
|
|
3466
|
-
}
|
|
3467
|
-
}
|
|
3468
|
-
class dr extends I {
|
|
3469
|
-
price;
|
|
3470
|
-
size;
|
|
3471
|
-
currency;
|
|
3472
|
-
data;
|
|
3473
|
-
constructor({
|
|
3474
|
-
price: e,
|
|
3475
|
-
item: t,
|
|
3476
|
-
size: a,
|
|
3477
|
-
currency: r
|
|
3478
|
-
}) {
|
|
3479
|
-
super(), this.data = t, this.price = e, this.size = a, this.currency = r;
|
|
3480
|
-
}
|
|
3481
|
-
async onBuy(e, t) {
|
|
3482
|
-
await super.onBuy(e, t), await m.addItem(e, this.data.entityId, t);
|
|
3483
|
-
}
|
|
3484
|
-
isBoostXp() {
|
|
3485
|
-
return !0;
|
|
3486
|
-
}
|
|
3487
|
-
}
|
|
3488
|
-
class pr extends I {
|
|
3489
|
-
price;
|
|
3490
|
-
size;
|
|
3491
|
-
currency;
|
|
3492
|
-
data;
|
|
3493
|
-
constructor({
|
|
3494
|
-
price: e,
|
|
3495
|
-
item: t,
|
|
3496
|
-
size: a,
|
|
3497
|
-
currency: r
|
|
3498
|
-
}) {
|
|
3499
|
-
super(), this.data = t, this.price = e, this.size = a, this.currency = r;
|
|
3500
|
-
}
|
|
3501
|
-
async onBuy(e, t) {
|
|
3502
|
-
await super.onBuy(e, t), await m.addItem(e, this.data.entityId, t);
|
|
3503
|
-
}
|
|
3504
|
-
isChest() {
|
|
3505
|
-
return !0;
|
|
3506
|
-
}
|
|
3507
|
-
}
|
|
3508
|
-
class yr extends I {
|
|
3509
|
-
price;
|
|
3510
|
-
size;
|
|
3511
|
-
currency;
|
|
3512
|
-
data;
|
|
3513
|
-
constructor({
|
|
3514
|
-
price: e,
|
|
3515
|
-
item: t,
|
|
3516
|
-
size: a,
|
|
3517
|
-
currency: r
|
|
3518
|
-
}) {
|
|
3519
|
-
super(), this.data = t, this.price = e, this.size = a, this.currency = r;
|
|
3520
|
-
}
|
|
3521
|
-
async onBuy(e, t) {
|
|
3522
|
-
await super.onBuy(e, t), await m.addItem(e, this.data.entityId, t);
|
|
3523
|
-
}
|
|
3524
|
-
isObject() {
|
|
3525
|
-
return !0;
|
|
3526
|
-
}
|
|
3527
|
-
}
|
|
3528
|
-
class fr extends I {
|
|
3529
|
-
price;
|
|
3530
|
-
size;
|
|
3531
|
-
currency;
|
|
3532
|
-
data;
|
|
3533
|
-
constructor({
|
|
3534
|
-
price: e,
|
|
3535
|
-
item: t,
|
|
3536
|
-
size: a,
|
|
3537
|
-
currency: r
|
|
3538
|
-
}) {
|
|
3539
|
-
super(), this.data = t, this.price = e, this.size = a, this.currency = r;
|
|
3540
|
-
}
|
|
3541
|
-
async onBuy(e, t) {
|
|
3542
|
-
await super.onBuy(e, t), await m.addEquipments(
|
|
3543
|
-
e,
|
|
3544
|
-
st({ stop: t }).map(
|
|
3545
|
-
() => l.seedEquipment(
|
|
3546
|
-
{ ...this.data },
|
|
3547
|
-
Date.now() - Math.round(Math.random() * 1e3)
|
|
3548
|
-
)
|
|
3549
|
-
).map((a) => ({
|
|
3550
|
-
entityId: a.entityId,
|
|
3551
|
-
seed: a.seed
|
|
3552
|
-
}))
|
|
3553
|
-
);
|
|
3554
|
-
}
|
|
3555
|
-
isEquipment() {
|
|
3556
|
-
return !0;
|
|
3557
|
-
}
|
|
3558
|
-
}
|
|
3559
|
-
class mr extends I {
|
|
3560
|
-
price;
|
|
3561
|
-
size;
|
|
3562
|
-
currency;
|
|
3563
|
-
data;
|
|
3564
|
-
constructor({
|
|
3565
|
-
price: e,
|
|
3566
|
-
item: t,
|
|
3567
|
-
size: a,
|
|
3568
|
-
currency: r
|
|
3569
|
-
}) {
|
|
3570
|
-
super(), this.data = t, this.price = e, this.size = a, this.currency = r;
|
|
3571
|
-
}
|
|
3572
|
-
async onBuy(e, t) {
|
|
3573
|
-
await super.onBuy(e, t), await m.addItem(e, this.data.entityId, t);
|
|
3574
|
-
}
|
|
3575
|
-
isBottle() {
|
|
3576
|
-
return !0;
|
|
3577
|
-
}
|
|
3578
|
-
}
|
|
3579
|
-
class hr extends I {
|
|
3580
|
-
price;
|
|
3581
|
-
size;
|
|
3582
|
-
currency;
|
|
3583
|
-
data;
|
|
3584
|
-
constructor({
|
|
3585
|
-
price: e,
|
|
3586
|
-
item: t,
|
|
3587
|
-
size: a,
|
|
3588
|
-
currency: r
|
|
3589
|
-
}) {
|
|
3590
|
-
super(), this.data = t, this.price = e, this.size = a, this.currency = r;
|
|
3591
|
-
}
|
|
3592
|
-
async onBuy(e, t) {
|
|
3593
|
-
await super.onBuy(e, t), await m.addItem(e, this.data.entityId, t);
|
|
3594
|
-
}
|
|
3595
|
-
isRepair() {
|
|
3596
|
-
return !0;
|
|
3597
|
-
}
|
|
3598
|
-
}
|
|
3599
|
-
class gr extends I {
|
|
3600
|
-
price;
|
|
3601
|
-
size;
|
|
3602
|
-
currency;
|
|
3603
|
-
data;
|
|
3604
|
-
constructor({
|
|
3605
|
-
price: e,
|
|
3606
|
-
item: t,
|
|
3607
|
-
size: a,
|
|
3608
|
-
currency: r
|
|
3609
|
-
}) {
|
|
3610
|
-
super(), this.data = t, this.price = e, this.size = a, this.currency = r;
|
|
3611
|
-
}
|
|
3612
|
-
async onBuy(e, t) {
|
|
3613
|
-
await super.onBuy(e, t), await m.addItem(e, this.data.entityId, t);
|
|
3614
|
-
}
|
|
3615
|
-
isStore() {
|
|
3616
|
-
return !0;
|
|
3617
|
-
}
|
|
3618
|
-
}
|
|
3619
|
-
class wr extends I {
|
|
3620
|
-
price;
|
|
3621
|
-
size;
|
|
3622
|
-
currency;
|
|
3623
|
-
data;
|
|
3624
|
-
constructor({
|
|
3625
|
-
price: e,
|
|
3626
|
-
item: t,
|
|
3627
|
-
size: a,
|
|
3628
|
-
currency: r
|
|
3629
|
-
}) {
|
|
3630
|
-
super(), this.data = t, this.price = e, this.size = a, this.currency = r;
|
|
3631
|
-
}
|
|
3632
|
-
async onBuy(e, t) {
|
|
3633
|
-
await super.onBuy(e, t), await L.unlockTitle(e, this.data.ornamentId);
|
|
3634
|
-
}
|
|
3635
|
-
isTitle() {
|
|
3636
|
-
return !0;
|
|
3637
|
-
}
|
|
3638
|
-
}
|
|
3639
|
-
class Sr extends f {
|
|
3640
|
-
async getShopItem(e, t) {
|
|
3641
|
-
const r = (await this.get(e)).items.find((h) => h.id === t);
|
|
3642
|
-
if (!r)
|
|
3643
|
-
return;
|
|
3644
|
-
const { price: s, size: i, currency: c } = r, u = await l.get(r.id) ?? await g.get(r.id);
|
|
3645
|
-
if (g.isOrnament(u) && g.isBackground(u))
|
|
3646
|
-
return new lr({ price: s, item: u, size: i, currency: c });
|
|
3647
|
-
if (g.isOrnament(u) && g.isShopTitle(u))
|
|
3648
|
-
return new wr({ price: s, item: u, size: i, currency: c });
|
|
3649
|
-
if (l.isEntity(u) && l.isChestItem(u))
|
|
3650
|
-
return new pr({ price: s, item: u, size: i, currency: c });
|
|
3651
|
-
if (l.isEntity(u) && l.isBoostItem(u))
|
|
3652
|
-
return new dr({ price: s, item: u, size: i, currency: c });
|
|
3653
|
-
if (l.isEntity(u) && l.isRepairItem(u))
|
|
3654
|
-
return new hr({ price: s, item: u, size: i, currency: c });
|
|
3655
|
-
if (l.isEntity(u) && l.isStoreItem(u))
|
|
3656
|
-
return new gr({ price: s, item: u, size: i, currency: c });
|
|
3657
|
-
if (l.isEntity(u) && l.isObjectItem(u))
|
|
3658
|
-
return new yr({ price: s, item: u, size: i, currency: c });
|
|
3659
|
-
if (l.isEntity(u) && l.isEquipment(u))
|
|
3660
|
-
return new fr({ price: s, item: u, size: i, currency: c });
|
|
3661
|
-
if (l.isEntity(u) && l.isBottleItem(u))
|
|
3662
|
-
return new mr({ price: s, size: i, item: u, currency: c });
|
|
3663
|
-
}
|
|
3664
|
-
async getShopItemList(e) {
|
|
3665
|
-
const t = await this.get(e), a = [];
|
|
3666
|
-
for (const { id: r } of t.items) {
|
|
3667
|
-
const s = await this.getShopItem(e, r);
|
|
3668
|
-
s && a.push(s);
|
|
3669
|
-
}
|
|
3670
|
-
return a;
|
|
3671
|
-
}
|
|
3672
|
-
getShopItemId(e) {
|
|
3673
|
-
return l.isEntity(e.data) ? e.data.entityId : e.data.ornamentId;
|
|
3674
|
-
}
|
|
3675
|
-
async updateShopStats(e, t, a) {
|
|
3676
|
-
await this.update(
|
|
3677
|
-
{ shopType: e },
|
|
3678
|
-
{
|
|
3679
|
-
$inc: {
|
|
3680
|
-
"stats.berrySpent": t.price * a,
|
|
3681
|
-
"stats.itemBought": a,
|
|
3682
|
-
"stats.chestBought": t.isChest() ? a : 0,
|
|
3683
|
-
"stats.percentBought": t.data.type === "repair" ? (t.data.effects.find((r) => r.type === "CREW_REPAIR")?.params.amount ?? 0) * a : 0,
|
|
3684
|
-
"stats.boostTimeBought": t.data.type === "boost" && t.data.ms ? t.data.ms / (1440 * 60 * 1e3) : 0
|
|
3685
|
-
}
|
|
3686
|
-
}
|
|
3687
|
-
);
|
|
3688
|
-
}
|
|
3689
|
-
async buyShopItem(e, t, a, r) {
|
|
3690
|
-
const s = t.map((i) => (i.id === this.getShopItemId(a) && i.size && (i.size -= r), i));
|
|
3691
|
-
await this.update(
|
|
3692
|
-
{ shopType: e },
|
|
3693
|
-
{
|
|
3694
|
-
$set: {
|
|
3695
|
-
items: s
|
|
3696
|
-
}
|
|
3697
|
-
}
|
|
3698
|
-
);
|
|
3699
|
-
}
|
|
3700
|
-
async publish(e) {
|
|
3701
|
-
await this.update(
|
|
3702
|
-
{ shopType: e },
|
|
3703
|
-
{
|
|
3704
|
-
$set: {
|
|
3705
|
-
publishedAt: /* @__PURE__ */ new Date()
|
|
3706
|
-
}
|
|
3707
|
-
}
|
|
3708
|
-
);
|
|
3709
|
-
}
|
|
3710
|
-
async setShopItems(e, t) {
|
|
3711
|
-
await this.update(
|
|
3712
|
-
{ shopType: e },
|
|
3713
|
-
{
|
|
3714
|
-
$set: {
|
|
3715
|
-
items: [...t]
|
|
3716
|
-
}
|
|
3717
|
-
}
|
|
3718
|
-
);
|
|
3719
|
-
}
|
|
3720
|
-
}
|
|
3721
|
-
const br = new o(
|
|
3722
|
-
{
|
|
3723
|
-
shopType: { type: String, required: !0, unique: !0 },
|
|
3724
|
-
publishedAt: { type: Date, default: /* @__PURE__ */ new Date() },
|
|
3725
|
-
duration: { type: Number, default: null },
|
|
3726
|
-
closeAt: { type: Date, default: null },
|
|
3727
|
-
items: {
|
|
3728
|
-
type: [
|
|
3729
|
-
{
|
|
3730
|
-
_id: !1,
|
|
3731
|
-
type: {
|
|
3732
|
-
price: Number,
|
|
3733
|
-
size: { type: Number, default: null },
|
|
3734
|
-
id: String,
|
|
3735
|
-
currency: String
|
|
3736
|
-
}
|
|
3737
|
-
}
|
|
3738
|
-
],
|
|
3739
|
-
default: []
|
|
3740
|
-
},
|
|
3741
|
-
stats: {
|
|
3742
|
-
berrySpent: { type: Number, default: 0 },
|
|
3743
|
-
itemBought: { type: Number, default: 0 },
|
|
3744
|
-
chestBought: { type: Number, default: 0 },
|
|
3745
|
-
boostTimeBought: { type: Number, default: 0 },
|
|
3746
|
-
percentBought: { type: Number, default: 0 }
|
|
3747
|
-
}
|
|
3748
|
-
},
|
|
3749
|
-
{ minimize: !1 }
|
|
3750
|
-
), fe = d?.Shop || p("Shop", br), $r = (n) => fe.create({
|
|
3751
|
-
shopType: n
|
|
3752
|
-
}), Ir = async (n) => {
|
|
3753
|
-
const e = await fe.findOne({ shopType: n }).lean();
|
|
3754
|
-
return e || y(await $r(n));
|
|
3755
|
-
}, Er = (n, e) => fe.findOneAndUpdate(n, e, { upsert: !0, returnDocument: "after" }).lean();
|
|
3756
|
-
class Ur extends Sr {
|
|
3757
|
-
constructor() {
|
|
3758
|
-
super(3600);
|
|
3759
|
-
}
|
|
3760
|
-
normalizeKey(e) {
|
|
3761
|
-
return e;
|
|
3762
|
-
}
|
|
3763
|
-
getKey({ shopType: e }) {
|
|
3764
|
-
return e;
|
|
3765
|
-
}
|
|
3766
|
-
fetchFromDb(e) {
|
|
3767
|
-
return Ir(e);
|
|
3154
|
+
return Ja(e);
|
|
3768
3155
|
}
|
|
3769
3156
|
updateInDb(e, t) {
|
|
3770
|
-
return
|
|
3157
|
+
return Za(e, t);
|
|
3771
3158
|
}
|
|
3772
3159
|
}
|
|
3773
|
-
const
|
|
3160
|
+
const Tr = new er(), tr = new u({
|
|
3774
3161
|
warnedUserId: { type: String, required: !0, index: !0 },
|
|
3775
3162
|
authorId: String,
|
|
3776
3163
|
date: { type: Date, default: Date.now() },
|
|
3777
3164
|
reason: { type: String, default: null }
|
|
3778
|
-
}),
|
|
3165
|
+
}), ne = c?.Warn || d("Warn", tr), nr = (n) => ne.countDocuments(n), ar = (n) => ne.create({
|
|
3779
3166
|
...n
|
|
3780
|
-
}),
|
|
3781
|
-
class
|
|
3167
|
+
}), rr = (n) => ne.findByIdAndDelete(n).lean();
|
|
3168
|
+
class sr extends m {
|
|
3782
3169
|
getUserWarns(e) {
|
|
3783
3170
|
return this.getMany({ warnedUserId: e });
|
|
3784
3171
|
}
|
|
3785
3172
|
getUserWarnCount(e) {
|
|
3786
|
-
return
|
|
3173
|
+
return nr({ warnedUserId: e });
|
|
3787
3174
|
}
|
|
3788
3175
|
async createWarn(e) {
|
|
3789
|
-
await
|
|
3176
|
+
await ar(e);
|
|
3790
3177
|
}
|
|
3791
3178
|
async deleteWarn(e) {
|
|
3792
|
-
const t = await
|
|
3179
|
+
const t = await rr(e);
|
|
3793
3180
|
return t && this.invalidate(this.getKey(t)), t;
|
|
3794
3181
|
}
|
|
3795
3182
|
}
|
|
3796
|
-
const
|
|
3797
|
-
class
|
|
3183
|
+
const ir = (n) => ne.find(n).lean();
|
|
3184
|
+
class ur extends sr {
|
|
3798
3185
|
constructor() {
|
|
3799
3186
|
super(300);
|
|
3800
3187
|
}
|
|
@@ -3808,59 +3195,48 @@ class kr extends Br {
|
|
|
3808
3195
|
throw new Error("Method not implemented.");
|
|
3809
3196
|
}
|
|
3810
3197
|
fetchManyFromDb(e) {
|
|
3811
|
-
return
|
|
3198
|
+
return ir(e);
|
|
3812
3199
|
}
|
|
3813
3200
|
updateInDb() {
|
|
3814
3201
|
throw new Error("Method not implemented.");
|
|
3815
3202
|
}
|
|
3816
3203
|
}
|
|
3817
|
-
const
|
|
3818
|
-
|
|
3204
|
+
const Or = new ur(), vr = (n) => {
|
|
3205
|
+
Fe(n);
|
|
3819
3206
|
};
|
|
3820
|
-
class
|
|
3207
|
+
class Mr extends Ne.ObjectId {
|
|
3821
3208
|
}
|
|
3822
3209
|
export {
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
b as
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
jr as userRankService,
|
|
3856
|
-
bt as userService,
|
|
3857
|
-
_e as userSettingsService,
|
|
3858
|
-
Hr as userShopService,
|
|
3859
|
-
Kr as userStatsCasinoService,
|
|
3860
|
-
Sa as userStatsEconomyService,
|
|
3861
|
-
Se as userStatsEngagementService,
|
|
3862
|
-
Pr as userStatsFlagsService,
|
|
3863
|
-
Lr as userStatsFrequencyService,
|
|
3864
|
-
Qr as userStatsInventoryService,
|
|
3865
|
-
Jr as warnService
|
|
3210
|
+
yr as COOLDOWN_COMMANDS,
|
|
3211
|
+
Mr as ObjectId,
|
|
3212
|
+
g as QUEST_MIDDLEWARE_EVENT_NAME,
|
|
3213
|
+
Dr as banService,
|
|
3214
|
+
vr as connectToServices,
|
|
3215
|
+
h as emitQuestMiddlewareEvent,
|
|
3216
|
+
f as entityService,
|
|
3217
|
+
Ir as invitationService,
|
|
3218
|
+
b as ornamentService,
|
|
3219
|
+
A as panoplyService,
|
|
3220
|
+
Er as recipeService,
|
|
3221
|
+
pr as registerQuestMiddlewareEvents,
|
|
3222
|
+
Ut as reminderService,
|
|
3223
|
+
Tr as settingsService,
|
|
3224
|
+
fr as userCooldownService,
|
|
3225
|
+
mr as userDailyReportService,
|
|
3226
|
+
se as userEncyclopediaService,
|
|
3227
|
+
hr as userGamesService,
|
|
3228
|
+
U as userInventoryService,
|
|
3229
|
+
E as userMetaService,
|
|
3230
|
+
ye as userOrnamentService,
|
|
3231
|
+
fe as userQuestService,
|
|
3232
|
+
gr as userRankService,
|
|
3233
|
+
yt as userService,
|
|
3234
|
+
Re as userSettingsService,
|
|
3235
|
+
wr as userStatsCasinoService,
|
|
3236
|
+
Sr as userStatsEconomyService,
|
|
3237
|
+
me as userStatsEngagementService,
|
|
3238
|
+
br as userStatsFlagsService,
|
|
3239
|
+
$r as userStatsFrequencyService,
|
|
3240
|
+
Ur as userStatsInventoryService,
|
|
3241
|
+
Or as warnService
|
|
3866
3242
|
};
|