@takaro/modules 0.0.1 → 0.0.4

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 (96) hide show
  1. package/dist/BuiltinModule.js +0 -4
  2. package/dist/BuiltinModule.js.map +1 -1
  3. package/dist/community-modules.json +21 -0
  4. package/dist/dto/gameEvents.d.ts +3 -2
  5. package/dist/dto/gameEvents.js +1 -0
  6. package/dist/dto/gameEvents.js.map +1 -1
  7. package/dist/dto/index.d.ts +6 -0
  8. package/dist/dto/takaroEvents.d.ts +46 -0
  9. package/dist/dto/takaroEvents.js +129 -1
  10. package/dist/dto/takaroEvents.js.map +1 -1
  11. package/dist/main.js +1 -1
  12. package/dist/main.js.map +1 -1
  13. package/dist/modules/chatBridge/hooks/GameToDiscord.js +1 -1
  14. package/dist/modules/chatBridge/hooks/GameToDiscord.js.map +1 -1
  15. package/dist/modules/chatBridge/hooks/PlayerConnected.js +2 -2
  16. package/dist/modules/chatBridge/hooks/PlayerConnected.js.map +1 -1
  17. package/dist/modules/chatBridge/hooks/PlayerDisconnected.js +1 -1
  18. package/dist/modules/chatBridge/hooks/PlayerDisconnected.js.map +1 -1
  19. package/dist/modules/economyUtils/commands/transfer.js +1 -1
  20. package/dist/modules/economyUtils/commands/transfer.js.map +1 -1
  21. package/dist/modules/geoBlock/hooks/IPDetected.js +13 -15
  22. package/dist/modules/geoBlock/hooks/IPDetected.js.map +1 -1
  23. package/dist/modules/geoBlock/index.js +1 -1
  24. package/dist/modules/geoBlock/index.js.map +1 -1
  25. package/dist/modules/lottery/commands/nextDraw.js +1 -1
  26. package/dist/modules/lottery/commands/nextDraw.js.map +1 -1
  27. package/dist/modules/playerOnboarding/index.js.map +1 -1
  28. package/dist/modules/teleports/commands/deletetp.js +1 -1
  29. package/dist/modules/teleports/commands/deletetp.js.map +1 -1
  30. package/dist/modules/teleports/commands/setprivate.js +4 -6
  31. package/dist/modules/teleports/commands/setprivate.js.map +1 -1
  32. package/dist/modules/teleports/commands/setpublic.js +8 -15
  33. package/dist/modules/teleports/commands/setpublic.js.map +1 -1
  34. package/dist/modules/teleports/commands/settp.js +2 -2
  35. package/dist/modules/teleports/commands/settp.js.map +1 -1
  36. package/dist/modules/teleports/commands/teleport.js +3 -8
  37. package/dist/modules/teleports/commands/teleport.js.map +1 -1
  38. package/dist/modules/teleports/commands/teleportwaypoint.js +9 -1
  39. package/dist/modules/teleports/commands/teleportwaypoint.js.map +1 -1
  40. package/dist/modules/teleports/commands/tplist.js +13 -12
  41. package/dist/modules/teleports/commands/tplist.js.map +1 -1
  42. package/dist/modules/teleports/functions/utils.d.ts +2 -2
  43. package/dist/modules/teleports/functions/utils.js +21 -3
  44. package/dist/modules/teleports/functions/utils.js.map +1 -1
  45. package/dist/modules.json +98 -78
  46. package/package.json +4 -8
  47. package/scripts/buildBuiltinJson.ts +20 -0
  48. package/src/BuiltinModule.ts +1 -1
  49. package/src/__tests__/aliases.integration.test.ts +2 -3
  50. package/src/__tests__/bugRepros.integration.test.ts +72 -0
  51. package/src/__tests__/commandArgs.integration.test.ts +2 -3
  52. package/src/__tests__/economyUtils.integration.test.ts +38 -39
  53. package/src/__tests__/geoblock.integration.test.ts +11 -12
  54. package/src/__tests__/gimme.integration.test.ts +4 -5
  55. package/src/__tests__/help.integration.test.ts +12 -13
  56. package/src/__tests__/lottery.integration.test.ts +6 -7
  57. package/src/__tests__/modulePermission.integration.test.ts +5 -6
  58. package/src/__tests__/onboarding.integration.test.ts +5 -6
  59. package/src/__tests__/ping.integration.test.ts +2 -3
  60. package/src/__tests__/roleExpiry.integration.test.ts +3 -4
  61. package/src/__tests__/serverMessages.integration.test.ts +5 -6
  62. package/src/__tests__/systemConfigCost.integration.test.ts +6 -7
  63. package/src/__tests__/teleports/listtp.integration.test.ts +84 -10
  64. package/src/__tests__/teleports/publicteleports.integration.test.ts +11 -12
  65. package/src/__tests__/teleports/teleport.integration.test.ts +4 -5
  66. package/src/__tests__/teleports/tpManagement.integration.test.ts +10 -11
  67. package/src/__tests__/teleports/waypoints.integration.test.ts +5 -6
  68. package/src/community-modules/README.md +5 -0
  69. package/src/community-modules/modules/vote.json +19 -0
  70. package/src/dto/gameEvents.ts +2 -2
  71. package/src/dto/takaroEvents.ts +79 -0
  72. package/src/main.ts +2 -3
  73. package/src/modules/chatBridge/hooks/GameToDiscord.js +1 -1
  74. package/src/modules/chatBridge/hooks/PlayerConnected.js +2 -2
  75. package/src/modules/chatBridge/hooks/PlayerDisconnected.js +1 -1
  76. package/src/modules/chatBridge/index.ts +1 -1
  77. package/src/modules/economyUtils/commands/transfer.js +4 -4
  78. package/src/modules/economyUtils/index.ts +1 -1
  79. package/src/modules/geoBlock/hooks/IPDetected.js +12 -13
  80. package/src/modules/geoBlock/index.ts +2 -2
  81. package/src/modules/gimme/index.ts +1 -1
  82. package/src/modules/highPingKicker/index.ts +1 -1
  83. package/src/modules/lottery/commands/nextDraw.js +3 -1
  84. package/src/modules/lottery/index.ts +1 -1
  85. package/src/modules/playerOnboarding/index.ts +2 -1
  86. package/src/modules/serverMessages/index.ts +1 -1
  87. package/src/modules/teleports/commands/deletetp.js +1 -1
  88. package/src/modules/teleports/commands/setprivate.js +6 -6
  89. package/src/modules/teleports/commands/setpublic.js +18 -25
  90. package/src/modules/teleports/commands/settp.js +2 -2
  91. package/src/modules/teleports/commands/teleport.js +3 -10
  92. package/src/modules/teleports/commands/teleportwaypoint.js +12 -1
  93. package/src/modules/teleports/commands/tplist.js +16 -15
  94. package/src/modules/teleports/functions/utils.js +19 -3
  95. package/src/modules/teleports/index.ts +1 -1
  96. package/src/modules/utils/index.ts +1 -1
