@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,250 @@
|
|
|
1
|
+
import { EventsAwaiter, expect, IntegrationTest, IShopSetup, shopSetup } from '@takaro/test';
|
|
2
|
+
import { HookEvents } from '../../dto/index.js';
|
|
3
|
+
import { describe } from 'node:test';
|
|
4
|
+
|
|
5
|
+
const group = 'EconomyUtils:Shop:Claim';
|
|
6
|
+
|
|
7
|
+
const tests = [
|
|
8
|
+
new IntegrationTest<IShopSetup>({
|
|
9
|
+
group,
|
|
10
|
+
snapshot: false,
|
|
11
|
+
setup: shopSetup,
|
|
12
|
+
name: 'Can claim an order happy path',
|
|
13
|
+
test: async function () {
|
|
14
|
+
await this.setupData.client1.shopOrder.shopOrderControllerCreate({
|
|
15
|
+
listingId: this.setupData.listing100.id,
|
|
16
|
+
amount: 1,
|
|
17
|
+
});
|
|
18
|
+
const events = (await new EventsAwaiter().connect(this.client)).waitForEvents(HookEvents.CHAT_MESSAGE, 1);
|
|
19
|
+
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
20
|
+
msg: '/claim',
|
|
21
|
+
playerId: this.setupData.players[0].id,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
expect(await events).to.have.length(1);
|
|
25
|
+
expect((await events)[0].data.meta.msg).to.equal('You have received items from a shop order.');
|
|
26
|
+
},
|
|
27
|
+
}),
|
|
28
|
+
new IntegrationTest<IShopSetup>({
|
|
29
|
+
group,
|
|
30
|
+
snapshot: false,
|
|
31
|
+
setup: shopSetup,
|
|
32
|
+
name: 'Shows a friendly error when there are no pending orders',
|
|
33
|
+
test: async function () {
|
|
34
|
+
const events = (await new EventsAwaiter().connect(this.client)).waitForEvents(HookEvents.CHAT_MESSAGE, 1);
|
|
35
|
+
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
36
|
+
msg: '/claim',
|
|
37
|
+
playerId: this.setupData.players[0].id,
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
expect(await events).to.have.length(1);
|
|
41
|
+
expect((await events)[0].data.meta.msg).to.equal('You have no pending orders.');
|
|
42
|
+
},
|
|
43
|
+
}),
|
|
44
|
+
new IntegrationTest<IShopSetup>({
|
|
45
|
+
group,
|
|
46
|
+
snapshot: false,
|
|
47
|
+
setup: shopSetup,
|
|
48
|
+
name: 'Handles double-claiming an order',
|
|
49
|
+
test: async function () {
|
|
50
|
+
await this.setupData.client1.shopOrder.shopOrderControllerCreate({
|
|
51
|
+
listingId: this.setupData.listing100.id,
|
|
52
|
+
amount: 1,
|
|
53
|
+
});
|
|
54
|
+
const events = (await new EventsAwaiter().connect(this.client)).waitForEvents(HookEvents.CHAT_MESSAGE, 1);
|
|
55
|
+
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
56
|
+
msg: '/claim',
|
|
57
|
+
playerId: this.setupData.players[0].id,
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
expect(await events).to.have.length(1);
|
|
61
|
+
expect((await events)[0].data.meta.msg).to.equal('You have received items from a shop order.');
|
|
62
|
+
|
|
63
|
+
const secondEvents = (await new EventsAwaiter().connect(this.client)).waitForEvents(HookEvents.CHAT_MESSAGE, 1);
|
|
64
|
+
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
65
|
+
msg: '/claim',
|
|
66
|
+
playerId: this.setupData.players[0].id,
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
expect(await secondEvents).to.have.length(1);
|
|
70
|
+
expect((await secondEvents)[0].data.meta.msg).to.equal('You have no pending orders.');
|
|
71
|
+
},
|
|
72
|
+
}),
|
|
73
|
+
new IntegrationTest<IShopSetup>({
|
|
74
|
+
group,
|
|
75
|
+
snapshot: false,
|
|
76
|
+
setup: shopSetup,
|
|
77
|
+
name: 'Only claims the first order by default',
|
|
78
|
+
test: async function () {
|
|
79
|
+
await this.setupData.client1.shopOrder.shopOrderControllerCreate({
|
|
80
|
+
listingId: this.setupData.listing100.id,
|
|
81
|
+
amount: 1,
|
|
82
|
+
});
|
|
83
|
+
await this.setupData.client1.shopOrder.shopOrderControllerCreate({
|
|
84
|
+
listingId: this.setupData.listing33.id,
|
|
85
|
+
amount: 1,
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
const events = (await new EventsAwaiter().connect(this.client)).waitForEvents(HookEvents.CHAT_MESSAGE, 1);
|
|
89
|
+
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
90
|
+
msg: '/claim',
|
|
91
|
+
playerId: this.setupData.players[0].id,
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
expect(await events).to.have.length(1);
|
|
95
|
+
expect((await events)[0].data.meta.msg).to.equal('You have received items from a shop order.');
|
|
96
|
+
|
|
97
|
+
const secondEvents = (await new EventsAwaiter().connect(this.client)).waitForEvents(HookEvents.CHAT_MESSAGE, 1);
|
|
98
|
+
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
99
|
+
msg: '/claim',
|
|
100
|
+
playerId: this.setupData.players[0].id,
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
expect(await secondEvents).to.have.length(1);
|
|
104
|
+
expect((await secondEvents)[0].data.meta.msg).to.equal('You have received items from a shop order.');
|
|
105
|
+
},
|
|
106
|
+
}),
|
|
107
|
+
|
|
108
|
+
new IntegrationTest<IShopSetup>({
|
|
109
|
+
group,
|
|
110
|
+
snapshot: false,
|
|
111
|
+
setup: shopSetup,
|
|
112
|
+
name: 'Can claim all orders in one go',
|
|
113
|
+
test: async function () {
|
|
114
|
+
await this.setupData.client1.shopOrder.shopOrderControllerCreate({
|
|
115
|
+
listingId: this.setupData.listing100.id,
|
|
116
|
+
amount: 1,
|
|
117
|
+
});
|
|
118
|
+
await this.setupData.client1.shopOrder.shopOrderControllerCreate({
|
|
119
|
+
listingId: this.setupData.listing33.id,
|
|
120
|
+
amount: 1,
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
const events = (await new EventsAwaiter().connect(this.client)).waitForEvents(HookEvents.CHAT_MESSAGE, 4);
|
|
124
|
+
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
125
|
+
msg: '/claim true',
|
|
126
|
+
playerId: this.setupData.players[0].id,
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
expect(await events).to.have.length(4);
|
|
130
|
+
expect((await events)[0].data.meta.msg).to.equal('You have received items from a shop order.');
|
|
131
|
+
expect((await events)[1].data.meta.msg).to.equal('1x Stone');
|
|
132
|
+
expect((await events)[2].data.meta.msg).to.equal('You have received items from a shop order.');
|
|
133
|
+
expect((await events)[3].data.meta.msg).to.equal('1x Wood');
|
|
134
|
+
},
|
|
135
|
+
}),
|
|
136
|
+
new IntegrationTest<IShopSetup>({
|
|
137
|
+
group,
|
|
138
|
+
snapshot: false,
|
|
139
|
+
setup: shopSetup,
|
|
140
|
+
name: 'Should only claim orders from the current game server when player has orders on multiple servers',
|
|
141
|
+
test: async function () {
|
|
142
|
+
// Test scenario: Player has pending orders on two servers but is only online on one.
|
|
143
|
+
// The /claim command should only claim orders from the server where they're currently online.
|
|
144
|
+
|
|
145
|
+
// Install economyUtils on gameserver2
|
|
146
|
+
await this.client.module.moduleInstallationsControllerInstallModule({
|
|
147
|
+
gameServerId: this.setupData.gameserver2.id,
|
|
148
|
+
versionId: this.setupData.economyUtilsModule.latestVersion.id,
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
await this.client.settings.settingsControllerSet('economyEnabled', {
|
|
152
|
+
value: 'true',
|
|
153
|
+
gameServerId: this.setupData.gameserver2.id,
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
157
|
+
|
|
158
|
+
// Create player on gameserver2 as online, then disconnect to set offline
|
|
159
|
+
// (Must create as online to trigger POG creation via PLAYER_CONNECTED event)
|
|
160
|
+
await this.client.gameserver.gameServerControllerExecuteCommand(this.setupData.gameserver2.id, {
|
|
161
|
+
command: `createPlayer player2_${this.setupData.players[0].steamId} {"name": "${this.setupData.players[0].name}", "steamId": "${this.setupData.players[0].steamId}", "online": true}`,
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
await new Promise((resolve) => setTimeout(resolve, 2000));
|
|
165
|
+
|
|
166
|
+
const pogsOnServer2 = await this.client.playerOnGameserver.playerOnGameServerControllerSearch({
|
|
167
|
+
filters: {
|
|
168
|
+
gameServerId: [this.setupData.gameserver2.id],
|
|
169
|
+
playerId: [this.setupData.players[0].id],
|
|
170
|
+
},
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
if (pogsOnServer2.data.data.length === 0) {
|
|
174
|
+
throw new Error(`Player POG was not created on gameserver2. Player ID: ${this.setupData.players[0].id}`);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
await this.client.gameserver.gameServerControllerExecuteCommand(this.setupData.gameserver2.id, {
|
|
178
|
+
command: `disconnectPlayer ${this.setupData.players[0].steamId}`,
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
182
|
+
|
|
183
|
+
await this.client.playerOnGameserver.playerOnGameServerControllerAddCurrency(
|
|
184
|
+
this.setupData.gameserver2.id,
|
|
185
|
+
this.setupData.players[0].id,
|
|
186
|
+
{ currency: 250 },
|
|
187
|
+
);
|
|
188
|
+
|
|
189
|
+
// Create listings on both servers
|
|
190
|
+
const listingServer1 = await this.client.shopListing.shopListingControllerCreate({
|
|
191
|
+
gameServerId: this.setupData.gameserver.id,
|
|
192
|
+
items: [{ itemId: this.setupData.items[0].id, amount: 1 }],
|
|
193
|
+
price: 50,
|
|
194
|
+
name: 'Server 1 Item',
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
const listingServer2 = await this.client.shopListing.shopListingControllerCreate({
|
|
198
|
+
gameServerId: this.setupData.gameserver2.id,
|
|
199
|
+
items: [{ itemId: this.setupData.items2[0].id, amount: 1 }],
|
|
200
|
+
price: 75,
|
|
201
|
+
name: 'Server 2 Item',
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
// Create order on server 2 first (older), then server 1 (newer)
|
|
205
|
+
const orderServer2 = await this.setupData.client1.shopOrder.shopOrderControllerCreate({
|
|
206
|
+
listingId: listingServer2.data.data.id,
|
|
207
|
+
amount: 1,
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
const orderServer1 = await this.setupData.client1.shopOrder.shopOrderControllerCreate({
|
|
211
|
+
listingId: listingServer1.data.data.id,
|
|
212
|
+
amount: 1,
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
// Verify both orders start as PAID
|
|
216
|
+
const orderServer1Status = await this.client.shopOrder.shopOrderControllerGetOne(orderServer1.data.data.id);
|
|
217
|
+
const orderServer2Status = await this.client.shopOrder.shopOrderControllerGetOne(orderServer2.data.data.id);
|
|
218
|
+
expect(orderServer1Status.data.data.status).to.equal('PAID');
|
|
219
|
+
expect(orderServer2Status.data.data.status).to.equal('PAID');
|
|
220
|
+
|
|
221
|
+
// Claim on gameserver where player is online
|
|
222
|
+
const claimEvents = (await new EventsAwaiter().connect(this.client)).waitForEvents(HookEvents.CHAT_MESSAGE, 2);
|
|
223
|
+
|
|
224
|
+
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
225
|
+
msg: '/claim',
|
|
226
|
+
playerId: this.setupData.players[0].id,
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
const messages = await claimEvents;
|
|
230
|
+
|
|
231
|
+
expect(messages).to.have.length(2);
|
|
232
|
+
expect(messages[0].data.meta.msg).to.equal('You have received items from a shop order.');
|
|
233
|
+
expect(messages[1].data.meta.msg).to.match(/1x/);
|
|
234
|
+
|
|
235
|
+
// Verify only the server 1 order was claimed
|
|
236
|
+
const claimedOrderServer1 = await this.client.shopOrder.shopOrderControllerGetOne(orderServer1.data.data.id);
|
|
237
|
+
expect(claimedOrderServer1.data.data.status).to.equal('COMPLETED');
|
|
238
|
+
|
|
239
|
+
// Server 2 order should remain unclaimed
|
|
240
|
+
const unclaimedOrderServer2 = await this.client.shopOrder.shopOrderControllerGetOne(orderServer2.data.data.id);
|
|
241
|
+
expect(unclaimedOrderServer2.data.data.status).to.equal('PAID');
|
|
242
|
+
},
|
|
243
|
+
}),
|
|
244
|
+
];
|
|
245
|
+
|
|
246
|
+
describe(group, function () {
|
|
247
|
+
tests.forEach((test) => {
|
|
248
|
+
test.run();
|
|
249
|
+
});
|
|
250
|
+
});
|