@s2script/sdk 0.11.0 → 0.13.0
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/README.md +53 -0
- package/commands.d.ts +19 -0
- package/dist/cli.js +3836 -370
- package/package.json +3 -2
- package/plugin.d.ts +11 -0
- package/sound.d.ts +17 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@s2script/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"license": "MIT OR Apache-2.0",
|
|
5
5
|
"description": "s2script SDK — the builtin capability types (imported as @s2script/sdk/entity, …) plus the `s2s` CLI for building Source 2 / CS2 plugins.",
|
|
6
6
|
"type": "module",
|
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@clack/prompts": "^1.7.0",
|
|
23
|
-
"fflate": "^0.8.2"
|
|
23
|
+
"fflate": "^0.8.2",
|
|
24
|
+
"semver": "^7.8.5"
|
|
24
25
|
},
|
|
25
26
|
"publishConfig": {
|
|
26
27
|
"access": "public"
|
package/plugin.d.ts
CHANGED
|
@@ -91,6 +91,17 @@ export interface CtxCommands {
|
|
|
91
91
|
registerServer(name: string, handler: (cmd: CommandInvocation) => void): void;
|
|
92
92
|
/** Register an admin command gated by `flags` (an `ADMFLAG` bitmask; fail-safe default-deny). */
|
|
93
93
|
registerAdmin(name: string, flags: number, handler: (cmd: CommandInvocation) => void): void;
|
|
94
|
+
/**
|
|
95
|
+
* Observe an existing CLIENT command by name — SourceMod's `AddCommandListener`.
|
|
96
|
+
*
|
|
97
|
+
* For engine-owned commands (`player_ping`, `jointeam`, `drop`), which {@link register} cannot
|
|
98
|
+
* claim. Observe-by-default: the engine still handles it unless the handler returns
|
|
99
|
+
* `>= HookResult.Handled`. Unsubscribed automatically when the plugin unloads.
|
|
100
|
+
*/
|
|
101
|
+
onClientCommand(
|
|
102
|
+
name: string,
|
|
103
|
+
handler: (slot: number, argString: string) => HookResultValue | void,
|
|
104
|
+
): void;
|
|
94
105
|
}
|
|
95
106
|
/** Config live-reload subscription on this plugin's load-scope ({@link PluginContext.config}). */
|
|
96
107
|
export interface CtxConfig {
|
package/sound.d.ts
CHANGED
|
@@ -18,8 +18,23 @@ export interface SoundEmitOptions {
|
|
|
18
18
|
* only: a stashed context used after the handler returns (or past an await) is a no-op `false`
|
|
19
19
|
* (the engine manifest is gone). */
|
|
20
20
|
export interface PrecacheContext {
|
|
21
|
-
/**
|
|
22
|
-
*
|
|
21
|
+
/**
|
|
22
|
+
* Add a resource path to the game session manifest — a soundevents file, a model, a particle.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* pc.add("soundevents/mypack.vsndevts");
|
|
26
|
+
* pc.add("models/props/cs_office/microwave.vmdl");
|
|
27
|
+
*
|
|
28
|
+
* Returns true iff the engine ACCEPTED the string, which is not the same as the resource existing
|
|
29
|
+
* or being loadable: it returns true for a path with no file behind it too. A model that was never
|
|
30
|
+
* really there still spawns as the pink-and-black ERROR box, and the engine only says so later, at
|
|
31
|
+
* spawn time, with "requested but is not in the system (Missing from a manifest?)". Treat a `false`
|
|
32
|
+
* as fatal and a `true` as "not rejected".
|
|
33
|
+
*
|
|
34
|
+
* TIMING: the manifest is built once per map, before plugins that load later exist. A plugin loaded
|
|
35
|
+
* AFTER that point — including on the boot map of a fresh server start — misses that map's
|
|
36
|
+
* precache, and its resources stay unusable until the next map change.
|
|
37
|
+
*/
|
|
23
38
|
add(path: string): boolean;
|
|
24
39
|
}
|
|
25
40
|
|