@takaro/modules 0.0.1 → 0.0.5
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/BuiltinModule.js +0 -4
- package/dist/BuiltinModule.js.map +1 -1
- package/dist/community-modules.json +21 -0
- package/dist/dto/gameEvents.d.ts +3 -2
- package/dist/dto/gameEvents.js +1 -0
- package/dist/dto/gameEvents.js.map +1 -1
- package/dist/dto/index.d.ts +6 -0
- package/dist/dto/takaroEvents.d.ts +46 -0
- package/dist/dto/takaroEvents.js +129 -1
- package/dist/dto/takaroEvents.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/modules/chatBridge/hooks/GameToDiscord.js +1 -1
- package/dist/modules/chatBridge/hooks/GameToDiscord.js.map +1 -1
- package/dist/modules/chatBridge/hooks/PlayerConnected.js +2 -2
- package/dist/modules/chatBridge/hooks/PlayerConnected.js.map +1 -1
- package/dist/modules/chatBridge/hooks/PlayerDisconnected.js +1 -1
- package/dist/modules/chatBridge/hooks/PlayerDisconnected.js.map +1 -1
- package/dist/modules/economyUtils/commands/transfer.js +1 -1
- package/dist/modules/economyUtils/commands/transfer.js.map +1 -1
- package/dist/modules/geoBlock/hooks/IPDetected.js +3 -5
- package/dist/modules/geoBlock/hooks/IPDetected.js.map +1 -1
- package/dist/modules/geoBlock/index.js +1 -1
- package/dist/modules/geoBlock/index.js.map +1 -1
- package/dist/modules/gimme/commands/gimme.js +1 -0
- package/dist/modules/gimme/commands/gimme.js.map +1 -1
- package/dist/modules/lottery/commands/nextDraw.js +1 -1
- package/dist/modules/lottery/commands/nextDraw.js.map +1 -1
- package/dist/modules/playerOnboarding/index.js.map +1 -1
- package/dist/modules/teleports/commands/deletetp.js +1 -1
- package/dist/modules/teleports/commands/deletetp.js.map +1 -1
- package/dist/modules/teleports/commands/setprivate.js +4 -6
- package/dist/modules/teleports/commands/setprivate.js.map +1 -1
- package/dist/modules/teleports/commands/setpublic.js +8 -15
- package/dist/modules/teleports/commands/setpublic.js.map +1 -1
- package/dist/modules/teleports/commands/settp.js +2 -2
- package/dist/modules/teleports/commands/settp.js.map +1 -1
- package/dist/modules/teleports/commands/teleport.js +3 -8
- package/dist/modules/teleports/commands/teleport.js.map +1 -1
- package/dist/modules/teleports/commands/teleportwaypoint.js +9 -1
- package/dist/modules/teleports/commands/teleportwaypoint.js.map +1 -1
- package/dist/modules/teleports/commands/tplist.js +13 -12
- package/dist/modules/teleports/commands/tplist.js.map +1 -1
- package/dist/modules/teleports/functions/utils.d.ts +2 -2
- package/dist/modules/teleports/functions/utils.js +21 -3
- package/dist/modules/teleports/functions/utils.js.map +1 -1
- package/dist/modules.json +99 -79
- package/package.json +4 -8
- package/scripts/buildBuiltinJson.ts +20 -0
- package/src/BuiltinModule.ts +1 -1
- package/src/__tests__/aliases.integration.test.ts +6 -7
- package/src/__tests__/bugRepros.integration.test.ts +72 -0
- package/src/__tests__/commandArgs.integration.test.ts +24 -25
- package/src/__tests__/economyUtils.integration.test.ts +66 -60
- package/src/__tests__/geoblock.integration.test.ts +22 -65
- package/src/__tests__/gimme.integration.test.ts +35 -36
- package/src/__tests__/help.integration.test.ts +47 -35
- package/src/__tests__/lottery.integration.test.ts +32 -28
- package/src/__tests__/modulePermission.integration.test.ts +24 -18
- package/src/__tests__/onboarding.integration.test.ts +13 -14
- package/src/__tests__/ping.integration.test.ts +5 -6
- package/src/__tests__/roleExpiry.integration.test.ts +9 -10
- package/src/__tests__/serverMessages.integration.test.ts +14 -12
- package/src/__tests__/systemConfigCost.integration.test.ts +14 -15
- package/src/__tests__/teleports/listtp.integration.test.ts +98 -22
- package/src/__tests__/teleports/publicteleports.integration.test.ts +55 -48
- package/src/__tests__/teleports/teleport.integration.test.ts +17 -16
- package/src/__tests__/teleports/tpManagement.integration.test.ts +26 -27
- package/src/__tests__/teleports/waypoints.integration.test.ts +113 -82
- package/src/community-modules/README.md +5 -0
- package/src/community-modules/modules/vote.json +19 -0
- package/src/dto/gameEvents.ts +2 -2
- package/src/dto/takaroEvents.ts +79 -0
- package/src/main.ts +2 -3
- package/src/modules/chatBridge/hooks/GameToDiscord.js +1 -1
- package/src/modules/chatBridge/hooks/PlayerConnected.js +2 -2
- package/src/modules/chatBridge/hooks/PlayerDisconnected.js +1 -1
- package/src/modules/chatBridge/index.ts +1 -1
- package/src/modules/economyUtils/commands/transfer.js +4 -4
- package/src/modules/economyUtils/index.ts +1 -1
- package/src/modules/geoBlock/hooks/IPDetected.js +3 -4
- package/src/modules/geoBlock/index.ts +2 -2
- package/src/modules/gimme/commands/gimme.js +2 -1
- package/src/modules/gimme/index.ts +1 -1
- package/src/modules/highPingKicker/index.ts +1 -1
- package/src/modules/lottery/commands/nextDraw.js +3 -1
- package/src/modules/lottery/index.ts +1 -1
- package/src/modules/playerOnboarding/index.ts +2 -1
- package/src/modules/serverMessages/index.ts +1 -1
- package/src/modules/teleports/commands/deletetp.js +1 -1
- package/src/modules/teleports/commands/setprivate.js +6 -6
- package/src/modules/teleports/commands/setpublic.js +18 -25
- package/src/modules/teleports/commands/settp.js +2 -2
- package/src/modules/teleports/commands/teleport.js +3 -10
- package/src/modules/teleports/commands/teleportwaypoint.js +12 -1
- package/src/modules/teleports/commands/tplist.js +16 -15
- package/src/modules/teleports/functions/utils.js +19 -3
- package/src/modules/teleports/index.ts +1 -1
- package/src/modules/utils/index.ts +1 -1
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import {
|
|
2
|
+
IntegrationTest,
|
|
3
|
+
expect,
|
|
4
|
+
integrationConfig,
|
|
5
|
+
IModuleTestsSetupData,
|
|
6
|
+
modulesTestSetup,
|
|
7
|
+
EventsAwaiter,
|
|
8
|
+
} from '@takaro/test';
|
|
9
|
+
import { GameEvents, HookEvents } from '../../dto/index.js';
|
|
4
10
|
import { GameServerTypesOutputDTOTypeEnum, PlayerOutputDTO, RoleOutputDTO } from '@takaro/apiclient';
|
|
5
11
|
|
|
6
12
|
const group = 'Teleports - waypoints';
|
|
@@ -22,7 +28,7 @@ const waypointsSetup = async function (this: IntegrationTest<WaypointsSetup>): P
|
|
|
22
28
|
await Promise.all(
|
|
23
29
|
playersRes.data.data.map(async (player) => {
|
|
24
30
|
await this.client.player.playerControllerRemoveRole(player.id, setupData.role.id);
|
|
25
|
-
})
|
|
31
|
+
}),
|
|
26
32
|
);
|
|
27
33
|
|
|
28
34
|
const manageWaypointsPermission = await this.client.permissionCodesToInputs(['TELEPORTS_MANAGE_WAYPOINTS']);
|
|
@@ -61,10 +67,13 @@ async function setupSecondServer() {
|
|
|
61
67
|
|
|
62
68
|
await this.client.gameserver.gameServerControllerInstallModule(
|
|
63
69
|
newGameServer.data.data.id,
|
|
64
|
-
this.setupData.teleportsModule.id
|
|
70
|
+
this.setupData.teleportsModule.id,
|
|
65
71
|
);
|
|
66
72
|
|
|
67
|
-
const connectedEvents = this.
|
|
73
|
+
const connectedEvents = (await new EventsAwaiter().connect(this.client)).waitForEvents(
|
|
74
|
+
GameEvents.PLAYER_CONNECTED,
|
|
75
|
+
5,
|
|
76
|
+
);
|
|
68
77
|
|
|
69
78
|
await this.client.gameserver.gameServerControllerExecuteCommand(newGameServer.data.data.id, {
|
|
70
79
|
command: 'connectAll',
|
|
@@ -82,7 +91,7 @@ async function setupSecondServer() {
|
|
|
82
91
|
|
|
83
92
|
await this.client.player.playerControllerAssignRole(
|
|
84
93
|
newServerModerator.playerId,
|
|
85
|
-
this.setupData.manageWaypointsRole.id
|
|
94
|
+
this.setupData.manageWaypointsRole.id,
|
|
86
95
|
);
|
|
87
96
|
|
|
88
97
|
return {
|
|
@@ -99,7 +108,7 @@ const tests = [
|
|
|
99
108
|
setup: waypointsSetup,
|
|
100
109
|
name: 'Can create a waypoint with /setwaypoint',
|
|
101
110
|
test: async function () {
|
|
102
|
-
const events = this.
|
|
111
|
+
const events = (await new EventsAwaiter().connect(this.client)).waitForEvents(GameEvents.CHAT_MESSAGE);
|
|
103
112
|
|
|
104
113
|
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
105
114
|
msg: '/setwaypoint A',
|
|
@@ -107,7 +116,7 @@ const tests = [
|
|
|
107
116
|
});
|
|
108
117
|
|
|
109
118
|
expect((await events).length).to.be.eq(1);
|
|
110
|
-
expect((await events)[0].data.msg).to.be.eq('Waypoint A set.');
|
|
119
|
+
expect((await events)[0].data.meta.msg).to.be.eq('Waypoint A set.');
|
|
111
120
|
},
|
|
112
121
|
}),
|
|
113
122
|
new IntegrationTest<WaypointsSetup>({
|
|
@@ -116,7 +125,7 @@ const tests = [
|
|
|
116
125
|
setup: waypointsSetup,
|
|
117
126
|
name: 'Errors when creating duplicate waypoints',
|
|
118
127
|
test: async function () {
|
|
119
|
-
const firstEvents = this.
|
|
128
|
+
const firstEvents = (await new EventsAwaiter().connect(this.client)).waitForEvents(GameEvents.CHAT_MESSAGE, 1);
|
|
120
129
|
|
|
121
130
|
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
122
131
|
msg: '/setwaypoint A',
|
|
@@ -124,9 +133,9 @@ const tests = [
|
|
|
124
133
|
});
|
|
125
134
|
|
|
126
135
|
expect((await firstEvents).length).to.be.eq(1);
|
|
127
|
-
expect((await firstEvents)[0].data.msg).to.be.eq('Waypoint A set.');
|
|
136
|
+
expect((await firstEvents)[0].data.meta.msg).to.be.eq('Waypoint A set.');
|
|
128
137
|
|
|
129
|
-
const secondEvents = this.
|
|
138
|
+
const secondEvents = (await new EventsAwaiter().connect(this.client)).waitForEvents(GameEvents.CHAT_MESSAGE, 1);
|
|
130
139
|
|
|
131
140
|
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
132
141
|
msg: '/setwaypoint A',
|
|
@@ -134,7 +143,7 @@ const tests = [
|
|
|
134
143
|
});
|
|
135
144
|
|
|
136
145
|
expect((await secondEvents).length).to.be.eq(1);
|
|
137
|
-
expect((await secondEvents)[0].data.msg).to.be.eq('Waypoint A already exists.');
|
|
146
|
+
expect((await secondEvents)[0].data.meta.msg).to.be.eq('Waypoint A already exists.');
|
|
138
147
|
},
|
|
139
148
|
}),
|
|
140
149
|
new IntegrationTest<WaypointsSetup>({
|
|
@@ -143,7 +152,7 @@ const tests = [
|
|
|
143
152
|
setup: waypointsSetup,
|
|
144
153
|
name: '/setwaypoint requires TELEPORTS_MANAGE_WAYPOINTS permission',
|
|
145
154
|
test: async function () {
|
|
146
|
-
const firstEvents = this.
|
|
155
|
+
const firstEvents = (await new EventsAwaiter().connect(this.client)).waitForEvents(GameEvents.CHAT_MESSAGE, 1);
|
|
147
156
|
|
|
148
157
|
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
149
158
|
msg: '/setwaypoint A',
|
|
@@ -151,14 +160,14 @@ const tests = [
|
|
|
151
160
|
});
|
|
152
161
|
|
|
153
162
|
expect((await firstEvents).length).to.be.eq(1);
|
|
154
|
-
expect((await firstEvents)[0].data.msg).to.be.eq('You do not have permission to manage waypoints.');
|
|
163
|
+
expect((await firstEvents)[0].data.meta.msg).to.be.eq('You do not have permission to manage waypoints.');
|
|
155
164
|
|
|
156
165
|
await this.client.player.playerControllerAssignRole(
|
|
157
166
|
this.setupData.player.id,
|
|
158
|
-
this.setupData.manageWaypointsRole.id
|
|
167
|
+
this.setupData.manageWaypointsRole.id,
|
|
159
168
|
);
|
|
160
169
|
|
|
161
|
-
const secondEvents = this.
|
|
170
|
+
const secondEvents = (await new EventsAwaiter().connect(this.client)).waitForEvents(GameEvents.CHAT_MESSAGE, 1);
|
|
162
171
|
|
|
163
172
|
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
164
173
|
msg: '/setwaypoint A',
|
|
@@ -166,7 +175,7 @@ const tests = [
|
|
|
166
175
|
});
|
|
167
176
|
|
|
168
177
|
expect((await secondEvents).length).to.be.eq(1);
|
|
169
|
-
expect((await secondEvents)[0].data.msg).to.be.eq('Waypoint A set.');
|
|
178
|
+
expect((await secondEvents)[0].data.meta.msg).to.be.eq('Waypoint A set.');
|
|
170
179
|
},
|
|
171
180
|
}),
|
|
172
181
|
new IntegrationTest<WaypointsSetup>({
|
|
@@ -175,7 +184,7 @@ const tests = [
|
|
|
175
184
|
setup: waypointsSetup,
|
|
176
185
|
name: 'Can delete a waypoint with /deletewaypoint',
|
|
177
186
|
test: async function () {
|
|
178
|
-
const events = this.
|
|
187
|
+
const events = (await new EventsAwaiter().connect(this.client)).waitForEvents(GameEvents.CHAT_MESSAGE);
|
|
179
188
|
|
|
180
189
|
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
181
190
|
msg: '/setwaypoint A',
|
|
@@ -183,9 +192,9 @@ const tests = [
|
|
|
183
192
|
});
|
|
184
193
|
|
|
185
194
|
expect((await events).length).to.be.eq(1);
|
|
186
|
-
expect((await events)[0].data.msg).to.be.eq('Waypoint A set.');
|
|
195
|
+
expect((await events)[0].data.meta.msg).to.be.eq('Waypoint A set.');
|
|
187
196
|
|
|
188
|
-
const teleportEvents = this.
|
|
197
|
+
const teleportEvents = (await new EventsAwaiter().connect(this.client)).waitForEvents(GameEvents.CHAT_MESSAGE);
|
|
189
198
|
|
|
190
199
|
const useWaypointPermission = await this.client.permissionCodesToInputs([
|
|
191
200
|
`WAYPOINTS_USE_A_${this.setupData.gameserver.id}`,
|
|
@@ -200,9 +209,9 @@ const tests = [
|
|
|
200
209
|
});
|
|
201
210
|
|
|
202
211
|
expect((await teleportEvents).length).to.be.eq(1);
|
|
203
|
-
expect((await teleportEvents)[0].data.msg).to.be.eq('Teleported to waypoint A.');
|
|
212
|
+
expect((await teleportEvents)[0].data.meta.msg).to.be.eq('Teleported to waypoint A.');
|
|
204
213
|
|
|
205
|
-
const deleteEvents = this.
|
|
214
|
+
const deleteEvents = (await new EventsAwaiter().connect(this.client)).waitForEvents(GameEvents.CHAT_MESSAGE);
|
|
206
215
|
|
|
207
216
|
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
208
217
|
msg: '/deletewaypoint A',
|
|
@@ -210,7 +219,7 @@ const tests = [
|
|
|
210
219
|
});
|
|
211
220
|
|
|
212
221
|
expect((await deleteEvents).length).to.be.eq(1);
|
|
213
|
-
expect((await deleteEvents)[0].data.msg).to.be.eq('Waypoint A deleted.');
|
|
222
|
+
expect((await deleteEvents)[0].data.meta.msg).to.be.eq('Waypoint A deleted.');
|
|
214
223
|
},
|
|
215
224
|
}),
|
|
216
225
|
new IntegrationTest<WaypointsSetup>({
|
|
@@ -219,7 +228,7 @@ const tests = [
|
|
|
219
228
|
setup: waypointsSetup,
|
|
220
229
|
name: 'Errors when trying to delete a waypoint that does not exist',
|
|
221
230
|
test: async function () {
|
|
222
|
-
const events = this.
|
|
231
|
+
const events = (await new EventsAwaiter().connect(this.client)).waitForEvents(GameEvents.CHAT_MESSAGE);
|
|
223
232
|
|
|
224
233
|
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
225
234
|
msg: '/deletewaypoint A',
|
|
@@ -228,7 +237,7 @@ const tests = [
|
|
|
228
237
|
|
|
229
238
|
expect((await events).length).to.be.eq(1);
|
|
230
239
|
// eslint-disable-next-line quotes
|
|
231
|
-
expect((await events)[0].data.msg).to.be.eq("Waypoint A doesn't exist.");
|
|
240
|
+
expect((await events)[0].data.meta.msg).to.be.eq("Waypoint A doesn't exist.");
|
|
232
241
|
},
|
|
233
242
|
}),
|
|
234
243
|
new IntegrationTest<WaypointsSetup>({
|
|
@@ -241,7 +250,7 @@ const tests = [
|
|
|
241
250
|
// Then try to delete as player -> error
|
|
242
251
|
// Then try to delete as moderator -> success
|
|
243
252
|
|
|
244
|
-
const firstEvents = this.
|
|
253
|
+
const firstEvents = (await new EventsAwaiter().connect(this.client)).waitForEvents(GameEvents.CHAT_MESSAGE, 1);
|
|
245
254
|
|
|
246
255
|
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
247
256
|
msg: '/setwaypoint A',
|
|
@@ -249,9 +258,9 @@ const tests = [
|
|
|
249
258
|
});
|
|
250
259
|
|
|
251
260
|
expect((await firstEvents).length).to.be.eq(1);
|
|
252
|
-
expect((await firstEvents)[0].data.msg).to.be.eq('Waypoint A set.');
|
|
261
|
+
expect((await firstEvents)[0].data.meta.msg).to.be.eq('Waypoint A set.');
|
|
253
262
|
|
|
254
|
-
const secondEvents = this.
|
|
263
|
+
const secondEvents = (await new EventsAwaiter().connect(this.client)).waitForEvents(GameEvents.CHAT_MESSAGE, 1);
|
|
255
264
|
|
|
256
265
|
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
257
266
|
msg: '/deletewaypoint A',
|
|
@@ -259,9 +268,9 @@ const tests = [
|
|
|
259
268
|
});
|
|
260
269
|
|
|
261
270
|
expect((await secondEvents).length).to.be.eq(1);
|
|
262
|
-
expect((await secondEvents)[0].data.msg).to.be.eq('You do not have permission to manage waypoints.');
|
|
271
|
+
expect((await secondEvents)[0].data.meta.msg).to.be.eq('You do not have permission to manage waypoints.');
|
|
263
272
|
|
|
264
|
-
const thirdEvents = this.
|
|
273
|
+
const thirdEvents = (await new EventsAwaiter().connect(this.client)).waitForEvents(GameEvents.CHAT_MESSAGE, 1);
|
|
265
274
|
|
|
266
275
|
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
267
276
|
msg: '/deletewaypoint A',
|
|
@@ -269,7 +278,7 @@ const tests = [
|
|
|
269
278
|
});
|
|
270
279
|
|
|
271
280
|
expect((await thirdEvents).length).to.be.eq(1);
|
|
272
|
-
expect((await thirdEvents)[0].data.msg).to.be.eq('Waypoint A deleted.');
|
|
281
|
+
expect((await thirdEvents)[0].data.meta.msg).to.be.eq('Waypoint A deleted.');
|
|
273
282
|
},
|
|
274
283
|
}),
|
|
275
284
|
new IntegrationTest<WaypointsSetup>({
|
|
@@ -284,21 +293,28 @@ const tests = [
|
|
|
284
293
|
// Remove access to B
|
|
285
294
|
// /waypoints -> shows only A
|
|
286
295
|
|
|
287
|
-
const
|
|
296
|
+
const setWaypointAEvents = (await new EventsAwaiter().connect(this.client)).waitForEvents(
|
|
297
|
+
GameEvents.CHAT_MESSAGE,
|
|
298
|
+
);
|
|
288
299
|
|
|
289
300
|
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
290
301
|
msg: '/setwaypoint A',
|
|
291
302
|
playerId: this.setupData.moderator.id,
|
|
292
303
|
});
|
|
293
304
|
|
|
305
|
+
expect((await setWaypointAEvents).length).to.be.eq(1);
|
|
306
|
+
expect((await setWaypointAEvents)[0].data.meta.msg).to.be.eq('Waypoint A set.');
|
|
307
|
+
|
|
294
308
|
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
295
309
|
msg: '/setwaypoint B',
|
|
296
310
|
playerId: this.setupData.moderator.id,
|
|
297
311
|
});
|
|
298
312
|
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
313
|
+
const setWaypointBEvents = (await new EventsAwaiter().connect(this.client)).waitForEvents(
|
|
314
|
+
GameEvents.CHAT_MESSAGE,
|
|
315
|
+
);
|
|
316
|
+
expect((await setWaypointBEvents).length).to.be.eq(1);
|
|
317
|
+
expect((await setWaypointBEvents)[0].data.meta.msg).to.be.eq('Waypoint B set.');
|
|
302
318
|
|
|
303
319
|
const useWaypointAPermission = await this.client.permissionCodesToInputs([
|
|
304
320
|
`WAYPOINTS_USE_A_${this.setupData.gameserver.id}`,
|
|
@@ -311,7 +327,7 @@ const tests = [
|
|
|
311
327
|
permissions: [...useWaypointAPermission, ...useWaypointBPermission],
|
|
312
328
|
});
|
|
313
329
|
|
|
314
|
-
const listEvents = this.
|
|
330
|
+
const listEvents = (await new EventsAwaiter().connect(this.client)).waitForEvents(GameEvents.CHAT_MESSAGE);
|
|
315
331
|
|
|
316
332
|
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
317
333
|
msg: '/waypoints',
|
|
@@ -319,13 +335,13 @@ const tests = [
|
|
|
319
335
|
});
|
|
320
336
|
|
|
321
337
|
expect((await listEvents).length).to.be.eq(1);
|
|
322
|
-
expect((await listEvents)[0].data.msg).to.be.eq('Available waypoints: A, B');
|
|
338
|
+
expect((await listEvents)[0].data.meta.msg).to.be.eq('Available waypoints: A, B');
|
|
323
339
|
|
|
324
340
|
await this.client.role.roleControllerUpdate(this.setupData.playerRole.id, {
|
|
325
341
|
permissions: useWaypointAPermission,
|
|
326
342
|
});
|
|
327
343
|
|
|
328
|
-
const listEvents2 = this.
|
|
344
|
+
const listEvents2 = (await new EventsAwaiter().connect(this.client)).waitForEvents(GameEvents.CHAT_MESSAGE);
|
|
329
345
|
|
|
330
346
|
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
331
347
|
msg: '/waypoints',
|
|
@@ -333,7 +349,7 @@ const tests = [
|
|
|
333
349
|
});
|
|
334
350
|
|
|
335
351
|
expect((await listEvents2).length).to.be.eq(1);
|
|
336
|
-
expect((await listEvents2)[0].data.msg).to.be.eq('Available waypoints: A');
|
|
352
|
+
expect((await listEvents2)[0].data.meta.msg).to.be.eq('Available waypoints: A');
|
|
337
353
|
},
|
|
338
354
|
}),
|
|
339
355
|
new IntegrationTest<WaypointsSetup>({
|
|
@@ -342,7 +358,7 @@ const tests = [
|
|
|
342
358
|
setup: waypointsSetup,
|
|
343
359
|
name: 'Has a user friendly message when listing waypoints and there are none',
|
|
344
360
|
test: async function () {
|
|
345
|
-
const listEvents = this.
|
|
361
|
+
const listEvents = (await new EventsAwaiter().connect(this.client)).waitForEvents(GameEvents.CHAT_MESSAGE);
|
|
346
362
|
|
|
347
363
|
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
348
364
|
msg: '/waypoints',
|
|
@@ -350,7 +366,7 @@ const tests = [
|
|
|
350
366
|
});
|
|
351
367
|
|
|
352
368
|
expect((await listEvents).length).to.be.eq(1);
|
|
353
|
-
expect((await listEvents)[0].data.msg).to.be.eq('There are no waypoints available.');
|
|
369
|
+
expect((await listEvents)[0].data.meta.msg).to.be.eq('There are no waypoints available.');
|
|
354
370
|
},
|
|
355
371
|
}),
|
|
356
372
|
new IntegrationTest<WaypointsSetup>({
|
|
@@ -359,13 +375,13 @@ const tests = [
|
|
|
359
375
|
setup: waypointsSetup,
|
|
360
376
|
name: 'Players can teleport to a waypoint',
|
|
361
377
|
test: async function () {
|
|
362
|
-
const events = this.
|
|
378
|
+
const events = (await new EventsAwaiter().connect(this.client)).waitForEvents(GameEvents.CHAT_MESSAGE);
|
|
363
379
|
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
364
380
|
msg: '/setwaypoint trader',
|
|
365
381
|
playerId: this.setupData.moderator.id,
|
|
366
382
|
});
|
|
367
383
|
expect((await events).length).to.be.eq(1);
|
|
368
|
-
expect((await events)[0].data.msg).to.be.eq('Waypoint trader set.');
|
|
384
|
+
expect((await events)[0].data.meta.msg).to.be.eq('Waypoint trader set.');
|
|
369
385
|
|
|
370
386
|
const useWaypointPermission = await this.client.permissionCodesToInputs([
|
|
371
387
|
`WAYPOINTS_USE_TRADER_${this.setupData.gameserver.id}`,
|
|
@@ -374,13 +390,13 @@ const tests = [
|
|
|
374
390
|
permissions: useWaypointPermission,
|
|
375
391
|
});
|
|
376
392
|
|
|
377
|
-
const teleportEvents = this.
|
|
393
|
+
const teleportEvents = (await new EventsAwaiter().connect(this.client)).waitForEvents(GameEvents.CHAT_MESSAGE);
|
|
378
394
|
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
379
395
|
msg: '/trader',
|
|
380
396
|
playerId: this.setupData.player.id,
|
|
381
397
|
});
|
|
382
398
|
expect((await teleportEvents).length).to.be.eq(1);
|
|
383
|
-
expect((await teleportEvents)[0].data.msg).to.be.eq('Teleported to waypoint trader.');
|
|
399
|
+
expect((await teleportEvents)[0].data.meta.msg).to.be.eq('Teleported to waypoint trader.');
|
|
384
400
|
},
|
|
385
401
|
}),
|
|
386
402
|
new IntegrationTest<WaypointsSetup>({
|
|
@@ -389,21 +405,28 @@ const tests = [
|
|
|
389
405
|
setup: waypointsSetup,
|
|
390
406
|
name: 'Can set multiple waypoints and teleport to them',
|
|
391
407
|
test: async function () {
|
|
392
|
-
const
|
|
408
|
+
const setWaypointAEvents = (await new EventsAwaiter().connect(this.client)).waitForEvents(
|
|
409
|
+
GameEvents.CHAT_MESSAGE,
|
|
410
|
+
);
|
|
393
411
|
|
|
394
412
|
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
395
413
|
msg: '/setwaypoint A',
|
|
396
414
|
playerId: this.setupData.moderator.id,
|
|
397
415
|
});
|
|
398
416
|
|
|
417
|
+
expect((await setWaypointAEvents).length).to.be.eq(1);
|
|
418
|
+
expect((await setWaypointAEvents)[0].data.meta.msg).to.be.eq('Waypoint A set.');
|
|
419
|
+
|
|
399
420
|
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
400
421
|
msg: '/setwaypoint B',
|
|
401
422
|
playerId: this.setupData.moderator.id,
|
|
402
423
|
});
|
|
403
424
|
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
425
|
+
const setWaypointBEvents = (await new EventsAwaiter().connect(this.client)).waitForEvents(
|
|
426
|
+
GameEvents.CHAT_MESSAGE,
|
|
427
|
+
);
|
|
428
|
+
expect((await setWaypointBEvents).length).to.be.eq(1);
|
|
429
|
+
expect((await setWaypointBEvents)[0].data.meta.msg).to.be.eq('Waypoint B set.');
|
|
407
430
|
|
|
408
431
|
const useWaypointPermission = await this.client.permissionCodesToInputs([
|
|
409
432
|
`WAYPOINTS_USE_A_${this.setupData.gameserver.id}`,
|
|
@@ -413,7 +436,7 @@ const tests = [
|
|
|
413
436
|
permissions: useWaypointPermission,
|
|
414
437
|
});
|
|
415
438
|
|
|
416
|
-
const teleportAEvents = this.
|
|
439
|
+
const teleportAEvents = (await new EventsAwaiter().connect(this.client)).waitForEvents(GameEvents.CHAT_MESSAGE);
|
|
417
440
|
|
|
418
441
|
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
419
442
|
msg: '/A',
|
|
@@ -421,9 +444,9 @@ const tests = [
|
|
|
421
444
|
});
|
|
422
445
|
|
|
423
446
|
expect((await teleportAEvents).length).to.be.eq(1);
|
|
424
|
-
expect((await teleportAEvents)[0].data.msg).to.be.eq('Teleported to waypoint A.');
|
|
447
|
+
expect((await teleportAEvents)[0].data.meta.msg).to.be.eq('Teleported to waypoint A.');
|
|
425
448
|
|
|
426
|
-
const teleportBEvents = this.
|
|
449
|
+
const teleportBEvents = (await new EventsAwaiter().connect(this.client)).waitForEvents(GameEvents.CHAT_MESSAGE);
|
|
427
450
|
|
|
428
451
|
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
429
452
|
msg: '/B',
|
|
@@ -431,7 +454,7 @@ const tests = [
|
|
|
431
454
|
});
|
|
432
455
|
|
|
433
456
|
expect((await teleportBEvents).length).to.be.eq(1);
|
|
434
|
-
expect((await teleportBEvents)[0].data.msg).to.be.eq('Teleported to waypoint B.');
|
|
457
|
+
expect((await teleportBEvents)[0].data.meta.msg).to.be.eq('Teleported to waypoint B.');
|
|
435
458
|
},
|
|
436
459
|
}),
|
|
437
460
|
new IntegrationTest<WaypointsSetup>({
|
|
@@ -445,21 +468,28 @@ const tests = [
|
|
|
445
468
|
// Player uses A -> success
|
|
446
469
|
// Player uses B -> error
|
|
447
470
|
|
|
448
|
-
const
|
|
471
|
+
const setWaypointAEvents = (await new EventsAwaiter().connect(this.client)).waitForEvents(
|
|
472
|
+
GameEvents.CHAT_MESSAGE,
|
|
473
|
+
);
|
|
449
474
|
|
|
450
475
|
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
451
476
|
msg: '/setwaypoint A',
|
|
452
477
|
playerId: this.setupData.moderator.id,
|
|
453
478
|
});
|
|
454
479
|
|
|
480
|
+
expect((await setWaypointAEvents).length).to.be.eq(1);
|
|
481
|
+
expect((await setWaypointAEvents)[0].data.meta.msg).to.be.eq('Waypoint A set.');
|
|
482
|
+
|
|
455
483
|
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
456
484
|
msg: '/setwaypoint B',
|
|
457
485
|
playerId: this.setupData.moderator.id,
|
|
458
486
|
});
|
|
459
487
|
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
488
|
+
const setWaypointBEvents = (await new EventsAwaiter().connect(this.client)).waitForEvents(
|
|
489
|
+
GameEvents.CHAT_MESSAGE,
|
|
490
|
+
);
|
|
491
|
+
expect((await setWaypointBEvents).length).to.be.eq(1);
|
|
492
|
+
expect((await setWaypointBEvents)[0].data.meta.msg).to.be.eq('Waypoint B set.');
|
|
463
493
|
|
|
464
494
|
const useWaypointPermission = await this.client.permissionCodesToInputs([
|
|
465
495
|
`WAYPOINTS_USE_A_${this.setupData.gameserver.id}`,
|
|
@@ -468,7 +498,7 @@ const tests = [
|
|
|
468
498
|
permissions: useWaypointPermission,
|
|
469
499
|
});
|
|
470
500
|
|
|
471
|
-
const teleportAEvents = this.
|
|
501
|
+
const teleportAEvents = (await new EventsAwaiter().connect(this.client)).waitForEvents(GameEvents.CHAT_MESSAGE);
|
|
472
502
|
|
|
473
503
|
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
474
504
|
msg: '/A',
|
|
@@ -476,9 +506,9 @@ const tests = [
|
|
|
476
506
|
});
|
|
477
507
|
|
|
478
508
|
expect((await teleportAEvents).length).to.be.eq(1);
|
|
479
|
-
expect((await teleportAEvents)[0].data.msg).to.be.eq('Teleported to waypoint A.');
|
|
509
|
+
expect((await teleportAEvents)[0].data.meta.msg).to.be.eq('Teleported to waypoint A.');
|
|
480
510
|
|
|
481
|
-
const teleportBEvents = this.
|
|
511
|
+
const teleportBEvents = (await new EventsAwaiter().connect(this.client)).waitForEvents(GameEvents.CHAT_MESSAGE);
|
|
482
512
|
|
|
483
513
|
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
484
514
|
msg: '/B',
|
|
@@ -486,7 +516,7 @@ const tests = [
|
|
|
486
516
|
});
|
|
487
517
|
|
|
488
518
|
expect((await teleportBEvents).length).to.be.eq(1);
|
|
489
|
-
expect((await teleportBEvents)[0].data.msg).to.be.eq('You are not allowed to use the waypoint B.');
|
|
519
|
+
expect((await teleportBEvents)[0].data.meta.msg).to.be.eq('You are not allowed to use the waypoint B.');
|
|
490
520
|
},
|
|
491
521
|
}),
|
|
492
522
|
new IntegrationTest<WaypointsSetup>({
|
|
@@ -502,22 +532,22 @@ const tests = [
|
|
|
502
532
|
const { newGameServer, newServerModerator, newServerPlayer } = await setupSecondServer.bind(this)();
|
|
503
533
|
|
|
504
534
|
// Make a waypoint on the new gameserver
|
|
505
|
-
const setEvents = this.
|
|
535
|
+
const setEvents = (await new EventsAwaiter().connect(this.client)).waitForEvents(GameEvents.CHAT_MESSAGE);
|
|
506
536
|
await this.client.command.commandControllerTrigger(newGameServer.data.data.id, {
|
|
507
537
|
msg: '/setwaypoint A',
|
|
508
538
|
playerId: newServerModerator.playerId,
|
|
509
539
|
});
|
|
510
540
|
expect((await setEvents).length).to.be.eq(1);
|
|
511
|
-
expect((await setEvents)[0].data.msg).to.be.eq('Waypoint A set.');
|
|
541
|
+
expect((await setEvents)[0].data.meta.msg).to.be.eq('Waypoint A set.');
|
|
512
542
|
|
|
513
543
|
// Make a waypoint on the original gameserver
|
|
514
|
-
const setEvents2 = this.
|
|
544
|
+
const setEvents2 = (await new EventsAwaiter().connect(this.client)).waitForEvents(GameEvents.CHAT_MESSAGE);
|
|
515
545
|
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
516
546
|
msg: '/setwaypoint notused',
|
|
517
547
|
playerId: this.setupData.moderator.id,
|
|
518
548
|
});
|
|
519
549
|
expect((await setEvents2).length).to.be.eq(1);
|
|
520
|
-
expect((await setEvents2)[0].data.msg).to.be.eq('Waypoint notused set.');
|
|
550
|
+
expect((await setEvents2)[0].data.meta.msg).to.be.eq('Waypoint notused set.');
|
|
521
551
|
|
|
522
552
|
const useWaypointPermission = await this.client.permissionCodesToInputs([
|
|
523
553
|
`WAYPOINTS_USE_A_${newGameServer.data.data.id}`,
|
|
@@ -527,22 +557,24 @@ const tests = [
|
|
|
527
557
|
});
|
|
528
558
|
|
|
529
559
|
// Use the waypoint from the new gameserver -> success
|
|
530
|
-
const teleportEvents = this.
|
|
560
|
+
const teleportEvents = (await new EventsAwaiter().connect(this.client)).waitForEvents(GameEvents.CHAT_MESSAGE, 1);
|
|
531
561
|
await this.client.command.commandControllerTrigger(newGameServer.data.data.id, {
|
|
532
562
|
msg: '/A',
|
|
533
563
|
playerId: newServerPlayer.playerId,
|
|
534
564
|
});
|
|
535
565
|
expect((await teleportEvents).length).to.be.eq(1);
|
|
536
|
-
expect((await teleportEvents)[0].data.msg).to.be.eq('Teleported to waypoint A.');
|
|
566
|
+
expect((await teleportEvents)[0].data.meta.msg).to.be.eq('Teleported to waypoint A.');
|
|
537
567
|
|
|
538
568
|
// Use the waypoint from the original gameserver -> "waypoint does not exist"
|
|
539
|
-
const teleportEvents2 = this.
|
|
569
|
+
const teleportEvents2 = (await new EventsAwaiter().connect(this.client)).waitForEvents(
|
|
570
|
+
HookEvents.COMMAND_EXECUTED,
|
|
571
|
+
);
|
|
540
572
|
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
541
573
|
msg: '/A',
|
|
542
574
|
playerId: this.setupData.player.id,
|
|
543
575
|
});
|
|
544
576
|
expect((await teleportEvents2).length).to.be.eq(1);
|
|
545
|
-
expect((await teleportEvents2)[0].data.msg).to.be.eq('
|
|
577
|
+
expect((await teleportEvents2)[0].data.meta.result.logs[0].msg).to.be.eq('Waypoint A is not for this server.');
|
|
546
578
|
},
|
|
547
579
|
}),
|
|
548
580
|
new IntegrationTest<WaypointsSetup>({
|
|
@@ -561,20 +593,20 @@ const tests = [
|
|
|
561
593
|
const { newGameServer, newServerModerator, newServerPlayer } = await setupSecondServer.bind(this)();
|
|
562
594
|
|
|
563
595
|
// Make a waypoint on the original gameserver
|
|
564
|
-
const setEvents = this.
|
|
596
|
+
const setEvents = (await new EventsAwaiter().connect(this.client)).waitForEvents(GameEvents.CHAT_MESSAGE);
|
|
565
597
|
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
566
598
|
msg: '/setwaypoint A',
|
|
567
599
|
playerId: this.setupData.moderator.id,
|
|
568
600
|
});
|
|
569
|
-
expect((await setEvents)[0].data.msg).to.be.eq('Waypoint A set.');
|
|
601
|
+
expect((await setEvents)[0].data.meta.msg).to.be.eq('Waypoint A set.');
|
|
570
602
|
|
|
571
603
|
// Make a waypoint on the new gameserver
|
|
572
|
-
const setEvents2 = this.
|
|
604
|
+
const setEvents2 = (await new EventsAwaiter().connect(this.client)).waitForEvents(GameEvents.CHAT_MESSAGE);
|
|
573
605
|
await this.client.command.commandControllerTrigger(newGameServer.data.data.id, {
|
|
574
606
|
msg: '/setwaypoint A',
|
|
575
607
|
playerId: newServerModerator.playerId,
|
|
576
608
|
});
|
|
577
|
-
expect((await setEvents2)[0].data.msg).to.be.eq('Waypoint A set.');
|
|
609
|
+
expect((await setEvents2)[0].data.meta.msg).to.be.eq('Waypoint A set.');
|
|
578
610
|
|
|
579
611
|
const useWaypointPermission = await this.client.permissionCodesToInputs([
|
|
580
612
|
`WAYPOINTS_USE_A_${this.setupData.gameserver.id}`,
|
|
@@ -584,24 +616,23 @@ const tests = [
|
|
|
584
616
|
});
|
|
585
617
|
|
|
586
618
|
// Use the waypoint from the original gameserver -> success
|
|
587
|
-
const teleportEvents = this.
|
|
588
|
-
gameServerId: this.setupData.gameserver.id,
|
|
589
|
-
});
|
|
619
|
+
const teleportEvents = (await new EventsAwaiter().connect(this.client)).waitForEvents(GameEvents.CHAT_MESSAGE, 1);
|
|
590
620
|
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
591
621
|
msg: '/A',
|
|
592
622
|
playerId: this.setupData.player.id,
|
|
593
623
|
});
|
|
594
|
-
expect((await teleportEvents)[0].data.msg).to.be.eq('Teleported to waypoint A.');
|
|
624
|
+
expect((await teleportEvents)[0].data.meta.msg).to.be.eq('Teleported to waypoint A.');
|
|
595
625
|
|
|
596
626
|
// Use the waypoint from the new gameserver -> error
|
|
597
|
-
const teleportEvents2 = this.
|
|
598
|
-
|
|
599
|
-
|
|
627
|
+
const teleportEvents2 = (await new EventsAwaiter().connect(this.client)).waitForEvents(
|
|
628
|
+
GameEvents.CHAT_MESSAGE,
|
|
629
|
+
1,
|
|
630
|
+
);
|
|
600
631
|
await this.client.command.commandControllerTrigger(newGameServer.data.data.id, {
|
|
601
632
|
msg: '/A',
|
|
602
633
|
playerId: newServerPlayer.playerId,
|
|
603
634
|
});
|
|
604
|
-
expect((await teleportEvents2)[0].data.msg).to.be.eq('You are not allowed to use the waypoint A.');
|
|
635
|
+
expect((await teleportEvents2)[0].data.meta.msg).to.be.eq('You are not allowed to use the waypoint A.');
|
|
605
636
|
},
|
|
606
637
|
}),
|
|
607
638
|
];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Community modules
|
|
2
|
+
|
|
3
|
+
This directory contains modules that are not part of the core suite of built in modules, but are contributed by the community. They are not officially supported, but are provided as-is for the community to use and improve.
|
|
4
|
+
|
|
5
|
+
We welcome contributions to this directory. If you have a module that you would like to contribute, please open a pull request.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"commands": [
|
|
3
|
+
{
|
|
4
|
+
"function": "\nimport { takaro, data, axios } from '@takaro/helpers';\nasync function main() {\n const { pog } = data;\n const playerRes = await takaro.player.playerControllerGetOne(data.player.id);\n const steamId = playerRes.data.data.steamId;\n const xboxLiveId = playerRes.data.data.xboxLiveId;\n const name = playerRes.data.data.name;\n const key = data.module.userConfig.votekey;\n\n let voteId = `username=${name}`;\n if (steamId.startsWith(\"7656\")) { voteId = `steamid=${steamId}`; }\n\n\n const res = await axios.get(`https://7daystodie-servers.com/api/?object=votes&element=claim&key=${key}&${voteId}`);\n if (res.data == 0) { data.player.pm(data.module.userConfig.didntvote); }\n if (res.data == 2) { data.player.pm(data.module.userConfig.alreadyvoted); }\n if (res.data == 1) {\n\n const claimresponse = await axios.post(`https://7daystodie-servers.com/api/?action=post&object=votes&element=claim&key=${key}&${voteId}`);\n if (claimresponse.data == 1) {\n if (data.module.userConfig.votednow.toLowerCase() !== 'none' && data.module.userConfig.votednow.toLowerCase() !== '\"none\"') { data.player.pm(data.module.userConfig.votednow); }\n if (data.module.userConfig.publicMessage.toLowerCase() !== 'none' && data.module.userConfig.publicMessage.toLowerCase() !== '\"none\"') {\n const originalMessage = data.module.userConfig.publicMessage;\n const modifiedMessage = originalMessage.replace(/\\{name\\}/g, name);\n await takaro.gameserver.gameServerControllerExecuteCommand(data.gameServerId, { command: `say \"${modifiedMessage}\"` });\n }\n await takaro.playerOnGameserver.playerOnGameServerControllerAddCurrency(data.gameServerId, pog.playerId, { currency: data.module.userConfig.currency });\n for (const stuff of data.module.userConfig.giveStuff) {\n if (voteId.startsWith(`steamid`)) {\n await takaro.gameserver.gameServerControllerExecuteCommand(data.gameServerId, { command: `giveplus Steam_${steamId} ${stuff}` });\n } else {\n await takaro.gameserver.gameServerControllerExecuteCommand(data.gameServerId, { command: `giveplus ${xboxLiveId} ${stuff}` });\n }\n }\n }\n }\n}\n\n\n\nawait main();",
|
|
5
|
+
"name": "vote",
|
|
6
|
+
"trigger": "vote",
|
|
7
|
+
"helpText": "Vote for the server and give players rewards.",
|
|
8
|
+
"arguments": []
|
|
9
|
+
}
|
|
10
|
+
],
|
|
11
|
+
"hooks": [],
|
|
12
|
+
"cronJobs": [],
|
|
13
|
+
"functions": [],
|
|
14
|
+
"permissions": [],
|
|
15
|
+
"name": "Vote",
|
|
16
|
+
"description": "Takaro Vote Module",
|
|
17
|
+
"configSchema": "{\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"type\":\"object\",\"required\":[\"votekey\",\"didntvote\",\"alreadyvoted\"],\"additionalProperties\":false,\"properties\":{\"votekey\":{\"title\":\"votekey\",\"description\":\"Votekey from website\",\"default\":\"\",\"type\":\"string\"},\"didntvote\":{\"title\":\"didntvote\",\"description\":\"Message to send to the player when voting site reports no vote was cast.\",\"default\":\"You haven't voted yet.\",\"type\":\"string\"},\"alreadyvoted\":{\"title\":\"alreadyvoted\",\"description\":\"Message to send to the player when voting site reports the vote was already claimed.\",\"default\":\"You have already claimed your last vote.\",\"type\":\"string\"},\"votednow\":{\"title\":\"votednow\",\"description\":\"Optional message to send to the player when vote is successful. \\nUse \\\"none\\\" as the message if you want nothing to be sent instead.\",\"default\":\"Thanks for voting.\",\"type\":\"string\"},\"publicMessage\":{\"title\":\"publicMessage\",\"description\":\"Optional message to broadcast to all players online when vote is successful. Use {name} in the message to refer to the player name.\\nUse \\\"none\\\" as the message if you want nothing to be sent instead.\",\"default\":\"[FF0000]{name}[-] voted at 7daystodie-servers.com and was rewarded Takaro Coins!\",\"type\":\"string\"},\"giveStuff\":{\"title\":\"giveStuff\",\"description\":\"Items to give to the player thru giveplus command. Must indicate quantities and, if applies, quality:\\n<item name> <amount> [<quality> <usedTimes>]\\n\\nItem name has to be the exact name of an item as listed by \\\"listitems\\\".\\n\\nQuality is the quality of the dropped items for items that have a quality.\\n\\nusedTimes is the % that the item was used.\\n\\nThe default value is giving 2 waters and a tier 6 stone axe with no use. If you are going to copy/paste, include the arguments. \",\"default\":[\"drinkJarBoiledWater 2\",\"meleeToolRepairT0StoneAxe 1 6 0\"],\"type\":\"array\",\"items\":{\"type\":\"string\"}},\"currency\":{\"title\":\"currency\",\"description\":\"How much currency to add to the player in Takaro\",\"default\":0,\"type\":\"number\"}}}",
|
|
18
|
+
"uiSchema": "{}"
|
|
19
|
+
}
|
package/src/dto/gameEvents.ts
CHANGED
|
@@ -61,7 +61,7 @@ export class BaseGameEvent<T> extends BaseEvent<T> {
|
|
|
61
61
|
msg: string;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
export interface
|
|
64
|
+
export interface IPositionInterface {
|
|
65
65
|
x: number;
|
|
66
66
|
y: number;
|
|
67
67
|
z: number;
|
|
@@ -105,7 +105,7 @@ export class EventChatMessage extends BaseGameEvent<EventChatMessage> {
|
|
|
105
105
|
declare msg: string;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
export class IPosition {
|
|
108
|
+
export class IPosition implements IPositionInterface {
|
|
109
109
|
@IsNumber()
|
|
110
110
|
x: number;
|
|
111
111
|
@IsNumber()
|