fix BN exploit

This commit is contained in:
Olivier Gagnon 2021-12-16 12:40:24 -05:00
parent 3c67da02f3
commit 6ef99e138c
3 changed files with 13 additions and 3 deletions

@ -2123,12 +2123,15 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS {
return Player.playtimeSinceLastAug; return Player.playtimeSinceLastAug;
}, },
alert: function (message: any): void { alert: function (message: any): void {
dialogBoxCreate(message); message = toNative(message);
dialogBoxCreate(JSON.stringify(message));
}, },
toast: function (message: any, variant: any = "success"): void { toast: function (message: any, variant: any = "success"): void {
if (!["success", "info", "warning", "error"].includes(variant)) if (!["success", "info", "warning", "error"].includes(variant))
throw new Error(`variant must be one of "success", "info", "warning", or "error"`); throw new Error(`variant must be one of "success", "info", "warning", or "error"`);
SnackbarEvents.emit(message, variant);
message = toNative(message);
SnackbarEvents.emit(JSON.stringify(message), variant);
}, },
prompt: function (txt: any): any { prompt: function (txt: any): any {
if (!isString(txt)) { if (!isString(txt)) {

@ -168,6 +168,13 @@ export function prestigeSourceFile(flume: boolean): void {
const homeComp = Player.getHomeComputer(); const homeComp = Player.getHomeComputer();
// Stop a Terminal action if there is one.
if (Terminal.action !== null) {
Terminal.finishAction(Router, Player, true);
}
Terminal.clear();
LogBoxClearEvents.emit();
// Delete all servers except home computer // Delete all servers except home computer
prestigeAllServers(); // Must be done before initForeignServers() prestigeAllServers(); // Must be done before initForeignServers()

@ -4624,7 +4624,7 @@ export interface NS extends Singularity {
* RAM cost: 0.1 GB * RAM cost: 0.1 GB
* *
* Returns the servers instrinsic growth parameter. This growth * Returns the servers instrinsic growth parameter. This growth
* parameter is a number between 1 and 100 that represents how * parameter is a number between 0 and 100 that represents how
* quickly the servers money grows. This parameter affects the * quickly the servers money grows. This parameter affects the
* percentage by which the servers money is increased when using the * percentage by which the servers money is increased when using the
* grow function. A higher growth parameter will result in a * grow function. A higher growth parameter will result in a