@takaro/modules 0.0.14 → 0.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (244) hide show
  1. package/dist/BuiltinModule.d.ts +13 -8
  2. package/dist/BuiltinModule.d.ts.map +1 -0
  3. package/dist/BuiltinModule.js +48 -31
  4. package/dist/BuiltinModule.js.map +1 -1
  5. package/dist/dto/base.d.ts +1 -0
  6. package/dist/dto/base.d.ts.map +1 -0
  7. package/dist/dto/discordEvents.d.ts +1 -0
  8. package/dist/dto/discordEvents.d.ts.map +1 -0
  9. package/dist/dto/gameEvents.d.ts +1 -0
  10. package/dist/dto/gameEvents.d.ts.map +1 -0
  11. package/dist/dto/index.d.ts +4 -0
  12. package/dist/dto/index.d.ts.map +1 -0
  13. package/dist/dto/takaroEvents.d.ts +16 -0
  14. package/dist/dto/takaroEvents.d.ts.map +1 -0
  15. package/dist/dto/takaroEvents.js +36 -0
  16. package/dist/dto/takaroEvents.js.map +1 -1
  17. package/dist/main.d.ts +4 -3
  18. package/dist/main.d.ts.map +1 -0
  19. package/dist/main.js +3 -1
  20. package/dist/main.js.map +1 -1
  21. package/dist/modules/chatBridge/hooks/DiscordToGame.d.ts +1 -0
  22. package/dist/modules/chatBridge/hooks/DiscordToGame.d.ts.map +1 -0
  23. package/dist/modules/chatBridge/hooks/GameToDiscord.d.ts +1 -0
  24. package/dist/modules/chatBridge/hooks/GameToDiscord.d.ts.map +1 -0
  25. package/dist/modules/chatBridge/hooks/PlayerConnected.d.ts +1 -0
  26. package/dist/modules/chatBridge/hooks/PlayerConnected.d.ts.map +1 -0
  27. package/dist/modules/chatBridge/hooks/PlayerDisconnected.d.ts +1 -0
  28. package/dist/modules/chatBridge/hooks/PlayerDisconnected.d.ts.map +1 -0
  29. package/dist/modules/chatBridge/index.d.ts +3 -2
  30. package/dist/modules/chatBridge/index.d.ts.map +1 -0
  31. package/dist/modules/chatBridge/index.js +55 -47
  32. package/dist/modules/chatBridge/index.js.map +1 -1
  33. package/dist/modules/dailyRewards/commands/daily.d.ts +2 -0
  34. package/dist/modules/dailyRewards/commands/daily.d.ts.map +1 -0
  35. package/dist/modules/dailyRewards/commands/daily.js +106 -0
  36. package/dist/modules/dailyRewards/commands/daily.js.map +1 -0
  37. package/dist/modules/dailyRewards/commands/streak.d.ts +2 -0
  38. package/dist/modules/dailyRewards/commands/streak.d.ts.map +1 -0
  39. package/dist/modules/dailyRewards/commands/streak.js +34 -0
  40. package/dist/modules/dailyRewards/commands/streak.js.map +1 -0
  41. package/dist/modules/dailyRewards/commands/topstreak.d.ts +2 -0
  42. package/dist/modules/dailyRewards/commands/topstreak.d.ts.map +1 -0
  43. package/dist/modules/dailyRewards/commands/topstreak.js +44 -0
  44. package/dist/modules/dailyRewards/commands/topstreak.js.map +1 -0
  45. package/dist/modules/dailyRewards/functions/utils.d.ts +6 -0
  46. package/dist/modules/dailyRewards/functions/utils.d.ts.map +1 -0
  47. package/dist/modules/dailyRewards/functions/utils.js +32 -0
  48. package/dist/modules/dailyRewards/functions/utils.js.map +1 -0
  49. package/dist/modules/dailyRewards/hooks/dailyLoginCheck.d.ts +2 -0
  50. package/dist/modules/dailyRewards/hooks/dailyLoginCheck.d.ts.map +1 -0
  51. package/dist/modules/dailyRewards/hooks/dailyLoginCheck.js +19 -0
  52. package/dist/modules/dailyRewards/hooks/dailyLoginCheck.js.map +1 -0
  53. package/dist/modules/dailyRewards/index.d.ts +5 -0
  54. package/dist/modules/dailyRewards/index.d.ts.map +1 -0
  55. package/dist/modules/dailyRewards/index.js +125 -0
  56. package/dist/modules/dailyRewards/index.js.map +1 -0
  57. package/dist/modules/economyUtils/commands/balance.d.ts +1 -0
  58. package/dist/modules/economyUtils/commands/balance.d.ts.map +1 -0
  59. package/dist/modules/economyUtils/commands/claim.d.ts +1 -0
  60. package/dist/modules/economyUtils/commands/claim.d.ts.map +1 -0
  61. package/dist/modules/economyUtils/commands/confirmTransfer.d.ts +1 -0
  62. package/dist/modules/economyUtils/commands/confirmTransfer.d.ts.map +1 -0
  63. package/dist/modules/economyUtils/commands/grantCurrency.d.ts +1 -0
  64. package/dist/modules/economyUtils/commands/grantCurrency.d.ts.map +1 -0
  65. package/dist/modules/economyUtils/commands/revokeCurrency.d.ts +1 -0
  66. package/dist/modules/economyUtils/commands/revokeCurrency.d.ts.map +1 -0
  67. package/dist/modules/economyUtils/commands/shop.d.ts +1 -0
  68. package/dist/modules/economyUtils/commands/shop.d.ts.map +1 -0
  69. package/dist/modules/economyUtils/commands/topCurrency.d.ts +1 -0
  70. package/dist/modules/economyUtils/commands/topCurrency.d.ts.map +1 -0
  71. package/dist/modules/economyUtils/commands/transfer.d.ts +1 -0
  72. package/dist/modules/economyUtils/commands/transfer.d.ts.map +1 -0
  73. package/dist/modules/economyUtils/cronJobs/zombieKillReward.d.ts +1 -0
  74. package/dist/modules/economyUtils/cronJobs/zombieKillReward.d.ts.map +1 -0
  75. package/dist/modules/economyUtils/index.d.ts +3 -2
  76. package/dist/modules/economyUtils/index.d.ts.map +1 -0
  77. package/dist/modules/economyUtils/index.js +178 -170
  78. package/dist/modules/economyUtils/index.js.map +1 -1
  79. package/dist/modules/geoBlock/hooks/IPDetected.d.ts +1 -0
  80. package/dist/modules/geoBlock/hooks/IPDetected.d.ts.map +1 -0
  81. package/dist/modules/geoBlock/hooks/IPDetected.js +4 -2
  82. package/dist/modules/geoBlock/hooks/IPDetected.js.map +1 -1
  83. package/dist/modules/geoBlock/index.d.ts +3 -2
  84. package/dist/modules/geoBlock/index.d.ts.map +1 -0
  85. package/dist/modules/geoBlock/index.js +71 -63
  86. package/dist/modules/geoBlock/index.js.map +1 -1
  87. package/dist/modules/gimme/commands/gimme.d.ts +1 -0
  88. package/dist/modules/gimme/commands/gimme.d.ts.map +1 -0
  89. package/dist/modules/gimme/commands/gimme.js +17 -6
  90. package/dist/modules/gimme/commands/gimme.js.map +1 -1
  91. package/dist/modules/gimme/index.d.ts +3 -2
  92. package/dist/modules/gimme/index.d.ts.map +1 -0
  93. package/dist/modules/gimme/index.js +64 -34
  94. package/dist/modules/gimme/index.js.map +1 -1
  95. package/dist/modules/highPingKicker/cronJobs/Ping check.d.ts +1 -0
  96. package/dist/modules/highPingKicker/cronJobs/Ping check.d.ts.map +1 -0
  97. package/dist/modules/highPingKicker/index.d.ts +3 -2
  98. package/dist/modules/highPingKicker/index.d.ts.map +1 -0
  99. package/dist/modules/highPingKicker/index.js +36 -28
  100. package/dist/modules/highPingKicker/index.js.map +1 -1
  101. package/dist/modules/lottery/commands/buyTicket.d.ts +1 -0
  102. package/dist/modules/lottery/commands/buyTicket.d.ts.map +1 -0
  103. package/dist/modules/lottery/commands/nextDraw.d.ts +1 -0
  104. package/dist/modules/lottery/commands/nextDraw.d.ts.map +1 -0
  105. package/dist/modules/lottery/commands/viewTickets.d.ts +1 -0
  106. package/dist/modules/lottery/commands/viewTickets.d.ts.map +1 -0
  107. package/dist/modules/lottery/cronJobs/drawLottery.d.ts +1 -0
  108. package/dist/modules/lottery/cronJobs/drawLottery.d.ts.map +1 -0
  109. package/dist/modules/lottery/index.d.ts +3 -2
  110. package/dist/modules/lottery/index.d.ts.map +1 -0
  111. package/dist/modules/lottery/index.js +73 -65
  112. package/dist/modules/lottery/index.js.map +1 -1
  113. package/dist/modules/playerOnboarding/commands/starterkit.d.ts +1 -0
  114. package/dist/modules/playerOnboarding/commands/starterkit.d.ts.map +1 -0
  115. package/dist/modules/playerOnboarding/commands/starterkit.js +16 -3
  116. package/dist/modules/playerOnboarding/commands/starterkit.js.map +1 -1
  117. package/dist/modules/playerOnboarding/hooks/playerConnected.d.ts +1 -0
  118. package/dist/modules/playerOnboarding/hooks/playerConnected.d.ts.map +1 -0
  119. package/dist/modules/playerOnboarding/index.d.ts +3 -2
  120. package/dist/modules/playerOnboarding/index.d.ts.map +1 -0
  121. package/dist/modules/playerOnboarding/index.js +73 -43
  122. package/dist/modules/playerOnboarding/index.js.map +1 -1
  123. package/dist/modules/serverMessages/cronJobs/Automated message.d.ts +1 -0
  124. package/dist/modules/serverMessages/cronJobs/Automated message.d.ts.map +1 -0
  125. package/dist/modules/serverMessages/index.d.ts +3 -2
  126. package/dist/modules/serverMessages/index.d.ts.map +1 -0
  127. package/dist/modules/serverMessages/index.js +36 -28
  128. package/dist/modules/serverMessages/index.js.map +1 -1
  129. package/dist/modules/teleports/commands/deletetp.d.ts +1 -0
  130. package/dist/modules/teleports/commands/deletetp.d.ts.map +1 -0
  131. package/dist/modules/teleports/commands/deletewaypoint.d.ts +1 -0
  132. package/dist/modules/teleports/commands/deletewaypoint.d.ts.map +1 -0
  133. package/dist/modules/teleports/commands/deletewaypoint.js +4 -35
  134. package/dist/modules/teleports/commands/deletewaypoint.js.map +1 -1
  135. package/dist/modules/teleports/commands/listwaypoints.d.ts +1 -0
  136. package/dist/modules/teleports/commands/listwaypoints.d.ts.map +1 -0
  137. package/dist/modules/teleports/commands/listwaypoints.js +3 -22
  138. package/dist/modules/teleports/commands/listwaypoints.js.map +1 -1
  139. package/dist/modules/teleports/commands/setprivate.d.ts +1 -0
  140. package/dist/modules/teleports/commands/setprivate.d.ts.map +1 -0
  141. package/dist/modules/teleports/commands/setpublic.d.ts +1 -0
  142. package/dist/modules/teleports/commands/setpublic.d.ts.map +1 -0
  143. package/dist/modules/teleports/commands/settp.d.ts +1 -0
  144. package/dist/modules/teleports/commands/settp.d.ts.map +1 -0
  145. package/dist/modules/teleports/commands/setwaypoint.d.ts +1 -0
  146. package/dist/modules/teleports/commands/setwaypoint.d.ts.map +1 -0
  147. package/dist/modules/teleports/commands/setwaypoint.js +5 -63
  148. package/dist/modules/teleports/commands/setwaypoint.js.map +1 -1
  149. package/dist/modules/teleports/commands/teleport.d.ts +1 -0
  150. package/dist/modules/teleports/commands/teleport.d.ts.map +1 -0
  151. package/dist/modules/teleports/commands/teleportwaypoint.d.ts +1 -0
  152. package/dist/modules/teleports/commands/teleportwaypoint.d.ts.map +1 -0
  153. package/dist/modules/teleports/commands/teleportwaypoint.js +7 -23
  154. package/dist/modules/teleports/commands/teleportwaypoint.js.map +1 -1
  155. package/dist/modules/teleports/commands/tplist.d.ts +1 -0
  156. package/dist/modules/teleports/commands/tplist.d.ts.map +1 -0
  157. package/dist/modules/teleports/cronJobs/Waypoint reconciler.d.ts +2 -0
  158. package/dist/modules/teleports/cronJobs/Waypoint reconciler.d.ts.map +1 -0
  159. package/dist/modules/teleports/cronJobs/Waypoint reconciler.js +6 -0
  160. package/dist/modules/teleports/cronJobs/Waypoint reconciler.js.map +1 -0
  161. package/dist/modules/teleports/functions/utils.d.ts +12 -0
  162. package/dist/modules/teleports/functions/utils.d.ts.map +1 -0
  163. package/dist/modules/teleports/functions/utils.js +117 -0
  164. package/dist/modules/teleports/functions/utils.js.map +1 -1
  165. package/dist/modules/teleports/index.d.ts +3 -2
  166. package/dist/modules/teleports/index.d.ts.map +1 -0
  167. package/dist/modules/teleports/index.js +188 -172
  168. package/dist/modules/teleports/index.js.map +1 -1
  169. package/dist/modules/timedShutdown/cronJobs/Shutdown.d.ts +1 -0
  170. package/dist/modules/timedShutdown/cronJobs/Shutdown.d.ts.map +1 -0
  171. package/dist/modules/timedShutdown/cronJobs/warning.d.ts +1 -0
  172. package/dist/modules/timedShutdown/cronJobs/warning.d.ts.map +1 -0
  173. package/dist/modules/timedShutdown/index.d.ts +3 -2
  174. package/dist/modules/timedShutdown/index.d.ts.map +1 -0
  175. package/dist/modules/timedShutdown/index.js +35 -27
  176. package/dist/modules/timedShutdown/index.js.map +1 -1
  177. package/dist/modules/utils/commands/help.d.ts +1 -0
  178. package/dist/modules/utils/commands/help.d.ts.map +1 -0
  179. package/dist/modules/utils/commands/help.js +10 -9
  180. package/dist/modules/utils/commands/help.js.map +1 -1
  181. package/dist/modules/utils/commands/ping.d.ts +1 -0
  182. package/dist/modules/utils/commands/ping.d.ts.map +1 -0
  183. package/dist/modules/utils/index.d.ts +3 -2
  184. package/dist/modules/utils/index.d.ts.map +1 -0
  185. package/dist/modules/utils/index.js +36 -28
  186. package/dist/modules/utils/index.js.map +1 -1
  187. package/dist/modules.json +601 -506
  188. package/package.json +2 -5
  189. package/scripts/buildBuiltinJson.ts +50 -2
  190. package/src/BuiltinModule.ts +25 -17
  191. package/src/__tests__/aliases.integration.test.ts +23 -26
  192. package/src/__tests__/bugRepros.integration.test.ts +261 -10
  193. package/src/__tests__/builtinmodule.unit.test.ts +3 -1
  194. package/src/__tests__/commandArgs.integration.test.ts +13 -6
  195. package/src/__tests__/economy/claim.integration.test.ts +1 -0
  196. package/src/__tests__/economy/economyUtils.integration.test.ts +43 -46
  197. package/src/__tests__/economy/shop.integration.test.ts +28 -4
  198. package/src/__tests__/economy/zombieKillReward.integration.test.ts +28 -31
  199. package/src/__tests__/geoblock.integration.test.ts +76 -91
  200. package/src/__tests__/gimme.integration.test.ts +25 -22
  201. package/src/__tests__/help.integration.test.ts +21 -20
  202. package/src/__tests__/lottery.integration.test.ts +15 -11
  203. package/src/__tests__/modulePermission.integration.test.ts +17 -13
  204. package/src/__tests__/onboarding.integration.test.ts +43 -43
  205. package/src/__tests__/ping.integration.test.ts +5 -4
  206. package/src/__tests__/roleExpiry.integration.test.ts +5 -4
  207. package/src/__tests__/serverMessages.integration.test.ts +24 -27
  208. package/src/__tests__/systemConfigCooldown.integration.test.ts +5 -1
  209. package/src/__tests__/systemConfigCost.integration.test.ts +16 -17
  210. package/src/__tests__/teleports/listtp.integration.test.ts +20 -21
  211. package/src/__tests__/teleports/publicteleports.integration.test.ts +58 -70
  212. package/src/__tests__/teleports/teleport.integration.test.ts +16 -17
  213. package/src/__tests__/teleports/tpManagement.integration.test.ts +21 -20
  214. package/src/__tests__/teleports/waypoints.integration.test.ts +52 -6
  215. package/src/dto/takaroEvents.ts +21 -0
  216. package/src/main.ts +14 -4
  217. package/src/modules/chatBridge/index.ts +54 -51
  218. package/src/modules/dailyRewards/commands/daily.js +118 -0
  219. package/src/modules/dailyRewards/commands/streak.js +42 -0
  220. package/src/modules/dailyRewards/commands/topstreak.js +54 -0
  221. package/src/modules/dailyRewards/functions/utils.js +36 -0
  222. package/src/modules/dailyRewards/hooks/dailyLoginCheck.js +24 -0
  223. package/src/modules/dailyRewards/index.ts +136 -0
  224. package/src/modules/economyUtils/index.ts +182 -179
  225. package/src/modules/geoBlock/hooks/IPDetected.js +4 -2
  226. package/src/modules/geoBlock/index.ts +72 -70
  227. package/src/modules/gimme/commands/gimme.js +16 -6
  228. package/src/modules/gimme/index.ts +62 -37
  229. package/src/modules/highPingKicker/index.ts +35 -32
  230. package/src/modules/lottery/index.ts +73 -71
  231. package/src/modules/playerOnboarding/commands/starterkit.js +19 -5
  232. package/src/modules/playerOnboarding/index.ts +72 -47
  233. package/src/modules/serverMessages/index.ts +36 -32
  234. package/src/modules/teleports/commands/deletewaypoint.js +4 -53
  235. package/src/modules/teleports/commands/listwaypoints.js +3 -35
  236. package/src/modules/teleports/commands/setwaypoint.js +5 -83
  237. package/src/modules/teleports/commands/teleportwaypoint.js +9 -36
  238. package/src/modules/teleports/cronJobs/Waypoint reconciler.js +7 -0
  239. package/src/modules/teleports/functions/utils.js +150 -0
  240. package/src/modules/teleports/index.ts +196 -180
  241. package/src/modules/timedShutdown/index.ts +35 -30
  242. package/src/modules/utils/commands/help.js +14 -14
  243. package/src/modules/utils/index.ts +36 -32
  244. package/tsconfig.json +1 -1
