unasync trywriteport

This commit is contained in:
Snarling
2022-10-04 07:59:50 -04:00
parent aa80cf6451
commit 361466b7fa
3 changed files with 5 additions and 9 deletions
+2 -2
View File
@@ -1518,7 +1518,7 @@ const base: InternalAPI<NS> = {
},
tryWritePort:
(ctx: NetscriptContext) =>
(_port: unknown, data: unknown = ""): Promise<any> => {
(_port: unknown, data: unknown = ""): boolean => {
const port = helpers.number(ctx, "port", _port);
if (typeof data !== "string" && typeof data !== "number") {
throw helpers.makeRuntimeErrorMsg(
@@ -1527,7 +1527,7 @@ const base: InternalAPI<NS> = {
);
}
const iport = helpers.getValidPort(ctx, port);
return Promise.resolve(iport.tryWrite(data));
return iport.tryWrite(data);
},
readPort:
(ctx: NetscriptContext) =>