fix import and make rainbow return the answer.

This commit is contained in:
Olivier Gagnon
2022-04-14 15:23:49 -04:00
parent 52e27e317e
commit 7685f52f8e
2 changed files with 8 additions and 5 deletions
+7 -4
View File
@@ -59,17 +59,20 @@ export function NetscriptExtra(player: IPlayer, workerScript: WorkerScript, help
player.giveExploit(Exploit.RealityAlteration);
}
},
rainbow: function (guess: unknown): void {
async function tryGuess(): Promise<void> {
const verified = await bcrypt.compare(
rainbow: function (guess: unknown): boolean {
function tryGuess(): boolean {
// eslint-disable-next-line no-sync
const verified = bcrypt.compareSync(
helper.string("rainbow", "guess", guess),
"$2a$10$aertxDEkgor8baVtQDZsLuMwwGYmkRM/ohcA6FjmmzIHQeTCsrCcO",
);
if (verified) {
player.giveExploit(Exploit.INeedARainbow);
return true;
}
return false;
}
tryGuess();
return tryGuess();
},
};
}