package/dist/modules.json CHANGED
@@ -1,9 +1,5 @@
1
1
  [
2
2
  {
3
- "name": "utils",
4
- "description": "A collection of useful commands",
5
- "configSchema": "{\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"type\":\"object\",\"additionalProperties\":false}",
6
- "uiSchema": "{}",
7
3
  "commands": [
8
4
  {
9
5
  "function": "import { data } from '@takaro/helpers';\nasync function main() {\n await data.player.pm('Pong!');\n}\nawait main();\n//# sourceMappingURL=ping.js.map",
@@ -31,16 +27,16 @@
31
27
  "hooks": [],
32
28
  "cronJobs": [],
33
29
  "functions": [],
34
- "permissions": []
30
+ "permissions": [],
31
+ "name": "utils",
32
+ "description": "A collection of useful commands",
33
+ "configSchema": "{\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"type\":\"object\",\"additionalProperties\":false}",
34
+ "uiSchema": "{}"
35
35
  },
36
36
  {
37
- "name": "teleports",
38
- "description": "A set of commands to allow players to set their own teleport points and teleport to them.",
39
- "configSchema": "{\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"type\":\"object\",\"properties\":{\"timeout\":{\"title\":\"Timeout\",\"description\":\"The time one has to wait before teleporting again.\",\"x-component\":\"duration\",\"type\":\"number\",\"minimum\":0,\"default\":1000},\"allowPublicTeleports\":{\"type\":\"boolean\",\"description\":\"Players can create public teleports.\",\"default\":false}},\"required\":[],\"additionalProperties\":false}",
40
- "uiSchema": "{\"timeout\":{\"ui:widget\":\"duration\"}}",
41
37
  "commands": [
42
38
  {
43
- "function": "import { takaro, data, checkPermission, TakaroUserError } from '@takaro/helpers';\nimport { findTp } from './utils.js';\nasync function main() {\n const { pog, gameServerId, arguments: args, module: mod } = data;\n if (!checkPermission(pog, 'TELEPORTS_USE')) {\n throw new TakaroUserError('You do not have permission to use teleports.');\n }\n const ownedTeleportRes = await findTp(args.tp, pog.playerId);\n let teleports = ownedTeleportRes.data.data;\n if (mod.userConfig.allowPublicTeleports) {\n const maybePublicTeleportRes = await findTp(args.tp);\n const publicTeleports = maybePublicTeleportRes.data.data.filter((tele) => {\n const teleport = JSON.parse(tele.value);\n return teleport.public;\n });\n teleports = teleports.concat(publicTeleports);\n }\n if (teleports.length === 0) {\n throw new TakaroUserError(`Teleport ${args.tp} does not exist.`);\n }\n const timeout = mod.userConfig.timeout;\n if (timeout !== 0) {\n const lastExecuted = await takaro.variable.variableControllerSearch({\n filters: {\n key: ['lastExecuted'],\n gameServerId: [gameServerId],\n playerId: [pog.playerId],\n moduleId: [mod.moduleId],\n },\n });\n let lastExecutedRecord = lastExecuted.data.data[0];\n if (!lastExecutedRecord) {\n const createRes = await takaro.variable.variableControllerCreate({\n key: 'lastExecuted',\n gameServerId,\n playerId: pog.playerId,\n moduleId: mod.moduleId,\n value: new Date().toISOString(),\n });\n console.log(createRes);\n lastExecutedRecord = createRes.data.data;\n }\n else {\n const lastExecutedTime = new Date(lastExecutedRecord.value);\n const now = new Date();\n const diff = now.getTime() - lastExecutedTime.getTime();\n if (diff < timeout) {\n throw new TakaroUserError('You cannot teleport yet. Please wait before trying again.');\n }\n }\n const teleport = JSON.parse(teleports[0].value);\n await takaro.gameserver.gameServerControllerTeleportPlayer(gameServerId, pog.playerId, {\n x: teleport.x,\n y: teleport.y,\n z: teleport.z,\n });\n await data.player.pm(`Teleported to ${teleport.name}.`);\n if (timeout !== 0 && lastExecutedRecord) {\n await takaro.variable.variableControllerUpdate(lastExecutedRecord.id, {\n value: new Date().toISOString(),\n });\n }\n return;\n }\n const teleport = JSON.parse(teleports[0].value);\n await takaro.gameserver.gameServerControllerTeleportPlayer(gameServerId, pog.playerId, {\n x: teleport.x,\n y: teleport.y,\n z: teleport.z,\n });\n await data.player.pm(`Teleported to ${teleport.name}.`);\n}\nawait main();\n//# sourceMappingURL=teleport.js.map",
39
+ "function": "import { takaro, data, checkPermission, TakaroUserError } from '@takaro/helpers';\nimport { findTp } from './utils.js';\nasync function main() {\n const { pog, gameServerId, arguments: args, module: mod } = data;\n if (!checkPermission(pog, 'TELEPORTS_USE')) {\n throw new TakaroUserError('You do not have permission to use teleports.');\n }\n const ownedTeleportRes = await findTp(args.tp, pog.playerId);\n let teleports = ownedTeleportRes.data.data;\n if (mod.userConfig.allowPublicTeleports) {\n const publicTeleportRes = await findTp(args.tp, null, true);\n teleports = teleports.concat(publicTeleportRes.data.data);\n }\n if (teleports.length === 0) {\n throw new TakaroUserError(`Teleport ${args.tp} does not exist.`);\n }\n const timeout = mod.userConfig.timeout;\n if (timeout > 0) {\n const lastExecuted = await takaro.variable.variableControllerSearch({\n filters: {\n key: ['lastExecuted'],\n gameServerId: [gameServerId],\n playerId: [pog.playerId],\n moduleId: [mod.moduleId],\n },\n });\n let lastExecutedRecord = lastExecuted.data.data[0];\n if (!lastExecutedRecord) {\n const createRes = await takaro.variable.variableControllerCreate({\n key: 'lastExecuted',\n gameServerId,\n playerId: pog.playerId,\n moduleId: mod.moduleId,\n value: new Date().toISOString(),\n });\n lastExecutedRecord = createRes.data.data;\n }\n else {\n const lastExecutedTime = new Date(lastExecutedRecord.value);\n const now = new Date();\n const diff = now.getTime() - lastExecutedTime.getTime();\n if (diff < timeout) {\n throw new TakaroUserError('You cannot teleport yet. Please wait before trying again.');\n }\n }\n const teleport = JSON.parse(teleports[0].value);\n await takaro.gameserver.gameServerControllerTeleportPlayer(gameServerId, pog.playerId, {\n x: teleport.x,\n y: teleport.y,\n z: teleport.z,\n });\n await data.player.pm(`Teleported to ${teleport.name}.`);\n if (timeout !== 0 && lastExecutedRecord) {\n await takaro.variable.variableControllerUpdate(lastExecutedRecord.id, {\n value: new Date().toISOString(),\n });\n }\n return;\n }\n const teleport = JSON.parse(teleports[0].value);\n await takaro.gameserver.gameServerControllerTeleportPlayer(gameServerId, pog.playerId, {\n x: teleport.x,\n y: teleport.y,\n z: teleport.z,\n });\n await data.player.pm(`Teleported to ${teleport.name}.`);\n}\nawait main();\n//# sourceMappingURL=teleport.js.map",
44
40
  "name": "teleport",
45
41
  "trigger": "tp",
46
42
  "helpText": "Teleports to one of your set locations.",
@@ -48,19 +44,21 @@
48
44
  {
49
45
  "name": "tp",
50
46
  "type": "string",
47
+ "defaultValue": null,
51
48
  "helpText": "The location to teleport to.",
52
49
  "position": 0
53
50
  }
54
51
  ]
55
52
  },
56
53
  {
57
- "function": "import { takaro, data } from '@takaro/helpers';\nasync function main() {\n const { pog, gameServerId, module: mod } = data;\n const prefix = (await takaro.settings.settingsControllerGetOne('commandPrefix', gameServerId)).data.data;\n const ownedTeleports = (await takaro.variable.variableControllerSearch({\n filters: {\n gameServerId: [gameServerId],\n playerId: [pog.playerId],\n moduleId: [mod.moduleId],\n },\n search: {\n key: 'tp',\n },\n sortBy: 'key',\n sortDirection: 'asc',\n })).data.data;\n const maybePublicTeleports = (await takaro.variable.variableControllerSearch({\n filters: {\n gameServerId: [gameServerId],\n moduleId: [mod.moduleId],\n },\n search: {\n key: ['tp'],\n },\n sortBy: 'key',\n sortDirection: 'asc',\n })).data.data;\n const teleports = maybePublicTeleports.filter((tele) => {\n const teleport = JSON.parse(tele.value);\n const isPublic = teleport.public && teleport.playerId !== pog.playerId;\n const isOwned = ownedTeleports.find((t) => t.playerId === pog.playerId);\n return isPublic || isOwned;\n });\n if (teleports.length === 0) {\n await data.player.pm(`You have no teleports set, use ${prefix}settp <name> to set one.`);\n return;\n }\n await data.player.pm(`You have ${teleports.length} teleport${teleports.length === 1 ? '' : 's'} available`);\n for (const rawTeleport of teleports) {\n const teleport = JSON.parse(rawTeleport.value);\n await data.player.pm(` - ${teleport.name}: ${teleport.x}, ${teleport.y}, ${teleport.z} ${teleport.public ? '(public)' : ''}`);\n }\n}\nawait main();\n//# sourceMappingURL=tplist.js.map",
54
+ "function": "import { takaro, data } from '@takaro/helpers';\nimport { getVariableKey } from './utils.js';\nasync function main() {\n const { pog, gameServerId, module: mod } = data;\n const prefix = (await takaro.settings.settingsControllerGetOne('commandPrefix', gameServerId)).data.data.value;\n const ownedTeleports = (await takaro.variable.variableControllerSearch({\n filters: {\n gameServerId: [gameServerId],\n playerId: [pog.playerId],\n moduleId: [mod.moduleId],\n },\n search: {\n key: [getVariableKey(undefined, false)],\n },\n sortBy: 'key',\n sortDirection: 'asc',\n })).data.data;\n const publicTeleports = (await takaro.variable.variableControllerSearch({\n filters: {\n gameServerId: [gameServerId],\n moduleId: [mod.moduleId],\n },\n search: {\n key: [getVariableKey(undefined, true)],\n },\n sortBy: 'key',\n sortDirection: 'asc',\n })).data.data\n // Filter out public teleports that are owned by the player\n // Since we'll be showing them in the owned teleports list\n .filter((teleport) => {\n return teleport.playerId !== pog.playerId;\n });\n const teleports = [...ownedTeleports, ...publicTeleports];\n if (teleports.length === 0) {\n await data.player.pm(`You have no teleports available, use ${prefix}settp <name> to set one.`);\n return;\n }\n await data.player.pm(`You have ${teleports.length} teleport${teleports.length === 1 ? '' : 's'} available`);\n for (const rawTeleport of teleports) {\n const teleport = JSON.parse(rawTeleport.value);\n await data.player.pm(`${teleport.name}: (${teleport.x},${teleport.y},${teleport.z}) ${rawTeleport.key.startsWith('pub') ? '(public)' : ''}`);\n }\n}\nawait main();\n//# sourceMappingURL=tplist.js.map",
58
55
  "name": "tplist",
59
56
  "trigger": "tplist",
60
- "helpText": "Lists all your set locations."
57
+ "helpText": "Lists all your set locations.",
58
+ "arguments": []
61
59
  },
62
60
  {
63
- "function": "import { takaro, data, checkPermission, TakaroUserError } from '@takaro/helpers';\nimport { getVariableKey, findTp } from './utils.js';\nasync function main() {\n const { pog, gameServerId, module: mod, arguments: args } = data;\n const hasPermission = checkPermission(pog, 'TELEPORTS_USE');\n if (!hasPermission) {\n throw new TakaroUserError('You do not have permission to use teleports.');\n }\n const prefix = (await takaro.settings.settingsControllerGetOne('commandPrefix', gameServerId)).data.data.value;\n const existingVariable = await findTp(args.tp);\n if (existingVariable.data.data.length > 0) {\n throw new TakaroUserError(`Teleport ${args.tp} already exists, use ${prefix}deletetp ${args.tp} to delete it.`);\n }\n const allPlayerTeleports = await takaro.variable.variableControllerSearch({\n search: {\n key: getVariableKey(''),\n },\n filters: {\n gameServerId: [gameServerId],\n playerId: [pog.playerId],\n moduleId: [mod.moduleId],\n },\n });\n if (allPlayerTeleports.data.data.length >= hasPermission.count) {\n throw new TakaroUserError(`You have reached the maximum number of teleports for your role, maximum allowed is ${hasPermission.count}`);\n }\n await takaro.variable.variableControllerCreate({\n key: getVariableKey(args.tp),\n value: JSON.stringify({\n name: args.tp,\n x: data.pog.positionX,\n y: data.pog.positionY,\n z: data.pog.positionZ,\n }),\n gameServerId,\n moduleId: mod.moduleId,\n playerId: pog.playerId,\n });\n await data.player.pm(`Teleport ${args.tp} set.`);\n}\nawait main();\n//# sourceMappingURL=settp.js.map",
61
+ "function": "import { takaro, data, checkPermission, TakaroUserError } from '@takaro/helpers';\nimport { getVariableKey, findTp } from './utils.js';\nasync function main() {\n const { pog, gameServerId, module: mod, arguments: args } = data;\n const hasPermission = checkPermission(pog, 'TELEPORTS_USE');\n if (!hasPermission) {\n throw new TakaroUserError('You do not have permission to use teleports.');\n }\n const prefix = (await takaro.settings.settingsControllerGetOne('commandPrefix', gameServerId)).data.data.value;\n const existingVariable = await findTp(args.tp, pog.playerId);\n if (existingVariable.data.data.length > 0) {\n throw new TakaroUserError(`Teleport ${args.tp} already exists, use ${prefix}deletetp ${args.tp} to delete it.`);\n }\n const allPlayerTeleports = await takaro.variable.variableControllerSearch({\n search: {\n key: [getVariableKey(undefined), getVariableKey(undefined, true)],\n },\n filters: {\n gameServerId: [gameServerId],\n playerId: [pog.playerId],\n moduleId: [mod.moduleId],\n },\n });\n if (allPlayerTeleports.data.data.length >= hasPermission.count) {\n throw new TakaroUserError(`You have reached the maximum number of teleports for your role, maximum allowed is ${hasPermission.count}`);\n }\n await takaro.variable.variableControllerCreate({\n key: getVariableKey(args.tp),\n value: JSON.stringify({\n name: args.tp,\n x: data.pog.positionX,\n y: data.pog.positionY,\n z: data.pog.positionZ,\n }),\n gameServerId,\n moduleId: mod.moduleId,\n playerId: pog.playerId,\n });\n await data.player.pm(`Teleport ${args.tp} set.`);\n}\nawait main();\n//# sourceMappingURL=settp.js.map",
64
62
  "name": "settp",
65
63
  "trigger": "settp",
66
64
  "helpText": "Sets a location to teleport to.",
@@ -68,13 +66,14 @@
68
66
  {
69
67
  "name": "tp",
70
68
  "type": "string",
69
+ "defaultValue": null,
71
70
  "helpText": "The location name.",
72
71
  "position": 0
73
72
  }
74
73
  ]
75
74
  },
76
75
  {
77
- "function": "import { takaro, data, TakaroUserError } from '@takaro/helpers';\nimport { getVariableKey } from './utils.js';\nasync function main() {\n const { pog, gameServerId, arguments: args, module: mod } = data;\n const existingVariable = await takaro.variable.variableControllerSearch({\n filters: {\n key: [getVariableKey(args.tp)],\n gameServerId: [gameServerId],\n playerId: [pog.playerId],\n moduleId: [mod.moduleId],\n },\n });\n if (existingVariable.data.data.length === 0) {\n throw new TakaroUserError(`Teleport ${args.tp} does not exist.`);\n }\n await takaro.variable.variableControllerDelete(existingVariable.data.data[0].id);\n await data.player.pm(`Teleport ${args.tp} deleted.`);\n}\nawait main();\n//# sourceMappingURL=deletetp.js.map",
76
+ "function": "import { takaro, data, TakaroUserError } from '@takaro/helpers';\nimport { getVariableKey } from './utils.js';\nasync function main() {\n const { pog, gameServerId, arguments: args, module: mod } = data;\n const existingVariable = await takaro.variable.variableControllerSearch({\n filters: {\n key: [getVariableKey(args.tp), getVariableKey(args.tp, true)],\n gameServerId: [gameServerId],\n playerId: [pog.playerId],\n moduleId: [mod.moduleId],\n },\n });\n if (existingVariable.data.data.length === 0) {\n throw new TakaroUserError(`Teleport ${args.tp} does not exist.`);\n }\n await takaro.variable.variableControllerDelete(existingVariable.data.data[0].id);\n await data.player.pm(`Teleport ${args.tp} deleted.`);\n}\nawait main();\n//# sourceMappingURL=deletetp.js.map",
78
77
  "name": "deletetp",
79
78
  "trigger": "deletetp",
80
79
  "helpText": "Deletes a location.",
@@ -82,13 +81,14 @@
82
81
  {
83
82
  "name": "tp",
84
83
  "type": "string",
84
+ "defaultValue": null,
85
85
  "helpText": "The location name.",
86
86
  "position": 0
87
87
  }
88
88
  ]
89
89
  },
90
90
  {
91
- "function": "import { takaro, data, checkPermission, TakaroUserError } from '@takaro/helpers';\nimport { getVariableKey } from './utils.js';\nasync function main() {\n const { pog, gameServerId, module: mod, arguments: args } = data;\n const prefix = (await takaro.settings.settingsControllerGetOne('commandPrefix', gameServerId)).data.data;\n if (!mod.userConfig.allowPublicTeleports) {\n throw new TakaroUserError('Public teleports are disabled.');\n }\n const hasPermission = checkPermission(pog, 'TELEPORTS_CREATE_PUBLIC');\n if (!hasPermission) {\n throw new TakaroUserError('You do not have permission to create public teleports.');\n }\n const existingTeleportsForPlayerRes = await takaro.variable.variableControllerSearch({\n search: {\n key: 'tp_',\n },\n filters: {\n gameServerId: [gameServerId],\n playerId: [pog.playerId],\n moduleId: [mod.moduleId],\n },\n });\n const existingPublicTeleportsForPlayer = existingTeleportsForPlayerRes.data.data.filter((tp) => {\n const teleport = JSON.parse(tp.value);\n return teleport.public;\n });\n if (existingPublicTeleportsForPlayer.length >= hasPermission.count) {\n throw new TakaroUserError(`You have reached the maximum number of public teleports for your role, maximum allowed is ${hasPermission.count}`);\n }\n const teleportRes = await takaro.variable.variableControllerSearch({\n filters: {\n gameServerId: [gameServerId],\n playerId: [pog.playerId],\n moduleId: [mod.moduleId],\n key: [getVariableKey(args.tp)],\n },\n sortBy: 'key',\n sortDirection: 'asc',\n });\n const teleports = teleportRes.data.data;\n if (teleports.length === 0) {\n throw new TakaroUserError(`No teleport with name ${args.tp} found, use ${prefix}settp <name> to set one first.`);\n }\n const teleportRecord = teleports[0];\n const teleport = JSON.parse(teleportRecord.value);\n await takaro.variable.variableControllerUpdate(teleportRecord.id, {\n value: JSON.stringify({\n ...teleport,\n public: true,\n }),\n });\n await data.player.pm(`Teleport ${args.tp} is now public.`);\n}\nawait main();\n//# sourceMappingURL=setpublic.js.map",
91
+ "function": "import { takaro, data, checkPermission, TakaroUserError } from '@takaro/helpers';\nimport { getVariableKey } from './utils.js';\nasync function main() {\n const { pog, gameServerId, module: mod, arguments: args } = data;\n const prefix = (await takaro.settings.settingsControllerGetOne('commandPrefix', gameServerId)).data.data.value;\n if (!mod.userConfig.allowPublicTeleports) {\n throw new TakaroUserError('Public teleports are disabled.');\n }\n const hasPermission = checkPermission(pog, 'TELEPORTS_CREATE_PUBLIC');\n if (!hasPermission) {\n throw new TakaroUserError('You do not have permission to create public teleports.');\n }\n const existingPublicTeleportsForPlayerRes = await takaro.variable.variableControllerSearch({\n search: {\n key: ['pubtp_'],\n },\n filters: {\n gameServerId: [gameServerId],\n playerId: [pog.playerId],\n moduleId: [mod.moduleId],\n },\n });\n if (existingPublicTeleportsForPlayerRes.data.data.length >= hasPermission.count) {\n throw new TakaroUserError(`You have reached the maximum number of public teleports for your role, maximum allowed is ${hasPermission.count}`);\n }\n const teleports = (await takaro.variable.variableControllerSearch({\n filters: {\n gameServerId: [gameServerId],\n playerId: [pog.playerId],\n moduleId: [mod.moduleId],\n key: [getVariableKey(args.tp)],\n },\n sortBy: 'key',\n sortDirection: 'asc',\n })).data.data;\n if (teleports.length === 0) {\n throw new TakaroUserError(`No teleport with name ${args.tp} found, use ${prefix}settp <name> to set one first.`);\n }\n const teleportRecord = teleports[0];\n const teleport = JSON.parse(teleportRecord.value);\n await takaro.variable.variableControllerUpdate(teleportRecord.id, {\n key: getVariableKey(args.tp, true),\n value: JSON.stringify(teleport),\n });\n await data.player.pm(`Teleport ${args.tp} is now public.`);\n}\nawait main();\n//# sourceMappingURL=setpublic.js.map",
92
92
  "name": "setpublic",
93
93
  "trigger": "setpublic",
94
94
  "helpText": "Sets a teleport to be public, allowing other players to teleport to it.",
@@ -96,13 +96,14 @@
96
96
  {
97
97
  "name": "tp",
98
98
  "type": "string",
99
+ "defaultValue": null,
99
100
  "helpText": "The location name.",
100
101
  "position": 0
101
102
  }
102
103
  ]
103
104
  },
104
105
  {
105
- "function": "import { takaro, data, TakaroUserError } from '@takaro/helpers';\nimport { getVariableKey } from './utils.js';\nasync function main() {\n const { pog, gameServerId, arguments: args, module: mod } = data;\n const prefix = (await takaro.settings.settingsControllerGetOne('commandPrefix', gameServerId)).data.data;\n const teleportRes = await takaro.variable.variableControllerSearch({\n filters: {\n gameServerId: [gameServerId],\n playerId: [pog.playerId],\n key: [getVariableKey(args.tp)],\n moduleId: [mod.moduleId],\n },\n sortBy: 'key',\n sortDirection: 'asc',\n });\n const teleports = teleportRes.data.data;\n if (teleports.length === 0) {\n throw new TakaroUserError(`No teleport with name ${args.tp} found, use ${prefix}settp <name> to set one first.`);\n }\n const teleportRecord = teleports[0];\n const teleport = JSON.parse(teleportRecord.value);\n await takaro.variable.variableControllerUpdate(teleportRecord.id, {\n value: JSON.stringify({\n ...teleport,\n public: false,\n }),\n });\n await data.player.pm(`Teleport ${args.tp} is now private.`);\n}\nawait main();\n//# sourceMappingURL=setprivate.js.map",
106
+ "function": "import { takaro, data, TakaroUserError } from '@takaro/helpers';\nimport { getVariableKey } from './utils.js';\nasync function main() {\n const { pog, gameServerId, arguments: args, module: mod } = data;\n const prefix = (await takaro.settings.settingsControllerGetOne('commandPrefix', gameServerId)).data.data;\n const teleportRes = await takaro.variable.variableControllerSearch({\n filters: {\n gameServerId: [gameServerId],\n playerId: [pog.playerId],\n key: [getVariableKey(args.tp, true)],\n moduleId: [mod.moduleId],\n },\n sortBy: 'key',\n sortDirection: 'asc',\n });\n const teleports = teleportRes.data.data;\n if (teleports.length === 0) {\n throw new TakaroUserError(`No public teleport with name ${args.tp} found, use ${prefix}settp <name> to set one first.`);\n }\n const teleportRecord = teleports[0];\n const teleport = JSON.parse(teleportRecord.value);\n await takaro.variable.variableControllerUpdate(teleportRecord.id, {\n key: getVariableKey(args.tp),\n value: JSON.stringify(teleport),\n });\n await data.player.pm(`Teleport ${args.tp} is now private.`);\n}\nawait main();\n//# sourceMappingURL=setprivate.js.map",
106
107
  "name": "setprivate",
107
108
  "trigger": "setprivate",
108
109
  "helpText": "Sets a teleport to be private, only the teleport owner can teleport to it.",
@@ -110,6 +111,7 @@
110
111
  {
111
112
  "name": "tp",
112
113
  "type": "string",
114
+ "defaultValue": null,
113
115
  "helpText": "The location name.",
114
116
  "position": 0
115
117
  }
@@ -124,6 +126,7 @@
124
126
  {
125
127
  "name": "waypoint",
126
128
  "type": "string",
129
+ "defaultValue": null,
127
130
  "helpText": "The location name.",
128
131
  "position": 0
129
132
  }
@@ -138,6 +141,7 @@
138
141
  {
139
142
  "name": "waypoint",
140
143
  "type": "string",
144
+ "defaultValue": null,
141
145
  "helpText": "The location name.",
142
146
  "position": 0
143
147
  }
@@ -147,12 +151,14 @@
147
151
  "function": "import { takaro, data, checkPermission } from '@takaro/helpers';\nasync function main() {\n const { pog, gameServerId } = data;\n async function ensureWaypointsModule() {\n let waypointsDefinition = (await takaro.module.moduleControllerSearch({\n filters: {\n name: ['Waypoints'],\n },\n })).data.data[0];\n if (!waypointsDefinition) {\n console.log('Waypoints module definition not found, creating it.');\n waypointsDefinition = (await takaro.module.moduleControllerCreate({\n name: 'Waypoints',\n description: 'Waypoints module for the teleport system.',\n })).data.data;\n }\n let waypointsInstallation = (await takaro.gameserver.gameServerControllerGetInstalledModules(gameServerId)).data.data.find((module) => module.name === 'Waypoints');\n if (!waypointsInstallation) {\n console.log('Waypoints module not found, installing it.');\n waypointsInstallation = (await takaro.gameserver.gameServerControllerInstallModule(gameServerId, waypointsDefinition.id)).data.data;\n }\n return { waypointsInstallation, waypointsDefinition };\n }\n const { waypointsDefinition } = await ensureWaypointsModule();\n const allWaypoints = waypointsDefinition.commands;\n const waypointsWithPermission = allWaypoints\n .filter((waypoint) => checkPermission(pog, `WAYPOINTS_USE_${waypoint.trigger.toUpperCase()}_${gameServerId}`))\n .sort((a, b) => a.trigger.localeCompare(b.trigger));\n if (!waypointsWithPermission.length) {\n await pog.pm('There are no waypoints available.');\n return;\n }\n await pog.pm(`Available waypoints: ${waypointsWithPermission.map((waypoint) => waypoint.trigger).join(', ')}`);\n}\nawait main();\n//# sourceMappingURL=listwaypoints.js.map",
148
152
  "name": "listwaypoints",
149
153
  "trigger": "waypoints",
150
- "helpText": "Lists all waypoints."
154
+ "helpText": "Lists all waypoints.",
155
+ "arguments": []
151
156
  },
152
157
  {
153
- "function": "import { takaro, data, TakaroUserError, checkPermission } from '@takaro/helpers';\nfunction getWaypointName(name) {\n return `waypoint ${name}`;\n}\nasync function main() {\n const { pog, gameServerId, trigger } = data;\n if (!checkPermission(pog, `WAYPOINTS_USE_${trigger.toUpperCase()}_${gameServerId}`)) {\n throw new TakaroUserError(`You are not allowed to use the waypoint ${trigger}.`);\n }\n async function ensureWaypointsModule() {\n let waypointsDefinition = (await takaro.module.moduleControllerSearch({\n filters: {\n name: ['Waypoints'],\n },\n })).data.data[0];\n if (!waypointsDefinition) {\n console.log('Waypoints module definition not found, creating it.');\n waypointsDefinition = (await takaro.module.moduleControllerCreate({\n name: 'Waypoints',\n description: 'Waypoints module for the teleport system.',\n })).data.data;\n }\n let waypointsInstallation = (await takaro.gameserver.gameServerControllerGetInstalledModules(gameServerId)).data.data.find((module) => module.name === 'Waypoints');\n if (!waypointsInstallation) {\n console.log('Waypoints module not found, installing it.');\n waypointsInstallation = (await takaro.gameserver.gameServerControllerInstallModule(gameServerId, waypointsDefinition.id)).data.data;\n }\n return { waypointsInstallation, waypointsDefinition };\n }\n const { waypointsInstallation } = await ensureWaypointsModule();\n const variable = await takaro.variable.variableControllerSearch({\n filters: {\n key: [getWaypointName(trigger)],\n gameServerId: [gameServerId],\n moduleId: [waypointsInstallation.moduleId],\n },\n });\n if (variable.data.data.length === 0) {\n throw new TakaroUserError(`Waypoint ${trigger} does not exist.`);\n }\n const waypoint = JSON.parse(variable.data.data[0].value);\n await takaro.gameserver.gameServerControllerTeleportPlayer(gameServerId, pog.playerId, {\n x: waypoint.x,\n y: waypoint.y,\n z: waypoint.z,\n });\n await pog.pm(`Teleported to waypoint ${trigger}.`);\n}\nawait main();\n//# sourceMappingURL=teleportwaypoint.js.map",
158
+ "function": "import { takaro, data, TakaroUserError, checkPermission } from '@takaro/helpers';\nfunction getWaypointName(name) {\n return `waypoint ${name}`;\n}\nasync function main() {\n const { pog, gameServerId, trigger, module, itemId } = data;\n const triggeredCommand = module.module.commands.find((command) => command.id === itemId);\n if (!triggeredCommand) {\n throw new Error('Waypoint not found.');\n }\n if (!triggeredCommand.name.includes(`server ${gameServerId}`)) {\n console.log(`Waypoint ${trigger} is not for this server.`);\n return;\n }\n if (!checkPermission(pog, `WAYPOINTS_USE_${trigger.toUpperCase()}_${gameServerId}`)) {\n throw new TakaroUserError(`You are not allowed to use the waypoint ${trigger}.`);\n }\n async function ensureWaypointsModule() {\n let waypointsDefinition = (await takaro.module.moduleControllerSearch({\n filters: {\n name: ['Waypoints'],\n },\n })).data.data[0];\n if (!waypointsDefinition) {\n console.log('Waypoints module definition not found, creating it.');\n waypointsDefinition = (await takaro.module.moduleControllerCreate({\n name: 'Waypoints',\n description: 'Waypoints module for the teleport system.',\n })).data.data;\n }\n let waypointsInstallation = (await takaro.gameserver.gameServerControllerGetInstalledModules(gameServerId)).data.data.find((module) => module.name === 'Waypoints');\n if (!waypointsInstallation) {\n console.log('Waypoints module not found, installing it.');\n waypointsInstallation = (await takaro.gameserver.gameServerControllerInstallModule(gameServerId, waypointsDefinition.id)).data.data;\n }\n return { waypointsInstallation, waypointsDefinition };\n }\n const { waypointsInstallation } = await ensureWaypointsModule();\n const variable = await takaro.variable.variableControllerSearch({\n filters: {\n key: [getWaypointName(trigger)],\n gameServerId: [gameServerId],\n moduleId: [waypointsInstallation.moduleId],\n },\n });\n if (variable.data.data.length === 0) {\n throw new TakaroUserError(`Waypoint ${trigger} does not exist.`);\n }\n const waypoint = JSON.parse(variable.data.data[0].value);\n await takaro.gameserver.gameServerControllerTeleportPlayer(gameServerId, pog.playerId, {\n x: waypoint.x,\n y: waypoint.y,\n z: waypoint.z,\n });\n await pog.pm(`Teleported to waypoint ${trigger}.`);\n}\nawait main();\n//# sourceMappingURL=teleportwaypoint.js.map",
154
159
  "name": "teleportwaypoint",
155
160
  "trigger": "teleportwaypoint",
161
+ "arguments": [],
156
162
  "helpText": "Placeholder command, this will not be used directly. The module will install aliases for this command corresponding to the waypoint names."
157
163
  }
158
164
  ],
