@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Waypoint reconciler.d.ts","sourceRoot":"","sources":["../../../../src/modules/teleports/cronJobs/Waypoint reconciler.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Waypoint reconciler.js","sourceRoot":"","sources":["../../../../src/modules/teleports/cronJobs/Waypoint reconciler.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,KAAK,UAAU,IAAI;IACjB,MAAM,kBAAkB,EAAE,CAAC;AAC7B,CAAC;AAED,MAAM,IAAI,EAAE,CAAC"}
|
|
@@ -1,2 +1,14 @@
|
|
|
1
1
|
export function getVariableKey(tpName: any, pub?: boolean): string;
|
|
2
2
|
export function findTp(tpName: any, playerId: any, pub?: boolean): Promise<any>;
|
|
3
|
+
export function ensureWaypointsModule(): Promise<{
|
|
4
|
+
waypointsInstallation: any;
|
|
5
|
+
waypointsDefinition: any;
|
|
6
|
+
}>;
|
|
7
|
+
export function getWaypointName(name: any): string;
|
|
8
|
+
export function getWaypointId(varName: any): any;
|
|
9
|
+
/**
|
|
10
|
+
* This function is responsible to read all the configured waypoints (vars)
|
|
11
|
+
* and then ensuring that the waypoints module has the correct config
|
|
12
|
+
*/
|
|
13
|
+
export function waypointReconciler(): Promise<void>;
|
|
14
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/modules/teleports/functions/utils.js"],"names":[],"mappings":"AAEA,mEAKC;AAED,gFA0BC;AAED;;;GAoCC;AAED,mDAEC;AAED,iDAIC;AAED;;;GAGG;AACH,oDAgGC"}
|
|
@@ -33,4 +33,121 @@ export async function findTp(tpName, playerId, pub = false) {
|
|
|
33
33
|
sortDirection: 'asc',
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
+
export async function ensureWaypointsModule() {
|
|
37
|
+
const { gameServerId } = data;
|
|
38
|
+
let waypointsDefinition = (await takaro.module.moduleControllerSearch({
|
|
39
|
+
filters: {
|
|
40
|
+
name: ['Waypoints'],
|
|
41
|
+
},
|
|
42
|
+
})).data.data[0];
|
|
43
|
+
if (!waypointsDefinition) {
|
|
44
|
+
console.log('Waypoints module definition not found, creating it.');
|
|
45
|
+
waypointsDefinition = (await takaro.module.moduleControllerCreate({
|
|
46
|
+
name: 'Waypoints',
|
|
47
|
+
})).data.data;
|
|
48
|
+
}
|
|
49
|
+
let waypointsInstallation = (await takaro.module.moduleInstallationsControllerGetInstalledModules({
|
|
50
|
+
filters: { gameserverId: [gameServerId] },
|
|
51
|
+
})).data.data.find((module) => module.module.name === 'Waypoints');
|
|
52
|
+
if (!waypointsInstallation) {
|
|
53
|
+
console.log('Waypoints installation not found, installing it.');
|
|
54
|
+
waypointsInstallation = (await takaro.module.moduleInstallationsControllerInstallModule({
|
|
55
|
+
gameServerId,
|
|
56
|
+
versionId: waypointsDefinition.latestVersion.id,
|
|
57
|
+
})).data.data;
|
|
58
|
+
}
|
|
59
|
+
return { waypointsInstallation, waypointsDefinition };
|
|
60
|
+
}
|
|
61
|
+
export function getWaypointName(name) {
|
|
62
|
+
return `waypoint ${name}`;
|
|
63
|
+
}
|
|
64
|
+
export function getWaypointId(varName) {
|
|
65
|
+
const split = varName.split(' ')[1];
|
|
66
|
+
if (split)
|
|
67
|
+
return split;
|
|
68
|
+
return varName;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* This function is responsible to read all the configured waypoints (vars)
|
|
72
|
+
* and then ensuring that the waypoints module has the correct config
|
|
73
|
+
*/
|
|
74
|
+
export async function waypointReconciler() {
|
|
75
|
+
console.log('Reconciling waypoints');
|
|
76
|
+
const { waypointsInstallation, waypointsDefinition } = await ensureWaypointsModule();
|
|
77
|
+
const { gameServerId, module: mod } = data;
|
|
78
|
+
// Get all the installed waypoints
|
|
79
|
+
const waypointVars = (await takaro.variable.variableControllerSearch({
|
|
80
|
+
filters: {
|
|
81
|
+
moduleId: [mod.moduleId],
|
|
82
|
+
gameServerId: [gameServerId],
|
|
83
|
+
},
|
|
84
|
+
})).data.data;
|
|
85
|
+
const waypointsInModule = waypointsDefinition.latestVersion.commands;
|
|
86
|
+
// Check if any waypoints are missing in module
|
|
87
|
+
const missingWaypoints = waypointVars.filter((waypointVar) => {
|
|
88
|
+
const existingWaypointsForServer = waypointsInModule.filter((waypoint) => waypoint.name.includes(gameServerId));
|
|
89
|
+
return !existingWaypointsForServer.some((waypoint) => waypoint.trigger === getWaypointId(waypointVar.key));
|
|
90
|
+
});
|
|
91
|
+
// Check if there are waypoints too many in module compared to our vars
|
|
92
|
+
const toDeleteWaypoints = waypointsInModule.filter((waypoint) => {
|
|
93
|
+
// We ignore any commands that are not for this game server
|
|
94
|
+
if (!waypoint.name.includes(gameServerId))
|
|
95
|
+
return false;
|
|
96
|
+
return !waypointVars.some((waypointVar) => getWaypointId(waypointVar.key) === waypoint.trigger);
|
|
97
|
+
});
|
|
98
|
+
if (!missingWaypoints.length && !toDeleteWaypoints.length) {
|
|
99
|
+
// No changes in waypoints, exit
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
console.log('Missing waypoints:', missingWaypoints.map((waypoint) => waypoint.key));
|
|
103
|
+
console.log('To delete waypoints:', toDeleteWaypoints.map((waypoint) => waypoint.trigger));
|
|
104
|
+
// Fetch the teleporting code template
|
|
105
|
+
const teleportCommand = await takaro.command.commandControllerSearch({
|
|
106
|
+
filters: {
|
|
107
|
+
moduleId: [mod.moduleId],
|
|
108
|
+
name: ['teleportwaypoint'],
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
// Edit the module accordingly
|
|
112
|
+
await Promise.all([
|
|
113
|
+
...missingWaypoints.map((waypoint) => {
|
|
114
|
+
return takaro.command.commandControllerCreate({
|
|
115
|
+
name: `waypoint ${getWaypointId(waypoint.key)} server ${gameServerId}`,
|
|
116
|
+
trigger: getWaypointId(waypoint.key),
|
|
117
|
+
helpText: `Teleport to waypoint ${getWaypointId(waypoint.key)}.`,
|
|
118
|
+
function: teleportCommand.data.data[0].function.code,
|
|
119
|
+
versionId: waypointsInstallation.versionId,
|
|
120
|
+
});
|
|
121
|
+
}),
|
|
122
|
+
...toDeleteWaypoints.map((waypointVar) => {
|
|
123
|
+
return takaro.command.commandControllerRemove(waypointVar.id);
|
|
124
|
+
}),
|
|
125
|
+
]);
|
|
126
|
+
// Update permissions
|
|
127
|
+
const existingPermissions = waypointsDefinition.latestVersion.permissions || [];
|
|
128
|
+
const permissionInputDTOs = existingPermissions.map((permission) => ({
|
|
129
|
+
permission: permission.permission,
|
|
130
|
+
description: permission.description,
|
|
131
|
+
friendlyName: permission.friendlyName,
|
|
132
|
+
canHaveCount: permission.canHaveCount,
|
|
133
|
+
}));
|
|
134
|
+
// We need to filter out the permissions we deleted in the above lines
|
|
135
|
+
const filteredPermissionsInputs = permissionInputDTOs.filter((permission) => {
|
|
136
|
+
return !toDeleteWaypoints.some((waypoint) => permission.permission === `WAYPOINTS_USE_${waypoint.trigger.toUpperCase()}_${gameServerId}`);
|
|
137
|
+
});
|
|
138
|
+
const gameServer = (await takaro.gameserver.gameServerControllerGetOne(gameServerId)).data.data;
|
|
139
|
+
await takaro.module.moduleControllerUpdate(waypointsInstallation.moduleId, {
|
|
140
|
+
latestVersion: {
|
|
141
|
+
permissions: [
|
|
142
|
+
...filteredPermissionsInputs,
|
|
143
|
+
...missingWaypoints.map((waypoint) => ({
|
|
144
|
+
permission: `WAYPOINTS_USE_${getWaypointId(waypoint.key).toUpperCase()}_${gameServerId}`,
|
|
145
|
+
description: `Use the waypoint ${getWaypointId(waypoint.key)} on ${gameServer.name}.`,
|
|
146
|
+
friendlyName: `Use waypoint ${getWaypointId(waypoint.key)} on ${gameServer.name}`,
|
|
147
|
+
canHaveCount: false,
|
|
148
|
+
})),
|
|
149
|
+
],
|
|
150
|
+
},
|
|
151
|
+
});
|
|
152
|
+
}
|
|
36
153
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/modules/teleports/functions/utils.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,UAAU,cAAc,CAAC,MAAM,EAAE,GAAG,GAAG,KAAK;IAChD,IAAI,GAAG,IAAI,MAAM;QAAE,OAAO,SAAS,MAAM,EAAE,CAAC;IAC5C,IAAI,GAAG,IAAI,CAAC,MAAM;QAAE,OAAO,QAAQ,CAAC;IACpC,IAAI,MAAM;QAAE,OAAO,MAAM,MAAM,EAAE,CAAC;IAClC,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,KAAK;IACxD,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IAE3C,IAAI,GAAG,EAAE,CAAC;QACR,OAAO,MAAM,CAAC,QAAQ,CAAC,wBAAwB,CAAC;YAC9C,OAAO,EAAE;gBACP,GAAG,EAAE,CAAC,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;gBACnC,YAAY,EAAE,CAAC,YAAY,CAAC;gBAC5B,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC;gBACpC,QAAQ,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC;aACzB;YACD,MAAM,EAAE,KAAK;YACb,aAA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CAAC,YAAY;QACrC,YAAY,EAAE,UAAU,CAAC,YAAY;KACtC,CAAC,CAAC,CAAC;IACJ,sEAAsE;IACtE,MAAM,yBAAyB,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,EAAE;QAC1E,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAC5B,CAAC,QAAQ,EAAE,EAAE,CAAC,UAAU,CAAC,UAAU,KAAK,iBAAiB,QAAQ,CAAC,OAAO,CAAC,WAAW,EAAE,IAAI,YAAY,EAAE,CAC1G,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,MAAM,UAAU,GAAG,CAAC,MAAM,MAAM,CAAC,UAAU,CAAC,0BAA0B,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;IAChG,MAAM,MAAM,CAAC,MAAM,CAAC,sBAAsB,CAAC,qBAAqB,CAAC,QAAQ,EAAE;QACzE,aAAa,EAAE;YACb,WAAW,EAAE;gBACX,GAAG,yBAAyB;gBAC5B,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;oBACrC,UAAU,EAAE,iBAAiB,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,IAAI,YAAY,EAAE;oBACxF,WAAW,EAAE,oBAAoB,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,UAAU,CAAC,IAAI,GAAG;oBACrF,YAAY,EAAE,gBAAgB,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,UAAU,CAAC,IAAI,EAAE;oBACjF,YAAY,EAAE,KAAK;iBACpB,CAAC,CAAC;aACJ;SACF;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare class Teleports extends
|
|
1
|
+
import { ModuleTransferDTO } from '../../BuiltinModule.js';
|
|
2
|
+
export declare class Teleports extends ModuleTransferDTO<Teleports> {
|
|
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/teleports/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAMlB,MAAM,wBAAwB,CAAC;AAGhC,qBAAa,SAAU,SAAQ,iBAAiB,CAAC,SAAS,CAAC;;CAsM1D"}
|
|
@@ -1,183 +1,199 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ModuleTransferDTO, ICommand, IFunction, IPermission, ModuleTransferVersionDTO, ICronJob, } from '../../BuiltinModule.js';
|
|
2
2
|
import { Duration } from 'luxon';
|
|
3
|
-
export class Teleports extends
|
|
3
|
+
export class Teleports extends ModuleTransferDTO {
|
|
4
4
|
constructor() {
|
|
5
|
-
super(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
type: '
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
this.functions = [
|
|
29
|
-
new IFunction({
|
|
30
|
-
name: 'utils',
|
|
31
|
-
function: this.loadFn('functions', 'utils'),
|
|
32
|
-
}),
|
|
33
|
-
];
|
|
34
|
-
this.permissions = [
|
|
35
|
-
new IPermission({
|
|
36
|
-
permission: 'TELEPORTS_CREATE_PUBLIC',
|
|
37
|
-
friendlyName: 'Create Public Teleports',
|
|
38
|
-
description: 'Allows the player to create public teleports.',
|
|
39
|
-
canHaveCount: true,
|
|
40
|
-
}),
|
|
41
|
-
new IPermission({
|
|
42
|
-
permission: 'TELEPORTS_USE',
|
|
43
|
-
friendlyName: 'Use Teleports',
|
|
44
|
-
description: 'Allows the player to use teleports modules.',
|
|
45
|
-
canHaveCount: true,
|
|
46
|
-
}),
|
|
47
|
-
new IPermission({
|
|
48
|
-
permission: 'TELEPORTS_MANAGE_WAYPOINTS',
|
|
49
|
-
friendlyName: 'Manage waypoints',
|
|
50
|
-
description: 'Allows creating, deleting, and managing waypoints.',
|
|
51
|
-
canHaveCount: false,
|
|
52
|
-
}),
|
|
53
|
-
];
|
|
54
|
-
this.commands = [
|
|
55
|
-
new ICommand({
|
|
56
|
-
function: this.loadFn('commands', 'teleport'),
|
|
57
|
-
name: 'teleport',
|
|
58
|
-
trigger: 'tp',
|
|
59
|
-
helpText: 'Teleports to one of your set locations.',
|
|
60
|
-
arguments: [
|
|
61
|
-
{
|
|
62
|
-
name: 'tp',
|
|
63
|
-
type: 'string',
|
|
64
|
-
defaultValue: null,
|
|
65
|
-
helpText: 'The location to teleport to.',
|
|
66
|
-
position: 0,
|
|
67
|
-
},
|
|
68
|
-
],
|
|
69
|
-
}),
|
|
70
|
-
new ICommand({
|
|
71
|
-
function: this.loadFn('commands', 'tplist'),
|
|
72
|
-
name: 'tplist',
|
|
73
|
-
trigger: 'tplist',
|
|
74
|
-
helpText: 'Lists all your set locations.',
|
|
75
|
-
arguments: [],
|
|
76
|
-
}),
|
|
77
|
-
new ICommand({
|
|
78
|
-
function: this.loadFn('commands', 'settp'),
|
|
79
|
-
name: 'settp',
|
|
80
|
-
trigger: 'settp',
|
|
81
|
-
helpText: 'Sets a location to teleport to.',
|
|
82
|
-
arguments: [
|
|
83
|
-
{
|
|
84
|
-
name: 'tp',
|
|
85
|
-
type: 'string',
|
|
86
|
-
defaultValue: null,
|
|
87
|
-
helpText: 'The location name.',
|
|
88
|
-
position: 0,
|
|
89
|
-
},
|
|
90
|
-
],
|
|
91
|
-
}),
|
|
92
|
-
new ICommand({
|
|
93
|
-
function: this.loadFn('commands', 'deletetp'),
|
|
94
|
-
name: 'deletetp',
|
|
95
|
-
trigger: 'deletetp',
|
|
96
|
-
helpText: 'Deletes a location.',
|
|
97
|
-
arguments: [
|
|
98
|
-
{
|
|
99
|
-
name: 'tp',
|
|
100
|
-
type: 'string',
|
|
101
|
-
defaultValue: null,
|
|
102
|
-
helpText: 'The location name.',
|
|
103
|
-
position: 0,
|
|
104
|
-
},
|
|
105
|
-
],
|
|
106
|
-
}),
|
|
107
|
-
new ICommand({
|
|
108
|
-
function: this.loadFn('commands', 'setpublic'),
|
|
109
|
-
name: 'setpublic',
|
|
110
|
-
trigger: 'setpublic',
|
|
111
|
-
helpText: 'Sets a teleport to be public, allowing other players to teleport to it.',
|
|
112
|
-
arguments: [
|
|
113
|
-
{
|
|
114
|
-
name: 'tp',
|
|
115
|
-
type: 'string',
|
|
116
|
-
defaultValue: null,
|
|
117
|
-
helpText: 'The location name.',
|
|
118
|
-
position: 0,
|
|
5
|
+
super();
|
|
6
|
+
this.name = 'teleports';
|
|
7
|
+
this.versions = [
|
|
8
|
+
new ModuleTransferVersionDTO({
|
|
9
|
+
tag: '0.0.2',
|
|
10
|
+
description: 'A set of commands to allow players to set their own teleport points and teleport to them.',
|
|
11
|
+
configSchema: JSON.stringify({
|
|
12
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
13
|
+
type: 'object',
|
|
14
|
+
properties: {
|
|
15
|
+
timeout: {
|
|
16
|
+
title: 'Timeout',
|
|
17
|
+
description: 'The time one has to wait before teleporting again.',
|
|
18
|
+
'x-component': 'duration',
|
|
19
|
+
type: 'number',
|
|
20
|
+
minimum: 0,
|
|
21
|
+
default: Duration.fromObject({ second: 1 }).as('milliseconds'),
|
|
22
|
+
},
|
|
23
|
+
allowPublicTeleports: {
|
|
24
|
+
type: 'boolean',
|
|
25
|
+
description: 'Players can create public teleports.',
|
|
26
|
+
default: false,
|
|
27
|
+
},
|
|
119
28
|
},
|
|
29
|
+
required: [],
|
|
30
|
+
additionalProperties: false,
|
|
31
|
+
}),
|
|
32
|
+
uiSchema: JSON.stringify({
|
|
33
|
+
timeout: { 'ui:widget': 'duration' },
|
|
34
|
+
}),
|
|
35
|
+
functions: [
|
|
36
|
+
new IFunction({
|
|
37
|
+
name: 'utils',
|
|
38
|
+
function: this.loadFn('functions', 'utils'),
|
|
39
|
+
}),
|
|
120
40
|
],
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
{
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
41
|
+
permissions: [
|
|
42
|
+
new IPermission({
|
|
43
|
+
permission: 'TELEPORTS_CREATE_PUBLIC',
|
|
44
|
+
friendlyName: 'Create Public Teleports',
|
|
45
|
+
description: 'Allows the player to create public teleports.',
|
|
46
|
+
canHaveCount: true,
|
|
47
|
+
}),
|
|
48
|
+
new IPermission({
|
|
49
|
+
permission: 'TELEPORTS_USE',
|
|
50
|
+
friendlyName: 'Use Teleports',
|
|
51
|
+
description: 'Allows the player to use teleports modules.',
|
|
52
|
+
canHaveCount: true,
|
|
53
|
+
}),
|
|
54
|
+
new IPermission({
|
|
55
|
+
permission: 'TELEPORTS_MANAGE_WAYPOINTS',
|
|
56
|
+
friendlyName: 'Manage waypoints',
|
|
57
|
+
description: 'Allows creating, deleting, and managing waypoints.',
|
|
58
|
+
canHaveCount: false,
|
|
59
|
+
}),
|
|
135
60
|
],
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
61
|
+
commands: [
|
|
62
|
+
new ICommand({
|
|
63
|
+
function: this.loadFn('commands', 'teleport'),
|
|
64
|
+
name: 'teleport',
|
|
65
|
+
trigger: 'tp',
|
|
66
|
+
helpText: 'Teleports to one of your set locations.',
|
|
67
|
+
arguments: [
|
|
68
|
+
{
|
|
69
|
+
name: 'tp',
|
|
70
|
+
type: 'string',
|
|
71
|
+
defaultValue: null,
|
|
72
|
+
helpText: 'The location to teleport to.',
|
|
73
|
+
position: 0,
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
}),
|
|
77
|
+
new ICommand({
|
|
78
|
+
function: this.loadFn('commands', 'tplist'),
|
|
79
|
+
name: 'tplist',
|
|
80
|
+
trigger: 'tplist',
|
|
81
|
+
helpText: 'Lists all your set locations.',
|
|
82
|
+
arguments: [],
|
|
83
|
+
}),
|
|
84
|
+
new ICommand({
|
|
85
|
+
function: this.loadFn('commands', 'settp'),
|
|
86
|
+
name: 'settp',
|
|
87
|
+
trigger: 'settp',
|
|
88
|
+
helpText: 'Sets a location to teleport to.',
|
|
89
|
+
arguments: [
|
|
90
|
+
{
|
|
91
|
+
name: 'tp',
|
|
92
|
+
type: 'string',
|
|
93
|
+
defaultValue: null,
|
|
94
|
+
helpText: 'The location name.',
|
|
95
|
+
position: 0,
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
}),
|
|
99
|
+
new ICommand({
|
|
100
|
+
function: this.loadFn('commands', 'deletetp'),
|
|
101
|
+
name: 'deletetp',
|
|
102
|
+
trigger: 'deletetp',
|
|
103
|
+
helpText: 'Deletes a location.',
|
|
104
|
+
arguments: [
|
|
105
|
+
{
|
|
106
|
+
name: 'tp',
|
|
107
|
+
type: 'string',
|
|
108
|
+
defaultValue: null,
|
|
109
|
+
helpText: 'The location name.',
|
|
110
|
+
position: 0,
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
}),
|
|
114
|
+
new ICommand({
|
|
115
|
+
function: this.loadFn('commands', 'setpublic'),
|
|
116
|
+
name: 'setpublic',
|
|
117
|
+
trigger: 'setpublic',
|
|
118
|
+
helpText: 'Sets a teleport to be public, allowing other players to teleport to it.',
|
|
119
|
+
arguments: [
|
|
120
|
+
{
|
|
121
|
+
name: 'tp',
|
|
122
|
+
type: 'string',
|
|
123
|
+
defaultValue: null,
|
|
124
|
+
helpText: 'The location name.',
|
|
125
|
+
position: 0,
|
|
126
|
+
},
|
|
127
|
+
],
|
|
128
|
+
}),
|
|
129
|
+
new ICommand({
|
|
130
|
+
function: this.loadFn('commands', 'setprivate'),
|
|
131
|
+
name: 'setprivate',
|
|
132
|
+
trigger: 'setprivate',
|
|
133
|
+
helpText: 'Sets a teleport to be private, only the teleport owner can teleport to it.',
|
|
134
|
+
arguments: [
|
|
135
|
+
{
|
|
136
|
+
name: 'tp',
|
|
137
|
+
type: 'string',
|
|
138
|
+
defaultValue: null,
|
|
139
|
+
helpText: 'The location name.',
|
|
140
|
+
position: 0,
|
|
141
|
+
},
|
|
142
|
+
],
|
|
143
|
+
}),
|
|
144
|
+
new ICommand({
|
|
145
|
+
function: this.loadFn('commands', 'setwaypoint'),
|
|
146
|
+
name: 'setwaypoint',
|
|
147
|
+
trigger: 'setwaypoint',
|
|
148
|
+
helpText: 'Creates a new waypoint.',
|
|
149
|
+
arguments: [
|
|
150
|
+
{
|
|
151
|
+
name: 'waypoint',
|
|
152
|
+
type: 'string',
|
|
153
|
+
defaultValue: null,
|
|
154
|
+
helpText: 'The location name.',
|
|
155
|
+
position: 0,
|
|
156
|
+
},
|
|
157
|
+
],
|
|
158
|
+
}),
|
|
159
|
+
new ICommand({
|
|
160
|
+
function: this.loadFn('commands', 'deletewaypoint'),
|
|
161
|
+
name: 'deletewaypoint',
|
|
162
|
+
trigger: 'deletewaypoint',
|
|
163
|
+
helpText: 'Deletes a waypoint.',
|
|
164
|
+
arguments: [
|
|
165
|
+
{
|
|
166
|
+
name: 'waypoint',
|
|
167
|
+
type: 'string',
|
|
168
|
+
defaultValue: null,
|
|
169
|
+
helpText: 'The location name.',
|
|
170
|
+
position: 0,
|
|
171
|
+
},
|
|
172
|
+
],
|
|
173
|
+
}),
|
|
174
|
+
new ICommand({
|
|
175
|
+
function: this.loadFn('commands', 'listwaypoints'),
|
|
176
|
+
name: 'listwaypoints',
|
|
177
|
+
trigger: 'waypoints',
|
|
178
|
+
helpText: 'Lists all waypoints.',
|
|
179
|
+
arguments: [],
|
|
180
|
+
}),
|
|
181
|
+
new ICommand({
|
|
182
|
+
function: this.loadFn('commands', 'teleportwaypoint'),
|
|
183
|
+
name: 'teleportwaypoint',
|
|
184
|
+
trigger: 'teleportwaypoint',
|
|
185
|
+
arguments: [],
|
|
186
|
+
helpText: 'Placeholder command, this will not be used directly. The module will install aliases for this command corresponding to the waypoint names.',
|
|
187
|
+
}),
|
|
150
188
|
],
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
arguments: [
|
|
158
|
-
{
|
|
159
|
-
name: 'waypoint',
|
|
160
|
-
type: 'string',
|
|
161
|
-
defaultValue: null,
|
|
162
|
-
helpText: 'The location name.',
|
|
163
|
-
position: 0,
|
|
164
|
-
},
|
|
189
|
+
cronJobs: [
|
|
190
|
+
new ICronJob({
|
|
191
|
+
name: 'Waypoint reconciler',
|
|
192
|
+
temporalValue: '*/30 * * * *',
|
|
193
|
+
function: this.loadFn('cronJobs', 'Waypoint reconciler'),
|
|
194
|
+
}),
|
|
165
195
|
],
|
|
166
196
|
}),
|
|
167
|
-
new ICommand({
|
|
168
|
-
function: this.loadFn('commands', 'listwaypoints'),
|
|
169
|
-
name: 'listwaypoints',
|
|
170
|
-
trigger: 'waypoints',
|
|
171
|
-
helpText: 'Lists all waypoints.',
|
|
172
|
-
arguments: [],
|
|
173
|
-
}),
|
|
174
|
-
new ICommand({
|
|
175
|
-
function: this.loadFn('commands', 'teleportwaypoint'),
|
|
176
|
-
name: 'teleportwaypoint',
|
|
177
|
-
trigger: 'teleportwaypoint',
|
|
178
|
-
arguments: [],
|
|
179
|
-
helpText: 'Placeholder command, this will not be used directly. The module will install aliases for this command corresponding to the waypoint names.',
|
|
180
|
-
}),
|
|
181
197
|
];
|
|
182
198
|
}
|
|
183
199
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/teleports/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/teleports/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,QAAQ,EACR,SAAS,EACT,WAAW,EACX,wBAAwB,EACxB,QAAQ,GACT,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,MAAM,OAAO,SAAU,SAAQ,iBAA4B;IACzD;QACE,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;QACxB,IAAI,CAAC,QAAQ,GAAG;YACd,IAAI,wBAAwB,CAAC;gBAC3B,GAAG,EAAE,OAAO;gBACZ,WAAW,EAAE,2FAA2F;gBACxG,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC;oBAC3B,OAAO,EAAE,yCAAyC;oBAClD,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,OAAO,EAAE;4BACP,KAAK,EAAE,SAAS;4BAChB,WAAW,EAAE,oDAAoD;4BACjE,aAAa,EAAE,UAAU;4BACzB,IAAI,EAAE,QAAQ;4BACd,OAAO,EAAE,CAAC;4BACV,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,cAAc,CAAC;yBAC/D;wBACD,oBAAoB,EAAE;4BACpB,IAAI,EAAE,SAAS;4BACf,WAAW,EAAE,sCAAsC;4BACnD,OAAO,EAAE,KAAK;yBACf;qBACF;oBACD,QAAQ,EAAE,EAAE;oBACZ,oBAAoB,EAAE,KAAK;iBAC5B,CAAC;gBACF,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC;oBACvB,OAAO,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE;iBACrC,CAAC;gBACF,SAAS,EAAE;oBACT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,QAAQ,EACN,4IAA4I;qBAC/I,CAAC;iBACH;gBACD,QAAQ,EAAE;oBACR,IAAI,QAAQ,CAAC;wBACX,IAAI,EAAE,qBAAqB;wBAC3B,aAAa,EAAE,cAAc;wBAC7B,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,qBAAqB,CAAC;qBACzD,CAAC;iBACH;aACF,CAAC;SACH,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Shutdown.d.ts","sourceRoot":"","sources":["../../../../src/modules/timedShutdown/cronJobs/Shutdown.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"warning.d.ts","sourceRoot":"","sources":["../../../../src/modules/timedShutdown/cronJobs/warning.js"],"names":[],"mappings":""}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare class TimedShutdown extends
|
|
1
|
+
import { ModuleTransferDTO } from '../../BuiltinModule.js';
|
|
2
|
+
export declare class TimedShutdown extends ModuleTransferDTO<TimedShutdown> {
|
|
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/timedShutdown/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAsC,MAAM,wBAAwB,CAAC;AAE/F,qBAAa,aAAc,SAAQ,iBAAiB,CAAC,aAAa,CAAC;;CAwClE"}
|