@tsukilabs/nil-ffi 0.7.3 → 0.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/def.d.ts +8 -0
- package/dist/index.d.ts +3 -19
- package/dist/index.js +21 -1
- package/package.json +2 -2
package/dist/def.d.ts
CHANGED
|
@@ -72,6 +72,14 @@ export declare const definitions: {
|
|
|
72
72
|
readonly arguments: readonly [ffi.types.UINT_32];
|
|
73
73
|
readonly return: ffi.types.VOID;
|
|
74
74
|
};
|
|
75
|
+
readonly nil_runtime_num_alive_tasks: {
|
|
76
|
+
readonly arguments: readonly [ffi.types.UINT_32];
|
|
77
|
+
readonly return: ffi.types.VOID;
|
|
78
|
+
};
|
|
79
|
+
readonly nil_runtime_num_workers: {
|
|
80
|
+
readonly arguments: readonly [ffi.types.UINT_32];
|
|
81
|
+
readonly return: ffi.types.VOID;
|
|
82
|
+
};
|
|
75
83
|
readonly nil_add_academy_recruit_order: {
|
|
76
84
|
readonly arguments: readonly [ffi.types.UINT_32, ffi.types.POINTER];
|
|
77
85
|
readonly return: ffi.types.VOID;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,29 +1,11 @@
|
|
|
1
1
|
import { definitions } from './def';
|
|
2
2
|
import { Option } from '@tb-dev/utils';
|
|
3
3
|
import { QueueOptions } from './queue';
|
|
4
|
-
import { AuthorizeRequest, GetPlayerIdsRequest, GetPlayerIdsResponse, GetPlayerRequest, GetPlayerStatusRequest, GetRemoteWorldsResponse,
|
|
4
|
+
import { AuthorizeRequest, ffi_UpdateClient, GetPlayerIdsRequest, GetPlayerIdsResponse, GetPlayerRequest, GetPlayerStatusRequest, GetRemoteWorldsResponse, LocalServer, PlayerExistsRequest, ServerAddr, SetPlayerStatusRequest, SpawnPlayerRequest, ValidateTokenRequest, ValidateTokenResponse, WorldOptions } from '@tsukilabs/nil-bindings';
|
|
5
5
|
import * as ffi from "node:ffi";
|
|
6
6
|
export * from './def';
|
|
7
7
|
export * from './error';
|
|
8
8
|
export type Handle = ffi.DynamicLibraryResult<typeof definitions>;
|
|
9
|
-
type LocalServer = {
|
|
10
|
-
world: WorldId;
|
|
11
|
-
addr: string;
|
|
12
|
-
};
|
|
13
|
-
type ServerAddr = {
|
|
14
|
-
kind: "remote";
|
|
15
|
-
} | {
|
|
16
|
-
kind: "local";
|
|
17
|
-
addr: string;
|
|
18
|
-
};
|
|
19
|
-
type ffi_UpdateClient = {
|
|
20
|
-
server: ServerAddr;
|
|
21
|
-
world_id?: WorldId | null;
|
|
22
|
-
world_password?: Password | null;
|
|
23
|
-
player_id?: PlayerId | null;
|
|
24
|
-
player_password?: Password | null;
|
|
25
|
-
authorization_token?: Token | null;
|
|
26
|
-
};
|
|
27
9
|
export declare const VERSION: string;
|
|
28
10
|
export declare const USER_AGENT: string;
|
|
29
11
|
export declare class Nil implements Disposable {
|
|
@@ -48,6 +30,8 @@ export declare class Nil implements Disposable {
|
|
|
48
30
|
getRemoteWorldLimit(): Promise<number>;
|
|
49
31
|
getRemoteWorldLimitPerUser(): Promise<number>;
|
|
50
32
|
getRemoteWorlds(): Promise<GetRemoteWorldsResponse>;
|
|
33
|
+
getRuntimeNumAliveTasks(): Promise<number>;
|
|
34
|
+
getRuntimeNumWorkers(): Promise<number>;
|
|
51
35
|
getServerAddr(): Promise<ServerAddr>;
|
|
52
36
|
getServerKind(): Promise<import('@tsukilabs/nil-bindings').ServerKind>;
|
|
53
37
|
getUserAgent(): Promise<string>;
|
package/dist/index.js
CHANGED
|
@@ -82,6 +82,14 @@ var definitions = {
|
|
|
82
82
|
arguments: [ffi.types.UINT_32],
|
|
83
83
|
return: ffi.types.VOID
|
|
84
84
|
},
|
|
85
|
+
nil_runtime_num_alive_tasks: {
|
|
86
|
+
arguments: [ffi.types.UINT_32],
|
|
87
|
+
return: ffi.types.VOID
|
|
88
|
+
},
|
|
89
|
+
nil_runtime_num_workers: {
|
|
90
|
+
arguments: [ffi.types.UINT_32],
|
|
91
|
+
return: ffi.types.VOID
|
|
92
|
+
},
|
|
85
93
|
nil_add_academy_recruit_order: {
|
|
86
94
|
arguments: [ffi.types.UINT_32, ffi.types.POINTER],
|
|
87
95
|
return: ffi.types.VOID
|
|
@@ -744,7 +752,7 @@ var Queue = class Queue {
|
|
|
744
752
|
};
|
|
745
753
|
//#endregion
|
|
746
754
|
//#region package.json
|
|
747
|
-
var version = "0.7.
|
|
755
|
+
var version = "0.7.4";
|
|
748
756
|
//#endregion
|
|
749
757
|
//#region \0@oxc-project+runtime@0.139.0/helpers/esm/decorate.js
|
|
750
758
|
function __decorate(decorators, target, key, desc) {
|
|
@@ -844,6 +852,16 @@ var Nil = class Nil {
|
|
|
844
852
|
this.functions.nil_get_remote_worlds(requestId);
|
|
845
853
|
});
|
|
846
854
|
}
|
|
855
|
+
async getRuntimeNumAliveTasks() {
|
|
856
|
+
return this.queue.request((requestId) => {
|
|
857
|
+
this.functions.nil_runtime_num_alive_tasks(requestId);
|
|
858
|
+
});
|
|
859
|
+
}
|
|
860
|
+
async getRuntimeNumWorkers() {
|
|
861
|
+
return this.queue.request((requestId) => {
|
|
862
|
+
this.functions.nil_runtime_num_workers(requestId);
|
|
863
|
+
});
|
|
864
|
+
}
|
|
847
865
|
async getServerAddr() {
|
|
848
866
|
return this.queue.request((requestId) => {
|
|
849
867
|
this.functions.nil_server_addr(requestId);
|
|
@@ -944,6 +962,8 @@ __decorate([ThrowIfClosed], Nil.prototype, "getPlayerStatus", null);
|
|
|
944
962
|
__decorate([ThrowIfClosed], Nil.prototype, "getRemoteWorldLimit", null);
|
|
945
963
|
__decorate([ThrowIfClosed], Nil.prototype, "getRemoteWorldLimitPerUser", null);
|
|
946
964
|
__decorate([ThrowIfClosed], Nil.prototype, "getRemoteWorlds", null);
|
|
965
|
+
__decorate([ThrowIfClosed], Nil.prototype, "getRuntimeNumAliveTasks", null);
|
|
966
|
+
__decorate([ThrowIfClosed], Nil.prototype, "getRuntimeNumWorkers", null);
|
|
947
967
|
__decorate([ThrowIfClosed], Nil.prototype, "getServerAddr", null);
|
|
948
968
|
__decorate([ThrowIfClosed], Nil.prototype, "getServerKind", null);
|
|
949
969
|
__decorate([ThrowIfClosed], Nil.prototype, "getUserAgent", null);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsukilabs/nil-ffi",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"packageManager": "pnpm@11.17.0",
|
|
6
6
|
"license": "AGPL-3.0-only",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@tb-dev/utils": "^8.1.1",
|
|
32
|
-
"@tsukilabs/nil-bindings": "^0.7.
|
|
32
|
+
"@tsukilabs/nil-bindings": "^0.7.3",
|
|
33
33
|
"es-toolkit": "^1.50.0"
|
|
34
34
|
},
|
|
35
35
|
"files": ["dist"],
|