summaryrefslogtreecommitdiff
path: root/src/routers/vault/utils/game_accounts.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/routers/vault/utils/game_accounts.js')
-rw-r--r--src/routers/vault/utils/game_accounts.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/routers/vault/utils/game_accounts.js b/src/routers/vault/utils/game_accounts.js
index fb0e5a4..a5df144 100644
--- a/src/routers/vault/utils/game_accounts.js
+++ b/src/routers/vault/utils/game_accounts.js
@@ -2,6 +2,7 @@ const LegacyAccount = require("../types/LegacyAccount.js");
const LegacyChar = require("../types/LegacyChar.js");
const EvolAccount = require("../types/EvolAccount.js");
const EvolChar = require("../types/EvolChar.js");
+const { Op } = require("sequelize");
/**
* fetch the legacy game accounts and cache in the Session
@@ -38,6 +39,27 @@ const get_legacy_accounts = async (req, session) => {
char_.gender = char.sex;
char_.revoltId = char.revoltId;
+ const char_vars = await req.app.locals.legacy.char_reg.findAll({
+ where: {
+ charId: char.charId,
+ [Op.or]: [
+ {name: "TUT_var"},
+ {name: "BOSS_POINTS"},
+ ],
+ },
+ limit: 2, // for now we only use these 2 vars ^
+ });
+
+ for (const var_ of char_vars) {
+ if (var_.name === "TUT_var") {
+ char_.creationTime = var_.value > 0xFF ? var_.value : 0;
+ } else if (var_.name === "BOSS_POINTS") {
+ char_.bossPoints = Math.max(0, var_.value);
+ }
+
+ // in the future maybe here set the vars in a Map<name, value>
+ }
+
account.chars.push(char_);
}