@@ -161,7 +167,7 @@
161
167
  "functions": [
162
168
  {
163
169
  "name": "utils",
164
- "function": "import { takaro, data } from '@takaro/helpers';\nexport function getVariableKey(tpName) {\n return `tp_${tpName}`;\n}\nexport async function findTp(tpName, playerId) {\n const { gameServerId, module: mod } = data;\n return takaro.variable.variableControllerSearch({\n filters: {\n key: [getVariableKey(tpName)],\n gameServerId: [gameServerId],\n playerId: [playerId].filter(Boolean),\n moduleId: [mod.moduleId],\n },\n sortBy: 'key',\n sortDirection: 'asc',\n });\n}\n//# sourceMappingURL=utils.js.map"
170
+ "function": "import { takaro, data } from '@takaro/helpers';\nexport function getVariableKey(tpName, pub = false) {\n if (pub && tpName)\n return `pubtp_${tpName}`;\n if (pub && !tpName)\n return 'pubtp_';\n if (tpName)\n return `tp_${tpName}`;\n return 'tp_';\n}\nexport async function findTp(tpName, playerId, pub = false) {\n const { gameServerId, module: mod } = data;\n if (pub) {\n return takaro.variable.variableControllerSearch({\n filters: {\n key: [getVariableKey(tpName, true)],\n gameServerId: [gameServerId],\n playerId: [playerId].filter(Boolean),\n moduleId: [mod.moduleId],\n },\n sortBy: 'key',\n sortDirection: 'asc',\n });\n }\n return takaro.variable.variableControllerSearch({\n filters: {\n key: [getVariableKey(tpName)],\n gameServerId: [gameServerId],\n playerId: [playerId].filter(Boolean),\n moduleId: [mod.moduleId],\n },\n sortBy: 'key',\n sortDirection: 'asc',\n });\n}\n//# sourceMappingURL=utils.js.map"
165
171
  }
166
172
  ],
167
173
  "permissions": [
@@ -169,13 +175,13 @@
169
175
  "permission": "TELEPORTS_CREATE_PUBLIC",
170
176
  "friendlyName": "Create Public Teleports",
171
177
  "description": "Allows the player to create public teleports.",
172
- "canHaveCount": false
178
+ "canHaveCount": true
173
179
  },
174
180
  {
175
181
  "permission": "TELEPORTS_USE",
176
182
  "friendlyName": "Use Teleports",
177
183
  "description": "Allows the player to use teleports modules.",
178
- "canHaveCount": false
184
+ "canHaveCount": true
179
185
  },
