@hotbunny/hackhub-content-sdk 0.9.6 → 0.9.7
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 +23 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 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
|
|
|
@@ -27,6 +27,7 @@ import { Bootstrap, RegisterModPackage } from "@hotbunny/hackhub-content-sdk";
|
|
|
27
27
|
|
|
28
28
|
@RegisterModPackage
|
|
29
29
|
export default class MyMod extends Bootstrap {
|
|
30
|
+
|
|
30
31
|
OnModPackageLoaded() {
|
|
31
32
|
console.log("Mod loaded!");
|
|
32
33
|
}
|
|
@@ -34,6 +35,7 @@ export default class MyMod extends Bootstrap {
|
|
|
34
35
|
OnModPackageUnloaded() {
|
|
35
36
|
console.log("Mod unloaded");
|
|
36
37
|
}
|
|
38
|
+
|
|
37
39
|
}
|
|
38
40
|
```
|
|
39
41
|
|
|
@@ -51,10 +53,10 @@ interface InfiltrationData {
|
|
|
51
53
|
|
|
52
54
|
@RegisterQuest
|
|
53
55
|
class InfiltrationQuest extends Quest<InfiltrationData> {
|
|
56
|
+
|
|
54
57
|
Name = "Infiltration";
|
|
55
58
|
Title = "Server Infiltration";
|
|
56
59
|
Description = "Hack into the target server and download the data.";
|
|
57
|
-
Employer = { name: "Mr. X", avatar: "mrx" };
|
|
58
60
|
Rewards = { money: 5000, xp: 200 };
|
|
59
61
|
Objectives = [
|
|
60
62
|
{ name: "scan", description: "Scan the target server" },
|
|
@@ -74,18 +76,16 @@ class InfiltrationQuest extends Quest<InfiltrationData> {
|
|
|
74
76
|
|
|
75
77
|
OnStart() {
|
|
76
78
|
Network.createSubnetNetwork({
|
|
77
|
-
ip: this.Data.targetIp,
|
|
79
|
+
ip: this.Data.targetIp,
|
|
78
80
|
type: "ROUTER",
|
|
79
81
|
ports: [{ external: 22, internal: 22, active: true, service: "ssh" }],
|
|
80
82
|
users: [Network.createUser({ username: "admin", password: "secret123" })],
|
|
81
83
|
children: [],
|
|
82
84
|
});
|
|
83
85
|
|
|
84
|
-
// Use this.Events.on() — listeners are automatically cleaned up
|
|
85
|
-
// when the quest completes or is abandoned. No memory leaks!
|
|
86
86
|
this.Events.on("Terminal.NmapScan", (data) => {
|
|
87
87
|
if (data.ip === this.Data.targetIp) {
|
|
88
|
-
this.SetData("attempts", this.Data.attempts + 1);
|
|
88
|
+
this.SetData("attempts", this.Data.attempts + 1);
|
|
89
89
|
this.completeObjective("scan");
|
|
90
90
|
}
|
|
91
91
|
});
|
|
@@ -98,6 +98,7 @@ class InfiltrationQuest extends Quest<InfiltrationData> {
|
|
|
98
98
|
OnComplete() {
|
|
99
99
|
Network.destroyNetwork(this.Data.targetIp);
|
|
100
100
|
}
|
|
101
|
+
|
|
101
102
|
}
|
|
102
103
|
```
|
|
103
104
|
|
|
@@ -108,14 +109,11 @@ Quests can send in-game emails and start phone call dialogs:
|
|
|
108
109
|
```typescript
|
|
109
110
|
@RegisterQuest
|
|
110
111
|
class StoryQuest extends Quest<{ contacted: boolean }> {
|
|
112
|
+
|
|
111
113
|
Name = "StoryQuest";
|
|
112
114
|
Title = "Story Quest";
|
|
113
115
|
Objectives = [{ name: "start", description: "Begin the mission" }];
|
|
114
116
|
|
|
115
|
-
CreateData() {
|
|
116
|
-
return { contacted: false };
|
|
117
|
-
}
|
|
118
|
-
|
|
119
117
|
Mails = [
|
|
120
118
|
{ title: "Mission Briefing", content: "Your target is ready. Good luck." },
|
|
121
119
|
];
|
|
@@ -132,10 +130,15 @@ class StoryQuest extends Quest<{ contacted: boolean }> {
|
|
|
132
130
|
],
|
|
133
131
|
};
|
|
134
132
|
|
|
133
|
+
CreateData() {
|
|
134
|
+
return { contacted: false };
|
|
135
|
+
}
|
|
136
|
+
|
|
135
137
|
OnStart() {
|
|
136
138
|
this.sendMail(0);
|
|
137
139
|
this.createDialog("default");
|
|
138
140
|
}
|
|
141
|
+
|
|
139
142
|
}
|
|
140
143
|
```
|
|
141
144
|
|
|
@@ -146,10 +149,12 @@ import { Website, RegisterWebsite } from "@hotbunny/hackhub-content-sdk";
|
|
|
146
149
|
|
|
147
150
|
@RegisterWebsite
|
|
148
151
|
class MyWebsite extends Website {
|
|
152
|
+
|
|
149
153
|
SiteName = "darkforum";
|
|
150
154
|
DisplayName = "DarkForum";
|
|
151
155
|
Description = "Underground hacking forum";
|
|
152
156
|
HTML = "website.html";
|
|
157
|
+
|
|
153
158
|
}
|
|
154
159
|
```
|
|
155
160
|
|
|
@@ -160,12 +165,14 @@ import { Command, RegisterCommand } from "@hotbunny/hackhub-content-sdk";
|
|
|
160
165
|
|
|
161
166
|
@RegisterCommand
|
|
162
167
|
class PingCommand extends Command {
|
|
168
|
+
|
|
163
169
|
CommandName = "myping";
|
|
164
170
|
Description = "Custom ping command";
|
|
165
171
|
|
|
166
172
|
OnCommand(args: string[], tools: any) {
|
|
167
173
|
tools.println(`Pinging ${args[0] || "nowhere"}...`);
|
|
168
174
|
}
|
|
175
|
+
|
|
169
176
|
}
|
|
170
177
|
```
|
|
171
178
|
|
|
@@ -176,11 +183,13 @@ import { App, RegisterApp } from "@hotbunny/hackhub-content-sdk";
|
|
|
176
183
|
|
|
177
184
|
@RegisterApp
|
|
178
185
|
class MyApp extends App {
|
|
186
|
+
|
|
179
187
|
AppName = "mytool";
|
|
180
188
|
DisplayName = "My Tool";
|
|
181
189
|
Description = "A custom desktop application";
|
|
182
190
|
HTML = "app.html";
|
|
183
191
|
Size = { width: 600, height: 400 };
|
|
192
|
+
|
|
184
193
|
}
|
|
185
194
|
```
|
|
186
195
|
|
|
@@ -193,6 +202,7 @@ import { Bootstrap, ModSettingDefinition, ModSettings, RegisterModPackage } from
|
|
|
193
202
|
|
|
194
203
|
@RegisterModPackage
|
|
195
204
|
export default class MyMod extends Bootstrap {
|
|
205
|
+
|
|
196
206
|
Settings: ModSettingDefinition[] = [
|
|
197
207
|
{
|
|
198
208
|
key: "difficulty",
|
|
@@ -214,6 +224,7 @@ export default class MyMod extends Bootstrap {
|
|
|
214
224
|
const hints = ModSettings.get<boolean>("showHints");
|
|
215
225
|
console.log(`Difficulty: ${difficulty}, Hints: ${hints}`);
|
|
216
226
|
}
|
|
227
|
+
|
|
217
228
|
}
|
|
218
229
|
```
|
|
219
230
|
|
|
@@ -224,7 +235,9 @@ For fully custom settings panels, use an HTML file rendered in iframe:
|
|
|
224
235
|
```typescript
|
|
225
236
|
@RegisterModPackage
|
|
226
237
|
export default class MyMod extends Bootstrap {
|
|
238
|
+
|
|
227
239
|
SettingsHTML = "settings.html";
|
|
240
|
+
|
|
228
241
|
}
|
|
229
242
|
```
|
|
230
243
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hotbunny/hackhub-content-sdk",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.7",
|
|
4
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": {
|