@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,29 @@
|
|
|
1
|
+
import { takaro, data } from '@takaro/helpers';
|
|
2
|
+
|
|
3
|
+
async function main() {
|
|
4
|
+
const richest = (
|
|
5
|
+
await takaro.playerOnGameserver.playerOnGameServerControllerSearch({
|
|
6
|
+
limit: 10,
|
|
7
|
+
sortBy: 'currency',
|
|
8
|
+
sortDirection: 'desc',
|
|
9
|
+
extend: ['player'],
|
|
10
|
+
})
|
|
11
|
+
).data.data;
|
|
12
|
+
|
|
13
|
+
const currencyName = (await takaro.settings.settingsControllerGetOne('currencyName', data.gameServerId)).data.data
|
|
14
|
+
.value;
|
|
15
|
+
|
|
16
|
+
// TODO: change this to name when it become available in playerOnGameServer
|
|
17
|
+
const richestStrings = richest.map(async (pog, index) => {
|
|
18
|
+
const playerName = (await takaro.player.playerControllerGetOne(pog.playerId)).data.data.name;
|
|
19
|
+
return `${index + 1}. ${playerName} - ${pog.currency} ${currencyName}`;
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
await data.player.pm('Richest players:');
|
|
23
|
+
|
|
24
|
+
for (const string of richestStrings) {
|
|
25
|
+
await data.player.pm(await string);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
await main();
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { takaro, data, TakaroUserError } from '@takaro/helpers';
|
|
2
|
+
|
|
3
|
+
async function main() {
|
|
4
|
+
const { pog: sender, arguments: args, gameServerId, module: mod } = data;
|
|
5
|
+
|
|
6
|
+
const currencyName = (await takaro.settings.settingsControllerGetOne('currencyName', gameServerId)).data.data.value;
|
|
7
|
+
|
|
8
|
+
const prefix = (await takaro.settings.settingsControllerGetOne('commandPrefix', gameServerId)).data.data.value;
|
|
9
|
+
|
|
10
|
+
// args.receiver has an argument type of "player". Arguments of this type are automatically resolved to the player's id.
|
|
11
|
+
// If the player doesn't exist or multiple players with the same name where found, it will have thrown an error before this command is executed.
|
|
12
|
+
const receiver = args.receiver;
|
|
13
|
+
const senderName = (await takaro.player.playerControllerGetOne(sender.playerId)).data.data.name;
|
|
14
|
+
const receiverName = (await takaro.player.playerControllerGetOne(receiver.playerId)).data.data.name;
|
|
15
|
+
|
|
16
|
+
if (mod.userConfig.pendingAmount !== 0 && args.amount >= mod.userConfig.pendingAmount) {
|
|
17
|
+
// create a variable to store confirmation requirement
|
|
18
|
+
// TODO: in the future, we should probably add an expiration date to this variable.
|
|
19
|
+
await takaro.variable.variableControllerCreate({
|
|
20
|
+
key: 'confirmTransfer',
|
|
21
|
+
value: JSON.stringify({
|
|
22
|
+
amount: args.amount,
|
|
23
|
+
receiver: {
|
|
24
|
+
id: receiver.id,
|
|
25
|
+
gameId: receiver.gameId,
|
|
26
|
+
playerId: receiver.playerId,
|
|
27
|
+
},
|
|
28
|
+
}),
|
|
29
|
+
moduleId: mod.moduleId,
|
|
30
|
+
playerId: sender.playerId,
|
|
31
|
+
gameServerId,
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
// NOTE: we should maybe check if the player has enough balance to send the amount since this is only checked when the transaction is executed.
|
|
35
|
+
await sender.pm(
|
|
36
|
+
`You are about to send ${args.amount} ${currencyName} to ${receiverName}. (Please confirm by typing ${prefix}confirmtransfer)`,
|
|
37
|
+
);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
try {
|
|
42
|
+
await takaro.playerOnGameserver.playerOnGameServerControllerTransactBetweenPlayers(
|
|
43
|
+
sender.gameServerId,
|
|
44
|
+
sender.id,
|
|
45
|
+
receiver.id,
|
|
46
|
+
{
|
|
47
|
+
currency: args.amount,
|
|
48
|
+
},
|
|
49
|
+
);
|
|
50
|
+
} catch {
|
|
51
|
+
throw new TakaroUserError(
|
|
52
|
+
`Failed to transfer ${args.amount} ${currencyName} to ${receiverName}. Are you sure you have enough balance?`,
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const messageToReceiver = takaro.gameserver.gameServerControllerSendMessage(gameServerId, {
|
|
57
|
+
message: `You received ${args.amount} ${currencyName} from ${senderName}`,
|
|
58
|
+
opts: {
|
|
59
|
+
recipient: {
|
|
60
|
+
gameId: receiver.gameId,
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
await Promise.all([
|
|
66
|
+
sender.pm(`You successfully transferred ${args.amount} ${currencyName} to ${receiverName}`),
|
|
67
|
+
messageToReceiver,
|
|
68
|
+
]);
|
|
69
|
+
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
await main();
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { data, takaro, checkPermission } from '@takaro/helpers';
|
|
2
|
+
|
|
3
|
+
const VARIABLE_KEY = 'lastZombieKillReward';
|
|
4
|
+
|
|
5
|
+
async function main() {
|
|
6
|
+
const { gameServerId, module: mod } = data;
|
|
7
|
+
|
|
8
|
+
const lastRunRes = (
|
|
9
|
+
await takaro.variable.variableControllerSearch({
|
|
10
|
+
filters: {
|
|
11
|
+
key: [VARIABLE_KEY],
|
|
12
|
+
gameServerId: [gameServerId],
|
|
13
|
+
moduleId: [mod.moduleId],
|
|
14
|
+
},
|
|
15
|
+
})
|
|
16
|
+
).data.data;
|
|
17
|
+
|
|
18
|
+
// We last ran the rewards script at this time
|
|
19
|
+
// If this is the first time we run it, just get the last 5 minutes
|
|
20
|
+
const lastRun = lastRunRes.length ? new Date(JSON.parse(lastRunRes[0].value)) : new Date(Date.now() - 5 * 60 * 1000);
|
|
21
|
+
|
|
22
|
+
// Fetch all the kill events since the last time we gave out rewards
|
|
23
|
+
const killEvents = (
|
|
24
|
+
await takaro.event.eventControllerSearch({
|
|
25
|
+
filters: { eventName: ['entity-killed'], gameserverId: [gameServerId] },
|
|
26
|
+
greaterThan: { createdAt: lastRun.toISOString() },
|
|
27
|
+
limit: 1000,
|
|
28
|
+
})
|
|
29
|
+
).data.data;
|
|
30
|
+
|
|
31
|
+
console.log(`Found ${killEvents.length} kill events since ${lastRun.toISOString()}`);
|
|
32
|
+
|
|
33
|
+
// Group the events by player
|
|
34
|
+
const playerKills = {};
|
|
35
|
+
for (const killEvent of killEvents) {
|
|
36
|
+
if (!playerKills[killEvent.playerId]) {
|
|
37
|
+
playerKills[killEvent.playerId] = [];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
playerKills[killEvent.playerId].push(killEvent);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Give each player their reward
|
|
44
|
+
// We use Promise.allSettled to run this concurrently
|
|
45
|
+
const results = await Promise.allSettled(
|
|
46
|
+
Object.entries(playerKills).map(async ([playerId, kills]) => {
|
|
47
|
+
const pog = (await takaro.playerOnGameserver.playerOnGameServerControllerGetOne(gameServerId, playerId)).data
|
|
48
|
+
.data;
|
|
49
|
+
const hasPermission = checkPermission(pog, 'ZOMBIE_KILL_REWARD_OVERRIDE');
|
|
50
|
+
const defaultReward = mod.userConfig.zombieKillReward;
|
|
51
|
+
const reward = hasPermission && hasPermission.count != null ? hasPermission.count : defaultReward;
|
|
52
|
+
const totalReward = reward * kills.length;
|
|
53
|
+
return takaro.playerOnGameserver.playerOnGameServerControllerAddCurrency(gameServerId, playerId, {
|
|
54
|
+
currency: totalReward,
|
|
55
|
+
});
|
|
56
|
+
}),
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
// Log any errors
|
|
60
|
+
for (const result of results) {
|
|
61
|
+
if (result.status === 'rejected') {
|
|
62
|
+
console.error(result.reason);
|
|
63
|
+
throw new Error(`Failed to give rewards: ${result.reason}`);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Update the last run time
|
|
68
|
+
if (lastRunRes.length) {
|
|
69
|
+
await takaro.variable.variableControllerUpdate(lastRunRes[0].id, {
|
|
70
|
+
value: JSON.stringify(new Date()),
|
|
71
|
+
});
|
|
72
|
+
} else {
|
|
73
|
+
await takaro.variable.variableControllerCreate({
|
|
74
|
+
key: VARIABLE_KEY,
|
|
75
|
+
value: JSON.stringify(new Date()),
|
|
76
|
+
moduleId: mod.moduleId,
|
|
77
|
+
gameServerId,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
await main();
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { ModuleTransferDTO, ICommand, ICronJob, IPermission, ModuleTransferVersionDTO } from '../../BuiltinModule.js';
|
|
2
|
+
|
|
3
|
+
export class EconomyUtils extends ModuleTransferDTO<EconomyUtils> {
|
|
4
|
+
constructor() {
|
|
5
|
+
super();
|
|
6
|
+
|
|
7
|
+
this.name = 'economyUtils';
|
|
8
|
+
this.author = 'Takaro';
|
|
9
|
+
this.supportedGames = ['all'];
|
|
10
|
+
this.versions = [
|
|
11
|
+
new ModuleTransferVersionDTO({
|
|
12
|
+
tag: '0.0.3',
|
|
13
|
+
description: 'A set of commands to allow players to manage their currency.',
|
|
14
|
+
configSchema: JSON.stringify({
|
|
15
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
16
|
+
type: 'object',
|
|
17
|
+
properties: {
|
|
18
|
+
pendingAmount: {
|
|
19
|
+
title: 'Pending amount',
|
|
20
|
+
type: 'number',
|
|
21
|
+
description:
|
|
22
|
+
'When a player transfers money, they must confirm the transfer when the amount is equal or above this value. Set to 0 to disable.',
|
|
23
|
+
default: 0,
|
|
24
|
+
},
|
|
25
|
+
zombieKillReward: {
|
|
26
|
+
title: 'Zombie kill reward',
|
|
27
|
+
type: 'number',
|
|
28
|
+
description:
|
|
29
|
+
'The default amount of currency a player receives for killing a zombie. This can be overridden by roles.',
|
|
30
|
+
default: 1,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
required: [],
|
|
34
|
+
additionalProperties: false,
|
|
35
|
+
}),
|
|
36
|
+
permissions: [
|
|
37
|
+
new IPermission({
|
|
38
|
+
permission: 'ECONOMY_UTILS_MANAGE_CURRENCY',
|
|
39
|
+
friendlyName: 'Manage currency',
|
|
40
|
+
description:
|
|
41
|
+
'Allows players to manage currency of other players. This includes granting and revoking currency.',
|
|
42
|
+
canHaveCount: false,
|
|
43
|
+
}),
|
|
44
|
+
new IPermission({
|
|
45
|
+
permission: 'ZOMBIE_KILL_REWARD_OVERRIDE',
|
|
46
|
+
friendlyName: 'Zombie kill reward override',
|
|
47
|
+
description: 'Allows a role to override the amount of currency a player receives for killing a entity.',
|
|
48
|
+
canHaveCount: true,
|
|
49
|
+
}),
|
|
50
|
+
],
|
|
51
|
+
cronJobs: [
|
|
52
|
+
new ICronJob({
|
|
53
|
+
function: this.loadFn('cronJobs', 'zombieKillReward'),
|
|
54
|
+
name: 'zombieKillReward',
|
|
55
|
+
temporalValue: '*/5 * * * *',
|
|
56
|
+
}),
|
|
57
|
+
],
|
|
58
|
+
|
|
59
|
+
commands: [
|
|
60
|
+
new ICommand({
|
|
61
|
+
function: this.loadFn('commands', 'balance'),
|
|
62
|
+
name: 'balance',
|
|
63
|
+
trigger: 'balance',
|
|
64
|
+
helpText: 'Check your balance.',
|
|
65
|
+
arguments: [],
|
|
66
|
+
}),
|
|
67
|
+
new ICommand({
|
|
68
|
+
function: this.loadFn('commands', 'topCurrency'),
|
|
69
|
+
name: 'topCurrency',
|
|
70
|
+
trigger: 'topcurrency',
|
|
71
|
+
helpText: 'List of the 10 players with the highest balance.',
|
|
72
|
+
arguments: [],
|
|
73
|
+
}),
|
|
74
|
+
new ICommand({
|
|
75
|
+
function: this.loadFn('commands', 'grantCurrency'),
|
|
76
|
+
name: 'grantCurrency',
|
|
77
|
+
trigger: 'grantcurrency',
|
|
78
|
+
helpText: 'Grant money to a player. The money is not taken from your own balance but is new currency.',
|
|
79
|
+
requiredPermissions: ['ECONOMY_UTILS_MANAGE_CURRENCY'],
|
|
80
|
+
arguments: [
|
|
81
|
+
{
|
|
82
|
+
name: 'receiver',
|
|
83
|
+
type: 'player',
|
|
84
|
+
helpText: 'The player to grant currency to.',
|
|
85
|
+
position: 0,
|
|
86
|
+
defaultValue: null,
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
name: 'amount',
|
|
90
|
+
type: 'number',
|
|
91
|
+
helpText: 'The amount of money.',
|
|
92
|
+
position: 1,
|
|
93
|
+
defaultValue: null,
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
}),
|
|
97
|
+
new ICommand({
|
|
98
|
+
function: this.loadFn('commands', 'revokeCurrency'),
|
|
99
|
+
name: 'revokeCurrency',
|
|
100
|
+
trigger: 'revokecurrency',
|
|
101
|
+
helpText: 'Revokes money from a player. The money disappears.',
|
|
102
|
+
requiredPermissions: ['ECONOMY_UTILS_MANAGE_CURRENCY'],
|
|
103
|
+
arguments: [
|
|
104
|
+
{
|
|
105
|
+
name: 'receiver',
|
|
106
|
+
type: 'player',
|
|
107
|
+
helpText: 'The player to revoke currency from.',
|
|
108
|
+
position: 0,
|
|
109
|
+
defaultValue: null,
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
name: 'amount',
|
|
113
|
+
type: 'number',
|
|
114
|
+
helpText: 'The amount of money.',
|
|
115
|
+
position: 1,
|
|
116
|
+
defaultValue: null,
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
}),
|
|
120
|
+
new ICommand({
|
|
121
|
+
function: this.loadFn('commands', 'confirmTransfer'),
|
|
122
|
+
name: 'confirmTransfer',
|
|
123
|
+
trigger: 'confirmtransfer',
|
|
124
|
+
helpText: 'Confirms a pending transfer.',
|
|
125
|
+
arguments: [],
|
|
126
|
+
}),
|
|
127
|
+
new ICommand({
|
|
128
|
+
function: this.loadFn('commands', 'transfer'),
|
|
129
|
+
name: 'transfer',
|
|
130
|
+
trigger: 'transfer',
|
|
131
|
+
helpText: 'Transfer money to another player.',
|
|
132
|
+
arguments: [
|
|
133
|
+
{
|
|
134
|
+
name: 'receiver',
|
|
135
|
+
type: 'player',
|
|
136
|
+
helpText: 'The player to transfer money to.',
|
|
137
|
+
position: 0,
|
|
138
|
+
defaultValue: null,
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
name: 'amount',
|
|
142
|
+
type: 'number',
|
|
143
|
+
helpText: 'The amount of money to transfer.',
|
|
144
|
+
position: 1,
|
|
145
|
+
defaultValue: null,
|
|
146
|
+
},
|
|
147
|
+
],
|
|
148
|
+
}),
|
|
149
|
+
new ICommand({
|
|
150
|
+
function: this.loadFn('commands', 'claim'),
|
|
151
|
+
name: 'claim',
|
|
152
|
+
trigger: 'claim',
|
|
153
|
+
helpText: 'Claim your pending shop orders.',
|
|
154
|
+
arguments: [
|
|
155
|
+
{
|
|
156
|
+
name: 'all',
|
|
157
|
+
type: 'boolean',
|
|
158
|
+
helpText: 'If true, claim ALL pending orders. If false, claim only the first one.',
|
|
159
|
+
position: 0,
|
|
160
|
+
defaultValue: 'false',
|
|
161
|
+
},
|
|
162
|
+
],
|
|
163
|
+
}),
|
|
164
|
+
new ICommand({
|
|
165
|
+
function: this.loadFn('commands', 'shop'),
|
|
166
|
+
name: 'shop',
|
|
167
|
+
trigger: 'shop',
|
|
168
|
+
helpText: 'Browse the shop and view available items.',
|
|
169
|
+
arguments: [
|
|
170
|
+
{
|
|
171
|
+
name: 'page',
|
|
172
|
+
type: 'number',
|
|
173
|
+
helpText: 'Display more items from the shop by specifying a page number.',
|
|
174
|
+
position: 0,
|
|
175
|
+
defaultValue: '1',
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
name: 'item',
|
|
179
|
+
type: 'number',
|
|
180
|
+
helpText: 'Select a specific item to view more details.',
|
|
181
|
+
position: 1,
|
|
182
|
+
defaultValue: '0',
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
name: 'action',
|
|
186
|
+
type: 'string',
|
|
187
|
+
helpText: 'Perform an action on the selected item. Currently only "buy" is supported.',
|
|
188
|
+
position: 2,
|
|
189
|
+
defaultValue: 'none',
|
|
190
|
+
},
|
|
191
|
+
],
|
|
192
|
+
}),
|
|
193
|
+
],
|
|
194
|
+
}),
|
|
195
|
+
];
|
|
196
|
+
}
|
|
197
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { takaro, data, checkPermission } from '@takaro/helpers';
|
|
2
|
+
|
|
3
|
+
async function main() {
|
|
4
|
+
const { gameServerId, player, pog } = data;
|
|
5
|
+
const { country } = data.eventData;
|
|
6
|
+
const { ban, banDuration, countries, message, mode } = data.module.userConfig;
|
|
7
|
+
|
|
8
|
+
async function handleAction() {
|
|
9
|
+
if (ban) {
|
|
10
|
+
const now = new Date();
|
|
11
|
+
const expiresAt = new Date(now.getTime() + banDuration * 1000);
|
|
12
|
+
await takaro.player.banControllerCreate({
|
|
13
|
+
gameServerId,
|
|
14
|
+
playerId: player.id,
|
|
15
|
+
until: expiresAt,
|
|
16
|
+
reason: message,
|
|
17
|
+
});
|
|
18
|
+
} else {
|
|
19
|
+
await takaro.gameserver.gameServerControllerKickPlayer(gameServerId, player.id, {
|
|
20
|
+
reason: message,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const isImmune = checkPermission(pog, 'GEOBLOCK_IMMUNITY');
|
|
26
|
+
if (isImmune) {
|
|
27
|
+
console.log('Player has immunity, no action');
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (mode === 'allow') {
|
|
32
|
+
if (countries.includes(country)) {
|
|
33
|
+
console.log('Allowed country detected, no action');
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
console.log('Blocked country detected, performing actions');
|
|
37
|
+
await handleAction();
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (mode === 'deny') {
|
|
42
|
+
if (countries.includes(country)) {
|
|
43
|
+
console.log('Blocked country detected, performing actions');
|
|
44
|
+
await handleAction();
|
|
45
|
+
return;
|
|
46
|
+
} else {
|
|
47
|
+
console.log('Allowed country detected, no action');
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
await main();
|