180
186
  {
181
187
  "permission": "TELEPORTS_MANAGE_WAYPOINTS",
@@ -183,19 +189,20 @@
183
189
  "description": "Allows creating, deleting, and managing waypoints.",
184
190
  "canHaveCount": false
185
191
  }
186
- ]
192
+ ],
193
+ "name": "teleports",
194
+ "description": "A set of commands to allow players to set their own teleport points and teleport to them.",
195
+ "configSchema": "{\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"type\":\"object\",\"properties\":{\"timeout\":{\"title\":\"Timeout\",\"description\":\"The time one has to wait before teleporting again.\",\"x-component\":\"duration\",\"type\":\"number\",\"minimum\":0,\"default\":1000},\"allowPublicTeleports\":{\"type\":\"boolean\",\"description\":\"Players can create public teleports.\",\"default\":false}},\"required\":[],\"additionalProperties\":false}",
196
+ "uiSchema": "{\"timeout\":{\"ui:widget\":\"duration\"}}"
187
197
  },
188
198
  {
189
- "name": "playerOnboarding",
190
- "description": "Collection of functions that are executed when a player joins the server. Helps with onboarding new players, like sending a welcome message.",
191
- "configSchema": "{\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"type\":\"object\",\"properties\":{\"message\":{\"title\":\"Message\",\"description\":\"The message to send to the player when they join the server.\",\"type\":\"string\",\"minLength\":1,\"maxLength\":256,\"default\":\"Welcome {player} to the server!\"},\"starterKitItems\":{\"type\":\"array\",\"x-component\":\"item\",\"title\":\"Starter kit items\",\"description\":\"List of items a player will receive when they execute the starterkit command for the first time.\",\"uniqueItems\":true,\"items\":{\"type\":\"string\"}}},\"required\":[],\"additionalProperties\":false}",
192
- "uiSchema": "{\"starterKitItems\":{\"ui:widget\":\"item\"}}",
193
199
  "commands": [
194
200
  {
195
201
  "name": "starterkit",
196
202
  "function": "import { takaro, data, TakaroUserError } from '@takaro/helpers';\nconst VARIABLE_KEY = 't_starterkit_lock';\nasync function main() {\n const items = data.module.userConfig.starterKitItems;\n if (!items || items.length === 0) {\n throw new TakaroUserError('No starter kit items configured. Please ask your server administrator to configure this.');\n }\n const starterKitLockRes = await takaro.variable.variableControllerSearch({\n filters: {\n key: [VARIABLE_KEY],\n gameServerId: [data.gameServerId],\n playerId: [data.player.id],\n },\n });\n if (starterKitLockRes.data.data.length > 0) {\n throw new TakaroUserError('You already used starterkit on this server');\n }\n await data.player.pm('You are about to receive your starter kit...');\n await Promise.all(items.map(async (item) => {\n return takaro.gameserver.gameServerControllerGiveItem(data.gameServerId, data.player.id, {\n name: item,\n amount: 1,\n });\n }));\n await takaro.variable.variableControllerCreate({\n key: VARIABLE_KEY,\n value: '1',\n gameServerId: data.gameServerId,\n playerId: data.player.id,\n });\n await data.player.pm(`Gave ${items.length} items, enjoy!`);\n}\nawait main();\n//# sourceMappingURL=starterkit.js.map",
197
203
  "trigger": "starterkit",
198
- "helpText": "Get a starter kit, you can only execute this once on a server!"
204
+ "helpText": "Get a starter kit, you can only execute this once on a server!",
205
+ "arguments": []
199
206
  }
200
207
  ],
201
208
  "hooks": [
@@ -207,13 +214,13 @@
207
214
  ],
208
215
  "cronJobs": [],
209
216
  "functions": [],
210
- "permissions": []
217
+ "permissions": [],
218
+ "name": "playerOnboarding",
219
+ "description": "Collection of functions that are executed when a player joins the server. Helps with onboarding new players, like sending a welcome message.",
220
+ "configSchema": "{\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"type\":\"object\",\"properties\":{\"message\":{\"title\":\"Message\",\"description\":\"The message to send to the player when they join the server.\",\"type\":\"string\",\"minLength\":1,\"maxLength\":256,\"default\":\"Welcome {player} to the server!\"},\"starterKitItems\":{\"type\":\"array\",\"x-component\":\"item\",\"title\":\"Starter kit items\",\"description\":\"List of items a player will receive when they execute the starterkit command for the first time.\",\"uniqueItems\":true,\"items\":{\"type\":\"string\"}}},\"required\":[],\"additionalProperties\":false}",
221
+ "uiSchema": "{\"starterKitItems\":{\"ui:widget\":\"item\"}}"
211
222
  },
212
223
  {
213
- "name": "serverMessages",
214
- "description": "Send automated, rotated, configurable messages to players on the server.",
215
- "configSchema": "{\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"type\":\"object\",\"properties\":{\"messages\":{\"type\":\"array\",\"title\":\"Messages\",\"description\":\"List of messages that will be sent to players on the server.\",\"default\":[\"This is an automated message, don't forget to read the server rules!\"],\"items\":{\"type\":\"string\",\"minLength\":5,\"maxLength\":1024},\"minItems\":1}},\"required\":[\"messages\"]}",
216
- "uiSchema": "{}",
217
224
  "commands": [],
218
225
  "hooks": [],
219
226
  "cronJobs": [
@@ -224,13 +231,13 @@
224
231
  }
225
232
  ],
226
233
  "functions": [],
227
- "permissions": []
234
+ "permissions": [],
235
+ "name": "serverMessages",
236
+ "description": "Send automated, rotated, configurable messages to players on the server.",
237
+ "configSchema": "{\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"type\":\"object\",\"properties\":{\"messages\":{\"type\":\"array\",\"title\":\"Messages\",\"description\":\"List of messages that will be sent to players on the server.\",\"default\":[\"This is an automated message, don't forget to read the server rules!\"],\"items\":{\"type\":\"string\",\"minLength\":5,\"maxLength\":1024},\"minItems\":1}},\"required\":[\"messages\"]}",
238
+ "uiSchema": "{}"
228
239
  },
229
240
  {
230
- "name": "chatBridge",
231
- "description": "Connect chat to other services like Discord.",
232
- "configSchema": "{\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"type\":\"object\",\"properties\":{\"sendPlayerConnected\":{\"title\":\"Send player connected\",\"type\":\"boolean\",\"description\":\"Send a message when a player connects.\",\"default\":true},\"sendPlayerDisconnected\":{\"title\":\"Send player disconnected\",\"type\":\"boolean\",\"description\":\"Send a message when a player disconnects.\",\"default\":true},\"onlyGlobalChat\":{\"title\":\"Only global chat\",\"type\":\"boolean\",\"default\":true,\"description\":\"Only relay messages from global chat. (no team chat or private messages)\"}},\"additionalProperties\":false}",
233
- "uiSchema": "{}",
234
241
  "commands": [],
235
242
  "hooks": [
236
243
  {
@@ -241,46 +248,47 @@
241
248
  {
242
249
  "eventType": "chat-message",
243
250
  "name": "GameToDiscord",
244
- "function": "import { takaro, data } from '@takaro/helpers';\nasync function main() {\n const onlyGlobal = data.module.userConfig.onlyGlobalChat;\n if (onlyGlobal && data.eventData.channel !== 'global')\n return;\n const discordChannel = data.module.systemConfig.hooks['DiscordToGame Discord channel ID'];\n const sender = data.player ? data.player.name : 'Non-player';\n const message = `**${sender}**: ${data.eventData.msg}`;\n await takaro.discord.discordControllerSendMessage(discordChannel, {\n message: message,\n });\n}\nawait main();\n//# sourceMappingURL=GameToDiscord.js.map"
251
+ "function": "import { takaro, data } from '@takaro/helpers';\nasync function main() {\n const onlyGlobal = data.module.userConfig.onlyGlobalChat;\n if (onlyGlobal && data.eventData.channel !== 'global')\n return;\n const discordChannel = data.module.systemConfig.hooks['DiscordToGame'].discordChannelId;\n const sender = data.player ? data.player.name : 'Non-player';\n const message = `**${sender}**: ${data.eventData.msg}`;\n await takaro.discord.discordControllerSendMessage(discordChannel, {\n message: message,\n });\n}\nawait main();\n//# sourceMappingURL=GameToDiscord.js.map"
245
252
  },
246
253
  {
247
254
  "eventType": "player-connected",
248
255
  "name": "PlayerConnected",
249
- "function": "import { takaro, data } from '@takaro/helpers';\nasync function main() {\n const discordChannel = data.module.systemConfig.hooks['DiscordToGame Discord channel ID'];\n await takaro.discord.discordControllerSendMessage(discordChannel, {\n message: `[🔌 Connected]: ${data.player.name}`,\n });\n}\nawait main();\n//# sourceMappingURL=PlayerConnected.js.map"
256
+ "function": "import { takaro, data } from '@takaro/helpers';\nasync function main() {\n const discordChannel = data.module.systemConfig.hooks['DiscordToGame'].discordChannelId;\n await takaro.discord.discordControllerSendMessage(discordChannel, {\n message: `[ Connected]: ${data.player.name}`,\n });\n}\nawait main();\n//# sourceMappingURL=PlayerConnected.js.map"
250
257
  },
251
258
  {
252
259
  "eventType": "player-disconnected",
253
260
  "name": "PlayerDisconnected",
254
- "function": "import { takaro, data } from '@takaro/helpers';\nasync function main() {\n const discordChannel = data.module.systemConfig.hooks['DiscordToGame Discord channel ID'];\n await takaro.discord.discordControllerSendMessage(discordChannel, {\n message: `[👋 Disconnected]: ${data.player.name}`,\n });\n}\nawait main();\n//# sourceMappingURL=PlayerDisconnected.js.map"
261
+ "function": "import { takaro, data } from '@takaro/helpers';\nasync function main() {\n const discordChannel = data.module.systemConfig.hooks['DiscordToGame'].discordChannelId;\n await takaro.discord.discordControllerSendMessage(discordChannel, {\n message: `[👋 Disconnected]: ${data.player.name}`,\n });\n}\nawait main();\n//# sourceMappingURL=PlayerDisconnected.js.map"
255
262
  }
256
263
  ],
257
264
  "cronJobs": [],
258
265
  "functions": [],
259
- "permissions": []
266
+ "permissions": [],
267
+ "name": "chatBridge",
268
+ "description": "Connect chat to other services like Discord.",
269
+ "configSchema": "{\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"type\":\"object\",\"properties\":{\"sendPlayerConnected\":{\"title\":\"Send player connected\",\"type\":\"boolean\",\"description\":\"Send a message when a player connects.\",\"default\":true},\"sendPlayerDisconnected\":{\"title\":\"Send player disconnected\",\"type\":\"boolean\",\"description\":\"Send a message when a player disconnects.\",\"default\":true},\"onlyGlobalChat\":{\"title\":\"Only global chat\",\"type\":\"boolean\",\"default\":true,\"description\":\"Only relay messages from global chat. (no team chat or private messages)\"}},\"additionalProperties\":false}",
270
+ "uiSchema": "{}"
260
271
  },
261
272
  {
262
- "name": "gimme",
263
- "description": "Randomly selects an item from a list of items.",
264
- "configSchema": "{\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"type\":\"object\",\"properties\":{\"items\":{\"x-component\":\"item\",\"type\":\"array\",\"title\":\"Items\",\"description\":\"List of items that a player can receive.\",\"uniqueItems\":true,\"items\":{\"type\":\"string\"}},\"commands\":{\"title\":\"Commands\",\"type\":\"array\",\"default\":[\"say hello from gimme\"],\"items\":{\"type\":\"string\"}}},\"required\":[\"items\"],\"additionalProperties\":false}",
265
- "uiSchema": "{\"items\":{\"ui:widget\":\"item\"}}",
266
273
  "commands": [
267
274
  {
268
275
  "function": "import { takaro, data, TakaroUserError } from '@takaro/helpers';\nasync function main() {\n const items = data.module.userConfig.items;\n const commands = data.module.userConfig.commands;\n if (items.length + commands.length === 0) {\n throw new TakaroUserError('No items or commands configured, please ask your server administrator to configure this module.');\n }\n // pick a random item between 0 and the length of both the items and commands arrays\n const randomIndex = Math.floor(Math.random() * (items.length + commands.length));\n const randomOption = items.concat(commands)[randomIndex];\n if (randomIndex < items.length) {\n await takaro.gameserver.gameServerControllerGiveItem(data.gameServerId, data.player.id, {\n name: randomOption,\n amount: 1,\n });\n await data.player.pm(`You received ${randomOption}!`);\n }\n else {\n await takaro.gameserver.gameServerControllerExecuteCommand(data.gameServerId, { command: randomOption });\n }\n}\nawait main();\n//# sourceMappingURL=gimme.js.map",
269
276
  "name": "gimme",
270
277
  "trigger": "gimme",
271
- "helpText": "Randomly selects item from a list of items and entities."
278
+ "helpText": "Randomly selects item from a list of items and entities.",
279
+ "arguments": []
272
280
  }
273
281
  ],
274
282
  "hooks": [],
275
283
  "cronJobs": [],
276
284
  "functions": [],
277
- "permissions": []
285
+ "permissions": [],
286
+ "name": "gimme",
287
+ "description": "Randomly selects an item from a list of items.",
288
+ "configSchema": "{\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"type\":\"object\",\"properties\":{\"items\":{\"x-component\":\"item\",\"type\":\"array\",\"title\":\"Items\",\"description\":\"List of items that a player can receive.\",\"uniqueItems\":true,\"items\":{\"type\":\"string\"}},\"commands\":{\"title\":\"Commands\",\"type\":\"array\",\"default\":[\"say hello from gimme\"],\"items\":{\"type\":\"string\"}}},\"required\":[\"items\"],\"additionalProperties\":false}",
289
+ "uiSchema": "{\"items\":{\"ui:widget\":\"item\"}}"
278
290
  },
279
291
  {
280
- "name": "highPingKicker",
281
- "description": "Automatically kick players with high ping, with warnings and configurable thresholds.",
282
- "configSchema": "{\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"type\":\"object\",\"properties\":{\"pingThreshold\":{\"type\":\"number\",\"title\":\"Ping threshold\",\"description\":\"A ping value that is deemed too high and prompts a warning.\",\"default\":200,\"minimum\":0},\"warningsBeforeKick\":{\"type\":\"number\",\"title\":\"Kick warnings\",\"description\":\"Number of warnings before a player is kicked.\",\"default\":3,\"minimum\":0}},\"required\":[]}",
283
- "uiSchema": "{}",
284
292
  "commands": [],
285
293
  "hooks": [],
286
294
  "cronJobs": [
@@ -291,13 +299,13 @@
291
299
  }
292
300
  ],
293
301
  "functions": [],
294
- "permissions": []
302
+ "permissions": [],
303
+ "name": "highPingKicker",
304
+ "description": "Automatically kick players with high ping, with warnings and configurable thresholds.",
305
+ "configSchema": "{\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"type\":\"object\",\"properties\":{\"pingThreshold\":{\"type\":\"number\",\"title\":\"Ping threshold\",\"description\":\"A ping value that is deemed too high and prompts a warning.\",\"default\":200,\"minimum\":0},\"warningsBeforeKick\":{\"type\":\"number\",\"title\":\"Kick warnings\",\"description\":\"Number of warnings before a player is kicked.\",\"default\":3,\"minimum\":0}},\"required\":[]}",
306
+ "uiSchema": "{}"
295
307
  },
