fix some bugs

This commit is contained in:
Olivier Gagnon
2021-10-03 21:33:48 -04:00
parent 1a749505e7
commit ab2ffb112f
13 changed files with 85 additions and 14 deletions
-1
View File
@@ -420,7 +420,6 @@ function processAllHacknetServerEarnings(player: IPlayer, numCycles: number): nu
if (hserver instanceof Server) throw new Error(`player nodes shoud not be Server`);
hserver.updateHashRate(player.hacknet_node_money_mult);
const h = hserver.process(numCycles);
hserver.totalHashesGenerated += h;
hashes += h;
}
+5 -1
View File
@@ -77,8 +77,12 @@ export class HacknetServer extends BaseServer implements IHacknetNode {
// Process this Hacknet Server in the game loop. Returns the number of hashes generated
process(numCycles = 1): number {
const seconds = (numCycles * CONSTANTS.MilliPerCycle) / 1000;
this.onlineTimeSeconds += seconds;
return this.hashRate * seconds;
const hashes = this.hashRate * seconds;
this.totalHashesGenerated += hashes;
return hashes;
}
upgradeCache(levels: number): void {