Skip to content

Commit

Permalink
Automatically rebind user to transferred account in account transfer
Browse files Browse the repository at this point in the history
  • Loading branch information
Rian8337 committed Nov 10, 2024
1 parent d5485df commit 1b9eed9
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/performAccountTransfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,11 @@ DatabaseManager.init().then(async () => {
playcount = (SELECT COUNT(*) FROM ${scoreTable} WHERE uid = ? AND score > 0),
archived = 0
WHERE id = ?`,
[transfer.transferUid, transfer.transferUid, transfer.transferUid],
[
transfer.transferUid,
transfer.transferUid,
transfer.transferUid,
],
);

await connection.commit();
Expand All @@ -316,6 +320,11 @@ DatabaseManager.init().then(async () => {
{ $set: { transferDone: true } },
);

await DatabaseManager.elainaDb.collections.userBind.updateOne(
{ discordid: transfer.discordId },
{ $set: { uid: transfer.transferUid } },
);

console.log(`Transfer for ${transfer.discordId} has been completed.`);
}

Expand Down

0 comments on commit 1b9eed9

Please sign in to comment.