Skip to content

Commit

Permalink
2.2.2 Release (#378)
Browse files Browse the repository at this point in the history
  • Loading branch information
Snarling authored Feb 21, 2023
1 parent bba6b26 commit d3f9554
Show file tree
Hide file tree
Showing 28 changed files with 196 additions and 67 deletions.
85 changes: 85 additions & 0 deletions doc/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,91 @@
Changelog
=========


v2.2.2 - 21 Feb 2022
--------------------

PLANNED 2.3 BREAKING CHANGES:

* 2.3 will include a large planned rework to corporation. This may cause api breaks for any corporation scripts, and there will be large changes in how the corporation mechanic functions.

NETSCRIPT API:

* Added ns.formatNumber, ns.formatRam, and ns.formatPercent, which allow formatting these types of numbers the same way the game does (@Snarling, See UI section).
* Deprecated ns.nFormat. Likely to be removed in 2.3. Now just directly wraps numeral.format (@Snarling)
* EXPERIMENTAL CHANGE (may be reverted next patch): BasicHGWOptions now allows specifying a number of additionalMsec. This should allow easier and more reliable coordination
of completion times for hack, grow, and weaken. Since this is an experimental change, be prepared for a possible API break next patch if you use this functionality. (@d0sboots)

* Corporation API:

* Fix bugs with ns.corporation.setAutoJobAssignment. (@zerbosh and @croy)

* Formulas API:

* Added ns.formulas.hacking.growThreads function (@d0sboots)

* Sleeve API:

* ns.sleeve.getTask now also includes cyclesWorked for the task types where this applies. (@Zelow79)
* Added ns.sleeve.setToIdle function (@Zelow79)

* Unsupported API:

* Added ns.printRaw - allows printing custom React content to script logs. Use at your own risk, misuse is very likely to cause a crash. (@d0sboots)

ELECTRON (STEAM) VERSION:

* Fix security issue where player scripts were allowed to access any part of the player's filesystem. Now access is limited to the game's 'dist' folder. (@Snarling)

SCRIPTS:

* Fix an issue where multiple copies of the same script could be launched with same args/same server (@Mughur)
* Followup changes to API wrapping from 2.2.1 changes. (@d0sboots)

UI:

* Add new number formatting code to replace internal use of unmaintained package numeral.js. Added several Numeric Display options. (@Snarling)
* Removed ingame donation section. (@hydroflame)
* Improve some bladeburner number formatting (@Zelow79)
* Added IronMan theme (@MattiYT)
* Factions that have not been joined yet will show how many unowned augments they have available. (@Zelow79)
* Added more features to dev menu (@Zelow79 and @Snarling)

CORPORATION:

* Reverted previous change to employee needs. Now they will trend up on their own again. (@d0sboots)
* Improvements to how Market TA II works (@d0sboots)
* ns.corporation.getOffice return value now includes a totalExperience property. (@Snarling)

HACKNET:

* Hacknet servers are now named hacknet-server-# instead of hacknet-node-#. (@Tyasuh)
* Fix bug related to renaming hacknet servers (@Mughur)

GRAFTING:

* Bladeburner augs can be grafted if player is in Bladeburner faction (@Tyasuh)

DOCUMENTATION

* Many documentation updates (@Mughur, @d0sboots, @Snarling, @teauxfu).
* Official non-markdown docs are at http://bitburner-official.readthedocs.io/
* Official dev version markdown docs are at https://github.com/bitburner-official/bitburner-src/blob/dev/markdown/bitburner.ns.md
* Official stable version markdown docs are at https://github.com/bitburner-official/bitburner-src/blob/stable/markdown/bitburner.ns.md
* Dev version documentation is now kept up to date as changes are made. (@Snarling)

CODEBASE:

* Updated many dependencies (@d0sboots)
* Updated lots of the build processes and GitHub workflows. (@Snarling)
* Internal refactoring of how BitNode multipliers are stored (@d0sboots)
* Added some extra helper function (useRerender hook, positiveInteger ns argument validator). (@Snarling)

MISC:

* Nerf noodle bar


v2.2.1 Hotfixes
---------------

Expand Down
2 changes: 1 addition & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
# The short X.Y version.
version = '2.2'
# The full version, including alpha/beta/rc tags.
release = '2.2.0'
release = '2.2.2'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion markdown/bitburner.basichgwoptions.additionalmsec.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## BasicHGWOptions.additionalMsec property

Number of additional milliseconds that will be spent waiting between the start of the function and when it completes. There will only be one, contiguous wait, which is relevant because stats such as server security level are computed at the \*start\* of the function. Must be non-negative.
Number of additional milliseconds that will be spent waiting between the start of the function and when it completes. Experimental in 2.2.2, may be removed in 2.3.

**Signature:**

Expand Down
2 changes: 1 addition & 1 deletion markdown/bitburner.basichgwoptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ interface BasicHGWOptions

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [additionalMsec?](./bitburner.basichgwoptions.additionalmsec.md) | | number | _(Optional)_ Number of additional milliseconds that will be spent waiting between the start of the function and when it completes. There will only be one, contiguous wait, which is relevant because stats such as server security level are computed at the \*start\* of the function. Must be non-negative. |
| [additionalMsec?](./bitburner.basichgwoptions.additionalmsec.md) | | number | _(Optional)_ Number of additional milliseconds that will be spent waiting between the start of the function and when it completes. Experimental in 2.2.2, may be removed in 2.3. |
| [stock?](./bitburner.basichgwoptions.stock.md) | | boolean | _(Optional)_ Set to true this action will affect the stock market. |
| [threads?](./bitburner.basichgwoptions.threads.md) | | number | _(Optional)_ Number of threads to use for this function. Must be less than or equal to the number of threads the script is running with. |

7 changes: 2 additions & 5 deletions markdown/bitburner.ns.getserverbasesecuritylevel.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@

## NS.getServerBaseSecurityLevel() method

> Warning: This API is now obsolete.
>
> useless
>
Get the base security level of a server.

**Signature:**

Expand All @@ -29,5 +26,5 @@ Base security level of the target server.

## Remarks

RAM cost: 0.1 GB Returns the base security level of the target server. This is the security level that the server starts out with. This is different than getServerSecurityLevel because getServerSecurityLevel returns the current security level of a server, which can constantly change due to hack, grow, and weaken, calls on that server. The base security level will stay the same until you reset by installing an Augmentation(s).
RAM cost: 0.1 GB Returns the base security level of the target server. For the server's actual security level, use [ns.getServerSecurityLevel](./bitburner.ns.getserversecuritylevel.md)<!-- -->.

2 changes: 1 addition & 1 deletion markdown/bitburner.ns.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export async function main(ns) {
| [getScriptName()](./bitburner.ns.getscriptname.md) | Returns the current script name. |
| [getScriptRam(script, host)](./bitburner.ns.getscriptram.md) | Get the ram cost of a script. |
| [getServer(host)](./bitburner.ns.getserver.md) | Returns a server object for the given server. Defaults to the running script's server if host is not specified. |
| [getServerBaseSecurityLevel(host)](./bitburner.ns.getserverbasesecuritylevel.md) | |
| [getServerBaseSecurityLevel(host)](./bitburner.ns.getserverbasesecuritylevel.md) | Get the base security level of a server. |
| [getServerGrowth(host)](./bitburner.ns.getservergrowth.md) | Get a server growth parameter. |
| [getServerMaxMoney(host)](./bitburner.ns.getservermaxmoney.md) | Get the maximum money available on a server. |
| [getServerMaxRam(host)](./bitburner.ns.getservermaxram.md) | Get the maximum amount of RAM on a server. |
Expand Down
5 changes: 5 additions & 0 deletions markdown/bitburner.ns.nformat.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

## NS.nFormat() method

> Warning: This API is now obsolete.
>
> Use ns.formatNumber, formatRam, or formatPercent instead. Will be removed in 2.3.
>
Format a number using the numeral library. This function is deprecated and will be removed in 2.3.

**Signature:**
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bitburner",
"license": "SEE LICENSE IN license.txt",
"version": "2.2.2dev",
"version": "2.2.2",
"main": "electron-main.js",
"author": {
"name": "Daniel Xie, Olivier Gagnon, et al."
Expand Down
75 changes: 62 additions & 13 deletions src/Constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
export const CONSTANTS: {
VersionString: string;
VersionNumber: number;
_idleSpeed: number;
MaxSkillLevel: number;
MilliPerCycle: number;
CorpFactionRepRequirement: number;
Expand Down Expand Up @@ -88,11 +87,8 @@ export const CONSTANTS: {
Donations: number; // number of blood/plasma/palette donation the dev have verified., boosts NFG
LatestUpdate: string;
} = {
VersionString: "2.2.2dev",
VersionNumber: 29,

// Speed (in ms) at which the main loop is updated
_idleSpeed: 200,
VersionString: "2.2.2",
VersionNumber: 30,

/** Max level for any skill, assuming no multipliers. Determined by max numerical value in javascript for experience
* and the skill level formula in Player.js. Note that all this means it that when experience hits MAX_INT, then
Expand Down Expand Up @@ -232,18 +228,71 @@ export const CONSTANTS: {
Donations: 41,

LatestUpdate: `
v2.2.2 in progress development patch notes
v2.2.2 - 21 Feb 2022
PLANNED 2.3 BREAKING CHANGES:
* 2.3 will include a large planned rework to corporation. This may cause api breaks for any corporation scripts, and there will be large changes in how the corporation mechanic functions.
NETSCRIPT API:
* Added ns.formatNumber, ns.formatRam, and ns.formatPercent, which allow formatting these types of numbers the same way the game does (@Snarling, See UI section).
* Deprecated ns.nFormat. Likely to be removed in 2.3. Now just directly wraps numeral.format (@Snarling)
* EXPERIMENTAL CHANGE (may be reverted next patch): BasicHGWOptions now allows specifying a number of additionalMsec. This should allow easier and more reliable coordination
of completion times for hack, grow, and weaken. Since this is an experimental change, be prepared for a possible API break next patch if you use this functionality. (@d0sboots)
- Corporation API
* Fix bugs with ns.corporation.setAutoJobAssignment. (@zerbosh and @croy)
NETSCRIPT:
- Formulas API
* Added ns.formulas.hacking.growThreads function (@d0sboots)
* Add unsupported ns.printRaw function, which allows printing rich content to script logs using React. (@d0sboots)
- Sleeve API
* ns.sleeve.getTask now also includes cyclesWorked for the task types where this applies. (@Zelow79)
* Added ns.sleeve.setToIdle function (@Zelow79)
- Unsupported API
* Added ns.printRaw - allows printing custom React content to script logs. Use at your own risk, misuse is very likely to cause a crash. (@d0sboots)
ELECTRON (STEAM) VERSION:
* Fix security issue where player scripts were allowed to access any part of the player's filesystem. Now access is limited to the game's 'dist' folder. (@Snarling)
SCRIPTS:
* Fix an issue where multiple copies of the same script could be launched with same args/same server (@Mughur)
* Internal changes to API wrapping. (@d0sboots)
* Followup changes to API wrapping from 2.2.1 changes. (@d0sboots)
UI:
* Add new number formatting code to replace internal use of unmaintained package numeral.js. Added several Numeric Display options. (@Snarling)
* Removed ingame donation section. (@hydroflame)
* Improve some bladeburner number formatting (@Zelow79)
* Added IronMan theme (@MattiYT)
* Factions that have not been joined yet will show how many unowned augments they have available. (@Zelow79)
* Added more features to dev menu (@Zelow79 and @Snarling)
CORPORATION:
* Reverted previous change to employee needs. Now they will trend up on their own again. (@d0sboots)
* Improvements to how Market TA II works (@d0sboots)
* ns.corporation.getOffice return value now includes a totalExperience property. (@Snarling)
HACKNET:
* Hacknet servers are now named hacknet-server-# instead of hacknet-node-#. (@Tyasuh)
* Fix bug related to renaming hacknet servers (@Mughur)
GRAFTING:
* Bladeburner augs can be grafted if player is in Bladeburner faction (@Tyasuh)
DOCUMENTATION
* Many documentation updates (@Mughur, @d0sboots, @Snarling, @teauxfu).
* Official non-markdown docs are at http://bitburner-official.readthedocs.io/
* Official dev version markdown docs are at https://github.com/bitburner-official/bitburner-src/blob/dev/markdown/bitburner.ns.md
* Official stable version markdown docs are at https://github.com/bitburner-official/bitburner-src/blob/stable/markdown/bitburner.ns.md
* Dev version documentation is now kept up to date as changes are made. (@Snarling)
CODEBASE:
* Updated many dependencies (@d0sboots)
* Updated lots of the build processes and GitHub workflows. (@Snarling)
* Internal refactoring of how BitNode multipliers are stored (@d0sboots)
* Added some extra helper function (useRerender hook, positiveInteger ns argument validator). (@Snarling)
MISC:
* Updated large number of dependency packages (@d0sboots)
* Refactored how bitnode multipliers for max / starting money work. (@d0sboots)
* Nerf noodle bar
`,
};
2 changes: 1 addition & 1 deletion src/CotMG/StaneksGift.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class StaneksGift extends BaseGift {
}

inBonus(): boolean {
return (this.storedCycles * CONSTANTS._idleSpeed) / 1000 > 1;
return (this.storedCycles * CONSTANTS.MilliPerCycle) / 1000 > 1;
}

process(numCycles = 1): void {
Expand Down
2 changes: 1 addition & 1 deletion src/CotMG/ui/StaneksGiftRoot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export function StaneksGiftRoot({ staneksGift }: IProps): React.ReactElement {
</Typography>
{staneksGift.storedCycles > 5 && (
<Typography sx={{ mb: 1 }}>
Bonus time: {convertTimeMsToTimeElapsedString(CONSTANTS._idleSpeed * staneksGift.storedCycles)}
Bonus time: {convertTimeMsToTimeElapsedString(CONSTANTS.MilliPerCycle * staneksGift.storedCycles)}
</Typography>
)}
<MainBoard gift={staneksGift} />
Expand Down
2 changes: 1 addition & 1 deletion src/Gang/Gang.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export class Gang {

process(numCycles = 1): void {
// Run every cycle
const CyclesPerSecond = 1000 / CONSTANTS._idleSpeed;
const CyclesPerSecond = 1000 / CONSTANTS.MilliPerCycle;

if (isNaN(numCycles)) {
console.error(`NaN passed into Gang.process(): ${numCycles}`);
Expand Down
2 changes: 1 addition & 1 deletion src/Gang/ui/BonusTime.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface IProps {

/** React Component for displaying the bonus time remaining. */
export function BonusTime(props: IProps): React.ReactElement {
const CyclerPerSecond = 1000 / CONSTANTS._idleSpeed;
const CyclerPerSecond = 1000 / CONSTANTS.MilliPerCycle;
if ((props.gang.storedCycles / CyclerPerSecond) * 1000 <= 5000) return <></>;
const bonusMillis = (props.gang.storedCycles / CyclerPerSecond) * 1000;
return (
Expand Down
2 changes: 1 addition & 1 deletion src/NetscriptWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ function createAndAddWorkerScript(runningScriptObj: RunningScript, server: BaseS

/** Updates the online running time stat of all running scripts */
export function updateOnlineScriptTimes(numCycles = 1): void {
const time = (numCycles * CONSTANTS._idleSpeed) / 1000; //seconds
const time = (numCycles * CONSTANTS.MilliPerCycle) / 1000; //seconds
for (const ws of workerScripts.values()) {
ws.scriptRef.onlineRunningTime += time;
}
Expand Down
2 changes: 1 addition & 1 deletion src/PersonObjects/Sleeve/Work/SleeveBladeburnerWork.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class SleeveBladeburnerWork extends Work {
cyclesNeeded(sleeve: Sleeve): number {
const ret = Player.bladeburner?.getActionTimeNetscriptFn(sleeve, this.actionType, this.actionName);
if (!ret || typeof ret === "string") throw new Error(`Error querying ${this.actionName} time`);
return ret / CONSTANTS._idleSpeed;
return ret / CONSTANTS.MilliPerCycle;
}

process(sleeve: Sleeve, cycles: number) {
Expand Down
2 changes: 1 addition & 1 deletion src/PersonObjects/Sleeve/Work/SleeveCrimeWork.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class SleeveCrimeWork extends Work {
}

cyclesNeeded(): number {
return this.getCrime().time / CONSTANTS._idleSpeed;
return this.getCrime().time / CONSTANTS.MilliPerCycle;
}

process(sleeve: Sleeve, cycles: number) {
Expand Down
2 changes: 1 addition & 1 deletion src/PersonObjects/Sleeve/Work/SleeveInfiltrateWork.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Sleeve } from "../Sleeve";
import { Work, WorkType } from "./Work";
import { CONSTANTS } from "../../../Constants";

const infiltrateCycles = 60000 / CONSTANTS._idleSpeed;
const infiltrateCycles = 60000 / CONSTANTS.MilliPerCycle;

export const isSleeveInfiltrateWork = (w: Work | null): w is SleeveInfiltrateWork =>
w !== null && w.type === WorkType.INFILTRATE;
Expand Down
19 changes: 6 additions & 13 deletions src/ScriptEditor/NetscriptDefinitions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,8 @@ interface BasicHGWOptions {
threads?: number;
/** Set to true this action will affect the stock market. */
stock?: boolean;
/** Number of additional milliseconds that will be spent waiting between the
* start of the function and when it completes. There will only be one,
* contiguous wait, which is relevant because stats such as server security
* level are computed at the *start* of the function.
* Must be non-negative. */
/** Number of additional milliseconds that will be spent waiting between the start of the function and when it
* completes. Experimental in 2.2.2, may be removed in 2.3. */
additionalMsec?: number;
}

Expand Down Expand Up @@ -5814,16 +5811,11 @@ export interface NS {
getServerMinSecurityLevel(host: string): number;

/**
* @deprecated useless
* Get the base security level of a server.
* @remarks
* RAM cost: 0.1 GB
* Returns the base security level of the target server. This is the security
* level that the server starts out with. This is different than
* getServerSecurityLevel because getServerSecurityLevel returns
* the current security level of a server, which can constantly change due to
* hack, grow, and weaken, calls on that server.
* The base security level will stay the same until you reset by
* installing an Augmentation(s).
* Returns the base security level of the target server.
* For the server's actual security level, use {@link NS.getServerSecurityLevel | ns.getServerSecurityLevel}.
*
* @param host - Host of target server.
* @returns Base security level of the target server.
Expand Down Expand Up @@ -6478,6 +6470,7 @@ export interface NS {

/**
* Format a number using the numeral library. This function is deprecated and will be removed in 2.3.
* @deprecated Use ns.formatNumber, formatRam, or formatPercent instead. Will be removed in 2.3.
* @remarks
* RAM cost: 0 GB
*
Expand Down
Loading

0 comments on commit d3f9554

Please sign in to comment.