@@ -1,177 +1,185 @@
1
- import { BuiltinModule, ICommand, ICronJob, IPermission } from '../../BuiltinModule.js';
2
- export class EconomyUtils extends BuiltinModule {
1
+ import { ModuleTransferDTO, ICommand, ICronJob, IPermission, ModuleTransferVersionDTO } from '../../BuiltinModule.js';
2
+ export class EconomyUtils extends ModuleTransferDTO {
3
3
  constructor() {
4
- super('economyUtils', 'A set of commands to allow players to manage their currency.', JSON.stringify({
5
- $schema: 'http://json-schema.org/draft-07/schema#',
6
- type: 'object',
7
- properties: {
8
- pendingAmount: {
9
- title: 'Pending amount',
10
- type: 'number',
11
- description: 'When a player transfers money, they must confirm the transfer when the amount is equal or above this value. Set to 0 to disable.',
12
- default: 0,
13
- },
14
- zombieKillReward: {
15
- title: 'Zombie kill reward',
16
- type: 'number',
17
- description: 'The default amount of currency a player receives for killing a zombie. This can be overridden by roles.',
18
- default: 1,
19
- },
20
- },
21
- required: [],
22
- additionalProperties: false,
23
- }));
24
- this.permissions = [
25
- new IPermission({
26
- permission: 'ECONOMY_UTILS_MANAGE_CURRENCY',
27
- friendlyName: 'Manage currency',
28
- description: 'Allows players to manage currency of other players. This includes granting and revoking currency.',
29
- canHaveCount: false,
30
- }),
31
- new IPermission({
32
- permission: 'ZOMBIE_KILL_REWARD_OVERRIDE',
33
- friendlyName: 'Zombie kill reward override',
34
- description: 'Allows a role to override the amount of currency a player receives for killing a entity.',
35
- canHaveCount: true,
36
- }),
37
- ];
38
- this.cronJobs = [
39
- new ICronJob({
40
- function: this.loadFn('cronJobs', 'zombieKillReward'),
41
- name: 'zombieKillReward',
42
- temporalValue: '*/5 * * * *',
43
- }),
44
- ];
45
- this.commands = [
46
- new ICommand({
47
- function: this.loadFn('commands', 'balance'),
48
- name: 'balance',
49
- trigger: 'balance',
50
- helpText: 'Check your balance.',
51
- arguments: [],
52
- }),
53
- new ICommand({
54
- function: this.loadFn('commands', 'topCurrency'),
55
- name: 'topCurrency',
56
- trigger: 'topcurrency',
57
- helpText: 'List of the 10 players with the highest balance.',
58
- arguments: [],
59
- }),
60
- new ICommand({
61
- function: this.loadFn('commands', 'grantCurrency'),
62
- name: 'grantCurrency',
63
- trigger: 'grantcurrency',
64
- helpText: 'Grant money to a player. The money is not taken from your own balance but is new currency.',
65
- arguments: [
66
- {
67
- name: 'receiver',
68
- type: 'player',
69
- helpText: 'The player to grant currency to.',
70
- position: 0,
71
- defaultValue: null,
72
- },
73
- {
74
- name: 'amount',
75
- type: 'number',
76
- helpText: 'The amount of money.',
77
- position: 1,
78
- defaultValue: null,
4
+ super();
5
+ this.name = 'economyUtils';
6
+ this.versions = [
7
+ new ModuleTransferVersionDTO({
8
+ tag: '0.0.1',
9
+ description: 'A set of commands to allow players to manage their currency.',
10
+ configSchema: JSON.stringify({
11
+ $schema: 'http://json-schema.org/draft-07/schema#',
12
+ type: 'object',
13
+ properties: {
14
+ pendingAmount: {
15
+ title: 'Pending amount',
16
+ type: 'number',
17
+ description: 'When a player transfers money, they must confirm the transfer when the amount is equal or above this value. Set to 0 to disable.',
18
+ default: 0,
19
+ },
20
+ zombieKillReward: {
21
+ title: 'Zombie kill reward',
22
+ type: 'number',
23
+ description: 'The default amount of currency a player receives for killing a zombie. This can be overridden by roles.',
24
+ default: 1,
25
+ },
79
26
  },
27
+ required: [],
28
+ additionalProperties: false,
29
+ }),
30
+ permissions: [
31
+ new IPermission({
32
+ permission: 'ECONOMY_UTILS_MANAGE_CURRENCY',
33
+ friendlyName: 'Manage currency',
34
+ description: 'Allows players to manage currency of other players. This includes granting and revoking currency.',
35
+ canHaveCount: false,
36
+ }),
37
+ new IPermission({
38
+ permission: 'ZOMBIE_KILL_REWARD_OVERRIDE',
39
+ friendlyName: 'Zombie kill reward override',
40
+ description: 'Allows a role to override the amount of currency a player receives for killing a entity.',
41
+ canHaveCount: true,
42
+ }),
80
43
  ],
81
- }),
82
- new ICommand({
83
- function: this.loadFn('commands', 'revokeCurrency'),
84
- name: 'revokeCurrency',
85
- trigger: 'revokecurrency',
86
- helpText: 'Revokes money from a player. The money disappears.',
87
- arguments: [
88
- {
89
- name: 'receiver',
90
- type: 'player',
91
- helpText: 'The player to revoke currency from.',
92
- position: 0,
93
- defaultValue: null,
94
- },
95
- {
96
- name: 'amount',
97
- type: 'number',
98
- helpText: 'The amount of money.',
99
- position: 1,
100
- defaultValue: null,
101
- },
44
+ cronJobs: [
45
+ new ICronJob({
46
+ function: this.loadFn('cronJobs', 'zombieKillReward'),
47
+ name: 'zombieKillReward',
48
+ temporalValue: '*/5 * * * *',
49
+ }),
102
50
  ],
103
- }),
104
- new ICommand({
105
- function: this.loadFn('commands', 'confirmTransfer'),
106
- name: 'confirmTransfer',
107
- trigger: 'confirmtransfer',
108
- helpText: 'Confirms a pending transfer.',
109
- arguments: [],
110
- }),
111
- new ICommand({
112
- function: this.loadFn('commands', 'transfer'),
113
- name: 'transfer',
114
- trigger: 'transfer',
115
- helpText: 'Transfer money to another player.',
116
- arguments: [
117
- {
118
- name: 'receiver',
119
- type: 'player',
120
- helpText: 'The player to transfer money to.',
121
- position: 0,
122
- defaultValue: null,
123
- },
124
- {
125
- name: 'amount',
126
- type: 'number',
127
- helpText: 'The amount of money to transfer.',
128
- position: 1,
129
- defaultValue: null,
130
- },
131
- ],
132
- }),
133
- new ICommand({
134
- function: this.loadFn('commands', 'claim'),
135
- name: 'claim',
136
- trigger: 'claim',
137
- helpText: 'Claim your pending shop orders.',
138
- arguments: [
139
- {
140
- name: 'all',
141
- type: 'boolean',
142
- helpText: 'If true, claim ALL pending orders. If false, claim only the first one.',
143
- position: 0,
144
- defaultValue: 'false',
145
- },
146
- ],
147
- }),
148
- new ICommand({
149
- function: this.loadFn('commands', 'shop'),
150
- name: 'shop',
151
- trigger: 'shop',
152
- helpText: 'Browse the shop and view available items.',
153
- arguments: [
154
- {
155
- name: 'page',
156
- type: 'number',
157
- helpText: 'Display more items from the shop by specifying a page number.',
158
- position: 0,
159
- defaultValue: '1',
160
- },
161
- {
162
- name: 'item',
163
- type: 'number',
164
- helpText: 'Select a specific item to view more details.',
165
- position: 1,
166
- defaultValue: '0',
167
- },
168
- {
169
- name: 'action',
170
- type: 'string',
171
- helpText: 'Perform an action on the selected item. Currently only "buy" is supported.',
172
- position: 2,
173
- defaultValue: 'none',
174
- },
51
+ commands: [
52
+ new ICommand({
53
+ function: this.loadFn('commands', 'balance'),
54
+ name: 'balance',
55
+ trigger: 'balance',
56
+ helpText: 'Check your balance.',
57
+ arguments: [],
58
+ }),
59
+ new ICommand({
60
+ function: this.loadFn('commands', 'topCurrency'),
61
+ name: 'topCurrency',
62
+ trigger: 'topcurrency',
63
+ helpText: 'List of the 10 players with the highest balance.',
64
+ arguments: [],
65
+ }),
66
+ new ICommand({
67
+ function: this.loadFn('commands', 'grantCurrency'),
68
+ name: 'grantCurrency',
69
+ trigger: 'grantcurrency',
70
+ helpText: 'Grant money to a player. The money is not taken from your own balance but is new currency.',
71
+ arguments: [
72
+ {
73
+ name: 'receiver',
74
+ type: 'player',
75
+ helpText: 'The player to grant currency to.',
76
+ position: 0,
77
+ defaultValue: null,
78
+ },
79
+ {
80
+ name: 'amount',
81
+ type: 'number',
82
+ helpText: 'The amount of money.',
83
+ position: 1,
84
+ defaultValue: null,
85
+ },
86
+ ],
87
+ }),
88
+ new ICommand({
89
+ function: this.loadFn('commands', 'revokeCurrency'),
90
+ name: 'revokeCurrency',
91
+ trigger: 'revokecurrency',
92
+ helpText: 'Revokes money from a player. The money disappears.',
93
+ arguments: [
94
+ {
95
+ name: 'receiver',
96
+ type: 'player',
97
+ helpText: 'The player to revoke currency from.',
98
+ position: 0,
99
+ defaultValue: null,
100
+ },
101
+ {
102
+ name: 'amount',
103
+ type: 'number',
104
+ helpText: 'The amount of money.',
105
+ position: 1,
106
+ defaultValue: null,
107
+ },
108
+ ],
109
+ }),
110
+ new ICommand({
111
+ function: this.loadFn('commands', 'confirmTransfer'),
112
+ name: 'confirmTransfer',
113
+ trigger: 'confirmtransfer',
114
+ helpText: 'Confirms a pending transfer.',
115
+ arguments: [],
116
+ }),
117
+ new ICommand({
118
+ function: this.loadFn('commands', 'transfer'),
119
+ name: 'transfer',
120
+ trigger: 'transfer',
121
+ helpText: 'Transfer money to another player.',
122
+ arguments: [
123
+ {
124
+ name: 'receiver',
125
+ type: 'player',
126
+ helpText: 'The player to transfer money to.',
127
+ position: 0,
128
+ defaultValue: null,
129
+ },
130
+ {
131
+ name: 'amount',
132
+ type: 'number',
133
+ helpText: 'The amount of money to transfer.',
134
+ position: 1,
135
+ defaultValue: null,
136
+ },
137
+ ],
138
+ }),
139
+ new ICommand({
140
+ function: this.loadFn('commands', 'claim'),
141
+ name: 'claim',
142
+ trigger: 'claim',
143
+ helpText: 'Claim your pending shop orders.',
144
+ arguments: [
145
+ {
146
+ name: 'all',
147
+ type: 'boolean',
148
+ helpText: 'If true, claim ALL pending orders. If false, claim only the first one.',
149
+ position: 0,
150
+ defaultValue: 'false',
151
+ },
152
+ ],
153
+ }),
154
+ new ICommand({
155
+ function: this.loadFn('commands', 'shop'),
156
+ name: 'shop',
157
+ trigger: 'shop',
158
+ helpText: 'Browse the shop and view available items.',
159
+ arguments: [
160
+ {
161
+ name: 'page',
162
+ type: 'number',
163
+ helpText: 'Display more items from the shop by specifying a page number.',
164
+ position: 0,
165
+ defaultValue: '1',
166
+ },
167
+ {
168
+ name: 'item',
169
+ type: 'number',
170
+ helpText: 'Select a specific item to view more details.',
171
+ position: 1,
172
+ defaultValue: '0',
173
+ },
174
+ {
175
+ name: 'action',
176
+ type: 'string',
177
+ helpText: 'Perform an action on the selected item. Currently only "buy" is supported.',
178
+ position: 2,
179
+ defaultValue: 'none',
180
+ },
181
+ ],
182
+ }),
175
183
  ],
176
184
  }),
177
185
  ];
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/economyUtils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAExF,MAAM,OAAO,YAAa,SAAQ,aAA2B;IAC3D;QACE,KAAK,CACH,cAAc,EACd,8DAA8D,EAC9D,IAAI,CAAC,SAAS,CAAC;YACb,OAAO,EAAE,yCAAyC;YAClD,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,aAAa,EAAE;oBACb,KAAK,EAAE,gBAAgB;oBACvB,IAAI,EAAE,QAAQ;oBACd,WAAW,EACT,kIAAkI;oBACpI,OAAO,EAAE,CAAC;iBACX;gBACD,gBAAgB,EAAE;oBAChB,KAAK,EAAE,oBAAoB;oBAC3B,IAAI,EAAE,QAAQ;oBACd,WAAW,EACT,yGAAyG;oBAC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OAAO,CAAC;wBAC1C,IAAI,EAAE,OAAO;wBACb,OAAO,EAAE,OAAO;wBAChB,QAAQ,EAAE,iCAAiC;wBAC3C,SAAS,EAAE;4BACT;gCACE,IAAI,EAAE,KAAK;gCACX,IAAI,EAAE,SAAS;gCACf,QAAQ,EAAE,wEAAwE;gCAClF,QAAQ,EAAE,CAAC;gCACX,YAAY,EAAE,OAAO;6BACtB;yBACF;qBACF,CAAC;oBACF,IAAI,QAAQ,CAAC;wBACX,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC;wBACzC,IAAI,EAAE,MAAM;wBACZ,OAAO,EAAE,MAAM;wBACf,QAAQ,EAAE,2CAA2C;wBACrD,SAAS,EAAE;4BACT;gCACE,IAAI,EAAE,MAAM;gCACZ,IAAI,EAAE,QAAQ;gCACd,QAAQ,EAAE,+DAA+D;gCACzE,QAAQ,EAAE,CAAC;gCACX,YAAY,EAAE,GAAG;6BAClB;4BACD;gCACE,IAAI,EAAE,MAAM;gCACZ,IAAI,EAAE,QAAQ;gCACd,QAAQ,EAAE,8CAA8C;gCACxD,QAAQ,EAAE,CAAC;gCACX,YAAY,EAAE,GAAG;6BAClB;4BACD;gCACE,IAAI,EAAE,QAAQ;gCACd,IAAI,EAAE,QAAQ;gCACd,QAAQ,EAAE,4EAA4E;gCACtF,QAAQ,EAAE,CAAC;gCACX,YAAY,EAAE,MAAM;6BACrB;yBACF;qBACF,CAAC;iBACH;aACF,CAAC;SACH,CAAC;IACJ,CAAC;CACF"}
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=IPDetected.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IPDetected.d.ts","sourceRoot":"","sources":["../../../../src/modules/geoBlock/hooks/IPDetected.js"],"names":[],"mappings":""}
@@ -7,9 +7,11 @@ async function main() {
7
7
  if (ban) {
8
8
  const now = new Date();
9
9
  const expiresAt = new Date(now.getTime() + banDuration * 1000);
10
- await takaro.gameserver.gameServerControllerBanPlayer(gameServerId, player.id, {
10
+ await takaro.player.banControllerCreate({
11
+ gameServerId,
12
+ playerId: player.id,
13
+ until: expiresAt,
11
14
  reason: message,
12
- expiresAt,
13
15
  });
14
16
  }
15
17
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"IPDetected.js","sourceRoot":"","sources":["../../../../src/modules/geoBlock/hooks/IPDetected.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEhE,KAAK,UAAU,IAAI;IACjB,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IAC3C,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC;IACnC,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC;IAE9E,KAAK,UAAU,YAAY;QACzB,IAAI,GAAG,EAAE,CAAC;YACR,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;YACvB,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,WAAW,GAAG,IAAI,CAAC,CAAC;YAC/D,MAAM,MAAM,CAAC,UAAU,CAAC,6BAA6B,CAAC,YAAY,EAAE,MAAM,CAAC,EAAE,EAAE;gBAC7E,MAAM,EAAE,OAAO;gBACf,SAAS;aACV,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,MAAM,MAAM,CAAC,UAAU,CAAC,8BAA8B,CAAC,YAAY,EAAE,MAAM,CAAC,EAAE,EAAE;gBAC9E,MAAM,EAAE,OAAO;aAChB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,MAAM,QAAQ,GAAG,eAAe,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAC;IAC3D,IAAI,QAAQ,EAAE,CAA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MAAM,IAAI,EAAE,CAAC"}
@@ -1,8 +1,9 @@
1
- import { BuiltinModule } from '../../BuiltinModule.js';
1
+ import { ModuleTransferDTO } from '../../BuiltinModule.js';
2
2
  export declare const countryCodes: {
3
3
  code: string;
4
4
  name: string;
5
5
  }[];
6
- export declare class GeoBlock extends BuiltinModule<GeoBlock> {
6
+ export declare class GeoBlock extends ModuleTransferDTO<GeoBlock> {
7
7
  constructor();
8
8
  }
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/geoBlock/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAgD,MAAM,wBAAwB,CAAC;AAKzG,eAAO,MAAM,YAAY;;;GAuPxB,CAAC;AAEF,qBAAa,QAAS,SAAQ,iBAAiB,CAAC,QAAQ,CAAC;;CA8ExD"}
@@ -1,4 +1,4 @@
1
- import { BuiltinModule, IHook, IPermission } from '../../BuiltinModule.js';
1
+ import { ModuleTransferDTO, IHook, IPermission, ModuleTransferVersionDTO } from '../../BuiltinModule.js';
2
2
  import { HookEvents } from '../../dto/index.js';
3
3
  import { Duration } from 'luxon';
4
4
  // temporary solution
@@ -250,70 +250,78 @@ export const countryCodes = [
250
250
  { code: 'ZM', name: 'Zambia' },
251
251
  { code: 'ZW', name: 'Zimbabwe' },
252
252
  ];
253
- export class GeoBlock extends BuiltinModule {
253
+ export class GeoBlock extends ModuleTransferDTO {
254
254
  constructor() {
255
- super('geoBlock', 'Block players from certain countries from joining the server.', JSON.stringify({
256
- $schema: 'http://json-schema.org/draft-07/schema#',
257
- type: 'object',
258
- properties: {
259
- mode: {
260
- title: 'Mode',
261
- type: 'string',
262
- description: 'If set to allow, only players from the specified countries will be allowed to join. If set to deny, players from the specified countries will be banned from the server.',
263
- enum: ['allow', 'deny'],
264
- default: 'deny',
265
- },
266
- countries: {
267
- title: 'Countries',
268
- description: 'List of countries',
269
- type: 'array',
270
- uniqueItems: true,
271
- 'x-component': 'country',
272
- items: {
273
- type: 'string',
274
- anyOf: countryCodes.map(({ code, name }) => ({ const: code, title: name })),
255
+ super();
256
+ this.name = 'geoBlock';
257
+ this.versions = [
258
+ new ModuleTransferVersionDTO({
259
+ tag: '0.0.1',
260
+ description: 'Block players from certain countries from joining the server.',
261
+ configSchema: JSON.stringify({
262
+ $schema: 'http://json-schema.org/draft-07/schema#',
263
+ type: 'object',
264
+ properties: {
265
+ mode: {
266
+ title: 'Mode',
267
+ type: 'string',
268
+ description: 'If set to allow, only players from the specified countries will be allowed to join. If set to deny, players from the specified countries will be banned from the server.',
269
+ enum: ['allow', 'deny'],
270
+ default: 'deny',
271
+ },
272
+ countries: {
273
+ title: 'Countries',
274
+ description: 'List of countries',
275
+ type: 'array',
276
+ uniqueItems: true,
277
+ 'x-component': 'country',
278
+ items: {
279
+ type: 'string',
280
+ anyOf: countryCodes.map(({ code, name }) => ({ const: code, title: name })),
281
+ },
282
+ },
283
+ ban: {
284
+ title: 'Ban',
285
+ description: 'Ban players from the server when they are detected. When false, players will be kicked instead.',
286
+ type: 'boolean',
287
+ default: true,
288
+ },
289
+ banDuration: {
290
+ title: 'Ban duration',
291
+ description: 'Duration of the ban.',
292
+ 'x-component': 'duration',
293
+ type: 'number',
294
+ minimum: 0,
295
+ default: Duration.fromObject({ days: 1 }).as('milliseconds'),
296
+ },
297
+ message: {
298
+ title: 'Message',
299
+ type: 'string',
300
+ description: 'Message to send to the player when they are kicked or banned.',
301
+ default: 'Your IP address is banned.',
302
+ },
275
303
  },
276
- },
277
- ban: {
278
- title: 'Ban',
279
- description: 'Ban players from the server when they are detected. When false, players will be kicked instead.',
280
- type: 'boolean',
281
- default: true,
282
- },
283
- banDuration: {
284
- title: 'Ban duration',
285
- description: 'Duration of the ban.',
286
- 'x-component': 'duration',
287
- type: 'number',
288
- minimum: 0,
289
- default: Duration.fromObject({ days: 1 }).as('milliseconds'),
290
- },
291
- message: {
292
- title: 'Message',
293
- type: 'string',
294
- description: 'Message to send to the player when they are kicked or banned.',
295
- default: 'Your IP address is banned.',
296
- },
297
- },
298
- required: ['countries'],
299
- additionalProperties: false,
300
- }), JSON.stringify({
301
- banDuration: { 'ui:widget': 'duration' },
302
- }));
303
- this.permissions = [
304
- new IPermission({
305
- permission: 'GEOBLOCK_IMMUNITY',
306
- friendlyName: 'GeoBlock immunity',
307
- description: 'Players with this permission will not be kicked or banned by GeoBlock.',
308
- canHaveCount: false,
309
- }),
310
- ];
311
- this.commands = [];
312
- this.hooks = [
313
- new IHook({
314
- eventType: HookEvents.PLAYER_NEW_IP_DETECTED,
315
- name: 'IPDetected',
316
- function: this.loadFn('hooks', 'IPDetected'),
304
+ required: ['countries'],
305
+ additionalProperties: false,
306
+ }),
307
+ uiSchema: JSON.stringify({
308
+ banDuration: { 'ui:widget': 'duration' },
309
+ }),
310
+ permissions: [
311
+ new IPermission({
312
+ permission: 'GEOBLOCK_IMMUNITY',
313
+ friendlyName: 'GeoBlock immunity',
314
+ description: 'Players with this permission will not be kicked or banned by GeoBlock.',
315
+ canHaveCount: false,
316
+ }),
317
+ ],
318
+ hooks: [
319
+ new IHook({
320
+ eventType: HookEvents.PLAYER_NEW_IP_DETECTED,
321
+ name: 'IPDetected',
322
+ function: this.loadFn('hooks', 'IPDetected'),
323
+ }),
324
+ ],
317
325
  }),
318
326
  ];
319
327
  }