@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,291 @@
|
|
|
1
|
+
import { IntegrationTest, expect, IModuleTestsSetupData, modulesTestSetup, EventsAwaiter } from '@takaro/test';
|
|
2
|
+
import { GameEvents } from '../dto/gameEvents.js';
|
|
3
|
+
import { CommandArgumentCreateDTO } from '@takaro/apiclient';
|
|
4
|
+
import { describe } from 'node:test';
|
|
5
|
+
|
|
6
|
+
const group = 'Command args';
|
|
7
|
+
|
|
8
|
+
const createSetup = (commandArgs: CommandArgumentCreateDTO[]) => {
|
|
9
|
+
return async function (this: IntegrationTest<IModuleTestsSetupData>) {
|
|
10
|
+
const setupRes = await modulesTestSetup.bind(this)();
|
|
11
|
+
const moduleRes = await this.client.module.moduleControllerCreate({
|
|
12
|
+
name: 'test',
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
await this.client.command.commandControllerCreate({
|
|
16
|
+
name: 'test',
|
|
17
|
+
trigger: 'test',
|
|
18
|
+
versionId: moduleRes.data.data.latestVersion.id,
|
|
19
|
+
arguments: commandArgs,
|
|
20
|
+
function: `import { getTakaro, getData } from '@takaro/helpers';
|
|
21
|
+
|
|
22
|
+
async function main() {
|
|
23
|
+
const data = await getData();
|
|
24
|
+
const takaro = await getTakaro(data);
|
|
25
|
+
const { arguments: args } = data;
|
|
26
|
+
await data.player.pm(JSON.stringify(args));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
await main();`,
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
await this.client.module.moduleInstallationsControllerInstallModule({
|
|
33
|
+
gameServerId: setupRes.gameserver.id,
|
|
34
|
+
versionId: moduleRes.data.data.latestVersion.id,
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
return setupRes;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const playerArgSetup = async function (this: IntegrationTest<IModuleTestsSetupData>) {
|
|
42
|
+
const setupRes = await modulesTestSetup.bind(this)();
|
|
43
|
+
const moduleRes = await this.client.module.moduleControllerCreate({
|
|
44
|
+
name: 'test',
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
await this.client.command.commandControllerCreate({
|
|
48
|
+
name: 'test',
|
|
49
|
+
trigger: 'test',
|
|
50
|
+
versionId: moduleRes.data.data.latestVersion.id,
|
|
51
|
+
arguments: [{ name: 'name', type: 'player', position: 0 }],
|
|
52
|
+
function: `import { getTakaro, getData } from '@takaro/helpers';
|
|
53
|
+
|
|
54
|
+
async function main() {
|
|
55
|
+
const data = await getData();
|
|
56
|
+
const takaro = await getTakaro(data);
|
|
57
|
+
const { arguments: args } = data;
|
|
58
|
+
await data.player.pm(args.name.gameId);
|
|
59
|
+
await data.player.pm(args.name.positionX.toString());
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
await main();`,
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
await this.client.module.moduleInstallationsControllerInstallModule({
|
|
66
|
+
gameServerId: setupRes.gameserver.id,
|
|
67
|
+
versionId: moduleRes.data.data.latestVersion.id,
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
return setupRes;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const tests = [
|
|
74
|
+
new IntegrationTest<IModuleTestsSetupData>({
|
|
75
|
+
name: 'Sends a clear error when passing invalid arguments (passing string to number args)',
|
|
76
|
+
group,
|
|
77
|
+
snapshot: false,
|
|
78
|
+
setup: createSetup([
|
|
79
|
+
{
|
|
80
|
+
name: 'test',
|
|
81
|
+
type: 'number',
|
|
82
|
+
position: 0,
|
|
83
|
+
},
|
|
84
|
+
]),
|
|
85
|
+
test: async function () {
|
|
86
|
+
const events = (await new EventsAwaiter().connect(this.client)).waitForEvents(GameEvents.CHAT_MESSAGE, 1);
|
|
87
|
+
|
|
88
|
+
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
89
|
+
msg: '/test "test"',
|
|
90
|
+
playerId: this.setupData.players[0].id,
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
expect((await events).length).to.be.eq(1);
|
|
94
|
+
expect((await events)[0].data.meta.msg).to.be.eq(
|
|
95
|
+
'The value for "test" should be a number. Please correct it and try again.',
|
|
96
|
+
);
|
|
97
|
+
},
|
|
98
|
+
}),
|
|
99
|
+
new IntegrationTest<IModuleTestsSetupData>({
|
|
100
|
+
name: 'Respects default values',
|
|
101
|
+
group,
|
|
102
|
+
snapshot: false,
|
|
103
|
+
setup: createSetup([
|
|
104
|
+
{ name: 'name', type: 'string', position: 0 },
|
|
105
|
+
{ name: 'public', type: 'boolean', position: 1, defaultValue: 'false' },
|
|
106
|
+
{ name: 'number', type: 'number', position: 2, defaultValue: '42' },
|
|
107
|
+
]),
|
|
108
|
+
test: async function () {
|
|
109
|
+
const events = (await new EventsAwaiter().connect(this.client)).waitForEvents(GameEvents.CHAT_MESSAGE, 1);
|
|
110
|
+
|
|
111
|
+
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
112
|
+
msg: '/test "test"',
|
|
113
|
+
playerId: this.setupData.players[0].id,
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
expect((await events).length).to.be.eq(1);
|
|
117
|
+
expect((await events)[0].data.meta.msg).to.be.eq('{"name":"test","public":false,"number":42}');
|
|
118
|
+
},
|
|
119
|
+
}),
|
|
120
|
+
new IntegrationTest<IModuleTestsSetupData>({
|
|
121
|
+
name: 'Handles spaces properly',
|
|
122
|
+
group,
|
|
123
|
+
snapshot: false,
|
|
124
|
+
setup: createSetup([
|
|
125
|
+
{ name: 'name', type: 'string', position: 0 },
|
|
126
|
+
{ name: 'public', type: 'boolean', position: 1 },
|
|
127
|
+
]),
|
|
128
|
+
test: async function () {
|
|
129
|
+
const events = (await new EventsAwaiter().connect(this.client)).waitForEvents(GameEvents.CHAT_MESSAGE, 1);
|
|
130
|
+
|
|
131
|
+
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
132
|
+
msg: '/test "test test" true',
|
|
133
|
+
playerId: this.setupData.players[0].id,
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
expect((await events).length).to.be.eq(1);
|
|
137
|
+
expect((await events)[0].data.meta.msg).to.be.eq('{"name":"test test","public":true}');
|
|
138
|
+
},
|
|
139
|
+
}),
|
|
140
|
+
new IntegrationTest<IModuleTestsSetupData>({
|
|
141
|
+
name: 'Can do a basic player arg',
|
|
142
|
+
group,
|
|
143
|
+
snapshot: false,
|
|
144
|
+
setup: playerArgSetup,
|
|
145
|
+
test: async function () {
|
|
146
|
+
const events = (await new EventsAwaiter().connect(this.client)).waitForEvents(GameEvents.CHAT_MESSAGE, 2);
|
|
147
|
+
|
|
148
|
+
const pogRes = await this.client.playerOnGameserver.playerOnGameServerControllerSearch({
|
|
149
|
+
filters: {
|
|
150
|
+
playerId: [this.setupData.players[0].id],
|
|
151
|
+
gameServerId: [this.setupData.gameserver.id],
|
|
152
|
+
},
|
|
153
|
+
});
|
|
154
|
+
const pog = pogRes.data.data[0];
|
|
155
|
+
|
|
156
|
+
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
157
|
+
msg: `/test ${this.setupData.players[0].name}`,
|
|
158
|
+
playerId: this.setupData.players[0].id,
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
expect((await events).length).to.be.eq(2);
|
|
162
|
+
expect((await events)[0].data.meta.msg).to.be.eq(pog.gameId);
|
|
163
|
+
expect((await events)[1].data.meta.msg).to.be.eq(pog.positionX?.toString());
|
|
164
|
+
},
|
|
165
|
+
}),
|
|
166
|
+
new IntegrationTest<IModuleTestsSetupData>({
|
|
167
|
+
name: 'Can do a player arg with partial name',
|
|
168
|
+
group,
|
|
169
|
+
snapshot: false,
|
|
170
|
+
setup: playerArgSetup,
|
|
171
|
+
test: async function () {
|
|
172
|
+
const pogRes = await this.client.playerOnGameserver.playerOnGameServerControllerSearch({
|
|
173
|
+
filters: {
|
|
174
|
+
playerId: [this.setupData.players[0].id],
|
|
175
|
+
gameServerId: [this.setupData.gameserver.id],
|
|
176
|
+
},
|
|
177
|
+
});
|
|
178
|
+
const pog = pogRes.data.data[0];
|
|
179
|
+
|
|
180
|
+
const events = (await new EventsAwaiter().connect(this.client)).waitForEvents(GameEvents.CHAT_MESSAGE, 2);
|
|
181
|
+
|
|
182
|
+
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
183
|
+
msg: `/test ${this.setupData.players[0].name.substring(0, 3)}`,
|
|
184
|
+
playerId: this.setupData.players[0].id,
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
expect((await events).length).to.be.eq(2);
|
|
188
|
+
expect((await events)[0].data.meta.msg).to.be.eq(pog.gameId);
|
|
189
|
+
expect((await events)[1].data.meta.msg).to.be.eq(pog.positionX?.toString());
|
|
190
|
+
},
|
|
191
|
+
}),
|
|
192
|
+
new IntegrationTest<IModuleTestsSetupData>({
|
|
193
|
+
name: 'Can do a player arg with case switched',
|
|
194
|
+
group,
|
|
195
|
+
snapshot: false,
|
|
196
|
+
setup: playerArgSetup,
|
|
197
|
+
test: async function () {
|
|
198
|
+
const events = (await new EventsAwaiter().connect(this.client)).waitForEvents(GameEvents.CHAT_MESSAGE, 2);
|
|
199
|
+
|
|
200
|
+
const pogRes = await this.client.playerOnGameserver.playerOnGameServerControllerSearch({
|
|
201
|
+
filters: {
|
|
202
|
+
playerId: [this.setupData.players[0].id],
|
|
203
|
+
gameServerId: [this.setupData.gameserver.id],
|
|
204
|
+
},
|
|
205
|
+
});
|
|
206
|
+
const pog = pogRes.data.data[0];
|
|
207
|
+
|
|
208
|
+
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
209
|
+
msg: `/test ${this.setupData.players[0].name.toUpperCase()}`,
|
|
210
|
+
playerId: this.setupData.players[0].id,
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
expect((await events).length).to.be.eq(2);
|
|
214
|
+
expect((await events)[0].data.meta.msg).to.be.eq(pog.gameId);
|
|
215
|
+
expect((await events)[1].data.meta.msg).to.be.eq(pog.positionX?.toString());
|
|
216
|
+
},
|
|
217
|
+
}),
|
|
218
|
+
new IntegrationTest<IModuleTestsSetupData>({
|
|
219
|
+
name: 'Can do a player arg with steam ID',
|
|
220
|
+
group,
|
|
221
|
+
snapshot: false,
|
|
222
|
+
setup: playerArgSetup,
|
|
223
|
+
test: async function () {
|
|
224
|
+
const events = (await new EventsAwaiter().connect(this.client)).waitForEvents(GameEvents.CHAT_MESSAGE, 2);
|
|
225
|
+
|
|
226
|
+
const pogRes = await this.client.playerOnGameserver.playerOnGameServerControllerSearch({
|
|
227
|
+
filters: {
|
|
228
|
+
playerId: [this.setupData.players[0].id],
|
|
229
|
+
gameServerId: [this.setupData.gameserver.id],
|
|
230
|
+
},
|
|
231
|
+
});
|
|
232
|
+
const pog = pogRes.data.data[0];
|
|
233
|
+
|
|
234
|
+
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
235
|
+
msg: `/test ${this.setupData.players[0].steamId}`,
|
|
236
|
+
playerId: this.setupData.players[0].id,
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
expect((await events).length).to.be.eq(2);
|
|
240
|
+
expect((await events)[0].data.meta.msg).to.be.eq(pog.gameId);
|
|
241
|
+
expect((await events)[1].data.meta.msg).to.be.eq(pog.positionX?.toString());
|
|
242
|
+
},
|
|
243
|
+
}),
|
|
244
|
+
new IntegrationTest<IModuleTestsSetupData>({
|
|
245
|
+
name: 'Shows an error when multiple players are found',
|
|
246
|
+
group,
|
|
247
|
+
snapshot: false,
|
|
248
|
+
setup: playerArgSetup,
|
|
249
|
+
test: async function () {
|
|
250
|
+
const events = (await new EventsAwaiter().connect(this.client)).waitForEvents(GameEvents.CHAT_MESSAGE, 1);
|
|
251
|
+
|
|
252
|
+
// Find a letter contained in one of the players' names
|
|
253
|
+
const letterToSearch = ['e', 'a'].find((letter) => {
|
|
254
|
+
return this.setupData.players.some((player) => {
|
|
255
|
+
return player.name.includes(letter);
|
|
256
|
+
});
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
260
|
+
msg: `/test ${letterToSearch}`,
|
|
261
|
+
playerId: this.setupData.players[0].id,
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
expect((await events).length).to.be.eq(1);
|
|
265
|
+
expect((await events)[0].data.meta.msg).to.match(/Multiple players found/);
|
|
266
|
+
},
|
|
267
|
+
}),
|
|
268
|
+
new IntegrationTest<IModuleTestsSetupData>({
|
|
269
|
+
name: 'Shows an error when no players are found',
|
|
270
|
+
group,
|
|
271
|
+
snapshot: false,
|
|
272
|
+
setup: playerArgSetup,
|
|
273
|
+
test: async function () {
|
|
274
|
+
const events = (await new EventsAwaiter().connect(this.client)).waitForEvents(GameEvents.CHAT_MESSAGE, 1);
|
|
275
|
+
|
|
276
|
+
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
277
|
+
msg: '/test itsimpossiblethatwewilleverfindaplayerwiththisnameright',
|
|
278
|
+
playerId: this.setupData.players[0].id,
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
expect((await events).length).to.be.eq(1);
|
|
282
|
+
expect((await events)[0].data.meta.msg).to.match(/No player found with the name or ID/);
|
|
283
|
+
},
|
|
284
|
+
}),
|
|
285
|
+
];
|
|
286
|
+
|
|
287
|
+
describe(group, function () {
|
|
288
|
+
tests.forEach((test) => {
|
|
289
|
+
test.run();
|
|
290
|
+
});
|
|
291
|
+
});
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { IntegrationTest, expect, IModuleTestsSetupData, modulesTestSetup, EventsAwaiter } from '@takaro/test';
|
|
2
|
+
import { GameEvents } from '../dto/gameEvents.js';
|
|
3
|
+
import { randomUUID } from 'crypto';
|
|
4
|
+
import { getMockServer } from '@takaro/mock-gameserver';
|
|
5
|
+
import { GameServerOutputDTO } from '@takaro/apiclient';
|
|
6
|
+
import { describe } from 'node:test';
|
|
7
|
+
|
|
8
|
+
const group = 'Cross-server player commands';
|
|
9
|
+
|
|
10
|
+
interface CrossServerSetupData extends IModuleTestsSetupData {
|
|
11
|
+
server2: GameServerOutputDTO;
|
|
12
|
+
sharedSteamId: string;
|
|
13
|
+
sharedPlayerOnServer2: any;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const crossServerPlayerSetup = async function (
|
|
17
|
+
this: IntegrationTest<CrossServerSetupData>,
|
|
18
|
+
): Promise<CrossServerSetupData> {
|
|
19
|
+
const setupRes = await modulesTestSetup.bind(this as unknown as IntegrationTest<IModuleTestsSetupData>)();
|
|
20
|
+
if (!this.domainRegistrationToken) throw new Error('Domain registration token is not set. Invalid setup?');
|
|
21
|
+
// Create a second server
|
|
22
|
+
const server2IdentityToken = randomUUID();
|
|
23
|
+
await getMockServer({
|
|
24
|
+
mockserver: {
|
|
25
|
+
registrationToken: this.domainRegistrationToken,
|
|
26
|
+
identityToken: server2IdentityToken,
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
// Wait for the second server to be registered
|
|
31
|
+
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
32
|
+
|
|
33
|
+
// Find the second server
|
|
34
|
+
const gameServersRes = await this.client.gameserver.gameServerControllerSearch({
|
|
35
|
+
filters: { identityToken: [server2IdentityToken] },
|
|
36
|
+
});
|
|
37
|
+
const server2 = gameServersRes.data.data[0];
|
|
38
|
+
|
|
39
|
+
// Create a module with a command that uses player argument
|
|
40
|
+
const moduleRes = await this.client.module.moduleControllerCreate({
|
|
41
|
+
name: 'cross-server-test',
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
await this.client.command.commandControllerCreate({
|
|
45
|
+
name: 'playerinfo',
|
|
46
|
+
trigger: 'playerinfo',
|
|
47
|
+
versionId: moduleRes.data.data.latestVersion.id,
|
|
48
|
+
arguments: [{ name: 'targetPlayer', type: 'player', position: 0 }],
|
|
49
|
+
function: `import { getTakaro, getData } from '@takaro/helpers';
|
|
50
|
+
|
|
51
|
+
async function main() {
|
|
52
|
+
const data = await getData();
|
|
53
|
+
const takaro = await getTakaro(data);
|
|
54
|
+
const { arguments: args } = data;
|
|
55
|
+
|
|
56
|
+
// Get the target player info
|
|
57
|
+
// targetPlayer is a PlayerOnGameserver object from the command argument resolution
|
|
58
|
+
const targetPlayer = args.targetPlayer;
|
|
59
|
+
|
|
60
|
+
// Search for all PlayerOnGameserver records for this player
|
|
61
|
+
const pogsSearch = await takaro.playerOnGameserver.playerOnGameServerControllerSearch({
|
|
62
|
+
filters: {
|
|
63
|
+
playerId: [targetPlayer.playerId]
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
const serverCount = pogsSearch.data.data.length;
|
|
68
|
+
const serverNames = [];
|
|
69
|
+
|
|
70
|
+
// Get server names for each POG
|
|
71
|
+
for (const pog of pogsSearch.data.data) {
|
|
72
|
+
const serverRes = await takaro.gameserver.gameServerControllerGetOne(pog.gameServerId);
|
|
73
|
+
if (serverRes.data.data) {
|
|
74
|
+
serverNames.push(serverRes.data.data.name);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
await data.player.pm(\`Player \${targetPlayer.name} (Steam ID: \${targetPlayer.steamId}) exists on \${serverCount} server(s): \${serverNames.join(', ')}\`);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
await main();`,
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
// Install module on both servers
|
|
85
|
+
await this.client.module.moduleInstallationsControllerInstallModule({
|
|
86
|
+
gameServerId: setupRes.gameserver.id,
|
|
87
|
+
versionId: moduleRes.data.data.latestVersion.id,
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
await this.client.module.moduleInstallationsControllerInstallModule({
|
|
91
|
+
gameServerId: server2.id,
|
|
92
|
+
versionId: moduleRes.data.data.latestVersion.id,
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
// Define a shared Steam ID
|
|
96
|
+
const sharedSteamId = '76561198000000001';
|
|
97
|
+
|
|
98
|
+
// Create a player with the same Steam ID on both servers
|
|
99
|
+
await this.client.gameserver.gameServerControllerExecuteCommand(setupRes.gameserver.id, {
|
|
100
|
+
command: `createPlayer player1 {"name": "SharedPlayer", "steamId": "${sharedSteamId}", "online": true}`,
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
await this.client.gameserver.gameServerControllerExecuteCommand(server2.id, {
|
|
104
|
+
command: `createPlayer player2 {"name": "SharedPlayer", "steamId": "${sharedSteamId}", "online": true}`,
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
// Wait for players to be created and synced
|
|
108
|
+
await new Promise((resolve) => setTimeout(resolve, 2000));
|
|
109
|
+
|
|
110
|
+
// Get the PlayerOnGameserver for SharedPlayer on server2 to use as command executor
|
|
111
|
+
const server2Players = await this.client.playerOnGameserver.playerOnGameServerControllerSearch({
|
|
112
|
+
filters: {
|
|
113
|
+
gameServerId: [server2.id],
|
|
114
|
+
gameId: ['player2'],
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
const sharedPlayerOnServer2 = server2Players.data.data[0];
|
|
119
|
+
|
|
120
|
+
return {
|
|
121
|
+
...setupRes,
|
|
122
|
+
server2,
|
|
123
|
+
sharedSteamId,
|
|
124
|
+
sharedPlayerOnServer2,
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
const tests = [
|
|
129
|
+
new IntegrationTest<CrossServerSetupData>({
|
|
130
|
+
name: 'Can target a player that exists on multiple servers using Steam ID',
|
|
131
|
+
group,
|
|
132
|
+
snapshot: false,
|
|
133
|
+
setup: crossServerPlayerSetup,
|
|
134
|
+
test: async function () {
|
|
135
|
+
const events = (await new EventsAwaiter().connect(this.client)).waitForEvents(GameEvents.CHAT_MESSAGE, 1);
|
|
136
|
+
|
|
137
|
+
// Trigger command on server1 targeting the shared player by Steam ID
|
|
138
|
+
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
139
|
+
msg: `/playerinfo ${this.setupData.sharedSteamId}`,
|
|
140
|
+
playerId: this.setupData.players[0].id,
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
const chatEvents = await events;
|
|
144
|
+
expect(chatEvents.length).to.be.eq(1);
|
|
145
|
+
expect(chatEvents[0].data.meta.msg).to.include('exists on 2 server(s)');
|
|
146
|
+
expect(chatEvents[0].data.meta.msg).to.include(this.setupData.gameserver.name);
|
|
147
|
+
expect(chatEvents[0].data.meta.msg).to.include(this.setupData.server2.name);
|
|
148
|
+
},
|
|
149
|
+
}),
|
|
150
|
+
|
|
151
|
+
new IntegrationTest<CrossServerSetupData>({
|
|
152
|
+
name: 'Can target a player by name when they exist on multiple servers',
|
|
153
|
+
group,
|
|
154
|
+
snapshot: false,
|
|
155
|
+
setup: crossServerPlayerSetup,
|
|
156
|
+
test: async function () {
|
|
157
|
+
const events = (await new EventsAwaiter().connect(this.client)).waitForEvents(GameEvents.CHAT_MESSAGE, 1);
|
|
158
|
+
|
|
159
|
+
// Trigger command on server2 targeting the shared player by name
|
|
160
|
+
await this.client.command.commandControllerTrigger(this.setupData.server2.id, {
|
|
161
|
+
msg: '/playerinfo SharedPlayer',
|
|
162
|
+
playerId: this.setupData.sharedPlayerOnServer2.playerId,
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
const chatEvents = await events;
|
|
166
|
+
expect(chatEvents.length).to.be.eq(1);
|
|
167
|
+
expect(chatEvents[0].data.meta.msg).to.include('exists on 2 server(s)');
|
|
168
|
+
},
|
|
169
|
+
}),
|
|
170
|
+
];
|
|
171
|
+
|
|
172
|
+
describe(group, function () {
|
|
173
|
+
tests.forEach((test) => {
|
|
174
|
+
test.run();
|
|
175
|
+
});
|
|
176
|
+
});
|