diff options
author | gumi <git@gumi.ca> | 2020-03-27 23:31:00 -0400 |
---|---|---|
committer | gumi <git@gumi.ca> | 2020-03-27 23:31:11 -0400 |
commit | d83e4cb9a5d12230a1d255dcd2c9f167c5cc4751 (patch) | |
tree | 590d4cc94f6e0b8e79c7d6bd96d3bfa24b17843e /src/routers/vault/middlewares/legacy/account.js | |
parent | 36fa6ec0227a6c2397c2059259b9b2a2a0983c1a (diff) | |
download | api-d83e4cb9a5d12230a1d255dcd2c9f167c5cc4751.tar.gz api-d83e4cb9a5d12230a1d255dcd2c9f167c5cc4751.tar.bz2 api-d83e4cb9a5d12230a1d255dcd2c9f167c5cc4751.tar.xz api-d83e4cb9a5d12230a1d255dcd2c9f167c5cc4751.zip |
set the vault account id in an account variable
Diffstat (limited to 'src/routers/vault/middlewares/legacy/account.js')
-rw-r--r-- | src/routers/vault/middlewares/legacy/account.js | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/routers/vault/middlewares/legacy/account.js b/src/routers/vault/middlewares/legacy/account.js index 50874ed..8a541f5 100644 --- a/src/routers/vault/middlewares/legacy/account.js +++ b/src/routers/vault/middlewares/legacy/account.js @@ -225,6 +225,13 @@ const migrate = async (req, res, next) => { email: `${session.vault}@vault`, // setting an actual email is pointless }); + // store the vault account id as a global account var + await req.app.locals.evol.global_acc_reg_num_db.create({ + accountId: evol_acc.accountId, + key: "##VAULT", index: 0, + value: session.vault, + }); + req.app.locals.vault.migration_log.create({ vaultId: session.vault, legacyId: legacy.accountId, @@ -238,8 +245,6 @@ const migrate = async (req, res, next) => { vaultId: session.vault, }); - // TODO: set an account variable with the original legacy account id - const evol_account = new EvolAccount(evol_acc.accountId, evol_acc.userid); evol_account.legacyId = legacy.accountId; evol_account.legacyAccount = legacy; @@ -277,7 +282,14 @@ const migrate = async (req, res, next) => { continue; } - // TODO: set a variable in the char with the original legacy char id + // update the Legacy flags: + // for now we're only using a single bit but this can be expanded when + // we need it in the future + await req.app.locals.evol.char_reg_num_db.create({ + charId: evol_char.charId, + key: "LEGACY", index: 0, + value: 0b00000000_00000000_00000000_00000001, // set the Legacy bit + }); // remove the name reservation req.app.locals.evol.char_reservation.destroy({ |