@hotbunny/hackhub-content-sdk 0.9.0 → 0.9.2
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 +187 -173
- package/package.json +8 -4
package/README.md
CHANGED
|
@@ -1,272 +1,281 @@
|
|
|
1
1
|
# @hotbunny/hackhub-content-sdk
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Official modding SDK for [HackHub - Ultimate Hacker Simulator](https://store.steampowered.com/app/2980270/HackHub__Ultimate_Hacker_Simulator/) on Steam. Create custom quests, websites, terminal commands, desktop apps, and more.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Getting Started
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
### Create a New Mod
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
10
|
npm create hackhub-mod
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
The CLI scaffolds a complete mod project with build config, templates, and TypeScript support.
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
### Manual Setup
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
18
|
npm install @hotbunny/hackhub-content-sdk --save-dev
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
##
|
|
21
|
+
## Mod Entry Point
|
|
22
|
+
|
|
23
|
+
Every mod needs a `Bootstrap` class decorated with `@RegisterModPackage`:
|
|
22
24
|
|
|
23
25
|
```typescript
|
|
24
|
-
import {
|
|
25
|
-
Bootstrap,
|
|
26
|
-
Quest,
|
|
27
|
-
Events,
|
|
28
|
-
Network,
|
|
29
|
-
Random,
|
|
30
|
-
RegisterModPackage,
|
|
31
|
-
RegisterQuest,
|
|
32
|
-
} from "@hotbunny/hackhub-content-sdk";
|
|
26
|
+
import { Bootstrap, RegisterModPackage, Storage } from "@hotbunny/hackhub-content-sdk";
|
|
33
27
|
|
|
34
28
|
@RegisterModPackage
|
|
35
|
-
class MyMod extends Bootstrap {
|
|
36
|
-
Settings = [
|
|
37
|
-
{ key: "difficulty", label: "Difficulty", type: "select" as const, default: "normal", options: [
|
|
38
|
-
{ label: "Easy", value: "easy" },
|
|
39
|
-
{ label: "Normal", value: "normal" },
|
|
40
|
-
{ label: "Hard", value: "hard" },
|
|
41
|
-
]},
|
|
42
|
-
{ key: "showHints", label: "Show Hints", type: "toggle" as const, default: true },
|
|
43
|
-
];
|
|
44
|
-
|
|
29
|
+
export default class MyMod extends Bootstrap {
|
|
45
30
|
OnModPackageLoaded() {
|
|
46
|
-
|
|
31
|
+
const difficulty = Storage.get<string>("difficulty");
|
|
32
|
+
console.log(`Loaded with difficulty: ${difficulty}`);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
OnModPackageUnloaded() {
|
|
36
|
+
console.log("Mod unloaded");
|
|
47
37
|
}
|
|
48
38
|
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Quests
|
|
42
|
+
|
|
43
|
+
```typescript
|
|
44
|
+
import { Quest, Network, RegisterQuest } from "@hotbunny/hackhub-content-sdk";
|
|
49
45
|
|
|
50
46
|
@RegisterQuest
|
|
51
|
-
class
|
|
47
|
+
class InfiltrationQuest extends Quest {
|
|
52
48
|
definition = {
|
|
53
|
-
name: "
|
|
54
|
-
title: "
|
|
55
|
-
description: "
|
|
56
|
-
|
|
49
|
+
name: "Infiltration",
|
|
50
|
+
title: "Server Infiltration",
|
|
51
|
+
description: "Hack into the target server and download the data.",
|
|
52
|
+
employer: { name: "Mr. X", avatar: "mrx" },
|
|
53
|
+
rewards: { money: 5000, xp: 200 },
|
|
57
54
|
objectives: [
|
|
58
55
|
{
|
|
59
56
|
name: "scan",
|
|
60
|
-
description: "Scan the target",
|
|
61
|
-
trigger: {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
57
|
+
description: "Scan the target server",
|
|
58
|
+
trigger: { event: "Terminal.NmapScan", condition: (data) => data.ip === this.Data.targetIp },
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: "connect",
|
|
62
|
+
description: "Connect via SSH",
|
|
63
|
+
trigger: { event: "Terminal.SSH.Connected", condition: (data) => data.ip === this.Data.targetIp },
|
|
65
64
|
},
|
|
66
65
|
],
|
|
67
66
|
};
|
|
68
67
|
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
Data = {
|
|
69
|
+
targetIp: "10.0.0.50",
|
|
70
|
+
};
|
|
71
71
|
|
|
72
|
+
OnStart() {
|
|
72
73
|
Network.createSubnetNetwork({
|
|
73
|
-
ip: targetIp,
|
|
74
|
+
ip: this.Data.targetIp,
|
|
74
75
|
type: "ROUTER",
|
|
75
|
-
ports: [{ external:
|
|
76
|
-
users: [Network.createUser({ username: "admin", password:
|
|
76
|
+
ports: [{ external: 22, internal: 22, active: true, service: "ssh" }],
|
|
77
|
+
users: [Network.createUser({ username: "admin", password: "secret123" })],
|
|
77
78
|
children: [],
|
|
78
79
|
});
|
|
79
80
|
}
|
|
80
81
|
}
|
|
81
82
|
```
|
|
82
83
|
|
|
83
|
-
|
|
84
|
+
### Quest Mail & Dialogs
|
|
84
85
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
| Class | Purpose |
|
|
88
|
-
|-------|---------|
|
|
89
|
-
| `Bootstrap` | Mod entry point with lifecycle callbacks, settings, and manifest |
|
|
90
|
-
| `Quest` | Define custom quests with objectives, rewards, mail, and dialogs |
|
|
91
|
-
| `Website` | Add in-game websites to the browser |
|
|
92
|
-
| `Command` | Register custom terminal commands |
|
|
93
|
-
| `App` | Create desktop applications |
|
|
94
|
-
|
|
95
|
-
### API Namespaces
|
|
96
|
-
|
|
97
|
-
| Namespace | Purpose |
|
|
98
|
-
|-----------|---------|
|
|
99
|
-
| `Events` | Listen to 60+ game events, emit custom cross-mod events |
|
|
100
|
-
| `Files` | Create, read, write, delete files in the game filesystem |
|
|
101
|
-
| `Network` | Create networks, manage ports, firewalls, domains |
|
|
102
|
-
| `Mail` | Send in-game emails |
|
|
103
|
-
| `Bank` | Manage bank transactions |
|
|
104
|
-
| `Random` | Random generation helpers (id, uuid, number, password, username, pick, sleep) |
|
|
105
|
-
| `Storage` | Persistent key-value storage (per-mod) |
|
|
106
|
-
| `Variables` | Session-only variables (per-mod, reset on game close) |
|
|
107
|
-
| `SharedStorage` | Persistent storage shared between mods |
|
|
108
|
-
| `SharedVariables` | Session variables shared between mods |
|
|
109
|
-
| `Shell` | Execute terminal commands programmatically |
|
|
110
|
-
| `UI` | Show notifications and toasts |
|
|
111
|
-
| `Twotter` | In-game Twitter -- create users, post tweets |
|
|
112
|
-
| `Kisscord` | In-game Discord -- create users, send messages |
|
|
113
|
-
| `WeeChat` | In-game IRC -- create servers, send messages |
|
|
114
|
-
|
|
115
|
-
### Decorators
|
|
86
|
+
Quests can send in-game emails and start phone call dialogs:
|
|
116
87
|
|
|
117
88
|
```typescript
|
|
118
|
-
@
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
@RegisterCommand // Register a terminal Command
|
|
122
|
-
@RegisterApp // Register a desktop App
|
|
123
|
-
```
|
|
89
|
+
@RegisterQuest
|
|
90
|
+
class StoryQuest extends Quest {
|
|
91
|
+
// ... definition, Data ...
|
|
124
92
|
|
|
125
|
-
|
|
93
|
+
Mails = [
|
|
94
|
+
{ title: "Mission Briefing", content: "Your target is ready. Good luck." },
|
|
95
|
+
];
|
|
126
96
|
|
|
127
|
-
|
|
97
|
+
Dialog = {
|
|
98
|
+
default: [
|
|
99
|
+
{ speaker: "Handler", text: "Are you ready for the mission?", options: [
|
|
100
|
+
{ label: "Yes", text: "I'm ready.", switchBranch: "briefing" },
|
|
101
|
+
{ label: "No", text: "Not yet.", isEnd: true },
|
|
102
|
+
]},
|
|
103
|
+
],
|
|
104
|
+
briefing: [
|
|
105
|
+
{ speaker: "Handler", text: "Good luck out there.", isEnd: true },
|
|
106
|
+
],
|
|
107
|
+
};
|
|
128
108
|
|
|
129
|
-
|
|
109
|
+
OnStart() {
|
|
110
|
+
this.sendMail(0);
|
|
111
|
+
this.createDialog("default");
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
```
|
|
130
115
|
|
|
131
|
-
|
|
116
|
+
## Websites
|
|
132
117
|
|
|
133
118
|
```typescript
|
|
134
|
-
@
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
{ key: "showHints", label: "Show Hints", type: "toggle" as const, default: true },
|
|
143
|
-
{ key: "volume", label: "Volume", type: "slider" as const, default: 50, min: 0, max: 100, step: 5 },
|
|
144
|
-
{ key: "playerName", label: "Player Name", type: "text" as const, default: "Player" },
|
|
145
|
-
];
|
|
119
|
+
import { Website, RegisterWebsite } from "@hotbunny/hackhub-content-sdk";
|
|
120
|
+
|
|
121
|
+
@RegisterWebsite
|
|
122
|
+
class MyWebsite extends Website {
|
|
123
|
+
SiteName = "darkforum";
|
|
124
|
+
DisplayName = "DarkForum";
|
|
125
|
+
Description = "Underground hacking forum";
|
|
126
|
+
HTML = "website.html";
|
|
146
127
|
}
|
|
147
128
|
```
|
|
148
129
|
|
|
149
|
-
|
|
130
|
+
## Terminal Commands
|
|
150
131
|
|
|
151
|
-
|
|
132
|
+
```typescript
|
|
133
|
+
import { Command, RegisterCommand } from "@hotbunny/hackhub-content-sdk";
|
|
134
|
+
|
|
135
|
+
@RegisterCommand
|
|
136
|
+
class PingCommand extends Command {
|
|
137
|
+
CommandName = "myping";
|
|
138
|
+
Description = "Custom ping command";
|
|
152
139
|
|
|
153
|
-
|
|
140
|
+
OnCommand(args: string[], tools: any) {
|
|
141
|
+
tools.println(`Pinging ${args[0] || "nowhere"}...`);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
```
|
|
154
145
|
|
|
155
|
-
|
|
146
|
+
## Desktop Apps
|
|
156
147
|
|
|
157
148
|
```typescript
|
|
158
|
-
@
|
|
159
|
-
|
|
160
|
-
|
|
149
|
+
import { App, RegisterApp } from "@hotbunny/hackhub-content-sdk";
|
|
150
|
+
|
|
151
|
+
@RegisterApp
|
|
152
|
+
class MyApp extends App {
|
|
153
|
+
AppName = "mytool";
|
|
154
|
+
DisplayName = "My Tool";
|
|
155
|
+
Description = "A custom desktop application";
|
|
156
|
+
HTML = "app.html";
|
|
157
|
+
Size = { width: 600, height: 400 };
|
|
161
158
|
}
|
|
162
159
|
```
|
|
163
160
|
|
|
164
|
-
|
|
161
|
+
## Mod Settings
|
|
165
162
|
|
|
166
|
-
|
|
163
|
+
Players can configure your mod from the in-game Mods menu. Settings values are accessible via `Storage.get(key)`.
|
|
167
164
|
|
|
168
165
|
```typescript
|
|
169
|
-
import {
|
|
166
|
+
import { Bootstrap, ModSettingDefinition, RegisterModPackage, Storage } from "@hotbunny/hackhub-content-sdk";
|
|
170
167
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
168
|
+
@RegisterModPackage
|
|
169
|
+
export default class MyMod extends Bootstrap {
|
|
170
|
+
Settings: ModSettingDefinition[] = [
|
|
171
|
+
{
|
|
172
|
+
key: "difficulty",
|
|
173
|
+
label: "Difficulty",
|
|
174
|
+
type: "select",
|
|
175
|
+
default: "normal",
|
|
176
|
+
options: [
|
|
177
|
+
{ label: "Easy", value: "easy" },
|
|
178
|
+
{ label: "Normal", value: "normal" },
|
|
179
|
+
{ label: "Hard", value: "hard" },
|
|
180
|
+
],
|
|
181
|
+
},
|
|
182
|
+
{ key: "showHints", label: "Show Hints", type: "toggle", default: true },
|
|
183
|
+
{ key: "maxEnemies", label: "Max Enemies", type: "slider", default: 5, min: 1, max: 20 },
|
|
184
|
+
];
|
|
185
|
+
|
|
186
|
+
OnModPackageLoaded() {
|
|
187
|
+
const difficulty = Storage.get<string>("difficulty");
|
|
188
|
+
const hints = Storage.get<boolean>("showHints");
|
|
189
|
+
console.log(`Difficulty: ${difficulty}, Hints: ${hints}`);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
179
192
|
```
|
|
180
193
|
|
|
181
|
-
|
|
194
|
+
Available setting types: `toggle`, `select`, `text`, `number`, `slider`.
|
|
182
195
|
|
|
183
|
-
|
|
196
|
+
For fully custom settings panels, use an HTML file rendered in iframe:
|
|
184
197
|
|
|
185
198
|
```typescript
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
199
|
+
@RegisterModPackage
|
|
200
|
+
export default class MyMod extends Bootstrap {
|
|
201
|
+
SettingsHTML = "settings.html";
|
|
202
|
+
}
|
|
203
|
+
```
|
|
189
204
|
|
|
190
|
-
|
|
191
|
-
console.log("Player opened Bettercap");
|
|
192
|
-
});
|
|
205
|
+
## API Reference
|
|
193
206
|
|
|
194
|
-
|
|
195
|
-
console.log(`Process ${data.name} was killed`);
|
|
196
|
-
});
|
|
197
|
-
```
|
|
207
|
+
### Namespaces
|
|
198
208
|
|
|
199
|
-
|
|
209
|
+
| Namespace | Purpose |
|
|
210
|
+
|-----------|---------|
|
|
211
|
+
| `Events` | Listen to 60+ game events, emit custom events |
|
|
212
|
+
| `Files` | Create, read, write, delete in-game files |
|
|
213
|
+
| `Network` | Create networks, ports, firewalls, domains |
|
|
214
|
+
| `Mail` | Send in-game emails |
|
|
215
|
+
| `Bank` | Bank accounts and transactions |
|
|
216
|
+
| `Random` | Random generation (id, password, username, pick, etc.) |
|
|
217
|
+
| `Storage` | Persistent key-value storage per mod |
|
|
218
|
+
| `Variables` | Session-only variables (reset on game close) |
|
|
219
|
+
| `SharedStorage` | Persistent storage shared between mods |
|
|
220
|
+
| `SharedVariables` | Session variables shared between mods |
|
|
221
|
+
| `Shell` | Execute terminal commands programmatically |
|
|
222
|
+
| `UI` | Notifications and toasts |
|
|
223
|
+
| `Twotter` | In-game social media (Twitter-like) |
|
|
224
|
+
| `Kisscord` | In-game messaging (Discord-like) |
|
|
225
|
+
| `WeeChat` | In-game IRC chat |
|
|
200
226
|
|
|
201
|
-
|
|
202
|
-
declare module "@hotbunny/hackhub-content-sdk" {
|
|
203
|
-
interface ModEventMap {
|
|
204
|
-
"MyMod.BossDefeated": { bossName: string; reward: number };
|
|
205
|
-
}
|
|
206
|
-
}
|
|
227
|
+
### Random
|
|
207
228
|
|
|
208
|
-
|
|
209
|
-
|
|
229
|
+
```typescript
|
|
230
|
+
import { Random } from "@hotbunny/hackhub-content-sdk";
|
|
210
231
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
232
|
+
Random.id(); // Short unique ID
|
|
233
|
+
Random.uuid(); // UUID v4
|
|
234
|
+
Random.number(1, 100); // Random integer 1-100
|
|
235
|
+
Random.password(); // Random password
|
|
236
|
+
Random.username(); // Random username
|
|
237
|
+
Random.pick(["a", "b", "c"]); // Random array element
|
|
238
|
+
Random.pickMultiple(arr, 3); // 3 unique random elements
|
|
239
|
+
await Random.sleep(2000); // Wait 2 seconds
|
|
214
240
|
```
|
|
215
241
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
Quests can send in-game emails and start phone call dialogs:
|
|
242
|
+
### Events
|
|
219
243
|
|
|
220
244
|
```typescript
|
|
221
|
-
@
|
|
222
|
-
class MyQuest extends Quest {
|
|
223
|
-
Mails = [
|
|
224
|
-
{ title: "Mission Briefing", content: "Your target is...", replyable: false },
|
|
225
|
-
];
|
|
245
|
+
import { Events } from "@hotbunny/hackhub-content-sdk";
|
|
226
246
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
{ label: "No", text: "Not yet.", isEnd: true },
|
|
232
|
-
]},
|
|
233
|
-
],
|
|
234
|
-
briefing: [
|
|
235
|
-
{ speaker: "Handler", text: "Good luck.", isEnd: true },
|
|
236
|
-
],
|
|
237
|
-
};
|
|
247
|
+
// Listen to game events
|
|
248
|
+
Events.on("Terminal.NmapScan", (data) => console.log(`Scanned ${data.ip}`));
|
|
249
|
+
Events.on("Bettercap.Open", () => console.log("Bettercap opened"));
|
|
250
|
+
Events.on("Process.Killed", (data) => console.log(`Killed ${data.name}`));
|
|
238
251
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
}
|
|
243
|
-
}
|
|
252
|
+
// Custom cross-mod events
|
|
253
|
+
Events.emit("MyMod.ScoreUpdated", { score: 100 });
|
|
254
|
+
Events.on("MyMod.ScoreUpdated", (data) => console.log(data.score));
|
|
244
255
|
```
|
|
245
256
|
|
|
246
257
|
## Manifest
|
|
247
258
|
|
|
248
|
-
Each mod requires a `manifest.json
|
|
259
|
+
Each mod requires a `manifest.json` in its root:
|
|
249
260
|
|
|
250
261
|
```json
|
|
251
262
|
{
|
|
252
|
-
"id": "my-
|
|
263
|
+
"id": "my-mod-id",
|
|
253
264
|
"name": "My Mod",
|
|
254
265
|
"version": "1.0.0",
|
|
255
266
|
"author": "Your Name",
|
|
256
|
-
"description": "
|
|
267
|
+
"description": "A brief description of the mod",
|
|
257
268
|
"apiVersion": 1,
|
|
258
269
|
"permissions": ["filesystem", "network", "events"],
|
|
259
270
|
"cover": "cover.png",
|
|
260
|
-
"tags": ["quest", "network"]
|
|
261
|
-
"dependencies": [],
|
|
262
|
-
"workshopId": ""
|
|
271
|
+
"tags": ["quest", "network"]
|
|
263
272
|
}
|
|
264
273
|
```
|
|
265
274
|
|
|
266
275
|
### Permissions
|
|
267
276
|
|
|
268
|
-
| Permission |
|
|
269
|
-
|
|
277
|
+
| Permission | Grants access to |
|
|
278
|
+
|------------|-----------------|
|
|
270
279
|
| `filesystem` | Files API |
|
|
271
280
|
| `network` | Network API |
|
|
272
281
|
| `events` | Events API |
|
|
@@ -277,11 +286,16 @@ Each mod requires a `manifest.json`:
|
|
|
277
286
|
|
|
278
287
|
## Steam Workshop
|
|
279
288
|
|
|
280
|
-
Mods
|
|
289
|
+
Mods support Steam Workshop for easy distribution:
|
|
290
|
+
|
|
291
|
+
- **Upload** local mods to Workshop from the in-game Mods menu
|
|
292
|
+
- **Subscribe** to mods on Workshop -- they're automatically downloaded and loaded
|
|
293
|
+
- **Update** published mods with change notes
|
|
294
|
+
|
|
295
|
+
## Links
|
|
281
296
|
|
|
282
|
-
-
|
|
283
|
-
-
|
|
284
|
-
- **Auto-discovery**: Subscribed Workshop mods are automatically loaded on game start
|
|
297
|
+
- [HackHub - Ultimate Hacker Simulator on Steam](https://store.steampowered.com/app/2980270/HackHub__Ultimate_Hacker_Simulator/)
|
|
298
|
+
- [Steam Workshop](https://steamcommunity.com/app/2980270/workshop/)
|
|
285
299
|
|
|
286
300
|
## License
|
|
287
301
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hotbunny/hackhub-content-sdk",
|
|
3
|
-
"version": "0.9.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.9.2",
|
|
4
|
+
"description": "Official modding SDK for HackHub - Ultimate Hacker Simulator on Steam. Create custom quests, websites, terminal commands, and desktop apps.",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
@@ -19,10 +19,14 @@
|
|
|
19
19
|
],
|
|
20
20
|
"keywords": [
|
|
21
21
|
"hackhub",
|
|
22
|
+
"hacker-simulator",
|
|
23
|
+
"hacking-game",
|
|
24
|
+
"steam",
|
|
22
25
|
"modding",
|
|
23
|
-
"sdk",
|
|
24
|
-
"types",
|
|
26
|
+
"modding-sdk",
|
|
25
27
|
"game-modding",
|
|
28
|
+
"steam-workshop",
|
|
29
|
+
"typescript",
|
|
26
30
|
"hotbunny"
|
|
27
31
|
],
|
|
28
32
|
"repository": {
|