296
308
  {
297
- "name": "economyUtils",
298
- "description": "A set of commands to allow players to manage their currency.",
299
- "configSchema": "{\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"type\":\"object\",\"properties\":{\"pendingAmount\":{\"title\":\"Pending amount\",\"type\":\"number\",\"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.\",\"default\":0}},\"required\":[],\"additionalProperties\":false}",
300
- "uiSchema": "{}",
301
309
  "commands": [
302
310
  {
303
311
  "function": "import { takaro, data } from '@takaro/helpers';\nasync function main() {\n const currencyName = (await takaro.settings.settingsControllerGetOne('currencyName', data.gameServerId)).data.data;\n await data.player.pm(`balance: ${data.pog.currency} ${currencyName.value}`);\n}\nawait main();\n//# sourceMappingURL=balance.js.map",
@@ -323,13 +331,15 @@
323
331
  "name": "receiver",
324
332
  "type": "player",
325
333
  "helpText": "The player to grant currency to.",
326
- "position": 0
334
+ "position": 0,
335
+ "defaultValue": null
327
336
  },
328
337
  {
329
338
  "name": "amount",
330
339
  "type": "number",
331
340
  "helpText": "The amount of money.",
332
- "position": 1
341
+ "position": 1,
342
+ "defaultValue": null
333
343
  }
334
344
  ]
335
345
  },
@@ -343,13 +353,15 @@
343
353
  "name": "receiver",
344
354
  "type": "player",
345
355
  "helpText": "The player to revoke currency from.",
346
- "position": 0
356
+ "position": 0,
357
+ "defaultValue": null
347
358
  },
348
359
  {
349
360
  "name": "amount",
350
361
  "type": "number",
351
362
  "helpText": "The amount of money.",
352
- "position": 1
363
+ "position": 1,
364
+ "defaultValue": null
353
365
  }
354
366
  ]
355
367
  },
@@ -357,10 +369,11 @@
357
369
  "function": "import { takaro, data, TakaroUserError } from '@takaro/helpers';\nasync function main() {\n const { gameServerId, pog: sender, module: mod } = data;\n // try to find a variable with key \"confirmTransfer\"\n const variables = (await takaro.variable.variableControllerSearch({\n filters: {\n key: 'confirmTransfer',\n gameServerId,\n moduleId: mod.moduleId,\n playerId: sender.playerId,\n },\n })).data.data;\n if (variables.length === 0) {\n throw new TakaroUserError('You have no pending transfer.');\n }\n // Remove the variable before potentially executing the transaction.\n await takaro.variable.variableControllerDelete(variables[0].id);\n const pendingTransfer = JSON.parse(variables[0].value);\n await takaro.playerOnGameserver.playerOnGameServerControllerTransactBetweenPlayers(sender.gameServerId, sender.id, pendingTransfer.receiver.id, {\n currency: pendingTransfer.amount,\n });\n const receiverName = (await takaro.player.playerControllerGetOne(pendingTransfer.receiver.playerId)).data.data.name;\n const senderName = (await takaro.player.playerControllerGetOne(sender.playerId)).data.data.name;\n const currencyName = (await takaro.settings.settingsControllerGetOne('currencyName', gameServerId)).data.data.value;\n const messageToSender = sender.pm(`You successfully transferred ${pendingTransfer.amount} ${currencyName} to ${receiverName}`);\n const messageToReceiver = takaro.gameserver.gameServerControllerSendMessage(gameServerId, {\n message: `You received ${pendingTransfer.amount} ${currencyName} from ${senderName}`,\n opts: {\n recipient: {\n gameId: pendingTransfer.receiver.gameId,\n },\n },\n });\n await Promise.all([messageToSender, messageToReceiver]);\n return;\n}\nawait main();\n//# sourceMappingURL=confirmTransfer.js.map",
358
370
  "name": "confirmTransfer",
359
371
  "trigger": "confirmtransfer",
360
- "helpText": "Confirms a pending transfer."
372
+ "helpText": "Confirms a pending transfer.",
373
+ "arguments": []
361
374
  },
362
375
  {
363
- "function": "import { takaro, data, TakaroUserError } from '@takaro/helpers';\nasync function main() {\n const { pog: sender, arguments: args, gameServerId, module: mod } = data;\n const currencyName = (await takaro.settings.settingsControllerGetOne('currencyName', gameServerId)).data.data.value;\n const prefix = (await takaro.settings.settingsControllerGetOne('commandPrefix', gameServerId)).data.data.value;\n // args.receiver has an argument type of \"player\". Arguments of this type are automatically resolved to the player's id.\n // If the player doesn't exist or multiple players with the same name where found, it will have thrown an error before this command is executed.\n const receiver = args.receiver;\n const senderName = (await takaro.player.playerControllerGetOne(sender.playerId)).data.data.name;\n const receiverName = (await takaro.player.playerControllerGetOne(receiver.playerId)).data.data.name;\n if (mod.userConfig.pendingAmount !== 0 && args.amount >= mod.userConfig.pendingAmount) {\n // create a variable to store confirmation requirement\n // TODO: in the future, we should probably add an expiration date to this variable.\n await takaro.variable.variableControllerCreate({\n key: 'confirmTransfer',\n value: JSON.stringify({\n amount: args.amount,\n receiver: {\n id: receiver.id,\n gameId: receiver.gameId,\n playerId: receiver.playerId,\n },\n }),\n moduleId: mod.moduleId,\n playerId: sender.playerId,\n gameServerId,\n });\n // NOTE: we should maybe check if the player has enough balance to send the amount since this is only checked when the transaction is executed.\n await sender.pm(`You are about to send ${args.amount} ${currencyName} to ${receiverName}. (Please confirm by typing ${prefix}confirmtransfer)`);\n return;\n }\n try {\n await takaro.playerOnGameserver.playerOnGameServerControllerTransactBetweenPlayers(sender.gameServerId, sender.id, receiver.id, {\n currency: args.amount,\n });\n }\n catch (e) {\n throw new TakaroUserError(`Failed to transfer ${args.amount} ${currencyName} to ${receiverName}. Are you sure you have enough balance?`);\n }\n const messageToReceiver = takaro.gameserver.gameServerControllerSendMessage(gameServerId, {\n message: `You received ${args.amount} ${currencyName} from ${senderName}`,\n opts: {\n recipient: {\n gameId: receiver.gameId,\n },\n },\n });\n await Promise.all([\n sender.pm(`You successfully transferred ${args.amount} ${currencyName} to ${receiverName}`),\n messageToReceiver,\n ]);\n return;\n}\nawait main();\n//# sourceMappingURL=transfer.js.map",
376
+ "function": "import { takaro, data, TakaroUserError } from '@takaro/helpers';\nasync function main() {\n const { pog: sender, arguments: args, gameServerId, module: mod } = data;\n const currencyName = (await takaro.settings.settingsControllerGetOne('currencyName', gameServerId)).data.data.value;\n const prefix = (await takaro.settings.settingsControllerGetOne('commandPrefix', gameServerId)).data.data.value;\n // args.receiver has an argument type of \"player\". Arguments of this type are automatically resolved to the player's id.\n // If the player doesn't exist or multiple players with the same name where found, it will have thrown an error before this command is executed.\n const receiver = args.receiver;\n const senderName = (await takaro.player.playerControllerGetOne(sender.playerId)).data.data.name;\n const receiverName = (await takaro.player.playerControllerGetOne(receiver.playerId)).data.data.name;\n if (mod.userConfig.pendingAmount !== 0 && args.amount >= mod.userConfig.pendingAmount) {\n // create a variable to store confirmation requirement\n // TODO: in the future, we should probably add an expiration date to this variable.\n await takaro.variable.variableControllerCreate({\n key: 'confirmTransfer',\n value: JSON.stringify({\n amount: args.amount,\n receiver: {\n id: receiver.id,\n gameId: receiver.gameId,\n playerId: receiver.playerId,\n },\n }),\n moduleId: mod.moduleId,\n playerId: sender.playerId,\n gameServerId,\n });\n // NOTE: we should maybe check if the player has enough balance to send the amount since this is only checked when the transaction is executed.\n await sender.pm(`You are about to send ${args.amount} ${currencyName} to ${receiverName}. (Please confirm by typing ${prefix}confirmtransfer)`);\n return;\n }\n try {\n await takaro.playerOnGameserver.playerOnGameServerControllerTransactBetweenPlayers(sender.gameServerId, sender.id, receiver.id, {\n currency: args.amount,\n });\n }\n catch (_e) {\n throw new TakaroUserError(`Failed to transfer ${args.amount} ${currencyName} to ${receiverName}. Are you sure you have enough balance?`);\n }\n const messageToReceiver = takaro.gameserver.gameServerControllerSendMessage(gameServerId, {\n message: `You received ${args.amount} ${currencyName} from ${senderName}`,\n opts: {\n recipient: {\n gameId: receiver.gameId,\n },\n },\n });\n await Promise.all([\n sender.pm(`You successfully transferred ${args.amount} ${currencyName} to ${receiverName}`),\n messageToReceiver,\n ]);\n return;\n}\nawait main();\n//# sourceMappingURL=transfer.js.map",
364
377
  "name": "transfer",
365
378
  "trigger": "transfer",
366
379
  "helpText": "Transfer money to another player.",
@@ -369,13 +382,15 @@
369
382
  "name": "receiver",
370
383
  "type": "player",
371
384
  "helpText": "The player to transfer money to.",
372
- "position": 0
385
+ "position": 0,
386
+ "defaultValue": null
373
387
  },
374
388
  {
375
389
  "name": "amount",
376
390
  "type": "number",
377
391
  "helpText": "The amount of money to transfer.",
378
- "position": 1
392
+ "position": 1,
393
+ "defaultValue": null
379
394
  }
380
395
  ]
381
396
  }
@@ -390,13 +405,13 @@
390
405
  "description": "Allows players to manage currency of other players. This includes granting and revoking currency.",
391
406
  "canHaveCount": false
392
407
  }
393
- ]
408
+ ],
409
+ "name": "economyUtils",
410
+ "description": "A set of commands to allow players to manage their currency.",
411
+ "configSchema": "{\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"type\":\"object\",\"properties\":{\"pendingAmount\":{\"title\":\"Pending amount\",\"type\":\"number\",\"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.\",\"default\":0}},\"required\":[],\"additionalProperties\":false}",
412
+ "uiSchema": "{}"
394
413
  },
395
414
  {
396
- "name": "lottery",
397
- "description": "Players can buy tickets for a lottery, and the winner is chosen at random.",
398
- "configSchema": "{\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"type\":\"object\",\"properties\":{\"profitMargin\":{\"type\":\"number\",\"maximum\":1,\"minimum\":0,\"description\":\"The profit margin the server takes from the lottery.\",\"default\":0.1}},\"required\":[],\"additionalProperties\":false}",
399
- "uiSchema": "{}",
400
415
  "commands": [
401
416
  {
402
417
  "function": "import { takaro, data, checkPermission, TakaroUserError } from '@takaro/helpers';\nasync function main() {\n const { pog, gameServerId, arguments: args, module: mod } = data;\n const varKey = 'lottery_tickets_bought';\n if (!checkPermission(pog, 'LOTTERY_BUY')) {\n throw new TakaroUserError('You do not have permission to buy lottery tickets.');\n }\n if (args.amount < 1) {\n throw new TakaroUserError('You must buy at least 1 ticket.');\n }\n const tickets = (await takaro.variable.variableControllerSearch({\n filters: {\n gameServerId: [gameServerId],\n key: [varKey],\n moduleId: [mod.moduleId],\n playerId: [pog.playerId],\n },\n })).data.data;\n // Player already has some tickets bought\n if (tickets.length > 0) {\n const ticketsBought = tickets[0];\n const ticketsBoughtAmount = parseInt(JSON.parse(ticketsBought.value).amount, 10);\n await takaro.variable.variableControllerUpdate(ticketsBought.id, {\n key: varKey,\n playerId: pog.playerId,\n moduleId: mod.moduleId,\n gameServerId,\n value: JSON.stringify({ amount: ticketsBoughtAmount + args.amount }),\n });\n }\n // Player has no tickets bought\n else {\n await takaro.variable.variableControllerCreate({\n key: varKey,\n value: JSON.stringify({\n amount: args.amount,\n }),\n gameServerId,\n moduleId: mod.moduleId,\n playerId: pog.playerId,\n });\n }\n const ticketPrice = args.amount * mod.systemConfig.commands.buyTicket.cost;\n // The price of the first ticket is deducted by the command execution itself.\n if (args.amount > 1) {\n await takaro.playerOnGameserver.playerOnGameServerControllerDeductCurrency(gameServerId, pog.playerId, {\n currency: ticketPrice - 1,\n });\n }\n const currencyName = (await takaro.settings.settingsControllerGetOne('currencyName', gameServerId)).data.data.value;\n await pog.pm(`You have successfully bought ${args.amount} tickets for ${ticketPrice} ${currencyName}. Good luck!`);\n}\nawait main();\n//# sourceMappingURL=buyTicket.js.map",
@@ -408,7 +423,8 @@
408
423
  "name": "amount",
409
424
  "type": "number",
410
425
  "helpText": "The amount of tickets to buy.",
411
- "position": 0
426
+ "position": 0,
427
+ "defaultValue": null
412
428
  }
413
429
  ]
414
430
  },
