fix sleeve memory bug

This commit is contained in:
Olivier Gagnon
2021-09-08 23:47:34 -04:00
parent bada8a5f39
commit 2a13db39c7
360 changed files with 5424 additions and 15764 deletions

View File

@@ -27,11 +27,7 @@ export function WorkerScriptAccordion(props: IProps): React.ReactElement {
const scriptRef = workerScript.scriptRef;
const logClickHandler = logBoxCreate.bind(null, scriptRef);
const killScript = killWorkerScript.bind(
null,
scriptRef as any,
scriptRef.server,
);
const killScript = killWorkerScript.bind(null, scriptRef as any, scriptRef.server);
function killScriptClickHandler(): void {
killScript();
@@ -51,62 +47,29 @@ export function WorkerScriptAccordion(props: IProps): React.ReactElement {
panelClass="active-scripts-script-panel"
panelContent={
<>
<pre>
Threads:{" "}
{numeralWrapper.formatThreads(props.workerScript.scriptRef.threads)}
</pre>
<pre>Threads: {numeralWrapper.formatThreads(props.workerScript.scriptRef.threads)}</pre>
<pre>Args: {arrayToString(props.workerScript.args)}</pre>
<pre>
Online Time:{" "}
{convertTimeMsToTimeElapsedString(
scriptRef.onlineRunningTime * 1e3,
)}
</pre>
<pre>
Offline Time:{" "}
{convertTimeMsToTimeElapsedString(
scriptRef.offlineRunningTime * 1e3,
)}
</pre>
<pre>Online Time: {convertTimeMsToTimeElapsedString(scriptRef.onlineRunningTime * 1e3)}</pre>
<pre>Offline Time: {convertTimeMsToTimeElapsedString(scriptRef.offlineRunningTime * 1e3)}</pre>
<pre>
Total online production: <Money money={scriptRef.onlineMoneyMade} />
</pre>
<pre>
{Array(26).join(" ") +
numeralWrapper.formatExp(scriptRef.onlineExpGained) +
" hacking exp"}
</pre>
<pre>{Array(26).join(" ") + numeralWrapper.formatExp(scriptRef.onlineExpGained) + " hacking exp"}</pre>
<pre>
Online production rate: <Money money={onlineMps} /> / second
</pre>
<pre>{Array(25).join(" ") + numeralWrapper.formatExp(onlineEps) + " hacking exp / second"}</pre>
<pre>
{Array(25).join(" ") +
numeralWrapper.formatExp(onlineEps) +
" hacking exp / second"}
</pre>
<pre>
Total offline production:{" "}
<Money money={scriptRef.offlineMoneyMade} />
</pre>
<pre>
{Array(27).join(" ") +
numeralWrapper.formatExp(scriptRef.offlineExpGained) +
" hacking exp"}
Total offline production: <Money money={scriptRef.offlineMoneyMade} />
</pre>
<pre>{Array(27).join(" ") + numeralWrapper.formatExp(scriptRef.offlineExpGained) + " hacking exp"}</pre>
<pre>
Offline production rate: <Money money={offlineMps} /> / second
</pre>
<pre>
{Array(26).join(" ") +
numeralWrapper.formatExp(offlineEps) +
" hacking exp / second"}
</pre>
<pre>{Array(26).join(" ") + numeralWrapper.formatExp(offlineEps) + " hacking exp / second"}</pre>
<AccordionButton onClick={logClickHandler} text="Log" />
<AccordionButton
onClick={killScriptClickHandler}
text="Kill Script"
/>
<AccordionButton onClick={killScriptClickHandler} text="Kill Script" />
</>
}
/>