@takaro/modules 0.0.14 → 0.0.18
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.d.ts +13 -8
- package/dist/BuiltinModule.d.ts.map +1 -0
- package/dist/BuiltinModule.js +48 -31
- package/dist/BuiltinModule.js.map +1 -1
- package/dist/dto/base.d.ts +1 -0
- package/dist/dto/base.d.ts.map +1 -0
- package/dist/dto/discordEvents.d.ts +1 -0
- package/dist/dto/discordEvents.d.ts.map +1 -0
- package/dist/dto/gameEvents.d.ts +1 -0
- package/dist/dto/gameEvents.d.ts.map +1 -0
- package/dist/dto/index.d.ts +4 -0
- package/dist/dto/index.d.ts.map +1 -0
- package/dist/dto/takaroEvents.d.ts +16 -0
- package/dist/dto/takaroEvents.d.ts.map +1 -0
- package/dist/dto/takaroEvents.js +36 -0
- package/dist/dto/takaroEvents.js.map +1 -1
- package/dist/main.d.ts +4 -3
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +3 -1
- package/dist/main.js.map +1 -1
- package/dist/modules/chatBridge/hooks/DiscordToGame.d.ts +1 -0
- package/dist/modules/chatBridge/hooks/DiscordToGame.d.ts.map +1 -0
- package/dist/modules/chatBridge/hooks/GameToDiscord.d.ts +1 -0
- package/dist/modules/chatBridge/hooks/GameToDiscord.d.ts.map +1 -0
- package/dist/modules/chatBridge/hooks/PlayerConnected.d.ts +1 -0
- package/dist/modules/chatBridge/hooks/PlayerConnected.d.ts.map +1 -0
- package/dist/modules/chatBridge/hooks/PlayerDisconnected.d.ts +1 -0
- package/dist/modules/chatBridge/hooks/PlayerDisconnected.d.ts.map +1 -0
- package/dist/modules/chatBridge/index.d.ts +3 -2
- package/dist/modules/chatBridge/index.d.ts.map +1 -0
- package/dist/modules/chatBridge/index.js +55 -47
- package/dist/modules/chatBridge/index.js.map +1 -1
- package/dist/modules/dailyRewards/commands/daily.d.ts +2 -0
- package/dist/modules/dailyRewards/commands/daily.d.ts.map +1 -0
- package/dist/modules/dailyRewards/commands/daily.js +106 -0
- package/dist/modules/dailyRewards/commands/daily.js.map +1 -0
- package/dist/modules/dailyRewards/commands/streak.d.ts +2 -0
- package/dist/modules/dailyRewards/commands/streak.d.ts.map +1 -0
- package/dist/modules/dailyRewards/commands/streak.js +34 -0
- package/dist/modules/dailyRewards/commands/streak.js.map +1 -0
- package/dist/modules/dailyRewards/commands/topstreak.d.ts +2 -0
- package/dist/modules/dailyRewards/commands/topstreak.d.ts.map +1 -0
- package/dist/modules/dailyRewards/commands/topstreak.js +44 -0
- package/dist/modules/dailyRewards/commands/topstreak.js.map +1 -0
- package/dist/modules/dailyRewards/functions/utils.d.ts +6 -0
- package/dist/modules/dailyRewards/functions/utils.d.ts.map +1 -0
- package/dist/modules/dailyRewards/functions/utils.js +32 -0
- package/dist/modules/dailyRewards/functions/utils.js.map +1 -0
- package/dist/modules/dailyRewards/hooks/dailyLoginCheck.d.ts +2 -0
- package/dist/modules/dailyRewards/hooks/dailyLoginCheck.d.ts.map +1 -0
- package/dist/modules/dailyRewards/hooks/dailyLoginCheck.js +19 -0
- package/dist/modules/dailyRewards/hooks/dailyLoginCheck.js.map +1 -0
- package/dist/modules/dailyRewards/index.d.ts +5 -0
- package/dist/modules/dailyRewards/index.d.ts.map +1 -0
- package/dist/modules/dailyRewards/index.js +125 -0
- package/dist/modules/dailyRewards/index.js.map +1 -0
- package/dist/modules/economyUtils/commands/balance.d.ts +1 -0
- package/dist/modules/economyUtils/commands/balance.d.ts.map +1 -0
- package/dist/modules/economyUtils/commands/claim.d.ts +1 -0
- package/dist/modules/economyUtils/commands/claim.d.ts.map +1 -0
- package/dist/modules/economyUtils/commands/confirmTransfer.d.ts +1 -0
- package/dist/modules/economyUtils/commands/confirmTransfer.d.ts.map +1 -0
- package/dist/modules/economyUtils/commands/grantCurrency.d.ts +1 -0
- package/dist/modules/economyUtils/commands/grantCurrency.d.ts.map +1 -0
- package/dist/modules/economyUtils/commands/revokeCurrency.d.ts +1 -0
- package/dist/modules/economyUtils/commands/revokeCurrency.d.ts.map +1 -0
- package/dist/modules/economyUtils/commands/shop.d.ts +1 -0
- package/dist/modules/economyUtils/commands/shop.d.ts.map +1 -0
- package/dist/modules/economyUtils/commands/topCurrency.d.ts +1 -0
- package/dist/modules/economyUtils/commands/topCurrency.d.ts.map +1 -0
- package/dist/modules/economyUtils/commands/transfer.d.ts +1 -0
- package/dist/modules/economyUtils/commands/transfer.d.ts.map +1 -0
- package/dist/modules/economyUtils/cronJobs/zombieKillReward.d.ts +1 -0
- package/dist/modules/economyUtils/cronJobs/zombieKillReward.d.ts.map +1 -0
- package/dist/modules/economyUtils/index.d.ts +3 -2
- package/dist/modules/economyUtils/index.d.ts.map +1 -0
- package/dist/modules/economyUtils/index.js +178 -170
- package/dist/modules/economyUtils/index.js.map +1 -1
- package/dist/modules/geoBlock/hooks/IPDetected.d.ts +1 -0
- package/dist/modules/geoBlock/hooks/IPDetected.d.ts.map +1 -0
- package/dist/modules/geoBlock/hooks/IPDetected.js +4 -2
- package/dist/modules/geoBlock/hooks/IPDetected.js.map +1 -1
- package/dist/modules/geoBlock/index.d.ts +3 -2
- package/dist/modules/geoBlock/index.d.ts.map +1 -0
- package/dist/modules/geoBlock/index.js +71 -63
- package/dist/modules/geoBlock/index.js.map +1 -1
- package/dist/modules/gimme/commands/gimme.d.ts +1 -0
- package/dist/modules/gimme/commands/gimme.d.ts.map +1 -0
- package/dist/modules/gimme/commands/gimme.js +17 -6
- package/dist/modules/gimme/commands/gimme.js.map +1 -1
- package/dist/modules/gimme/index.d.ts +3 -2
- package/dist/modules/gimme/index.d.ts.map +1 -0
- package/dist/modules/gimme/index.js +64 -34
- package/dist/modules/gimme/index.js.map +1 -1
- package/dist/modules/highPingKicker/cronJobs/Ping check.d.ts +1 -0
- package/dist/modules/highPingKicker/cronJobs/Ping check.d.ts.map +1 -0
- package/dist/modules/highPingKicker/index.d.ts +3 -2
- package/dist/modules/highPingKicker/index.d.ts.map +1 -0
- package/dist/modules/highPingKicker/index.js +36 -28
- package/dist/modules/highPingKicker/index.js.map +1 -1
- package/dist/modules/lottery/commands/buyTicket.d.ts +1 -0
- package/dist/modules/lottery/commands/buyTicket.d.ts.map +1 -0
- package/dist/modules/lottery/commands/nextDraw.d.ts +1 -0
- package/dist/modules/lottery/commands/nextDraw.d.ts.map +1 -0
- package/dist/modules/lottery/commands/viewTickets.d.ts +1 -0
- package/dist/modules/lottery/commands/viewTickets.d.ts.map +1 -0
- package/dist/modules/lottery/cronJobs/drawLottery.d.ts +1 -0
- package/dist/modules/lottery/cronJobs/drawLottery.d.ts.map +1 -0
- package/dist/modules/lottery/index.d.ts +3 -2
- package/dist/modules/lottery/index.d.ts.map +1 -0
- package/dist/modules/lottery/index.js +73 -65
- package/dist/modules/lottery/index.js.map +1 -1
- package/dist/modules/playerOnboarding/commands/starterkit.d.ts +1 -0
- package/dist/modules/playerOnboarding/commands/starterkit.d.ts.map +1 -0
- package/dist/modules/playerOnboarding/commands/starterkit.js +16 -3
- package/dist/modules/playerOnboarding/commands/starterkit.js.map +1 -1
- package/dist/modules/playerOnboarding/hooks/playerConnected.d.ts +1 -0
- package/dist/modules/playerOnboarding/hooks/playerConnected.d.ts.map +1 -0
- package/dist/modules/playerOnboarding/index.d.ts +3 -2
- package/dist/modules/playerOnboarding/index.d.ts.map +1 -0
- package/dist/modules/playerOnboarding/index.js +73 -43
- package/dist/modules/playerOnboarding/index.js.map +1 -1
- package/dist/modules/serverMessages/cronJobs/Automated message.d.ts +1 -0
- package/dist/modules/serverMessages/cronJobs/Automated message.d.ts.map +1 -0
- package/dist/modules/serverMessages/index.d.ts +3 -2
- package/dist/modules/serverMessages/index.d.ts.map +1 -0
- package/dist/modules/serverMessages/index.js +36 -28
- package/dist/modules/serverMessages/index.js.map +1 -1
- package/dist/modules/teleports/commands/deletetp.d.ts +1 -0
- package/dist/modules/teleports/commands/deletetp.d.ts.map +1 -0
- package/dist/modules/teleports/commands/deletewaypoint.d.ts +1 -0
- package/dist/modules/teleports/commands/deletewaypoint.d.ts.map +1 -0
- package/dist/modules/teleports/commands/deletewaypoint.js +4 -35
- package/dist/modules/teleports/commands/deletewaypoint.js.map +1 -1
- package/dist/modules/teleports/commands/listwaypoints.d.ts +1 -0
- package/dist/modules/teleports/commands/listwaypoints.d.ts.map +1 -0
- package/dist/modules/teleports/commands/listwaypoints.js +3 -22
- package/dist/modules/teleports/commands/listwaypoints.js.map +1 -1
- package/dist/modules/teleports/commands/setprivate.d.ts +1 -0
- package/dist/modules/teleports/commands/setprivate.d.ts.map +1 -0
- package/dist/modules/teleports/commands/setpublic.d.ts +1 -0
- package/dist/modules/teleports/commands/setpublic.d.ts.map +1 -0
- package/dist/modules/teleports/commands/settp.d.ts +1 -0
- package/dist/modules/teleports/commands/settp.d.ts.map +1 -0
- package/dist/modules/teleports/commands/setwaypoint.d.ts +1 -0
- package/dist/modules/teleports/commands/setwaypoint.d.ts.map +1 -0
- package/dist/modules/teleports/commands/setwaypoint.js +5 -63
- package/dist/modules/teleports/commands/setwaypoint.js.map +1 -1
- package/dist/modules/teleports/commands/teleport.d.ts +1 -0
- package/dist/modules/teleports/commands/teleport.d.ts.map +1 -0
- package/dist/modules/teleports/commands/teleportwaypoint.d.ts +1 -0
- package/dist/modules/teleports/commands/teleportwaypoint.d.ts.map +1 -0
- package/dist/modules/teleports/commands/teleportwaypoint.js +7 -23
- package/dist/modules/teleports/commands/teleportwaypoint.js.map +1 -1
- package/dist/modules/teleports/commands/tplist.d.ts +1 -0
- package/dist/modules/teleports/commands/tplist.d.ts.map +1 -0
- package/dist/modules/teleports/cronJobs/Waypoint reconciler.d.ts +2 -0
- package/dist/modules/teleports/cronJobs/Waypoint reconciler.d.ts.map +1 -0
- package/dist/modules/teleports/cronJobs/Waypoint reconciler.js +6 -0
- package/dist/modules/teleports/cronJobs/Waypoint reconciler.js.map +1 -0
- package/dist/modules/teleports/functions/utils.d.ts +12 -0
- package/dist/modules/teleports/functions/utils.d.ts.map +1 -0
- package/dist/modules/teleports/functions/utils.js +117 -0
- package/dist/modules/teleports/functions/utils.js.map +1 -1
- package/dist/modules/teleports/index.d.ts +3 -2
- package/dist/modules/teleports/index.d.ts.map +1 -0
- package/dist/modules/teleports/index.js +188 -172
- package/dist/modules/teleports/index.js.map +1 -1
- package/dist/modules/timedShutdown/cronJobs/Shutdown.d.ts +1 -0
- package/dist/modules/timedShutdown/cronJobs/Shutdown.d.ts.map +1 -0
- package/dist/modules/timedShutdown/cronJobs/warning.d.ts +1 -0
- package/dist/modules/timedShutdown/cronJobs/warning.d.ts.map +1 -0
- package/dist/modules/timedShutdown/index.d.ts +3 -2
- package/dist/modules/timedShutdown/index.d.ts.map +1 -0
- package/dist/modules/timedShutdown/index.js +35 -27
- package/dist/modules/timedShutdown/index.js.map +1 -1
- package/dist/modules/utils/commands/help.d.ts +1 -0
- package/dist/modules/utils/commands/help.d.ts.map +1 -0
- package/dist/modules/utils/commands/help.js +10 -9
- package/dist/modules/utils/commands/help.js.map +1 -1
- package/dist/modules/utils/commands/ping.d.ts +1 -0
- package/dist/modules/utils/commands/ping.d.ts.map +1 -0
- package/dist/modules/utils/index.d.ts +3 -2
- package/dist/modules/utils/index.d.ts.map +1 -0
- package/dist/modules/utils/index.js +36 -28
- package/dist/modules/utils/index.js.map +1 -1
- package/dist/modules.json +601 -506
- package/package.json +2 -5
- package/scripts/buildBuiltinJson.ts +50 -2
- package/src/BuiltinModule.ts +25 -17
- package/src/__tests__/aliases.integration.test.ts +23 -26
- package/src/__tests__/bugRepros.integration.test.ts +261 -10
- package/src/__tests__/builtinmodule.unit.test.ts +3 -1
- package/src/__tests__/commandArgs.integration.test.ts +13 -6
- package/src/__tests__/economy/claim.integration.test.ts +1 -0
- package/src/__tests__/economy/economyUtils.integration.test.ts +43 -46
- package/src/__tests__/economy/shop.integration.test.ts +28 -4
- package/src/__tests__/economy/zombieKillReward.integration.test.ts +28 -31
- package/src/__tests__/geoblock.integration.test.ts +76 -91
- package/src/__tests__/gimme.integration.test.ts +25 -22
- package/src/__tests__/help.integration.test.ts +21 -20
- package/src/__tests__/lottery.integration.test.ts +15 -11
- package/src/__tests__/modulePermission.integration.test.ts +17 -13
- package/src/__tests__/onboarding.integration.test.ts +43 -43
- package/src/__tests__/ping.integration.test.ts +5 -4
- package/src/__tests__/roleExpiry.integration.test.ts +5 -4
- package/src/__tests__/serverMessages.integration.test.ts +24 -27
- package/src/__tests__/systemConfigCooldown.integration.test.ts +5 -1
- package/src/__tests__/systemConfigCost.integration.test.ts +16 -17
- package/src/__tests__/teleports/listtp.integration.test.ts +20 -21
- package/src/__tests__/teleports/publicteleports.integration.test.ts +58 -70
- package/src/__tests__/teleports/teleport.integration.test.ts +16 -17
- package/src/__tests__/teleports/tpManagement.integration.test.ts +21 -20
- package/src/__tests__/teleports/waypoints.integration.test.ts +52 -6
- package/src/dto/takaroEvents.ts +21 -0
- package/src/main.ts +14 -4
- package/src/modules/chatBridge/index.ts +54 -51
- package/src/modules/dailyRewards/commands/daily.js +118 -0
- package/src/modules/dailyRewards/commands/streak.js +42 -0
- package/src/modules/dailyRewards/commands/topstreak.js +54 -0
- package/src/modules/dailyRewards/functions/utils.js +36 -0
- package/src/modules/dailyRewards/hooks/dailyLoginCheck.js +24 -0
- package/src/modules/dailyRewards/index.ts +136 -0
- package/src/modules/economyUtils/index.ts +182 -179
- package/src/modules/geoBlock/hooks/IPDetected.js +4 -2
- package/src/modules/geoBlock/index.ts +72 -70
- package/src/modules/gimme/commands/gimme.js +16 -6
- package/src/modules/gimme/index.ts +62 -37
- package/src/modules/highPingKicker/index.ts +35 -32
- package/src/modules/lottery/index.ts +73 -71
- package/src/modules/playerOnboarding/commands/starterkit.js +19 -5
- package/src/modules/playerOnboarding/index.ts +72 -47
- package/src/modules/serverMessages/index.ts +36 -32
- package/src/modules/teleports/commands/deletewaypoint.js +4 -53
- package/src/modules/teleports/commands/listwaypoints.js +3 -35
- package/src/modules/teleports/commands/setwaypoint.js +5 -83
- package/src/modules/teleports/commands/teleportwaypoint.js +9 -36
- package/src/modules/teleports/cronJobs/Waypoint reconciler.js +7 -0
- package/src/modules/teleports/functions/utils.js +150 -0
- package/src/modules/teleports/index.ts +196 -180
- package/src/modules/timedShutdown/index.ts +35 -30
- package/src/modules/utils/commands/help.js +14 -14
- package/src/modules/utils/index.ts +36 -32
- package/tsconfig.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare class PlayerOnboarding extends
|
|
1
|
+
import { ModuleTransferDTO } from '../../BuiltinModule.js';
|
|
2
|
+
export declare class PlayerOnboarding extends ModuleTransferDTO<PlayerOnboarding> {
|
|
3
3
|
constructor();
|
|
4
4
|
}
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/playerOnboarding/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAA6C,MAAM,wBAAwB,CAAC;AAGtG,qBAAa,gBAAiB,SAAQ,iBAAiB,CAAC,gBAAgB,CAAC;;CAgFxE"}
|
|
@@ -1,49 +1,79 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ModuleTransferDTO, ICommand, IHook, ModuleTransferVersionDTO } from '../../BuiltinModule.js';
|
|
2
2
|
import { HookEvents } from '../../dto/index.js';
|
|
3
|
-
export class PlayerOnboarding extends
|
|
3
|
+
export class PlayerOnboarding extends ModuleTransferDTO {
|
|
4
4
|
constructor() {
|
|
5
|
-
super(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
5
|
+
super();
|
|
6
|
+
this.name = 'playerOnboarding';
|
|
7
|
+
this.versions = [
|
|
8
|
+
new ModuleTransferVersionDTO({
|
|
9
|
+
tag: '0.0.1',
|
|
10
|
+
description: 'Collection of functions that are executed when a player joins the server. Helps with onboarding new players, like sending a welcome message.',
|
|
11
|
+
configSchema: JSON.stringify({
|
|
12
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
13
|
+
type: 'object',
|
|
14
|
+
properties: {
|
|
15
|
+
message: {
|
|
16
|
+
title: 'Message',
|
|
17
|
+
description: 'The message to send to the player when they join the server.',
|
|
18
|
+
type: 'string',
|
|
19
|
+
minLength: 1,
|
|
20
|
+
maxLength: 256,
|
|
21
|
+
default: 'Welcome {player} to the server!',
|
|
22
|
+
},
|
|
23
|
+
starterKitItems: {
|
|
24
|
+
type: 'array',
|
|
25
|
+
title: 'Starter kit items',
|
|
26
|
+
'x-component': 'item',
|
|
27
|
+
description: 'List of items a player will receive when they execute the starterkit command for the first time.',
|
|
28
|
+
uniqueItems: true,
|
|
29
|
+
items: {
|
|
30
|
+
type: 'object',
|
|
31
|
+
title: 'Item',
|
|
32
|
+
properties: {
|
|
33
|
+
item: {
|
|
34
|
+
type: 'string',
|
|
35
|
+
title: 'Item',
|
|
36
|
+
},
|
|
37
|
+
amount: {
|
|
38
|
+
type: 'number',
|
|
39
|
+
title: 'Amount',
|
|
40
|
+
},
|
|
41
|
+
quality: {
|
|
42
|
+
type: 'string',
|
|
43
|
+
title: 'Quality',
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
},
|
|
25
48
|
},
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
49
|
+
required: [],
|
|
50
|
+
additionalProperties: false,
|
|
51
|
+
}),
|
|
52
|
+
uiSchema: JSON.stringify({
|
|
53
|
+
starterKitItems: {
|
|
54
|
+
items: {
|
|
55
|
+
item: {
|
|
56
|
+
'ui:widget': 'item',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
}),
|
|
61
|
+
hooks: [
|
|
62
|
+
new IHook({
|
|
63
|
+
eventType: HookEvents.PLAYER_CONNECTED,
|
|
64
|
+
name: 'playerConnected',
|
|
65
|
+
function: this.loadFn('hooks', 'playerConnected'),
|
|
66
|
+
}),
|
|
67
|
+
],
|
|
68
|
+
commands: [
|
|
69
|
+
new ICommand({
|
|
70
|
+
name: 'starterkit',
|
|
71
|
+
function: this.loadFn('commands', 'starterkit'),
|
|
72
|
+
trigger: 'starterkit',
|
|
73
|
+
helpText: 'Get a starter kit, you can only execute this once on a server!',
|
|
74
|
+
arguments: [],
|
|
75
|
+
}),
|
|
76
|
+
],
|
|
47
77
|
}),
|
|
48
78
|
];
|
|
49
79
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/playerOnboarding/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/playerOnboarding/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,KAAK,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AACtG,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,MAAM,OAAO,gBAAiB,SAAQ,iBAAmC;IACvE;QACE,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;QAC/B,IAAI,CAAC,QAAQ,GAAG;YACd,IAAI,wBAAwB,CAAC;gBAC3B,GAAG,EAAE,OAAO;gBACZ,WAAW,EACT,8IAA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IAAI,QAAQ,CAAC;wBACX,IAAI,EAAE,YAAY;wBAClB,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,YAAY,CAAC;wBAC/C,OAAO,EAAE,YAAY;wBACrB,QAAQ,EAAE,gEAAgE;wBAC1E,SAAS,EAAE,EAAE;qBACd,CAAC;iBACH;aACF,CAAC;SACH,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Automated message.d.ts","sourceRoot":"","sources":["../../../../src/modules/serverMessages/cronJobs/Automated message.js"],"names":[],"mappings":""}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare class ServerMessages extends
|
|
1
|
+
import { ModuleTransferDTO } from '../../BuiltinModule.js';
|
|
2
|
+
export declare class ServerMessages extends ModuleTransferDTO<ServerMessages> {
|
|
3
3
|
constructor();
|
|
4
4
|
}
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/serverMessages/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAsC,MAAM,wBAAwB,CAAC;AAE/F,qBAAa,cAAe,SAAQ,iBAAiB,CAAC,cAAc,CAAC;;CAyCpE"}
|
|
@@ -1,33 +1,41 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export class ServerMessages extends
|
|
1
|
+
import { ModuleTransferDTO, ICronJob, ModuleTransferVersionDTO } from '../../BuiltinModule.js';
|
|
2
|
+
export class ServerMessages extends ModuleTransferDTO {
|
|
3
3
|
constructor() {
|
|
4
|
-
super(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
4
|
+
super();
|
|
5
|
+
this.name = 'serverMessages';
|
|
6
|
+
this.versions = [
|
|
7
|
+
new ModuleTransferVersionDTO({
|
|
8
|
+
tag: '0.0.1',
|
|
9
|
+
description: 'Send automated, rotated, configurable messages to players on the server.',
|
|
10
|
+
configSchema: JSON.stringify({
|
|
11
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
12
|
+
type: 'object',
|
|
13
|
+
properties: {
|
|
14
|
+
messages: {
|
|
15
|
+
type: 'array',
|
|
16
|
+
title: 'Messages',
|
|
17
|
+
description: 'List of messages that will be sent to players on the server.',
|
|
18
|
+
default: [
|
|
19
|
+
// prettier-ignore
|
|
20
|
+
'This is an automated message, don\'t forget to read the server rules!',
|
|
21
|
+
],
|
|
22
|
+
items: {
|
|
23
|
+
type: 'string',
|
|
24
|
+
minLength: 5,
|
|
25
|
+
maxLength: 1024,
|
|
26
|
+
},
|
|
27
|
+
minItems: 1,
|
|
28
|
+
},
|
|
20
29
|
},
|
|
21
|
-
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
function: this.loadFn('cronJobs', 'Automated message'),
|
|
30
|
+
required: ['messages'],
|
|
31
|
+
}),
|
|
32
|
+
cronJobs: [
|
|
33
|
+
new ICronJob({
|
|
34
|
+
name: 'Automated message',
|
|
35
|
+
temporalValue: '*/30 * * * *',
|
|
36
|
+
function: this.loadFn('cronJobs', 'Automated message'),
|
|
37
|
+
}),
|
|
38
|
+
],
|
|
31
39
|
}),
|
|
32
40
|
];
|
|
33
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/serverMessages/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/serverMessages/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAE/F,MAAM,OAAO,cAAe,SAAQ,iBAAiC;IACnE;QACE,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;QAC7B,IAAI,CAAC,QAAQ,GAAG;YACd,IAAI,wBAAwB,CAAC;gBAC3B,GAAG,EAAE,OAAO;gBACZ,WAAW,EAAE,0EAA0E;gBACvF,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC;oBAC3B,OAAO,EAAE,yCAAyC;oBAClD,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,QAAQ,EAAE;4BACR,IAAI,EAAE,OAAO;4BACb,KAAK,EAAE,UAAU;4BACjB,WAAW,EAAE,8DAA8D;4BAC3E,OAAO,EAAE;gCACP,kBAAkB;gCAClB,uEAAuE;6BACxE;4BACD,KAAK,EAAE;gCACL,IAAI,EAAE,QAAQ;gCACd,SAAS,EAAE,CAAC;gCACZ,SAAS,EAAE,IAAI;6BAChB;4BACD,QAAQ,EAAE,CAAC;yBACZ;qBACF;oBACD,QAAQ,EAAE,CAAC,UAAU,CAAC;iBACvB,CAAC;gBACF,QAAQ,EAAE;oBACR,IAAI,QAAQ,CAAC;wBACX,IAAI,EAAE,mBAAmB;wBACzB,aAAa,EAAE,cAAc;wBAC7B,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,mBAAmB,CAAC;qBACvD,CAAC;iBACH;aACF,CAAC;SACH,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deletetp.d.ts","sourceRoot":"","sources":["../../../../src/modules/teleports/commands/deletetp.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deletewaypoint.d.ts","sourceRoot":"","sources":["../../../../src/modules/teleports/commands/deletewaypoint.js"],"names":[],"mappings":""}
|
|
@@ -1,53 +1,22 @@
|
|
|
1
1
|
import { takaro, data, checkPermission, TakaroUserError } from '@takaro/helpers';
|
|
2
|
-
|
|
3
|
-
return `waypoint ${name}`;
|
|
4
|
-
}
|
|
2
|
+
import { getWaypointName, waypointReconciler } from './utils.js';
|
|
5
3
|
async function main() {
|
|
6
|
-
const { pog, gameServerId, arguments: args } = data;
|
|
4
|
+
const { pog, gameServerId, arguments: args, module: mod } = data;
|
|
7
5
|
if (!checkPermission(pog, 'TELEPORTS_MANAGE_WAYPOINTS')) {
|
|
8
6
|
throw new TakaroUserError('You do not have permission to manage waypoints.');
|
|
9
7
|
}
|
|
10
|
-
async function ensureWaypointsModule() {
|
|
11
|
-
let waypointsDefinition = (await takaro.module.moduleControllerSearch({
|
|
12
|
-
filters: {
|
|
13
|
-
name: ['Waypoints'],
|
|
14
|
-
},
|
|
15
|
-
})).data.data[0];
|
|
16
|
-
if (!waypointsDefinition) {
|
|
17
|
-
console.log('Waypoints module definition not found, creating it.');
|
|
18
|
-
waypointsDefinition = (await takaro.module.moduleControllerCreate({
|
|
19
|
-
name: 'Waypoints',
|
|
20
|
-
description: 'Waypoints module for the teleport system.',
|
|
21
|
-
})).data.data;
|
|
22
|
-
}
|
|
23
|
-
let waypointsInstallation = (await takaro.gameserver.gameServerControllerGetInstalledModules(gameServerId)).data.data.find((module) => module.name === 'Waypoints');
|
|
24
|
-
if (!waypointsInstallation) {
|
|
25
|
-
console.log('Waypoints module not found, installing it.');
|
|
26
|
-
waypointsInstallation = (await takaro.gameserver.gameServerControllerInstallModule(gameServerId, waypointsDefinition.id)).data.data;
|
|
27
|
-
}
|
|
28
|
-
return { waypointsInstallation, waypointsDefinition };
|
|
29
|
-
}
|
|
30
|
-
const { waypointsInstallation } = await ensureWaypointsModule();
|
|
31
8
|
const variable = await takaro.variable.variableControllerSearch({
|
|
32
9
|
filters: {
|
|
33
10
|
key: [getWaypointName(args.waypoint)],
|
|
34
11
|
gameServerId: [gameServerId],
|
|
35
|
-
moduleId: [
|
|
12
|
+
moduleId: [mod.moduleId],
|
|
36
13
|
},
|
|
37
14
|
});
|
|
38
15
|
if (!variable.data.data.length) {
|
|
39
16
|
throw new TakaroUserError(`Waypoint ${args.waypoint} doesn't exist.`);
|
|
40
17
|
}
|
|
41
18
|
await takaro.variable.variableControllerDelete(variable.data.data[0].id);
|
|
42
|
-
|
|
43
|
-
filters: {
|
|
44
|
-
moduleId: [waypointsInstallation.moduleId],
|
|
45
|
-
name: [`waypoint ${args.waypoint} server ${gameServerId}`],
|
|
46
|
-
},
|
|
47
|
-
});
|
|
48
|
-
if (teleportCommand.data.data.length) {
|
|
49
|
-
await takaro.command.commandControllerRemove(teleportCommand.data.data[0].id);
|
|
50
|
-
}
|
|
19
|
+
await waypointReconciler();
|
|
51
20
|
await pog.pm(`Waypoint ${args.waypoint} deleted.`);
|
|
52
21
|
}
|
|
53
22
|
await main();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deletewaypoint.js","sourceRoot":"","sources":["../../../../src/modules/teleports/commands/deletewaypoint.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"deletewaypoint.js","sourceRoot":"","sources":["../../../../src/modules/teleports/commands/deletewaypoint.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEjE,KAAK,UAAU,IAAI;IACjB,MAAM,EAAE,GAAG,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IAEjE,IAAI,CAAC,eAAe,CAAC,GAAG,EAAE,4BAA4B,CAAC,EAAE,CAAC;QACxD,MAAM,IAAI,eAAe,CAAC,iDAAiD,CAAC,CAAC;IAC/E,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,wBAAwB,CAAC;QAC9D,OAAO,EAAE;YACP,GAAG,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACrC,YAAY,EAAE,CAAC,YAAY,CAAC;YAC5B,QAAQ,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC;SACzB;KACF,CAAC,CAAC;IAEH,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;QAC/B,MAAM,IAAI,eAAe,CAAC,YAAY,IAAI,CAAC,QAAQ,iBAAiB,CAAC,CAAC;IACxE,CAAC;IAED,MAAM,MAAM,CAAC,QAAQ,CAAC,wBAAwB,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACzE,MAAM,kBAAkB,EAAE,CAAC;IAC3B,MAAM,GAAG,CAAC,EAAE,CAAC,YAAY,IAAI,CAAC,QAAQ,WAAW,CAAC,CAAC;AACrD,CAAC;AAED,MAAM,IAAI,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listwaypoints.d.ts","sourceRoot":"","sources":["../../../../src/modules/teleports/commands/listwaypoints.js"],"names":[],"mappings":""}
|
|
@@ -1,28 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { data, checkPermission } from '@takaro/helpers';
|
|
2
|
+
import { ensureWaypointsModule } from './utils.js';
|
|
2
3
|
async function main() {
|
|
3
4
|
const { pog, gameServerId } = data;
|
|
4
|
-
async function ensureWaypointsModule() {
|
|
5
|
-
let waypointsDefinition = (await takaro.module.moduleControllerSearch({
|
|
6
|
-
filters: {
|
|
7
|
-
name: ['Waypoints'],
|
|
8
|
-
},
|
|
9
|
-
})).data.data[0];
|
|
10
|
-
if (!waypointsDefinition) {
|
|
11
|
-
console.log('Waypoints module definition not found, creating it.');
|
|
12
|
-
waypointsDefinition = (await takaro.module.moduleControllerCreate({
|
|
13
|
-
name: 'Waypoints',
|
|
14
|
-
description: 'Waypoints module for the teleport system.',
|
|
15
|
-
})).data.data;
|
|
16
|
-
}
|
|
17
|
-
let waypointsInstallation = (await takaro.gameserver.gameServerControllerGetInstalledModules(gameServerId)).data.data.find((module) => module.name === 'Waypoints');
|
|
18
|
-
if (!waypointsInstallation) {
|
|
19
|
-
console.log('Waypoints module not found, installing it.');
|
|
20
|
-
waypointsInstallation = (await takaro.gameserver.gameServerControllerInstallModule(gameServerId, waypointsDefinition.id)).data.data;
|
|
21
|
-
}
|
|
22
|
-
return { waypointsInstallation, waypointsDefinition };
|
|
23
|
-
}
|
|
24
5
|
const { waypointsDefinition } = await ensureWaypointsModule();
|
|
25
|
-
const allWaypoints = waypointsDefinition.commands;
|
|
6
|
+
const allWaypoints = waypointsDefinition.latestVersion.commands;
|
|
26
7
|
const waypointsWithPermission = allWaypoints
|
|
27
8
|
.filter((waypoint) => checkPermission(pog, `WAYPOINTS_USE_${waypoint.trigger.toUpperCase()}_${gameServerId}`))
|
|
28
9
|
.sort((a, b) => a.trigger.localeCompare(b.trigger));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listwaypoints.js","sourceRoot":"","sources":["../../../../src/modules/teleports/commands/listwaypoints.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"listwaypoints.js","sourceRoot":"","sources":["../../../../src/modules/teleports/commands/listwaypoints.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAEnD,KAAK,UAAU,IAAI;IACjB,MAAM,EAAE,GAAG,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IAEnC,MAAM,EAAE,mBAAmB,EAAE,GAAG,MAAM,qBAAqB,EAAE,CAAC;IAE9D,MAAM,YAAY,GAAG,mBAAmB,CAAC,aAAa,CAAC,QAAQ,CAAC;IAEhE,MAAM,uBAAuB,GAAG,YAAY;SACzC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,eAAe,CAAC,GAAG,EAAE,iBAAiB,QAAQ,CAAC,OAAO,CAAC,WAAW,EAAE,IAAI,YAAY,EAAE,CAAC,CAAC;SAC7G,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAEtD,IAAI,CAAC,uBAAuB,CAAC,MAAM,EAAE,CAAC;QACpC,MAAM,GAAG,CAAC,EAAE,CAAC,mCAAmC,CAAC,CAAC;QAClD,OAAO;IACT,CAAC;IAED,MAAM,GAAG,CAAC,EAAE,CAAC,wBAAwB,uBAAuB,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACjH,CAAC;AAED,MAAM,IAAI,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setprivate.d.ts","sourceRoot":"","sources":["../../../../src/modules/teleports/commands/setprivate.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setpublic.d.ts","sourceRoot":"","sources":["../../../../src/modules/teleports/commands/setpublic.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settp.d.ts","sourceRoot":"","sources":["../../../../src/modules/teleports/commands/settp.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setwaypoint.d.ts","sourceRoot":"","sources":["../../../../src/modules/teleports/commands/setwaypoint.js"],"names":[],"mappings":""}
|
|
@@ -1,36 +1,13 @@
|
|
|
1
1
|
import { takaro, data, checkPermission, TakaroUserError } from '@takaro/helpers';
|
|
2
|
-
|
|
3
|
-
return `waypoint ${name}`;
|
|
4
|
-
}
|
|
2
|
+
import { getWaypointName, waypointReconciler } from './utils.js';
|
|
5
3
|
async function main() {
|
|
6
|
-
const { pog, gameServerId,
|
|
4
|
+
const { pog, gameServerId, arguments: args, module: mod } = data;
|
|
7
5
|
if (!checkPermission(pog, 'TELEPORTS_MANAGE_WAYPOINTS')) {
|
|
8
6
|
throw new TakaroUserError('You do not have permission to manage waypoints.');
|
|
9
7
|
}
|
|
10
|
-
async function ensureWaypointsModule() {
|
|
11
|
-
let waypointsDefinition = (await takaro.module.moduleControllerSearch({
|
|
12
|
-
filters: {
|
|
13
|
-
name: ['Waypoints'],
|
|
14
|
-
},
|
|
15
|
-
})).data.data[0];
|
|
16
|
-
if (!waypointsDefinition) {
|
|
17
|
-
console.log('Waypoints module definition not found, creating it.');
|
|
18
|
-
waypointsDefinition = (await takaro.module.moduleControllerCreate({
|
|
19
|
-
name: 'Waypoints',
|
|
20
|
-
description: 'Waypoints module for the teleport system.',
|
|
21
|
-
})).data.data;
|
|
22
|
-
}
|
|
23
|
-
let waypointsInstallation = (await takaro.gameserver.gameServerControllerGetInstalledModules(gameServerId)).data.data.find((module) => module.name === 'Waypoints');
|
|
24
|
-
if (!waypointsInstallation) {
|
|
25
|
-
console.log('Waypoints module not found, installing it.');
|
|
26
|
-
waypointsInstallation = (await takaro.gameserver.gameServerControllerInstallModule(gameServerId, waypointsDefinition.id)).data.data;
|
|
27
|
-
}
|
|
28
|
-
return { waypointsInstallation, waypointsDefinition };
|
|
29
|
-
}
|
|
30
|
-
const { waypointsInstallation, waypointsDefinition } = await ensureWaypointsModule();
|
|
31
8
|
try {
|
|
32
9
|
await takaro.variable.variableControllerCreate({
|
|
33
|
-
moduleId:
|
|
10
|
+
moduleId: mod.moduleId,
|
|
34
11
|
gameServerId,
|
|
35
12
|
key: getWaypointName(args.waypoint),
|
|
36
13
|
value: JSON.stringify({
|
|
@@ -44,44 +21,9 @@ async function main() {
|
|
|
44
21
|
if (error.message === 'Request failed with status code 409') {
|
|
45
22
|
throw new TakaroUserError(`Waypoint ${args.waypoint} already exists.`);
|
|
46
23
|
}
|
|
24
|
+
throw error;
|
|
47
25
|
}
|
|
48
|
-
|
|
49
|
-
filters: {
|
|
50
|
-
moduleId: [mod.moduleId],
|
|
51
|
-
name: ['teleportwaypoint'],
|
|
52
|
-
},
|
|
53
|
-
});
|
|
54
|
-
await takaro.command.commandControllerCreate({
|
|
55
|
-
moduleId: waypointsInstallation.moduleId,
|
|
56
|
-
name: `waypoint ${args.waypoint} server ${gameServerId}`,
|
|
57
|
-
trigger: args.waypoint,
|
|
58
|
-
helpText: `Teleport to waypoint ${args.waypoint}.`,
|
|
59
|
-
function: teleportCommand.data.data[0].function.code,
|
|
60
|
-
});
|
|
61
|
-
const existingPermissions = waypointsDefinition.permissions || [];
|
|
62
|
-
const permissionInputDTOs = existingPermissions.map((permission) => ({
|
|
63
|
-
permission: permission.permission,
|
|
64
|
-
description: permission.description,
|
|
65
|
-
friendlyName: permission.friendlyName,
|
|
66
|
-
canHaveCount: permission.canHaveCount,
|
|
67
|
-
}));
|
|
68
|
-
const gameServer = (await takaro.gameserver.gameServerControllerGetOne(gameServerId)).data.data;
|
|
69
|
-
await takaro.module.moduleControllerUpdate(waypointsInstallation.moduleId, {
|
|
70
|
-
permissions: [
|
|
71
|
-
{
|
|
72
|
-
permission: `WAYPOINTS_USE_${args.waypoint.toUpperCase()}_${gameServerId}`,
|
|
73
|
-
description: `Use the waypoint ${args.waypoint} on ${gameServer.name}.`,
|
|
74
|
-
friendlyName: `Use waypoint ${args.waypoint} on ${gameServer.name}`,
|
|
75
|
-
canHaveCount: false,
|
|
76
|
-
},
|
|
77
|
-
...permissionInputDTOs,
|
|
78
|
-
],
|
|
79
|
-
});
|
|
80
|
-
// Need to reinstall the module to ensure the new commands systemconfig and permissions are properly in place
|
|
81
|
-
await takaro.gameserver.gameServerControllerInstallModule(gameServerId, waypointsInstallation.moduleId, {
|
|
82
|
-
systemConfig: JSON.stringify(waypointsInstallation.systemConfig),
|
|
83
|
-
userConfig: JSON.stringify(waypointsInstallation.userConfig),
|
|
84
|
-
});
|
|
26
|
+
await waypointReconciler();
|
|
85
27
|
await pog.pm(`Waypoint ${args.waypoint} set.`);
|
|
86
28
|
}
|
|
87
29
|
await main();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setwaypoint.js","sourceRoot":"","sources":["../../../../src/modules/teleports/commands/setwaypoint.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"setwaypoint.js","sourceRoot":"","sources":["../../../../src/modules/teleports/commands/setwaypoint.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEjE,KAAK,UAAU,IAAI;IACjB,MAAM,EAAE,GAAG,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IAEjE,IAAI,CAAC,eAAe,CAAC,GAAG,EAAE,4BAA4B,CAAC,EAAE,CAAC;QACxD,MAAM,IAAI,eAAe,CAAC,iDAAiD,CAAC,CAAC;IAC/E,CAAC;IAED,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,QAAQ,CAAC,wBAAwB,CAAC;YAC7C,QAAQ,EAAE,GAAG,CAAC,QAAQ;YACtB,YAAY;YACZ,GAAG,EAAE,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC;YACnC,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC;gBACpB,CAAC,EAAE,GAAG,CAAC,SAAS;gBAChB,CAAC,EAAE,GAAG,CAAC,SAAS;gBAChB,CAAC,EAAE,GAAG,CAAC,SAAS;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,CAAC,OAAO,KAAK,qCAAqC,EAAE,CAAC;YAC5D,MAAM,IAAI,eAAe,CAAC,YAAY,IAAI,CAAC,QAAQ,kBAAkB,CAAC,CAAC;QACzE,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;IAED,MAAM,kBAAkB,EAAE,CAAC;IAE3B,MAAM,GAAG,CAAC,EAAE,CAAC,YAAY,IAAI,CAAC,QAAQ,OAAO,CAAC,CAAC;AACjD,CAAC;AAED,MAAM,IAAI,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"teleport.d.ts","sourceRoot":"","sources":["../../../../src/modules/teleports/commands/teleport.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"teleportwaypoint.d.ts","sourceRoot":"","sources":["../../../../src/modules/teleports/commands/teleportwaypoint.js"],"names":[],"mappings":""}
|
|
@@ -4,7 +4,7 @@ function getWaypointName(name) {
|
|
|
4
4
|
}
|
|
5
5
|
async function main() {
|
|
6
6
|
const { pog, gameServerId, trigger, module, itemId } = data;
|
|
7
|
-
const triggeredCommand = module.
|
|
7
|
+
const triggeredCommand = module.version.commands.find((command) => command.id === itemId);
|
|
8
8
|
if (!triggeredCommand) {
|
|
9
9
|
throw new Error('Waypoint not found.');
|
|
10
10
|
}
|
|
@@ -15,32 +15,16 @@ async function main() {
|
|
|
15
15
|
if (!checkPermission(pog, `WAYPOINTS_USE_${trigger.toUpperCase()}_${gameServerId}`)) {
|
|
16
16
|
throw new TakaroUserError(`You are not allowed to use the waypoint ${trigger}.`);
|
|
17
17
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
})).data.data[0];
|
|
24
|
-
if (!waypointsDefinition) {
|
|
25
|
-
console.log('Waypoints module definition not found, creating it.');
|
|
26
|
-
waypointsDefinition = (await takaro.module.moduleControllerCreate({
|
|
27
|
-
name: 'Waypoints',
|
|
28
|
-
description: 'Waypoints module for the teleport system.',
|
|
29
|
-
})).data.data;
|
|
30
|
-
}
|
|
31
|
-
let waypointsInstallation = (await takaro.gameserver.gameServerControllerGetInstalledModules(gameServerId)).data.data.find((module) => module.name === 'Waypoints');
|
|
32
|
-
if (!waypointsInstallation) {
|
|
33
|
-
console.log('Waypoints module not found, installing it.');
|
|
34
|
-
waypointsInstallation = (await takaro.gameserver.gameServerControllerInstallModule(gameServerId, waypointsDefinition.id)).data.data;
|
|
35
|
-
}
|
|
36
|
-
return { waypointsInstallation, waypointsDefinition };
|
|
37
|
-
}
|
|
38
|
-
const { waypointsInstallation } = await ensureWaypointsModule();
|
|
18
|
+
const teleportsModule = (await takaro.module.moduleControllerSearch({
|
|
19
|
+
filters: {
|
|
20
|
+
builtin: ['teleports'],
|
|
21
|
+
},
|
|
22
|
+
})).data.data[0];
|
|
39
23
|
const variable = await takaro.variable.variableControllerSearch({
|
|
40
24
|
filters: {
|
|
41
25
|
key: [getWaypointName(trigger)],
|
|
42
26
|
gameServerId: [gameServerId],
|
|
43
|
-
moduleId: [
|
|
27
|
+
moduleId: [teleportsModule.id],
|
|
44
28
|
},
|
|
45
29
|
});
|
|
46
30
|
if (variable.data.data.length === 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"teleportwaypoint.js","sourceRoot":"","sources":["../../../../src/modules/teleports/commands/teleportwaypoint.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEjF,SAAS,eAAe,CAAC,IAAI;IAC3B,OAAO,YAAY,IAAI,EA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