@@ -420,7 +436,7 @@
420
436
  "arguments": []
421
437
  },
422
438
  {
423
- "function": "import { nextCronJobRun, data } from '@takaro/helpers';\nfunction formatTimeToReach(cronJob) {\n const targetDate = nextCronJobRun(cronJob);\n // Get the current date and time\n const currentDate = new Date();\n // Calculate the time difference in milliseconds\n const delta = targetDate - currentDate;\n // Calculate days, hours, minutes, and seconds\n const days = Math.floor(delta / (1000 * 60 * 60 * 24));\n const hours = Math.floor((delta % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));\n const minutes = Math.floor((delta % (1000 * 60 * 60)) / (1000 * 60));\n const seconds = Math.floor((delta % (1000 * 60)) / 1000);\n // Build the formatted string\n let formattedString = '';\n if (days > 0) {\n formattedString += `${days} day${days > 1 ? 's' : ''} `;\n }\n if (hours > 0) {\n formattedString += `${hours} hour${hours > 1 ? 's' : ''} `;\n }\n if (minutes > 0) {\n formattedString += `${minutes} minute${minutes > 1 ? 's' : ''} `;\n }\n if (seconds > 0) {\n formattedString += `${seconds} second${seconds > 1 ? 's' : ''} `;\n }\n return formattedString.trim();\n}\nasync function main() {\n const { player, module: mod } = data;\n await player.pm(`The next lottery draw is in about ${formatTimeToReach(mod.systemConfig.cronJobs.drawLottery)}`);\n}\nawait main();\n//# sourceMappingURL=nextDraw.js.map",
439
+ "function": "import { nextCronJobRun, data } from '@takaro/helpers';\nfunction formatTimeToReach(cronJob) {\n const targetDate = nextCronJobRun(cronJob);\n // Get the current date and time\n const currentDate = new Date();\n // Calculate the time difference in milliseconds\n const delta = targetDate - currentDate;\n // Calculate days, hours, minutes, and seconds\n const days = Math.floor(delta / (1000 * 60 * 60 * 24));\n const hours = Math.floor((delta % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));\n const minutes = Math.floor((delta % (1000 * 60 * 60)) / (1000 * 60));\n const seconds = Math.floor((delta % (1000 * 60)) / 1000);\n // Build the formatted string\n let formattedString = '';\n if (days > 0) {\n formattedString += `${days} day${days > 1 ? 's' : ''} `;\n }\n if (hours > 0) {\n formattedString += `${hours} hour${hours > 1 ? 's' : ''} `;\n }\n if (minutes > 0) {\n formattedString += `${minutes} minute${minutes > 1 ? 's' : ''} `;\n }\n if (seconds > 0) {\n formattedString += `${seconds} second${seconds > 1 ? 's' : ''} `;\n }\n return formattedString.trim();\n}\nasync function main() {\n const { player, module: mod } = data;\n await player.pm(`The next lottery draw is in about ${formatTimeToReach(mod.systemConfig.cronJobs.drawLottery.temporalValue)}`);\n}\nawait main();\n//# sourceMappingURL=nextDraw.js.map",
424
440
  "name": "nextDraw",
425
441
  "trigger": "nextDraw",
426
442
  "helpText": "View when the next draw is.",
@@ -449,19 +465,19 @@
449
465
  "description": "Allows the player to view his lottery tickets.",
450
466
  "canHaveCount": false
451
467
  }
452
- ]
468
+ ],
469
+ "name": "lottery",
470
+ "description": "Players can buy tickets for a lottery, and the winner is chosen at random.",
471
+ "configSchema": "{\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"type\":\"object\",\"properties\":{\"profitMargin\":{\"type\":\"number\",\"maximum\":1,\"minimum\":0,\"description\":\"The profit margin the server takes from the lottery.\",\"default\":0.1}},\"required\":[],\"additionalProperties\":false}",
472
+ "uiSchema": "{}"
453
473
  },
