@takaro/modules 0.0.0-next.0da151e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/BuiltinModule.d.ts +62 -0
- package/dist/BuiltinModule.d.ts.map +1 -0
- package/dist/BuiltinModule.js +245 -0
- package/dist/BuiltinModule.js.map +1 -0
- package/dist/community-modules.json +21 -0
- package/dist/dto/base.d.ts +7 -0
- package/dist/dto/base.d.ts.map +1 -0
- package/dist/dto/base.js +28 -0
- package/dist/dto/base.js.map +1 -0
- package/dist/dto/discordEvents.d.ts +32 -0
- package/dist/dto/discordEvents.d.ts.map +1 -0
- package/dist/dto/discordEvents.js +92 -0
- package/dist/dto/discordEvents.js.map +1 -0
- package/dist/dto/gameEvents.d.ts +83 -0
- package/dist/dto/gameEvents.d.ts.map +1 -0
- package/dist/dto/gameEvents.js +205 -0
- package/dist/dto/gameEvents.js.map +1 -0
- package/dist/dto/index.d.ts +54 -0
- package/dist/dto/index.d.ts.map +1 -0
- package/dist/dto/index.js +18 -0
- package/dist/dto/index.js.map +1 -0
- package/dist/dto/takaroEvents.d.ts +276 -0
- package/dist/dto/takaroEvents.d.ts.map +1 -0
- package/dist/dto/takaroEvents.js +794 -0
- package/dist/dto/takaroEvents.js.map +1 -0
- package/dist/main.d.ts +5 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +35 -0
- package/dist/main.js.map +1 -0
- package/dist/modules/chatBridge/hooks/DiscordToGame.d.ts +2 -0
- package/dist/modules/chatBridge/hooks/DiscordToGame.d.ts.map +1 -0
- package/dist/modules/chatBridge/hooks/DiscordToGame.js +18 -0
- package/dist/modules/chatBridge/hooks/DiscordToGame.js.map +1 -0
- package/dist/modules/chatBridge/hooks/GameToDiscord.d.ts +2 -0
- package/dist/modules/chatBridge/hooks/GameToDiscord.d.ts.map +1 -0
- package/dist/modules/chatBridge/hooks/GameToDiscord.js +14 -0
- package/dist/modules/chatBridge/hooks/GameToDiscord.js.map +1 -0
- package/dist/modules/chatBridge/hooks/PlayerConnected.d.ts +2 -0
- package/dist/modules/chatBridge/hooks/PlayerConnected.d.ts.map +1 -0
- package/dist/modules/chatBridge/hooks/PlayerConnected.js +9 -0
- package/dist/modules/chatBridge/hooks/PlayerConnected.js.map +1 -0
- package/dist/modules/chatBridge/hooks/PlayerDisconnected.d.ts +2 -0
- package/dist/modules/chatBridge/hooks/PlayerDisconnected.d.ts.map +1 -0
- package/dist/modules/chatBridge/hooks/PlayerDisconnected.js +9 -0
- package/dist/modules/chatBridge/hooks/PlayerDisconnected.js.map +1 -0
- package/dist/modules/chatBridge/index.d.ts +5 -0
- package/dist/modules/chatBridge/index.d.ts.map +1 -0
- package/dist/modules/chatBridge/index.js +64 -0
- package/dist/modules/chatBridge/index.js.map +1 -0
- 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 +103 -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 +127 -0
- package/dist/modules/dailyRewards/index.js.map +1 -0
- package/dist/modules/economyUtils/commands/balance.d.ts +2 -0
- package/dist/modules/economyUtils/commands/balance.d.ts.map +1 -0
- package/dist/modules/economyUtils/commands/balance.js +7 -0
- package/dist/modules/economyUtils/commands/balance.js.map +1 -0
- package/dist/modules/economyUtils/commands/claim.d.ts +2 -0
- package/dist/modules/economyUtils/commands/claim.d.ts.map +1 -0
- package/dist/modules/economyUtils/commands/claim.js +35 -0
- package/dist/modules/economyUtils/commands/claim.js.map +1 -0
- package/dist/modules/economyUtils/commands/confirmTransfer.d.ts +2 -0
- package/dist/modules/economyUtils/commands/confirmTransfer.d.ts.map +1 -0
- package/dist/modules/economyUtils/commands/confirmTransfer.js +38 -0
- package/dist/modules/economyUtils/commands/confirmTransfer.js.map +1 -0
- package/dist/modules/economyUtils/commands/grantCurrency.d.ts +2 -0
- package/dist/modules/economyUtils/commands/grantCurrency.d.ts.map +1 -0
- package/dist/modules/economyUtils/commands/grantCurrency.js +28 -0
- package/dist/modules/economyUtils/commands/grantCurrency.js.map +1 -0
- package/dist/modules/economyUtils/commands/revokeCurrency.d.ts +2 -0
- package/dist/modules/economyUtils/commands/revokeCurrency.d.ts.map +1 -0
- package/dist/modules/economyUtils/commands/revokeCurrency.js +28 -0
- package/dist/modules/economyUtils/commands/revokeCurrency.js.map +1 -0
- package/dist/modules/economyUtils/commands/shop.d.ts +2 -0
- package/dist/modules/economyUtils/commands/shop.d.ts.map +1 -0
- package/dist/modules/economyUtils/commands/shop.js +69 -0
- package/dist/modules/economyUtils/commands/shop.js.map +1 -0
- package/dist/modules/economyUtils/commands/topCurrency.d.ts +2 -0
- package/dist/modules/economyUtils/commands/topCurrency.d.ts.map +1 -0
- package/dist/modules/economyUtils/commands/topCurrency.js +22 -0
- package/dist/modules/economyUtils/commands/topCurrency.js.map +1 -0
- package/dist/modules/economyUtils/commands/transfer.d.ts +2 -0
- package/dist/modules/economyUtils/commands/transfer.d.ts.map +1 -0
- package/dist/modules/economyUtils/commands/transfer.js +55 -0
- package/dist/modules/economyUtils/commands/transfer.js.map +1 -0
- package/dist/modules/economyUtils/cronJobs/zombieKillReward.d.ts +2 -0
- package/dist/modules/economyUtils/cronJobs/zombieKillReward.d.ts.map +1 -0
- package/dist/modules/economyUtils/cronJobs/zombieKillReward.js +66 -0
- package/dist/modules/economyUtils/cronJobs/zombieKillReward.js.map +1 -0
- package/dist/modules/economyUtils/index.d.ts +5 -0
- package/dist/modules/economyUtils/index.d.ts.map +1 -0
- package/dist/modules/economyUtils/index.js +192 -0
- package/dist/modules/economyUtils/index.js.map +1 -0
- package/dist/modules/geoBlock/hooks/IPDetected.d.ts +2 -0
- package/dist/modules/geoBlock/hooks/IPDetected.d.ts.map +1 -0
- package/dist/modules/geoBlock/hooks/IPDetected.js +50 -0
- package/dist/modules/geoBlock/hooks/IPDetected.js.map +1 -0
- package/dist/modules/geoBlock/index.d.ts +9 -0
- package/dist/modules/geoBlock/index.d.ts.map +1 -0
- package/dist/modules/geoBlock/index.js +329 -0
- package/dist/modules/geoBlock/index.js.map +1 -0
- package/dist/modules/gimme/commands/gimme.d.ts +2 -0
- package/dist/modules/gimme/commands/gimme.d.ts.map +1 -0
- package/dist/modules/gimme/commands/gimme.js +25 -0
- package/dist/modules/gimme/commands/gimme.js.map +1 -0
- package/dist/modules/gimme/index.d.ts +5 -0
- package/dist/modules/gimme/index.d.ts.map +1 -0
- package/dist/modules/gimme/index.js +75 -0
- package/dist/modules/gimme/index.js.map +1 -0
- package/dist/modules/highPingKicker/cronJobs/Ping check.d.ts +2 -0
- package/dist/modules/highPingKicker/cronJobs/Ping check.d.ts.map +1 -0
- package/dist/modules/highPingKicker/cronJobs/Ping check.js +59 -0
- package/dist/modules/highPingKicker/cronJobs/Ping check.js.map +1 -0
- package/dist/modules/highPingKicker/index.d.ts +5 -0
- package/dist/modules/highPingKicker/index.d.ts.map +1 -0
- package/dist/modules/highPingKicker/index.js +44 -0
- package/dist/modules/highPingKicker/index.js.map +1 -0
- package/dist/modules/lottery/commands/buyTicket.d.ts +2 -0
- package/dist/modules/lottery/commands/buyTicket.d.ts.map +1 -0
- package/dist/modules/lottery/commands/buyTicket.js +51 -0
- package/dist/modules/lottery/commands/buyTicket.js.map +1 -0
- package/dist/modules/lottery/commands/nextDraw.d.ts +2 -0
- package/dist/modules/lottery/commands/nextDraw.d.ts.map +1 -0
- package/dist/modules/lottery/commands/nextDraw.js +34 -0
- package/dist/modules/lottery/commands/nextDraw.js.map +1 -0
- package/dist/modules/lottery/commands/viewTickets.d.ts +2 -0
- package/dist/modules/lottery/commands/viewTickets.d.ts.map +1 -0
- package/dist/modules/lottery/commands/viewTickets.js +20 -0
- package/dist/modules/lottery/commands/viewTickets.js.map +1 -0
- package/dist/modules/lottery/cronJobs/drawLottery.d.ts +2 -0
- package/dist/modules/lottery/cronJobs/drawLottery.d.ts.map +1 -0
- package/dist/modules/lottery/cronJobs/drawLottery.js +96 -0
- package/dist/modules/lottery/cronJobs/drawLottery.js.map +1 -0
- package/dist/modules/lottery/index.d.ts +5 -0
- package/dist/modules/lottery/index.d.ts.map +1 -0
- package/dist/modules/lottery/index.js +85 -0
- package/dist/modules/lottery/index.js.map +1 -0
- package/dist/modules/playerOnboarding/commands/starterkit.d.ts +2 -0
- package/dist/modules/playerOnboarding/commands/starterkit.d.ts.map +1 -0
- package/dist/modules/playerOnboarding/commands/starterkit.js +47 -0
- package/dist/modules/playerOnboarding/commands/starterkit.js.map +1 -0
- package/dist/modules/playerOnboarding/hooks/playerConnected.d.ts +2 -0
- package/dist/modules/playerOnboarding/hooks/playerConnected.d.ts.map +1 -0
- package/dist/modules/playerOnboarding/hooks/playerConnected.js +11 -0
- package/dist/modules/playerOnboarding/hooks/playerConnected.js.map +1 -0
- package/dist/modules/playerOnboarding/index.d.ts +5 -0
- package/dist/modules/playerOnboarding/index.d.ts.map +1 -0
- package/dist/modules/playerOnboarding/index.js +83 -0
- package/dist/modules/playerOnboarding/index.js.map +1 -0
- package/dist/modules/serverMessages/cronJobs/Automated message.d.ts +2 -0
- package/dist/modules/serverMessages/cronJobs/Automated message.d.ts.map +1 -0
- package/dist/modules/serverMessages/cronJobs/Automated message.js +41 -0
- package/dist/modules/serverMessages/cronJobs/Automated message.js.map +1 -0
- package/dist/modules/serverMessages/index.d.ts +5 -0
- package/dist/modules/serverMessages/index.d.ts.map +1 -0
- package/dist/modules/serverMessages/index.js +45 -0
- package/dist/modules/serverMessages/index.js.map +1 -0
- package/dist/modules/teleports/commands/deletetp.d.ts +2 -0
- package/dist/modules/teleports/commands/deletetp.d.ts.map +1 -0
- package/dist/modules/teleports/commands/deletetp.js +20 -0
- package/dist/modules/teleports/commands/deletetp.js.map +1 -0
- package/dist/modules/teleports/commands/deletewaypoint.d.ts +2 -0
- package/dist/modules/teleports/commands/deletewaypoint.d.ts.map +1 -0
- package/dist/modules/teleports/commands/deletewaypoint.js +20 -0
- package/dist/modules/teleports/commands/deletewaypoint.js.map +1 -0
- package/dist/modules/teleports/commands/listwaypoints.d.ts +2 -0
- package/dist/modules/teleports/commands/listwaypoints.d.ts.map +1 -0
- package/dist/modules/teleports/commands/listwaypoints.js +17 -0
- package/dist/modules/teleports/commands/listwaypoints.js.map +1 -0
- package/dist/modules/teleports/commands/setprivate.d.ts +2 -0
- package/dist/modules/teleports/commands/setprivate.d.ts.map +1 -0
- package/dist/modules/teleports/commands/setprivate.js +29 -0
- package/dist/modules/teleports/commands/setprivate.js.map +1 -0
- package/dist/modules/teleports/commands/setpublic.d.ts +2 -0
- package/dist/modules/teleports/commands/setpublic.d.ts.map +1 -0
- package/dist/modules/teleports/commands/setpublic.js +45 -0
- package/dist/modules/teleports/commands/setpublic.js.map +1 -0
- package/dist/modules/teleports/commands/settp.d.ts +2 -0
- package/dist/modules/teleports/commands/settp.d.ts.map +1 -0
- package/dist/modules/teleports/commands/settp.js +40 -0
- package/dist/modules/teleports/commands/settp.js.map +1 -0
- package/dist/modules/teleports/commands/setwaypoint.d.ts +2 -0
- package/dist/modules/teleports/commands/setwaypoint.d.ts.map +1 -0
- package/dist/modules/teleports/commands/setwaypoint.js +28 -0
- package/dist/modules/teleports/commands/setwaypoint.js.map +1 -0
- package/dist/modules/teleports/commands/teleport.d.ts +2 -0
- package/dist/modules/teleports/commands/teleport.d.ts.map +1 -0
- package/dist/modules/teleports/commands/teleport.js +68 -0
- package/dist/modules/teleports/commands/teleport.js.map +1 -0
- package/dist/modules/teleports/commands/teleportwaypoint.d.ts +2 -0
- package/dist/modules/teleports/commands/teleportwaypoint.d.ts.map +1 -0
- package/dist/modules/teleports/commands/teleportwaypoint.js +43 -0
- package/dist/modules/teleports/commands/teleportwaypoint.js.map +1 -0
- package/dist/modules/teleports/commands/tplist.d.ts +2 -0
- package/dist/modules/teleports/commands/tplist.d.ts.map +1 -0
- package/dist/modules/teleports/commands/tplist.js +46 -0
- package/dist/modules/teleports/commands/tplist.js.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 +14 -0
- package/dist/modules/teleports/functions/utils.d.ts.map +1 -0
- package/dist/modules/teleports/functions/utils.js +156 -0
- package/dist/modules/teleports/functions/utils.js.map +1 -0
- package/dist/modules/teleports/index.d.ts +5 -0
- package/dist/modules/teleports/index.d.ts.map +1 -0
- package/dist/modules/teleports/index.js +208 -0
- package/dist/modules/teleports/index.js.map +1 -0
- package/dist/modules/timedShutdown/cronJobs/Shutdown.d.ts +2 -0
- package/dist/modules/timedShutdown/cronJobs/Shutdown.d.ts.map +1 -0
- package/dist/modules/timedShutdown/cronJobs/Shutdown.js +7 -0
- package/dist/modules/timedShutdown/cronJobs/Shutdown.js.map +1 -0
- package/dist/modules/timedShutdown/cronJobs/warning.d.ts +2 -0
- package/dist/modules/timedShutdown/cronJobs/warning.d.ts.map +1 -0
- package/dist/modules/timedShutdown/cronJobs/warning.js +10 -0
- package/dist/modules/timedShutdown/cronJobs/warning.js.map +1 -0
- package/dist/modules/timedShutdown/index.d.ts +5 -0
- package/dist/modules/timedShutdown/index.d.ts.map +1 -0
- package/dist/modules/timedShutdown/index.js +43 -0
- package/dist/modules/timedShutdown/index.js.map +1 -0
- package/dist/modules/utils/commands/help.d.ts +2 -0
- package/dist/modules/utils/commands/help.d.ts.map +1 -0
- package/dist/modules/utils/commands/help.js +84 -0
- package/dist/modules/utils/commands/help.js.map +1 -0
- package/dist/modules/utils/commands/ping.d.ts +2 -0
- package/dist/modules/utils/commands/ping.d.ts.map +1 -0
- package/dist/modules/utils/commands/ping.js +6 -0
- package/dist/modules/utils/commands/ping.js.map +1 -0
- package/dist/modules/utils/index.d.ts +5 -0
- package/dist/modules/utils/index.d.ts.map +1 -0
- package/dist/modules/utils/index.js +52 -0
- package/dist/modules/utils/index.js.map +1 -0
- package/dist/modules.json +757 -0
- package/package.json +17 -0
- package/scripts/buildBuiltinJson.ts +81 -0
- package/src/BuiltinModule.ts +159 -0
- package/src/__tests__/aliases.integration.test.ts +90 -0
- package/src/__tests__/bugRepros.integration.test.ts +485 -0
- package/src/__tests__/builtinmodule.unit.test.ts +15 -0
- package/src/__tests__/commandArgs.integration.test.ts +291 -0
- package/src/__tests__/crossServerPlayer.integration.test.ts +176 -0
- package/src/__tests__/economy/claim.integration.test.ts +250 -0
- package/src/__tests__/economy/economyUtils.integration.test.ts +495 -0
- package/src/__tests__/economy/shop.integration.test.ts +177 -0
- package/src/__tests__/economy/zombieKillReward.integration.test.ts +293 -0
- package/src/__tests__/geoblock.integration.test.ts +322 -0
- package/src/__tests__/gimme.integration.test.ts +106 -0
- package/src/__tests__/help.integration.test.ts +314 -0
- package/src/__tests__/highPingKicker.integration.test.ts +618 -0
- package/src/__tests__/lottery.integration.test.ts +344 -0
- package/src/__tests__/modulePermission.integration.test.ts +387 -0
- package/src/__tests__/onboarding.integration.test.ts +122 -0
- package/src/__tests__/ping.integration.test.ts +36 -0
- package/src/__tests__/roleExpiry.integration.test.ts +78 -0
- package/src/__tests__/serverMessages.integration.test.ts +116 -0
- package/src/__tests__/systemConfigCooldown.integration.test.ts +84 -0
- package/src/__tests__/systemConfigCost.integration.test.ts +194 -0
- package/src/__tests__/teleports/listtp.integration.test.ts +189 -0
- package/src/__tests__/teleports/publicteleports.integration.test.ts +345 -0
- package/src/__tests__/teleports/teleport.integration.test.ts +153 -0
- package/src/__tests__/teleports/tpManagement.integration.test.ts +175 -0
- package/src/__tests__/teleports/waypoints.integration.test.ts +832 -0
- package/src/community-modules/README.md +5 -0
- package/src/community-modules/modules/vote.json +19 -0
- package/src/dto/base.ts +13 -0
- package/src/dto/discordEvents.ts +69 -0
- package/src/dto/gameEvents.ts +159 -0
- package/src/dto/index.ts +25 -0
- package/src/dto/takaroEvents.ts +525 -0
- package/src/main.ts +47 -0
- package/src/modules/.eslintrc +5 -0
- package/src/modules/chatBridge/hooks/DiscordToGame.js +18 -0
- package/src/modules/chatBridge/hooks/GameToDiscord.js +18 -0
- package/src/modules/chatBridge/hooks/PlayerConnected.js +11 -0
- package/src/modules/chatBridge/hooks/PlayerDisconnected.js +11 -0
- package/src/modules/chatBridge/index.ts +64 -0
- package/src/modules/dailyRewards/commands/daily.js +114 -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 +138 -0
- package/src/modules/economyUtils/commands/balance.js +8 -0
- package/src/modules/economyUtils/commands/claim.js +42 -0
- package/src/modules/economyUtils/commands/confirmTransfer.js +55 -0
- package/src/modules/economyUtils/commands/grantCurrency.js +34 -0
- package/src/modules/economyUtils/commands/revokeCurrency.js +34 -0
- package/src/modules/economyUtils/commands/shop.js +87 -0
- package/src/modules/economyUtils/commands/topCurrency.js +29 -0
- package/src/modules/economyUtils/commands/transfer.js +73 -0
- package/src/modules/economyUtils/cronJobs/zombieKillReward.js +82 -0
- package/src/modules/economyUtils/index.ts +197 -0
- package/src/modules/geoBlock/hooks/IPDetected.js +53 -0
- package/src/modules/geoBlock/index.ts +333 -0
- package/src/modules/gimme/commands/gimme.js +30 -0
- package/src/modules/gimme/index.ts +76 -0
- package/src/modules/highPingKicker/cronJobs/Ping check.js +68 -0
- package/src/modules/highPingKicker/index.ts +44 -0
- package/src/modules/lottery/commands/buyTicket.js +64 -0
- package/src/modules/lottery/commands/nextDraw.js +47 -0
- package/src/modules/lottery/commands/viewTickets.js +28 -0
- package/src/modules/lottery/cronJobs/drawLottery.js +124 -0
- package/src/modules/lottery/index.ts +86 -0
- package/src/modules/playerOnboarding/commands/starterkit.js +61 -0
- package/src/modules/playerOnboarding/hooks/playerConnected.js +14 -0
- package/src/modules/playerOnboarding/index.ts +86 -0
- package/src/modules/serverMessages/cronJobs/Automated message.js +47 -0
- package/src/modules/serverMessages/index.ts +46 -0
- package/src/modules/teleports/commands/deletetp.js +25 -0
- package/src/modules/teleports/commands/deletewaypoint.js +24 -0
- package/src/modules/teleports/commands/listwaypoints.js +23 -0
- package/src/modules/teleports/commands/setprivate.js +39 -0
- package/src/modules/teleports/commands/setpublic.js +60 -0
- package/src/modules/teleports/commands/settp.js +50 -0
- package/src/modules/teleports/commands/setwaypoint.js +31 -0
- package/src/modules/teleports/commands/teleport.js +84 -0
- package/src/modules/teleports/commands/teleportwaypoint.js +57 -0
- package/src/modules/teleports/commands/tplist.js +62 -0
- package/src/modules/teleports/cronJobs/Waypoint reconciler.js +7 -0
- package/src/modules/teleports/functions/utils.js +189 -0
- package/src/modules/teleports/index.ts +217 -0
- package/src/modules/timedShutdown/cronJobs/Shutdown.js +8 -0
- package/src/modules/timedShutdown/cronJobs/warning.js +13 -0
- package/src/modules/timedShutdown/index.ts +45 -0
- package/src/modules/utils/commands/help.js +100 -0
- package/src/modules/utils/commands/ping.js +7 -0
- package/src/modules/utils/index.ts +53 -0
- package/tsconfig.build.json +10 -0
- package/tsconfig.json +9 -0
- package/typedoc.json +3 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { takaro, data, TakaroUserError } from '@takaro/helpers';
|
|
2
|
+
const VARIABLE_KEY = 't_starterkit_lock';
|
|
3
|
+
async function main() {
|
|
4
|
+
const items = data.module.userConfig.starterKitItems;
|
|
5
|
+
if (!items || items.length === 0) {
|
|
6
|
+
throw new TakaroUserError('No starter kit items configured. Please ask your server administrator to configure this.');
|
|
7
|
+
}
|
|
8
|
+
const starterKitLockRes = await takaro.variable.variableControllerSearch({
|
|
9
|
+
filters: {
|
|
10
|
+
key: [VARIABLE_KEY],
|
|
11
|
+
gameServerId: [data.gameServerId],
|
|
12
|
+
playerId: [data.player.id],
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
if (starterKitLockRes.data.data.length > 0) {
|
|
16
|
+
throw new TakaroUserError('You already used starterkit on this server');
|
|
17
|
+
}
|
|
18
|
+
await data.player.pm('You are about to receive your starter kit...');
|
|
19
|
+
const itemRecords = (await takaro.item.itemControllerSearch({ filters: { id: items.map((_) => _.item) } })).data.data;
|
|
20
|
+
const fullItems = items.map((item) => {
|
|
21
|
+
const itemRecord = itemRecords.find((record) => record.id === item.item);
|
|
22
|
+
if (!itemRecord) {
|
|
23
|
+
throw new TakaroUserError(`Item with ID ${item.item} not found.`);
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
id: itemRecord.id,
|
|
27
|
+
quality: item.quality,
|
|
28
|
+
amount: item.amount,
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
await Promise.all(fullItems.map(async (item) => {
|
|
32
|
+
return takaro.gameserver.gameServerControllerGiveItem(data.gameServerId, data.player.id, {
|
|
33
|
+
name: item.id,
|
|
34
|
+
quality: item.quality ?? '',
|
|
35
|
+
amount: item.amount,
|
|
36
|
+
});
|
|
37
|
+
}));
|
|
38
|
+
await takaro.variable.variableControllerCreate({
|
|
39
|
+
key: VARIABLE_KEY,
|
|
40
|
+
value: '1',
|
|
41
|
+
gameServerId: data.gameServerId,
|
|
42
|
+
playerId: data.player.id,
|
|
43
|
+
});
|
|
44
|
+
await data.player.pm(`Gave ${items.length} items, enjoy!`);
|
|
45
|
+
}
|
|
46
|
+
await main();
|
|
47
|
+
//# sourceMappingURL=starterkit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"starterkit.js","sourceRoot":"","sources":["../../../../src/modules/playerOnboarding/commands/starterkit.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEhE,MAAM,YAAY,GAAG,mBAAmB,CAAC;AAEzC,KAAK,UAAU,IAAI;IACjB,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,eAAe,CAAC;IAErD,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACjC,MAAM,IAAI,eAAe,CACvB,0FAA0F,CAC3F,CAAC;IACJ,CAAC;IAED,MAAM,iBAAiB,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,wBAAwB,CAAC;QACvE,OAAO,EAAE;YACP,GAAG,EAAE,CAAC,YAAY,CAAC;YACnB,YAAY,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC;YACjC,QAAQ,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;SAC3B;KACF,CAAC,CAAC;IAEH,IAAI,iBAAiB,CAAC,IAAI,CAAC,IAAI,CA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L,CAAC,CAAC,CACH,CAAC;IAEF,MAAM,MAAM,CAAC,QAAQ,CAAC,wBAAwB,CAAC;QAC7C,GAAG,EAAE,YAAY;QACjB,KAAK,EAAE,GAAG;QACV,YAAY,EAAE,IAAI,CAAC,YAAY;QAC/B,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE;KACzB,CAAC,CAAC;IAEH,MAAM,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,QAAQ,KAAK,CAAC,MAAM,gBAAgB,CAAC,CAAC;AAC7D,CAAC;AAED,MAAM,IAAI,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playerConnected.d.ts","sourceRoot":"","sources":["../../../../src/modules/playerOnboarding/hooks/playerConnected.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { takaro, data } from '@takaro/helpers';
|
|
2
|
+
async function main() {
|
|
3
|
+
const { player } = data;
|
|
4
|
+
const rawMessage = data.module.userConfig.message;
|
|
5
|
+
const message = rawMessage.replace('{player}', player.name);
|
|
6
|
+
await takaro.gameserver.gameServerControllerSendMessage(data.gameServerId, {
|
|
7
|
+
message,
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
await main();
|
|
11
|
+
//# sourceMappingURL=playerConnected.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playerConnected.js","sourceRoot":"","sources":["../../../../src/modules/playerOnboarding/hooks/playerConnected.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE/C,KAAK,UAAU,IAAI;IACjB,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAExB,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC;IAClD,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAE5D,MAAM,MAAM,CAAC,UAAU,CAAC,+BAA+B,CAAC,IAAI,CAAC,YAAY,EAAE;QACzE,OAAO;KACR,CAAC,CAAC;AACL,CAAC;AAED,MAAM,IAAI,EAAE,CAAC"}
|
|
@@ -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;;CAkFxE"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { ModuleTransferDTO, ICommand, IHook, ModuleTransferVersionDTO } from '../../BuiltinModule.js';
|
|
2
|
+
import { HookEvents } from '../../dto/index.js';
|
|
3
|
+
export class PlayerOnboarding extends ModuleTransferDTO {
|
|
4
|
+
constructor() {
|
|
5
|
+
super();
|
|
6
|
+
this.name = 'playerOnboarding';
|
|
7
|
+
this.author = 'Takaro';
|
|
8
|
+
this.supportedGames = ['all'];
|
|
9
|
+
this.versions = [
|
|
10
|
+
new ModuleTransferVersionDTO({
|
|
11
|
+
tag: '0.0.3',
|
|
12
|
+
description: 'Collection of functions that are executed when a player joins the server. Helps with onboarding new players, like sending a welcome message. Fixed issue with starterkit item identifiers.',
|
|
13
|
+
configSchema: JSON.stringify({
|
|
14
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
15
|
+
type: 'object',
|
|
16
|
+
properties: {
|
|
17
|
+
message: {
|
|
18
|
+
title: 'Message',
|
|
19
|
+
description: 'The message to send to the player when they join the server.',
|
|
20
|
+
type: 'string',
|
|
21
|
+
minLength: 1,
|
|
22
|
+
maxLength: 256,
|
|
23
|
+
default: 'Welcome {player} to the server!',
|
|
24
|
+
},
|
|
25
|
+
starterKitItems: {
|
|
26
|
+
type: 'array',
|
|
27
|
+
title: 'Starter kit items',
|
|
28
|
+
'x-component': 'item',
|
|
29
|
+
description: 'List of items a player will receive when they execute the starterkit command for the first time.',
|
|
30
|
+
uniqueItems: true,
|
|
31
|
+
items: {
|
|
32
|
+
type: 'object',
|
|
33
|
+
title: 'Item',
|
|
34
|
+
properties: {
|
|
35
|
+
item: {
|
|
36
|
+
type: 'string',
|
|
37
|
+
title: 'Item',
|
|
38
|
+
},
|
|
39
|
+
amount: {
|
|
40
|
+
type: 'number',
|
|
41
|
+
title: 'Amount',
|
|
42
|
+
},
|
|
43
|
+
quality: {
|
|
44
|
+
type: 'string',
|
|
45
|
+
title: 'Quality',
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
required: [],
|
|
52
|
+
additionalProperties: false,
|
|
53
|
+
}),
|
|
54
|
+
uiSchema: JSON.stringify({
|
|
55
|
+
starterKitItems: {
|
|
56
|
+
items: {
|
|
57
|
+
item: {
|
|
58
|
+
'ui:widget': 'item',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
}),
|
|
63
|
+
hooks: [
|
|
64
|
+
new IHook({
|
|
65
|
+
eventType: HookEvents.PLAYER_CONNECTED,
|
|
66
|
+
name: 'playerConnected',
|
|
67
|
+
function: this.loadFn('hooks', 'playerConnected'),
|
|
68
|
+
}),
|
|
69
|
+
],
|
|
70
|
+
commands: [
|
|
71
|
+
new ICommand({
|
|
72
|
+
name: 'starterkit',
|
|
73
|
+
function: this.loadFn('commands', 'starterkit'),
|
|
74
|
+
trigger: 'starterkit',
|
|
75
|
+
helpText: 'Get a starter kit, you can only execute this once on a server!',
|
|
76
|
+
arguments: [],
|
|
77
|
+
}),
|
|
78
|
+
],
|
|
79
|
+
}),
|
|
80
|
+
];
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../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wCACd,KAAK,EAAE,SAAS;qCACjB;iCACF;6BACF;yBACF;qBACF;oBACD,QAAQ,EAAE,EAAE;oBACZ,oBAAoB,EAAE,KAAK;iBAC5B,CAAC;gBACF,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC;oBACvB,eAAe,EAAE;wBACf,KAAK,EAAE;4BACL,IAAI,EAAE;gCACJ,WAAW,EAAE,MAAM;6BACpB;yBACF;qBACF;iBACF,CAAC;gBACF,KAAK,EAAE;oBACL,IAAI,KAAK,CAAC;wBACR,SAAS,EAAE,UAAU,CAAC,gBAAgB;wBACtC,IAAI,EAAE,iBAAiB;wBACvB,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,iBAAiB,CAAC;qBAClD,CAAC;iBACH;gBACD,QAAQ,EAAE;oBACR,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":""}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { data, takaro } from '@takaro/helpers';
|
|
2
|
+
async function main() {
|
|
3
|
+
const { module: mod, gameServerId } = data;
|
|
4
|
+
// Check what the last message we sent was
|
|
5
|
+
const lastMessageVar = (await takaro.variable.variableControllerSearch({
|
|
6
|
+
filters: {
|
|
7
|
+
key: ['lastMessage'],
|
|
8
|
+
moduleId: [mod.moduleId],
|
|
9
|
+
gameServerId: [gameServerId],
|
|
10
|
+
},
|
|
11
|
+
})).data.data[0];
|
|
12
|
+
// If we haven't sent any messages yet, start with the first one
|
|
13
|
+
const lastMessage = lastMessageVar ? parseInt(lastMessageVar.value, 10) : -1;
|
|
14
|
+
// The next message we should send is the next in the array
|
|
15
|
+
// However, if we're at the end of the array, we should start over
|
|
16
|
+
const nextMessage = data.module.userConfig.messages[lastMessage + 1] ? lastMessage + 1 : 0;
|
|
17
|
+
// The actual text of the message we're going to send
|
|
18
|
+
const messageToSend = data.module.userConfig.messages[nextMessage];
|
|
19
|
+
// Send the message to the game server
|
|
20
|
+
await takaro.gameserver.gameServerControllerSendMessage(data.gameServerId, {
|
|
21
|
+
message: messageToSend,
|
|
22
|
+
});
|
|
23
|
+
// Update the last message variable so the next time this cron job runs, we know what to send
|
|
24
|
+
if (lastMessageVar) {
|
|
25
|
+
// The variable already exists, update it
|
|
26
|
+
await takaro.variable.variableControllerUpdate(lastMessageVar.id, {
|
|
27
|
+
value: nextMessage.toString(),
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
// The variable doesn't exist, create it
|
|
32
|
+
await takaro.variable.variableControllerCreate({
|
|
33
|
+
key: 'lastMessage',
|
|
34
|
+
value: nextMessage.toString(),
|
|
35
|
+
moduleId: mod.moduleId,
|
|
36
|
+
gameServerId: gameServerId,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
await main();
|
|
41
|
+
//# sourceMappingURL=Automated%20message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Automated message.js","sourceRoot":"","sources":["../../../../src/modules/serverMessages/cronJobs/Automated message.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAE/C,KAAK,UAAU,IAAI;IACjB,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IAE3C,0CAA0C;IAC1C,MAAM,cAAc,GAAG,CACrB,MAAM,MAAM,CAAC,QAAQ,CAAC,wBAA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AC,CAAC;IACL,CAAC;AACH,CAAC;AAED,MAAM,IAAI,EAAE,CAAC"}
|
|
@@ -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;;CA2CpE"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ModuleTransferDTO, ICronJob, ModuleTransferVersionDTO } from '../../BuiltinModule.js';
|
|
2
|
+
export class ServerMessages extends ModuleTransferDTO {
|
|
3
|
+
constructor() {
|
|
4
|
+
super();
|
|
5
|
+
this.name = 'serverMessages';
|
|
6
|
+
this.author = 'Takaro';
|
|
7
|
+
this.supportedGames = ['all'];
|
|
8
|
+
this.versions = [
|
|
9
|
+
new ModuleTransferVersionDTO({
|
|
10
|
+
tag: '0.0.1',
|
|
11
|
+
description: 'Send automated, rotated, configurable messages to players on the server.',
|
|
12
|
+
configSchema: JSON.stringify({
|
|
13
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
14
|
+
type: 'object',
|
|
15
|
+
properties: {
|
|
16
|
+
messages: {
|
|
17
|
+
type: 'array',
|
|
18
|
+
title: 'Messages',
|
|
19
|
+
description: 'List of messages that will be sent to players on the server.',
|
|
20
|
+
default: [
|
|
21
|
+
// prettier-ignore
|
|
22
|
+
'This is an automated message, don\'t forget to read the server rules!',
|
|
23
|
+
],
|
|
24
|
+
items: {
|
|
25
|
+
type: 'string',
|
|
26
|
+
minLength: 5,
|
|
27
|
+
maxLength: 1024,
|
|
28
|
+
},
|
|
29
|
+
minItems: 1,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
required: ['messages'],
|
|
33
|
+
}),
|
|
34
|
+
cronJobs: [
|
|
35
|
+
new ICronJob({
|
|
36
|
+
name: 'Automated message',
|
|
37
|
+
temporalValue: '*/30 * * * *',
|
|
38
|
+
function: this.loadFn('cronJobs', 'Automated message'),
|
|
39
|
+
}),
|
|
40
|
+
],
|
|
41
|
+
}),
|
|
42
|
+
];
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,MAAM,GAAG,QAAQ,CAAC;QACvB,IAAI,CAAC,cAAc,GAAG,CAAC,KAAK,CAAC,CAAC;QAC9B,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,20 @@
|
|
|
1
|
+
import { takaro, data, TakaroUserError } from '@takaro/helpers';
|
|
2
|
+
import { getVariableKey } from './utils.js';
|
|
3
|
+
async function main() {
|
|
4
|
+
const { pog, gameServerId, arguments: args, module: mod } = data;
|
|
5
|
+
const existingVariable = await takaro.variable.variableControllerSearch({
|
|
6
|
+
filters: {
|
|
7
|
+
key: [getVariableKey(args.tp), getVariableKey(args.tp, true)],
|
|
8
|
+
gameServerId: [gameServerId],
|
|
9
|
+
playerId: [pog.playerId],
|
|
10
|
+
moduleId: [mod.moduleId],
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
if (existingVariable.data.data.length === 0) {
|
|
14
|
+
throw new TakaroUserError(`Teleport ${args.tp} does not exist.`);
|
|
15
|
+
}
|
|
16
|
+
await takaro.variable.variableControllerDelete(existingVariable.data.data[0].id);
|
|
17
|
+
await data.player.pm(`Teleport ${args.tp} deleted.`);
|
|
18
|
+
}
|
|
19
|
+
await main();
|
|
20
|
+
//# sourceMappingURL=deletetp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deletetp.js","sourceRoot":"","sources":["../../../../src/modules/teleports/commands/deletetp.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,KAAK,UAAU,IAAI;IACjB,MAAM,EAAE,GAAG,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IAEjE,MAAM,gBAAgB,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,wBAAwB,CAAC;QACtE,OAAO,EAAE;YACP,GAAG,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,cAAc,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;YAC7D,YAAY,EAAE,CAAC,YAAY,CAAC;YAC5B,QAAQ,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC;YACxB,QAAQ,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC;SACzB;KACF,CAAC,CAAC;IAEH,IAAI,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5C,MAAM,IAAI,eAAe,CAAC,YAAY,IAAI,CAAC,EAAE,kBAAkB,CAAC,CAAC;IACnE,CAAC;IAED,MAAM,MAAM,CAAC,QAAQ,CAAC,wBAAwB,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAEjF,MAAM,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,YAAY,IAAI,CAAC,EAAE,WAAW,CAAC,CAAC;AACvD,CAAC;AAED,MAAM,IAAI,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deletewaypoint.d.ts","sourceRoot":"","sources":["../../../../src/modules/teleports/commands/deletewaypoint.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { takaro, data, TakaroUserError } from '@takaro/helpers';
|
|
2
|
+
import { getWaypointName, waypointReconciler } from './utils.js';
|
|
3
|
+
async function main() {
|
|
4
|
+
const { pog, gameServerId, arguments: args, module: mod } = data;
|
|
5
|
+
const variable = await takaro.variable.variableControllerSearch({
|
|
6
|
+
filters: {
|
|
7
|
+
key: [getWaypointName(args.waypoint)],
|
|
8
|
+
gameServerId: [gameServerId],
|
|
9
|
+
moduleId: [mod.moduleId],
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
if (!variable.data.data.length) {
|
|
13
|
+
throw new TakaroUserError(`Waypoint ${args.waypoint} doesn't exist.`);
|
|
14
|
+
}
|
|
15
|
+
await takaro.variable.variableControllerDelete(variable.data.data[0].id);
|
|
16
|
+
await waypointReconciler();
|
|
17
|
+
await pog.pm(`Waypoint ${args.waypoint} deleted.`);
|
|
18
|
+
}
|
|
19
|
+
await main();
|
|
20
|
+
//# sourceMappingURL=deletewaypoint.js.map
|
|
@@ -0,0 +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,MAAM,iBAAiB,CAAC;AAChE,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,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":""}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { data, checkPermission } from '@takaro/helpers';
|
|
2
|
+
import { ensureWaypointsModule } from './utils.js';
|
|
3
|
+
async function main() {
|
|
4
|
+
const { pog, gameServerId } = data;
|
|
5
|
+
const { waypointsDefinition } = await ensureWaypointsModule();
|
|
6
|
+
const allWaypoints = waypointsDefinition.latestVersion.commands;
|
|
7
|
+
const waypointsWithPermission = allWaypoints
|
|
8
|
+
.filter((waypoint) => checkPermission(pog, `WAYPOINTS_USE_${waypoint.trigger.toUpperCase()}_${gameServerId}`))
|
|
9
|
+
.sort((a, b) => a.trigger.localeCompare(b.trigger));
|
|
10
|
+
if (!waypointsWithPermission.length) {
|
|
11
|
+
await pog.pm('There are no waypoints available.');
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
await pog.pm(`Available waypoints: ${waypointsWithPermission.map((waypoint) => waypoint.trigger).join(', ')}`);
|
|
15
|
+
}
|
|
16
|
+
await main();
|
|
17
|
+
//# sourceMappingURL=listwaypoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,29 @@
|
|
|
1
|
+
import { takaro, data, TakaroUserError } from '@takaro/helpers';
|
|
2
|
+
import { getVariableKey } from './utils.js';
|
|
3
|
+
async function main() {
|
|
4
|
+
const { pog, gameServerId, arguments: args, module: mod } = data;
|
|
5
|
+
const prefix = (await takaro.settings.settingsControllerGetOne('commandPrefix', gameServerId)).data.data;
|
|
6
|
+
const teleportRes = await takaro.variable.variableControllerSearch({
|
|
7
|
+
filters: {
|
|
8
|
+
gameServerId: [gameServerId],
|
|
9
|
+
playerId: [pog.playerId],
|
|
10
|
+
key: [getVariableKey(args.tp, true)],
|
|
11
|
+
moduleId: [mod.moduleId],
|
|
12
|
+
},
|
|
13
|
+
sortBy: 'key',
|
|
14
|
+
sortDirection: 'asc',
|
|
15
|
+
});
|
|
16
|
+
const teleports = teleportRes.data.data;
|
|
17
|
+
if (teleports.length === 0) {
|
|
18
|
+
throw new TakaroUserError(`No public teleport with name ${args.tp} found, use ${prefix}settp <name> to set one first.`);
|
|
19
|
+
}
|
|
20
|
+
const teleportRecord = teleports[0];
|
|
21
|
+
const teleport = JSON.parse(teleportRecord.value);
|
|
22
|
+
await takaro.variable.variableControllerUpdate(teleportRecord.id, {
|
|
23
|
+
key: getVariableKey(args.tp),
|
|
24
|
+
value: JSON.stringify(teleport),
|
|
25
|
+
});
|
|
26
|
+
await data.player.pm(`Teleport ${args.tp} is now private.`);
|
|
27
|
+
}
|
|
28
|
+
await main();
|
|
29
|
+
//# sourceMappingURL=setprivate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setprivate.js","sourceRoot":"","sources":["../../../../src/modules/teleports/commands/setprivate.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,KAAK,UAAU,IAAI;IACjB,MAAM,EAAE,GAAG,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IAEjE,MAAM,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,QAAQ,CAAC,wBAAwB,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC,CA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45 @@
|
|
|
1
|
+
import { takaro, data, checkPermission, TakaroUserError } from '@takaro/helpers';
|
|
2
|
+
import { getVariableKey } from './utils.js';
|
|
3
|
+
async function main() {
|
|
4
|
+
const { pog, gameServerId, module: mod, arguments: args } = data;
|
|
5
|
+
const prefix = (await takaro.settings.settingsControllerGetOne('commandPrefix', gameServerId)).data.data.value;
|
|
6
|
+
if (!mod.userConfig.allowPublicTeleports) {
|
|
7
|
+
throw new TakaroUserError('Public teleports are disabled.');
|
|
8
|
+
}
|
|
9
|
+
const hasPermission = checkPermission(pog, 'TELEPORTS_CREATE_PUBLIC');
|
|
10
|
+
const existingPublicTeleportsForPlayerRes = await takaro.variable.variableControllerSearch({
|
|
11
|
+
search: {
|
|
12
|
+
key: ['pubtp_'],
|
|
13
|
+
},
|
|
14
|
+
filters: {
|
|
15
|
+
gameServerId: [gameServerId],
|
|
16
|
+
playerId: [pog.playerId],
|
|
17
|
+
moduleId: [mod.moduleId],
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
if (existingPublicTeleportsForPlayerRes.data.data.length >= hasPermission.count) {
|
|
21
|
+
throw new TakaroUserError(`You have reached the maximum number of public teleports for your role, maximum allowed is ${hasPermission.count}`);
|
|
22
|
+
}
|
|
23
|
+
const teleports = (await takaro.variable.variableControllerSearch({
|
|
24
|
+
filters: {
|
|
25
|
+
gameServerId: [gameServerId],
|
|
26
|
+
playerId: [pog.playerId],
|
|
27
|
+
moduleId: [mod.moduleId],
|
|
28
|
+
key: [getVariableKey(args.tp)],
|
|
29
|
+
},
|
|
30
|
+
sortBy: 'key',
|
|
31
|
+
sortDirection: 'asc',
|
|
32
|
+
})).data.data;
|
|
33
|
+
if (teleports.length === 0) {
|
|
34
|
+
throw new TakaroUserError(`No teleport with name ${args.tp} found, use ${prefix}settp <name> to set one first.`);
|
|
35
|
+
}
|
|
36
|
+
const teleportRecord = teleports[0];
|
|
37
|
+
const teleport = JSON.parse(teleportRecord.value);
|
|
38
|
+
await takaro.variable.variableControllerUpdate(teleportRecord.id, {
|
|
39
|
+
key: getVariableKey(args.tp, true),
|
|
40
|
+
value: JSON.stringify(teleport),
|
|
41
|
+
});
|
|
42
|
+
await data.player.pm(`Teleport ${args.tp} is now public.`);
|
|
43
|
+
}
|
|
44
|
+
await main();
|
|
45
|
+
//# sourceMappingURL=setpublic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setpublic.js","sourceRoot":"","sources":["../../../../src/modules/teleports/commands/setpublic.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,KAAK,UAAU,IAAI;IACjB,MAAM,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;IAEjE,MAAM,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,QAAQ,CAAC,wBAAwB,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;IAE/G,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,oBAAoB,EAAE,CAAC;QACzC,MAAM,IAAI,eAAe,CAAC,gCAAgC,CAAC,CAAC;IAC9D,CAAC;IAED,MAAM,aAAa,GAAG,eAAe,CAAC,GAAG,EAAE,yBAAyB,CAAC,CAAC;IAEtE,MAAM,mCAAmC,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,wBAAwB,CAAC;QACzF,MAAM,EAAE;YACN,GAAG,EAAE,CAAC,QAAQ,CAAC;SAChB;QACD,OAAO,EAAE;YACP,YAAY,EAAE,CAAC,YAAY,CAAC;YAC5B,QAAQ,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC;YACxB,QAAQ,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC;SACz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AC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settp.d.ts","sourceRoot":"","sources":["../../../../src/modules/teleports/commands/settp.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { takaro, data, checkPermission, TakaroUserError } from '@takaro/helpers';
|
|
2
|
+
import { getVariableKey, findTp } from './utils.js';
|
|
3
|
+
async function main() {
|
|
4
|
+
const { pog, gameServerId, module: mod, arguments: args } = data;
|
|
5
|
+
const prefix = (await takaro.settings.settingsControllerGetOne('commandPrefix', gameServerId)).data.data.value;
|
|
6
|
+
const existingVariable = await findTp(args.tp, pog.playerId);
|
|
7
|
+
if (existingVariable.data.data.length > 0) {
|
|
8
|
+
throw new TakaroUserError(`Teleport ${args.tp} already exists, use ${prefix}deletetp ${args.tp} to delete it.`);
|
|
9
|
+
}
|
|
10
|
+
const hasPermission = checkPermission(pog, 'TELEPORTS_USE');
|
|
11
|
+
const allPlayerTeleports = await takaro.variable.variableControllerSearch({
|
|
12
|
+
search: {
|
|
13
|
+
key: [getVariableKey(undefined), getVariableKey(undefined, true)],
|
|
14
|
+
},
|
|
15
|
+
filters: {
|
|
16
|
+
gameServerId: [gameServerId],
|
|
17
|
+
playerId: [pog.playerId],
|
|
18
|
+
moduleId: [mod.moduleId],
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
if (allPlayerTeleports.data.data.length >= hasPermission.count) {
|
|
22
|
+
throw new TakaroUserError(`You have reached the maximum number of teleports for your role, maximum allowed is ${hasPermission.count}`);
|
|
23
|
+
}
|
|
24
|
+
await takaro.variable.variableControllerCreate({
|
|
25
|
+
key: getVariableKey(args.tp),
|
|
26
|
+
value: JSON.stringify({
|
|
27
|
+
name: args.tp,
|
|
28
|
+
x: data.pog.positionX,
|
|
29
|
+
y: data.pog.positionY,
|
|
30
|
+
z: data.pog.positionZ,
|
|
31
|
+
dimension: data.pog.dimension,
|
|
32
|
+
}),
|
|
33
|
+
gameServerId,
|
|
34
|
+
moduleId: mod.moduleId,
|
|
35
|
+
playerId: pog.playerId,
|
|
36
|
+
});
|
|
37
|
+
await data.player.pm(`Teleport ${args.tp} set.`);
|
|
38
|
+
}
|
|
39
|
+
await main();
|
|
40
|
+
//# sourceMappingURL=settp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settp.js","sourceRoot":"","sources":["../../../../src/modules/teleports/commands/settp.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpD,KAAK,UAAU,IAAI;IACjB,MAAM,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;IAEjE,MAAM,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,QAAQ,CAAC,wBAAwB,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;IAE/G,MAAM,gBAAgB,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;IAE7D,IAAI,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1C,MAAM,IAAI,eAAe,CAAC,YAAY,IAAI,CAAC,EAAE,wBAAwB,MAAM,YAAY,IAAI,CAAC,EAAE,gBAAgB,CAAC,CAAC;IAClH,CAAC;IAED,MAAM,aAAa,GAAG,eAAe,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;IAC5D,MAAM,kBAAkB,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,wBAAwB,CAAC;QACxE,MAAM,EAAE;YACN,GAAG,EAAE,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,cAAc,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;SAClE;QACD,OAAO,EAAE;YACP,YAAY,EAAE,CAAC,YAAY,CAAC;YAC5B,QAAQ,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC;YACxB,QAAQ,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC;SACzB;KACF,CAAC,CAAC;IAEH,IAAI,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,aAAa,CAAC,KAAK,EAAE,CAAC;QAC/D,MAAM,IAAI,eAAe,CACvB,sFAAsF,aAAa,CAAC,KAAK,EAAE,CAC5G,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,CAAC,QAAQ,CAAC,wBAAwB,CAAC;QAC7C,GAAG,EAAE,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC;QAC5B,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC;YACpB,IAAI,EAAE,IAAI,CAAC,EAAE;YACb,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,SAAS;YACrB,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,SAAS;YACrB,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,SAAS;YACrB,SAAS,EAAE,IAAI,CAAC,GAAG,CAAC,SAAS;SAC9B,CAAC;QACF,YAAY;QACZ,QAAQ,EAAE,GAAG,CAAC,QAAQ;QACtB,QAAQ,EAAE,GAAG,CAAC,QAAQ;KACvB,CAAC,CAAC;IAEH,MAAM,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,YAAY,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC;AACnD,CAAC;AAED,MAAM,IAAI,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setwaypoint.d.ts","sourceRoot":"","sources":["../../../../src/modules/teleports/commands/setwaypoint.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { takaro, data, TakaroUserError } from '@takaro/helpers';
|
|
2
|
+
import { getWaypointName, waypointReconciler } from './utils.js';
|
|
3
|
+
async function main() {
|
|
4
|
+
const { pog, gameServerId, arguments: args, module: mod } = data;
|
|
5
|
+
try {
|
|
6
|
+
await takaro.variable.variableControllerCreate({
|
|
7
|
+
moduleId: mod.moduleId,
|
|
8
|
+
gameServerId,
|
|
9
|
+
key: getWaypointName(args.waypoint),
|
|
10
|
+
value: JSON.stringify({
|
|
11
|
+
x: pog.positionX,
|
|
12
|
+
y: pog.positionY,
|
|
13
|
+
z: pog.positionZ,
|
|
14
|
+
dimension: pog.dimension,
|
|
15
|
+
}),
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
if (error.message === 'Request failed with status code 409') {
|
|
20
|
+
throw new TakaroUserError(`Waypoint ${args.waypoint} already exists.`);
|
|
21
|
+
}
|
|
22
|
+
throw error;
|
|
23
|
+
}
|
|
24
|
+
await waypointReconciler();
|
|
25
|
+
await pog.pm(`Waypoint ${args.waypoint} set.`);
|
|
26
|
+
}
|
|
27
|
+
await main();
|
|
28
|
+
//# sourceMappingURL=setwaypoint.js.map
|
|
@@ -0,0 +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,MAAM,iBAAiB,CAAC;AAChE,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;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;gBAChB,SAAS,EAAE,GAAG,CAAC,SAAS;aACzB,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":""}
|