454
474
  {
455
- "name": "geoBlock",
456
- "description": "Block players from certain countries from joining the server.",
457
- "configSchema": "{\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"type\":\"object\",\"properties\":{\"mode\":{\"title\":\"Mode\",\"type\":\"string\",\"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.\",\"enum\":[\"allow\",\"deny\"],\"default\":\"deny\"},\"countries\":{\"title\":\"Countries\",\"description\":\"List of country\",\"type\":\"array\",\"uniqueItems\":true,\"x-component\":\"country\",\"items\":{\"type\":\"string\",\"anyOf\":[{\"const\":\"AF\",\"title\":\"Afghanistan\"},{\"const\":\"AX\",\"title\":\"Aland Islands\"},{\"const\":\"AL\",\"title\":\"Albania\"},{\"const\":\"DZ\",\"title\":\"Algeria\"},{\"const\":\"AS\",\"title\":\"American Samoa\"},{\"const\":\"AD\",\"title\":\"Andorra\"},{\"const\":\"AO\",\"title\":\"Angola\"},{\"const\":\"AI\",\"title\":\"Anguilla\"},{\"const\":\"AQ\",\"title\":\"Antarctica\"},{\"const\":\"AG\",\"title\":\"Antigua And Barbuda\"},{\"const\":\"AR\",\"title\":\"Argentina\"},{\"const\":\"AM\",\"title\":\"Armenia\"},{\"const\":\"AW\",\"title\":\"Aruba\"},{\"const\":\"AU\",\"title\":\"Australia\"},{\"const\":\"AT\",\"title\":\"Austria\"},{\"const\":\"AZ\",\"title\":\"Azerbaijan\"},{\"const\":\"BS\",\"title\":\"Bahamas\"},{\"const\":\"BH\",\"title\":\"Bahrain\"},{\"const\":\"BD\",\"title\":\"Bangladesh\"},{\"const\":\"BB\",\"title\":\"Barbados\"},{\"const\":\"BY\",\"title\":\"Belarus\"},{\"const\":\"BE\",\"title\":\"Belgium\"},{\"const\":\"BZ\",\"title\":\"Belize\"},{\"const\":\"BJ\",\"title\":\"Benin\"},{\"const\":\"BM\",\"title\":\"Bermuda\"},{\"const\":\"BT\",\"title\":\"Bhutan\"},{\"const\":\"BO\",\"title\":\"Bolivia\"},{\"const\":\"BA\",\"title\":\"Bosnia And Herzegovina\"},{\"const\":\"BW\",\"title\":\"Botswana\"},{\"const\":\"BV\",\"title\":\"Bouvet Island\"},{\"const\":\"BR\",\"title\":\"Brazil\"},{\"const\":\"IO\",\"title\":\"British Indian Ocean Territory\"},{\"const\":\"BN\",\"title\":\"Brunei Darussalam\"},{\"const\":\"BG\",\"title\":\"Bulgaria\"},{\"const\":\"BF\",\"title\":\"Burkina Faso\"},{\"const\":\"BI\",\"title\":\"Burundi\"},{\"const\":\"KH\",\"title\":\"Cambodia\"},{\"const\":\"CM\",\"title\":\"Cameroon\"},{\"const\":\"CA\",\"title\":\"Canada\"},{\"const\":\"CV\",\"title\":\"Cape Verde\"},{\"const\":\"KY\",\"title\":\"Cayman Islands\"},{\"const\":\"CF\",\"title\":\"Central African Republic\"},{\"const\":\"TD\",\"title\":\"Chad\"},{\"const\":\"CL\",\"title\":\"Chile\"},{\"const\":\"CN\",\"title\":\"China\"},{\"const\":\"CX\",\"title\":\"Christmas Island\"},{\"const\":\"CC\",\"title\":\"Cocos (Keeling) Islands\"},{\"const\":\"CO\",\"title\":\"Colombia\"},{\"const\":\"KM\",\"title\":\"Comoros\"},{\"const\":\"CG\",\"title\":\"Congo\"},{\"const\":\"CD\",\"title\":\"Congo, Democratic Republic\"},{\"const\":\"CK\",\"title\":\"Cook Islands\"},{\"const\":\"CR\",\"title\":\"Costa Rica\"},{\"const\":\"CI\",\"title\":\"Cote D'Ivoire\"},{\"const\":\"HR\",\"title\":\"Croatia\"},{\"const\":\"CU\",\"title\":\"Cuba\"},{\"const\":\"CY\",\"title\":\"Cyprus\"},{\"const\":\"CZ\",\"title\":\"Czech Republic\"},{\"const\":\"DK\",\"title\":\"Denmark\"},{\"const\":\"DJ\",\"title\":\"Djibouti\"},{\"const\":\"DM\",\"title\":\"Dominica\"},{\"const\":\"DO\",\"title\":\"Dominican Republic\"},{\"const\":\"EC\",\"title\":\"Ecuador\"},{\"const\":\"EG\",\"title\":\"Egypt\"},{\"const\":\"SV\",\"title\":\"El Salvador\"},{\"const\":\"GQ\",\"title\":\"Equatorial Guinea\"},{\"const\":\"ER\",\"title\":\"Eritrea\"},{\"const\":\"EE\",\"title\":\"Estonia\"},{\"const\":\"ET\",\"title\":\"Ethiopia\"},{\"const\":\"FK\",\"title\":\"Falkland Islands (Malvinas)\"},{\"const\":\"FO\",\"title\":\"Faroe Islands\"},{\"const\":\"FJ\",\"title\":\"Fiji\"},{\"const\":\"FI\",\"title\":\"Finland\"},{\"const\":\"FR\",\"title\":\"France\"},{\"const\":\"GF\",\"title\":\"French Guiana\"},{\"const\":\"PF\",\"title\":\"French Polynesia\"},{\"const\":\"TF\",\"title\":\"French Southern Territories\"},{\"const\":\"GA\",\"title\":\"Gabon\"},{\"const\":\"GM\",\"title\":\"Gambia\"},{\"const\":\"GE\",\"title\":\"Georgia\"},{\"const\":\"DE\",\"title\":\"Germany\"},{\"const\":\"GH\",\"title\":\"Ghana\"},{\"const\":\"GI\",\"title\":\"Gibraltar\"},{\"const\":\"GR\",\"title\":\"Greece\"},{\"const\":\"GL\",\"title\":\"Greenland\"},{\"const\":\"GD\",\"title\":\"Grenada\"},{\"const\":\"GP\",\"title\":\"Guadeloupe\"},{\"const\":\"GU\",\"title\":\"Guam\"},{\"const\":\"GT\",\"title\":\"Guatemala\"},{\"const\":\"GG\",\"title\":\"Guernsey\"},{\"const\":\"GN\",\"title\":\"Guinea\"},{\"const\":\"GW\",\"title\":\"Guinea-Bissau\"},{\"const\":\"GY\",\"title\":\"Guyana\"},{\"const\":\"HT\",\"title\":\"Haiti\"},{\"const\":\"VA\",\"title\":\"Holy See (Vatican City State)\"},{\"const\":\"HN\",\"title\":\"Honduras\"},{\"const\":\"HK\",\"title\":\"Hong Kong\"},{\"const\":\"HU\",\"title\":\"Hungary\"},{\"const\":\"IS\",\"title\":\"Iceland\"},{\"const\":\"IN\",\"title\":\"India\"},{\"const\":\"ID\",\"title\":\"Indonesia\"},{\"const\":\"IR\",\"title\":\"Iran, Islamic Republic Of\"},{\"const\":\"IQ\",\"title\":\"Iraq\"},{\"const\":\"IE\",\"title\":\"Ireland\"},{\"const\":\"IM\",\"title\":\"Isle Of Man\"},{\"const\":\"IL\",\"title\":\"Israel\"},{\"const\":\"IT\",\"title\":\"Italy\"},{\"const\":\"JM\",\"title\":\"Jamaica\"},{\"const\":\"JP\",\"title\":\"Japan\"},{\"const\":\"JE\",\"title\":\"Jersey\"},{\"const\":\"JO\",\"title\":\"Jordan\"},{\"const\":\"KZ\",\"title\":\"Kazakhstan\"},{\"const\":\"KE\",\"title\":\"Kenya\"},{\"const\":\"KI\",\"title\":\"Kiribati\"},{\"const\":\"KR\",\"title\":\"Korea\"},{\"const\":\"KW\",\"title\":\"Kuwait\"},{\"const\":\"KG\",\"title\":\"Kyrgyzstan\"},{\"const\":\"LA\",\"title\":\"Lao People's Democratic Republic\"},{\"const\":\"LV\",\"title\":\"Latvia\"},{\"const\":\"LB\",\"title\":\"Lebanon\"},{\"const\":\"LS\",\"title\":\"Lesotho\"},{\"const\":\"LR\",\"title\":\"Liberia\"},{\"const\":\"LY\",\"title\":\"Libyan Arab Jamahiriya\"},{\"const\":\"LI\",\"title\":\"Liechtenstein\"},{\"const\":\"LT\",\"title\":\"Lithuania\"},{\"const\":\"LU\",\"title\":\"Luxembourg\"},{\"const\":\"MO\",\"title\":\"Macao\"},{\"const\":\"MK\",\"title\":\"Macedonia\"},{\"const\":\"MG\",\"title\":\"Madagascar\"},{\"const\":\"MW\",\"title\":\"Malawi\"},{\"const\":\"MY\",\"title\":\"Malaysia\"},{\"const\":\"MV\",\"title\":\"Maldives\"},{\"const\":\"ML\",\"title\":\"Mali\"},{\"const\":\"MT\",\"title\":\"Malta\"},{\"const\":\"MH\",\"title\":\"Marshall Islands\"},{\"const\":\"MQ\",\"title\":\"Martinique\"},{\"const\":\"MR\",\"title\":\"Mauritania\"},{\"const\":\"MU\",\"title\":\"Mauritius\"},{\"const\":\"YT\",\"title\":\"Mayotte\"},{\"const\":\"MX\",\"title\":\"Mexico\"},{\"const\":\"FM\",\"title\":\"Micronesia, Federated States Of\"},{\"const\":\"MD\",\"title\":\"Moldova\"},{\"const\":\"MC\",\"title\":\"Monaco\"},{\"const\":\"MN\",\"title\":\"Mongolia\"},{\"const\":\"ME\",\"title\":\"Montenegro\"},{\"const\":\"MS\",\"title\":\"Montserrat\"},{\"const\":\"MA\",\"title\":\"Morocco\"},{\"const\":\"MZ\",\"title\":\"Mozambique\"},{\"const\":\"MM\",\"title\":\"Myanmar\"},{\"const\":\"NA\",\"title\":\"Namibia\"},{\"const\":\"NR\",\"title\":\"Nauru\"},{\"const\":\"NP\",\"title\":\"Nepal\"},{\"const\":\"NL\",\"title\":\"Netherlands\"},{\"const\":\"NC\",\"title\":\"New Caledonia\"},{\"const\":\"NZ\",\"title\":\"New Zealand\"},{\"const\":\"NI\",\"title\":\"Nicaragua\"},{\"const\":\"NE\",\"title\":\"Niger\"},{\"const\":\"NG\",\"title\":\"Nigeria\"},{\"const\":\"NU\",\"title\":\"Niue\"},{\"const\":\"NF\",\"title\":\"Norfolk Island\"},{\"const\":\"MP\",\"title\":\"Northern Mariana Islands\"},{\"const\":\"NO\",\"title\":\"Norway\"},{\"const\":\"OM\",\"title\":\"Oman\"},{\"const\":\"PK\",\"title\":\"Pakistan\"},{\"const\":\"PW\",\"title\":\"Palau\"},{\"const\":\"PS\",\"title\":\"Palestinian Territory, Occupied\"},{\"const\":\"PA\",\"title\":\"Panama\"},{\"const\":\"PG\",\"title\":\"Papua New Guinea\"},{\"const\":\"PY\",\"title\":\"Paraguay\"},{\"const\":\"PE\",\"title\":\"Peru\"},{\"const\":\"PH\",\"title\":\"Philippines\"},{\"const\":\"PN\",\"title\":\"Pitcairn\"},{\"const\":\"PL\",\"title\":\"Poland\"},{\"const\":\"PT\",\"title\":\"Portugal\"},{\"const\":\"PR\",\"title\":\"Puerto Rico\"},{\"const\":\"QA\",\"title\":\"Qatar\"},{\"const\":\"RE\",\"title\":\"Reunion\"},{\"const\":\"RO\",\"title\":\"Romania\"},{\"const\":\"RU\",\"title\":\"Russian Federation\"},{\"const\":\"RW\",\"title\":\"Rwanda\"},{\"const\":\"BL\",\"title\":\"Saint Barthelemy\"},{\"const\":\"SH\",\"title\":\"Saint Helena\"},{\"const\":\"KN\",\"title\":\"Saint Kitts And Nevis\"},{\"const\":\"LC\",\"title\":\"Saint Lucia\"},{\"const\":\"MF\",\"title\":\"Saint Martin\"},{\"const\":\"PM\",\"title\":\"Saint Pierre And Miquelon\"},{\"const\":\"VC\",\"title\":\"Saint Vincent And Grenadines\"},{\"const\":\"WS\",\"title\":\"Samoa\"},{\"const\":\"SM\",\"title\":\"San Marino\"},{\"const\":\"ST\",\"title\":\"Sao Tome And Principe\"},{\"const\":\"SA\",\"title\":\"Saudi Arabia\"},{\"const\":\"SN\",\"title\":\"Senegal\"},{\"const\":\"RS\",\"title\":\"Serbia\"},{\"const\":\"SC\",\"title\":\"Seychelles\"},{\"const\":\"SL\",\"title\":\"Sierra Leone\"},{\"const\":\"SG\",\"title\":\"Singapore\"},{\"const\":\"SK\",\"title\":\"Slovakia\"},{\"const\":\"SI\",\"title\":\"Slovenia\"},{\"const\":\"SB\",\"title\":\"Solomon Islands\"},{\"const\":\"SO\",\"title\":\"Somalia\"},{\"const\":\"ZA\",\"title\":\"South Africa\"},{\"const\":\"ES\",\"title\":\"Spain\"},{\"const\":\"LK\",\"title\":\"Sri Lanka\"},{\"const\":\"SD\",\"title\":\"Sudan\"},{\"const\":\"SR\",\"title\":\"Suriname\"},{\"const\":\"SZ\",\"title\":\"Swaziland\"},{\"const\":\"SE\",\"title\":\"Sweden\"},{\"const\":\"CH\",\"title\":\"Switzerland\"},{\"const\":\"SY\",\"title\":\"Syrian Arab Republic\"},{\"const\":\"TW\",\"title\":\"Taiwan\"},{\"const\":\"TJ\",\"title\":\"Tajikistan\"},{\"const\":\"TZ\",\"title\":\"Tanzania\"},{\"const\":\"TH\",\"title\":\"Thailand\"},{\"const\":\"TL\",\"title\":\"Timor-Leste\"},{\"const\":\"TG\",\"title\":\"Togo\"},{\"const\":\"TK\",\"title\":\"Tokelau\"},{\"const\":\"TO\",\"title\":\"Tonga\"},{\"const\":\"TT\",\"title\":\"Trinidad And Tobago\"},{\"const\":\"TN\",\"title\":\"Tunisia\"},{\"const\":\"TR\",\"title\":\"Turkey\"},{\"const\":\"TM\",\"title\":\"Turkmenistan\"},{\"const\":\"TV\",\"title\":\"Tuvalu\"},{\"const\":\"UG\",\"title\":\"Uganda\"},{\"const\":\"UA\",\"title\":\"Ukraine\"},{\"const\":\"AE\",\"title\":\"United Arab Emirates\"},{\"const\":\"GB\",\"title\":\"United Kingdom\"},{\"const\":\"US\",\"title\":\"United States\"},{\"const\":\"UY\",\"title\":\"Uruguay\"},{\"const\":\"UZ\",\"title\":\"Uzbekistan\"},{\"const\":\"VU\",\"title\":\"Vanuatu\"},{\"const\":\"VE\",\"title\":\"Venezuela\"},{\"const\":\"VN\",\"title\":\"Vietnam\"},{\"const\":\"EH\",\"title\":\"Western Sahara\"},{\"const\":\"YE\",\"title\":\"Yemen\"},{\"const\":\"ZM\",\"title\":\"Zambia\"},{\"const\":\"ZW\",\"title\":\"Zimbabwe\"}]}},\"ban\":{\"title\":\"Ban\",\"description\":\"Ban players from the server when they are detected. When false, players will be kicked instead.\",\"type\":\"boolean\",\"default\":true},\"banDuration\":{\"title\":\"Ban duration\",\"description\":\"Duration of the ban.\",\"x-component\":\"duration\",\"type\":\"number\",\"minimum\":0,\"default\":86400000},\"message\":{\"title\":\"Message\",\"type\":\"string\",\"description\":\"Message to send to the player when they are kicked or banned.\",\"default\":\"Your IP address is banned.\"}},\"required\":[\"countries\"],\"additionalProperties\":false}",
458
- "uiSchema": "{\"banDuration\":{\"ui:widget\":\"duration\"}}",
459
475
  "commands": [],
460
476
  "hooks": [
461
477
  {
462
478
  "eventType": "player-new-ip-detected",
463
479
  "name": "IPDetected",
464
- "function": "import { takaro, data, checkPermission } from '@takaro/helpers';\nasync function main() {\n const { gameServerId, player, pog } = data;\n const { country } = data.eventData;\n const { ban, banDuration, countries, message, mode } = data.module.userConfig;\n async function handleAction() {\n if (ban) {\n const now = new Date();\n const expiresAt = new Date(now.getTime() + banDuration * 1000);\n await takaro.gameserver.gameServerControllerBanPlayer(gameServerId, player.id, {\n reason: message,\n expiresAt,\n });\n }\n else {\n await takaro.gameserver.gameServerControllerKickPlayer(gameServerId, player.id, {\n reason: message,\n });\n }\n }\n const isImmune = checkPermission(pog, 'GEOBLOCK_IMMUNITY');\n if (isImmune) {\n console.log('Player has immunity, no action');\n return;\n }\n if (mode === 'allow') {\n if (countries.includes(country)) {\n console.log('Allowed country detected, no action');\n return;\n }\n else {\n console.log('Blocked country detected, performing actions');\n await handleAction();\n return;\n }\n }\n if (mode === 'deny') {\n if (countries.includes(country)) {\n console.log('Blocked country detected, performing actions');\n await handleAction();\n return;\n }\n else {\n console.log('Allowed country detected, no action');\n return;\n }\n }\n}\nawait main();\n//# sourceMappingURL=IPDetected.js.map"
480
+ "function": "import { takaro, data, checkPermission } from '@takaro/helpers';\nasync function main() {\n const { gameServerId, player, pog } = data;\n const { country } = data.eventData;\n const { ban, banDuration, countries, message, mode } = data.module.userConfig;\n async function handleAction() {\n if (ban) {\n const now = new Date();\n const expiresAt = new Date(now.getTime() + banDuration * 1000);\n await takaro.gameserver.gameServerControllerBanPlayer(gameServerId, player.id, {\n reason: message,\n expiresAt,\n });\n }\n else {\n await takaro.gameserver.gameServerControllerKickPlayer(gameServerId, player.id, {\n reason: message,\n });\n }\n }\n const isImmune = checkPermission(pog, 'GEOBLOCK_IMMUNITY');\n if (isImmune) {\n console.log('Player has immunity, no action');\n return;\n }\n if (mode === 'allow') {\n if (countries.includes(country)) {\n console.log('Allowed country detected, no action');\n return;\n }\n console.log('Blocked country detected, performing actions');\n await handleAction();\n return;\n }\n}\nif (mode === 'deny') {\n if (countries.includes(country)) {\n console.log('Blocked country detected, performing actions');\n await handleAction();\n return;\n }\n else {\n console.log('Allowed country detected, no action');\n return;\n }\n}\nawait main();\n//# sourceMappingURL=IPDetected.js.map"
465
481
  }
466
482
  ],
467
483
  "cronJobs": [],
@@ -473,6 +489,10 @@
473
489
  "description": "Players with this permission will not be kicked or banned by GeoBlock.",
474
490
  "canHaveCount": false
475
491
  }
476
- ]
492
+ ],
493
+ "name": "geoBlock",
494
+ "description": "Block players from certain countries from joining the server.",
495
+ "configSchema": "{\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"type\":\"object\",\"properties\":{\"mode\":{\"title\":\"Mode\",\"type\":\"string\",\"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.\",\"enum\":[\"allow\",\"deny\"],\"default\":\"deny\"},\"countries\":{\"title\":\"Countries\",\"description\":\"List of countries\",\"type\":\"array\",\"uniqueItems\":true,\"x-component\":\"country\",\"items\":{\"type\":\"string\",\"anyOf\":[{\"const\":\"AF\",\"title\":\"Afghanistan\"},{\"const\":\"AX\",\"title\":\"Aland Islands\"},{\"const\":\"AL\",\"title\":\"Albania\"},{\"const\":\"DZ\",\"title\":\"Algeria\"},{\"const\":\"AS\",\"title\":\"American Samoa\"},{\"const\":\"AD\",\"title\":\"Andorra\"},{\"const\":\"AO\",\"title\":\"Angola\"},{\"const\":\"AI\",\"title\":\"Anguilla\"},{\"const\":\"AQ\",\"title\":\"Antarctica\"},{\"const\":\"AG\",\"title\":\"Antigua And Barbuda\"},{\"const\":\"AR\",\"title\":\"Argentina\"},{\"const\":\"AM\",\"title\":\"Armenia\"},{\"const\":\"AW\",\"title\":\"Aruba\"},{\"const\":\"AU\",\"title\":\"Australia\"},{\"const\":\"AT\",\"title\":\"Austria\"},{\"const\":\"AZ\",\"title\":\"Azerbaijan\"},{\"const\":\"BS\",\"title\":\"Bahamas\"},{\"const\":\"BH\",\"title\":\"Bahrain\"},{\"const\":\"BD\",\"title\":\"Bangladesh\"},{\"const\":\"BB\",\"title\":\"Barbados\"},{\"const\":\"BY\",\"title\":\"Belarus\"},{\"const\":\"BE\",\"title\":\"Belgium\"},{\"const\":\"BZ\",\"title\":\"Belize\"},{\"const\":\"BJ\",\"title\":\"Benin\"},{\"const\":\"BM\",\"title\":\"Bermuda\"},{\"const\":\"BT\",\"title\":\"Bhutan\"},{\"const\":\"BO\",\"title\":\"Bolivia\"},{\"const\":\"BA\",\"title\":\"Bosnia And Herzegovina\"},{\"const\":\"BW\",\"title\":\"Botswana\"},{\"const\":\"BV\",\"title\":\"Bouvet Island\"},{\"const\":\"BR\",\"title\":\"Brazil\"},{\"const\":\"IO\",\"title\":\"British Indian Ocean Territory\"},{\"const\":\"BN\",\"title\":\"Brunei Darussalam\"},{\"const\":\"BG\",\"title\":\"Bulgaria\"},{\"const\":\"BF\",\"title\":\"Burkina Faso\"},{\"const\":\"BI\",\"title\":\"Burundi\"},{\"const\":\"KH\",\"title\":\"Cambodia\"},{\"const\":\"CM\",\"title\":\"Cameroon\"},{\"const\":\"CA\",\"title\":\"Canada\"},{\"const\":\"CV\",\"title\":\"Cape Verde\"},{\"const\":\"KY\",\"title\":\"Cayman Islands\"},{\"const\":\"CF\",\"title\":\"Central African Republic\"},{\"const\":\"TD\",\"title\":\"Chad\"},{\"const\":\"CL\",\"title\":\"Chile\"},{\"const\":\"CN\",\"title\":\"China\"},{\"const\":\"CX\",\"title\":\"Christmas Island\"},{\"const\":\"CC\",\"title\":\"Cocos (Keeling) Islands\"},{\"const\":\"CO\",\"title\":\"Colombia\"},{\"const\":\"KM\",\"title\":\"Comoros\"},{\"const\":\"CG\",\"title\":\"Congo\"},{\"const\":\"CD\",\"title\":\"Congo, Democratic Republic\"},{\"const\":\"CK\",\"title\":\"Cook Islands\"},{\"const\":\"CR\",\"title\":\"Costa Rica\"},{\"const\":\"CI\",\"title\":\"Cote D'Ivoire\"},{\"const\":\"HR\",\"title\":\"Croatia\"},{\"const\":\"CU\",\"title\":\"Cuba\"},{\"const\":\"CY\",\"title\":\"Cyprus\"},{\"const\":\"CZ\",\"title\":\"Czech Republic\"},{\"const\":\"DK\",\"title\":\"Denmark\"},{\"const\":\"DJ\",\"title\":\"Djibouti\"},{\"const\":\"DM\",\"title\":\"Dominica\"},{\"const\":\"DO\",\"title\":\"Dominican Republic\"},{\"const\":\"EC\",\"title\":\"Ecuador\"},{\"const\":\"EG\",\"title\":\"Egypt\"},{\"const\":\"SV\",\"title\":\"El Salvador\"},{\"const\":\"GQ\",\"title\":\"Equatorial Guinea\"},{\"const\":\"ER\",\"title\":\"Eritrea\"},{\"const\":\"EE\",\"title\":\"Estonia\"},{\"const\":\"ET\",\"title\":\"Ethiopia\"},{\"const\":\"FK\",\"title\":\"Falkland Islands (Malvinas)\"},{\"const\":\"FO\",\"title\":\"Faroe Islands\"},{\"const\":\"FJ\",\"title\":\"Fiji\"},{\"const\":\"FI\",\"title\":\"Finland\"},{\"const\":\"FR\",\"title\":\"France\"},{\"const\":\"GF\",\"title\":\"French Guiana\"},{\"const\":\"PF\",\"title\":\"French Polynesia\"},{\"const\":\"TF\",\"title\":\"French Southern Territories\"},{\"const\":\"GA\",\"title\":\"Gabon\"},{\"const\":\"GM\",\"title\":\"Gambia\"},{\"const\":\"GE\",\"title\":\"Georgia\"},{\"const\":\"DE\",\"title\":\"Germany\"},{\"const\":\"GH\",\"title\":\"Ghana\"},{\"const\":\"GI\",\"title\":\"Gibraltar\"},{\"const\":\"GR\",\"title\":\"Greece\"},{\"const\":\"GL\",\"title\":\"Greenland\"},{\"const\":\"GD\",\"title\":\"Grenada\"},{\"const\":\"GP\",\"title\":\"Guadeloupe\"},{\"const\":\"GU\",\"title\":\"Guam\"},{\"const\":\"GT\",\"title\":\"Guatemala\"},{\"const\":\"GG\",\"title\":\"Guernsey\"},{\"const\":\"GN\",\"title\":\"Guinea\"},{\"const\":\"GW\",\"title\":\"Guinea-Bissau\"},{\"const\":\"GY\",\"title\":\"Guyana\"},{\"const\":\"HT\",\"title\":\"Haiti\"},{\"const\":\"VA\",\"title\":\"Holy See (Vatican City State)\"},{\"const\":\"HN\",\"title\":\"Honduras\"},{\"const\":\"HK\",\"title\":\"Hong Kong\"},{\"const\":\"HU\",\"title\":\"Hungary\"},{\"const\":\"IS\",\"title\":\"Iceland\"},{\"const\":\"IN\",\"title\":\"India\"},{\"const\":\"ID\",\"title\":\"Indonesia\"},{\"const\":\"IR\",\"title\":\"Iran, Islamic Republic Of\"},{\"const\":\"IQ\",\"title\":\"Iraq\"},{\"const\":\"IE\",\"title\":\"Ireland\"},{\"const\":\"IM\",\"title\":\"Isle Of Man\"},{\"const\":\"IL\",\"title\":\"Israel\"},{\"const\":\"IT\",\"title\":\"Italy\"},{\"const\":\"JM\",\"title\":\"Jamaica\"},{\"const\":\"JP\",\"title\":\"Japan\"},{\"const\":\"JE\",\"title\":\"Jersey\"},{\"const\":\"JO\",\"title\":\"Jordan\"},{\"const\":\"KZ\",\"title\":\"Kazakhstan\"},{\"const\":\"KE\",\"title\":\"Kenya\"},{\"const\":\"KI\",\"title\":\"Kiribati\"},{\"const\":\"KR\",\"title\":\"Korea\"},{\"const\":\"KW\",\"title\":\"Kuwait\"},{\"const\":\"KG\",\"title\":\"Kyrgyzstan\"},{\"const\":\"LA\",\"title\":\"Lao People's Democratic Republic\"},{\"const\":\"LV\",\"title\":\"Latvia\"},{\"const\":\"LB\",\"title\":\"Lebanon\"},{\"const\":\"LS\",\"title\":\"Lesotho\"},{\"const\":\"LR\",\"title\":\"Liberia\"},{\"const\":\"LY\",\"title\":\"Libyan Arab Jamahiriya\"},{\"const\":\"LI\",\"title\":\"Liechtenstein\"},{\"const\":\"LT\",\"title\":\"Lithuania\"},{\"const\":\"LU\",\"title\":\"Luxembourg\"},{\"const\":\"MO\",\"title\":\"Macao\"},{\"const\":\"MK\",\"title\":\"Macedonia\"},{\"const\":\"MG\",\"title\":\"Madagascar\"},{\"const\":\"MW\",\"title\":\"Malawi\"},{\"const\":\"MY\",\"title\":\"Malaysia\"},{\"const\":\"MV\",\"title\":\"Maldives\"},{\"const\":\"ML\",\"title\":\"Mali\"},{\"const\":\"MT\",\"title\":\"Malta\"},{\"const\":\"MH\",\"title\":\"Marshall Islands\"},{\"const\":\"MQ\",\"title\":\"Martinique\"},{\"const\":\"MR\",\"title\":\"Mauritania\"},{\"const\":\"MU\",\"title\":\"Mauritius\"},{\"const\":\"YT\",\"title\":\"Mayotte\"},{\"const\":\"MX\",\"title\":\"Mexico\"},{\"const\":\"FM\",\"title\":\"Micronesia, Federated States Of\"},{\"const\":\"MD\",\"title\":\"Moldova\"},{\"const\":\"MC\",\"title\":\"Monaco\"},{\"const\":\"MN\",\"title\":\"Mongolia\"},{\"const\":\"ME\",\"title\":\"Montenegro\"},{\"const\":\"MS\",\"title\":\"Montserrat\"},{\"const\":\"MA\",\"title\":\"Morocco\"},{\"const\":\"MZ\",\"title\":\"Mozambique\"},{\"const\":\"MM\",\"title\":\"Myanmar\"},{\"const\":\"NA\",\"title\":\"Namibia\"},{\"const\":\"NR\",\"title\":\"Nauru\"},{\"const\":\"NP\",\"title\":\"Nepal\"},{\"const\":\"NL\",\"title\":\"Netherlands\"},{\"const\":\"NC\",\"title\":\"New Caledonia\"},{\"const\":\"NZ\",\"title\":\"New Zealand\"},{\"const\":\"NI\",\"title\":\"Nicaragua\"},{\"const\":\"NE\",\"title\":\"Niger\"},{\"const\":\"NG\",\"title\":\"Nigeria\"},{\"const\":\"NU\",\"title\":\"Niue\"},{\"const\":\"NF\",\"title\":\"Norfolk Island\"},{\"const\":\"MP\",\"title\":\"Northern Mariana Islands\"},{\"const\":\"NO\",\"title\":\"Norway\"},{\"const\":\"OM\",\"title\":\"Oman\"},{\"const\":\"PK\",\"title\":\"Pakistan\"},{\"const\":\"PW\",\"title\":\"Palau\"},{\"const\":\"PS\",\"title\":\"Palestinian Territory, Occupied\"},{\"const\":\"PA\",\"title\":\"Panama\"},{\"const\":\"PG\",\"title\":\"Papua New Guinea\"},{\"const\":\"PY\",\"title\":\"Paraguay\"},{\"const\":\"PE\",\"title\":\"Peru\"},{\"const\":\"PH\",\"title\":\"Philippines\"},{\"const\":\"PN\",\"title\":\"Pitcairn\"},{\"const\":\"PL\",\"title\":\"Poland\"},{\"const\":\"PT\",\"title\":\"Portugal\"},{\"const\":\"PR\",\"title\":\"Puerto Rico\"},{\"const\":\"QA\",\"title\":\"Qatar\"},{\"const\":\"RE\",\"title\":\"Reunion\"},{\"const\":\"RO\",\"title\":\"Romania\"},{\"const\":\"RU\",\"title\":\"Russian Federation\"},{\"const\":\"RW\",\"title\":\"Rwanda\"},{\"const\":\"BL\",\"title\":\"Saint Barthelemy\"},{\"const\":\"SH\",\"title\":\"Saint Helena\"},{\"const\":\"KN\",\"title\":\"Saint Kitts And Nevis\"},{\"const\":\"LC\",\"title\":\"Saint Lucia\"},{\"const\":\"MF\",\"title\":\"Saint Martin\"},{\"const\":\"PM\",\"title\":\"Saint Pierre And Miquelon\"},{\"const\":\"VC\",\"title\":\"Saint Vincent And Grenadines\"},{\"const\":\"WS\",\"title\":\"Samoa\"},{\"const\":\"SM\",\"title\":\"San Marino\"},{\"const\":\"ST\",\"title\":\"Sao Tome And Principe\"},{\"const\":\"SA\",\"title\":\"Saudi Arabia\"},{\"const\":\"SN\",\"title\":\"Senegal\"},{\"const\":\"RS\",\"title\":\"Serbia\"},{\"const\":\"SC\",\"title\":\"Seychelles\"},{\"const\":\"SL\",\"title\":\"Sierra Leone\"},{\"const\":\"SG\",\"title\":\"Singapore\"},{\"const\":\"SK\",\"title\":\"Slovakia\"},{\"const\":\"SI\",\"title\":\"Slovenia\"},{\"const\":\"SB\",\"title\":\"Solomon Islands\"},{\"const\":\"SO\",\"title\":\"Somalia\"},{\"const\":\"ZA\",\"title\":\"South Africa\"},{\"const\":\"ES\",\"title\":\"Spain\"},{\"const\":\"LK\",\"title\":\"Sri Lanka\"},{\"const\":\"SD\",\"title\":\"Sudan\"},{\"const\":\"SR\",\"title\":\"Suriname\"},{\"const\":\"SZ\",\"title\":\"Swaziland\"},{\"const\":\"SE\",\"title\":\"Sweden\"},{\"const\":\"CH\",\"title\":\"Switzerland\"},{\"const\":\"SY\",\"title\":\"Syrian Arab Republic\"},{\"const\":\"TW\",\"title\":\"Taiwan\"},{\"const\":\"TJ\",\"title\":\"Tajikistan\"},{\"const\":\"TZ\",\"title\":\"Tanzania\"},{\"const\":\"TH\",\"title\":\"Thailand\"},{\"const\":\"TL\",\"title\":\"Timor-Leste\"},{\"const\":\"TG\",\"title\":\"Togo\"},{\"const\":\"TK\",\"title\":\"Tokelau\"},{\"const\":\"TO\",\"title\":\"Tonga\"},{\"const\":\"TT\",\"title\":\"Trinidad And Tobago\"},{\"const\":\"TN\",\"title\":\"Tunisia\"},{\"const\":\"TR\",\"title\":\"Turkey\"},{\"const\":\"TM\",\"title\":\"Turkmenistan\"},{\"const\":\"TV\",\"title\":\"Tuvalu\"},{\"const\":\"UG\",\"title\":\"Uganda\"},{\"const\":\"UA\",\"title\":\"Ukraine\"},{\"const\":\"AE\",\"title\":\"United Arab Emirates\"},{\"const\":\"GB\",\"title\":\"United Kingdom\"},{\"const\":\"US\",\"title\":\"United States\"},{\"const\":\"UY\",\"title\":\"Uruguay\"},{\"const\":\"UZ\",\"title\":\"Uzbekistan\"},{\"const\":\"VU\",\"title\":\"Vanuatu\"},{\"const\":\"VE\",\"title\":\"Venezuela\"},{\"const\":\"VN\",\"title\":\"Vietnam\"},{\"const\":\"EH\",\"title\":\"Western Sahara\"},{\"const\":\"YE\",\"title\":\"Yemen\"},{\"const\":\"ZM\",\"title\":\"Zambia\"},{\"const\":\"ZW\",\"title\":\"Zimbabwe\"}]}},\"ban\":{\"title\":\"Ban\",\"description\":\"Ban players from the server when they are detected. When false, players will be kicked instead.\",\"type\":\"boolean\",\"default\":true},\"banDuration\":{\"title\":\"Ban duration\",\"description\":\"Duration of the ban.\",\"x-component\":\"duration\",\"type\":\"number\",\"minimum\":0,\"default\":86400000},\"message\":{\"title\":\"Message\",\"type\":\"string\",\"description\":\"Message to send to the player when they are kicked or banned.\",\"default\":\"Your IP address is banned.\"}},\"required\":[\"countries\"],\"additionalProperties\":false}",
496
+ "uiSchema": "{\"banDuration\":{\"ui:widget\":\"duration\"}}"
477
497
  }
478
498
  ]