@takaro/modules 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/BuiltinModule.d.ts +49 -0
- package/dist/BuiltinModule.js +194 -0
- package/dist/BuiltinModule.js.map +1 -0
- package/dist/dto/base.d.ts +6 -0
- package/dist/dto/base.js +28 -0
- package/dist/dto/base.js.map +1 -0
- package/dist/dto/discordEvents.d.ts +31 -0
- package/dist/dto/discordEvents.js +92 -0
- package/dist/dto/discordEvents.js.map +1 -0
- package/dist/dto/gameEvents.d.ts +84 -0
- package/dist/dto/gameEvents.js +190 -0
- package/dist/dto/gameEvents.js.map +1 -0
- package/dist/dto/index.d.ts +37 -0
- package/dist/dto/index.js +18 -0
- package/dist/dto/index.js.map +1 -0
- package/dist/dto/takaroEvents.d.ts +150 -0
- package/dist/dto/takaroEvents.js +422 -0
- package/dist/dto/takaroEvents.js.map +1 -0
- package/dist/main.d.ts +4 -0
- package/dist/main.js +31 -0
- package/dist/main.js.map +1 -0
- package/dist/modules/chatBridge/hooks/DiscordToGame.d.ts +1 -0
- package/dist/modules/chatBridge/hooks/DiscordToGame.js +18 -0
- package/dist/modules/chatBridge/hooks/DiscordToGame.js.map +1 -0
- package/dist/modules/chatBridge/hooks/GameToDiscord.d.ts +1 -0
- package/dist/modules/chatBridge/hooks/GameToDiscord.js +14 -0
- package/dist/modules/chatBridge/hooks/GameToDiscord.js.map +1 -0
- package/dist/modules/chatBridge/hooks/PlayerConnected.d.ts +1 -0
- package/dist/modules/chatBridge/hooks/PlayerConnected.js +9 -0
- package/dist/modules/chatBridge/hooks/PlayerConnected.js.map +1 -0
- package/dist/modules/chatBridge/hooks/PlayerDisconnected.d.ts +1 -0
- package/dist/modules/chatBridge/hooks/PlayerDisconnected.js +9 -0
- package/dist/modules/chatBridge/hooks/PlayerDisconnected.js.map +1 -0
- package/dist/modules/chatBridge/index.d.ts +4 -0
- package/dist/modules/chatBridge/index.js +54 -0
- package/dist/modules/chatBridge/index.js.map +1 -0
- package/dist/modules/economyUtils/commands/balance.d.ts +1 -0
- package/dist/modules/economyUtils/commands/balance.js +7 -0
- package/dist/modules/economyUtils/commands/balance.js.map +1 -0
- package/dist/modules/economyUtils/commands/confirmTransfer.d.ts +1 -0
- package/dist/modules/economyUtils/commands/confirmTransfer.js +38 -0
- package/dist/modules/economyUtils/commands/confirmTransfer.js.map +1 -0
- package/dist/modules/economyUtils/commands/grantCurrency.d.ts +1 -0
- package/dist/modules/economyUtils/commands/grantCurrency.js +31 -0
- package/dist/modules/economyUtils/commands/grantCurrency.js.map +1 -0
- package/dist/modules/economyUtils/commands/revokeCurrency.d.ts +1 -0
- package/dist/modules/economyUtils/commands/revokeCurrency.js +31 -0
- package/dist/modules/economyUtils/commands/revokeCurrency.js.map +1 -0
- package/dist/modules/economyUtils/commands/topCurrency.d.ts +1 -0
- package/dist/modules/economyUtils/commands/topCurrency.js +22 -0
- package/dist/modules/economyUtils/commands/topCurrency.js.map +1 -0
- package/dist/modules/economyUtils/commands/transfer.d.ts +1 -0
- package/dist/modules/economyUtils/commands/transfer.js +55 -0
- package/dist/modules/economyUtils/commands/transfer.js.map +1 -0
- package/dist/modules/economyUtils/index.d.ts +4 -0
- package/dist/modules/economyUtils/index.js +117 -0
- package/dist/modules/economyUtils/index.js.map +1 -0
- package/dist/modules/geoBlock/hooks/IPDetected.d.ts +1 -0
- package/dist/modules/geoBlock/hooks/IPDetected.js +50 -0
- package/dist/modules/geoBlock/hooks/IPDetected.js.map +1 -0
- package/dist/modules/geoBlock/index.d.ts +8 -0
- package/dist/modules/geoBlock/index.js +321 -0
- package/dist/modules/geoBlock/index.js.map +1 -0
- package/dist/modules/gimme/commands/gimme.d.ts +1 -0
- package/dist/modules/gimme/commands/gimme.js +23 -0
- package/dist/modules/gimme/commands/gimme.js.map +1 -0
- package/dist/modules/gimme/index.d.ts +4 -0
- package/dist/modules/gimme/index.js +43 -0
- package/dist/modules/gimme/index.js.map +1 -0
- package/dist/modules/highPingKicker/cronJobs/Ping check.d.ts +1 -0
- package/dist/modules/highPingKicker/cronJobs/Ping check.js +54 -0
- package/dist/modules/highPingKicker/cronJobs/Ping check.js.map +1 -0
- package/dist/modules/highPingKicker/index.d.ts +4 -0
- package/dist/modules/highPingKicker/index.js +34 -0
- package/dist/modules/highPingKicker/index.js.map +1 -0
- package/dist/modules/lottery/commands/buyTicket.d.ts +1 -0
- package/dist/modules/lottery/commands/buyTicket.js +54 -0
- package/dist/modules/lottery/commands/buyTicket.js.map +1 -0
- package/dist/modules/lottery/commands/nextDraw.d.ts +1 -0
- package/dist/modules/lottery/commands/nextDraw.js +34 -0
- package/dist/modules/lottery/commands/nextDraw.js.map +1 -0
- package/dist/modules/lottery/commands/viewTickets.d.ts +1 -0
- package/dist/modules/lottery/commands/viewTickets.js +23 -0
- package/dist/modules/lottery/commands/viewTickets.js.map +1 -0
- package/dist/modules/lottery/cronJobs/drawLottery.d.ts +1 -0
- package/dist/modules/lottery/cronJobs/drawLottery.js +96 -0
- package/dist/modules/lottery/cronJobs/drawLottery.js.map +1 -0
- package/dist/modules/lottery/index.d.ts +4 -0
- package/dist/modules/lottery/index.js +73 -0
- package/dist/modules/lottery/index.js.map +1 -0
- package/dist/modules/playerOnboarding/commands/starterkit.d.ts +1 -0
- package/dist/modules/playerOnboarding/commands/starterkit.js +34 -0
- package/dist/modules/playerOnboarding/commands/starterkit.js.map +1 -0
- package/dist/modules/playerOnboarding/hooks/playerConnected.d.ts +1 -0
- package/dist/modules/playerOnboarding/hooks/playerConnected.js +11 -0
- package/dist/modules/playerOnboarding/hooks/playerConnected.js.map +1 -0
- package/dist/modules/playerOnboarding/index.d.ts +4 -0
- package/dist/modules/playerOnboarding/index.js +51 -0
- package/dist/modules/playerOnboarding/index.js.map +1 -0
- package/dist/modules/serverMessages/cronJobs/Automated message.d.ts +1 -0
- package/dist/modules/serverMessages/cronJobs/Automated message.js +9 -0
- package/dist/modules/serverMessages/cronJobs/Automated message.js.map +1 -0
- package/dist/modules/serverMessages/index.d.ts +4 -0
- package/dist/modules/serverMessages/index.js +35 -0
- package/dist/modules/serverMessages/index.js.map +1 -0
- package/dist/modules/teleports/commands/deletetp.d.ts +1 -0
- package/dist/modules/teleports/commands/deletetp.js +20 -0
- package/dist/modules/teleports/commands/deletetp.js.map +1 -0
- package/dist/modules/teleports/commands/deletewaypoint.d.ts +1 -0
- package/dist/modules/teleports/commands/deletewaypoint.js +54 -0
- package/dist/modules/teleports/commands/deletewaypoint.js.map +1 -0
- package/dist/modules/teleports/commands/listwaypoints.d.ts +1 -0
- package/dist/modules/teleports/commands/listwaypoints.js +36 -0
- package/dist/modules/teleports/commands/listwaypoints.js.map +1 -0
- package/dist/modules/teleports/commands/setprivate.d.ts +1 -0
- package/dist/modules/teleports/commands/setprivate.js +31 -0
- package/dist/modules/teleports/commands/setprivate.js.map +1 -0
- package/dist/modules/teleports/commands/setpublic.d.ts +1 -0
- package/dist/modules/teleports/commands/setpublic.js +55 -0
- package/dist/modules/teleports/commands/setpublic.js.map +1 -0
- package/dist/modules/teleports/commands/settp.d.ts +1 -0
- package/dist/modules/teleports/commands/settp.js +42 -0
- package/dist/modules/teleports/commands/settp.js.map +1 -0
- package/dist/modules/teleports/commands/setwaypoint.d.ts +1 -0
- package/dist/modules/teleports/commands/setwaypoint.js +88 -0
- package/dist/modules/teleports/commands/setwaypoint.js.map +1 -0
- package/dist/modules/teleports/commands/teleport.d.ts +1 -0
- package/dist/modules/teleports/commands/teleport.js +74 -0
- package/dist/modules/teleports/commands/teleport.js.map +1 -0
- package/dist/modules/teleports/commands/teleportwaypoint.d.ts +1 -0
- package/dist/modules/teleports/commands/teleportwaypoint.js +50 -0
- package/dist/modules/teleports/commands/teleportwaypoint.js.map +1 -0
- package/dist/modules/teleports/commands/tplist.d.ts +1 -0
- package/dist/modules/teleports/commands/tplist.js +45 -0
- package/dist/modules/teleports/commands/tplist.js.map +1 -0
- package/dist/modules/teleports/functions/utils.d.ts +2 -0
- package/dist/modules/teleports/functions/utils.js +18 -0
- package/dist/modules/teleports/functions/utils.js.map +1 -0
- package/dist/modules/teleports/index.d.ts +4 -0
- package/dist/modules/teleports/index.js +184 -0
- package/dist/modules/teleports/index.js.map +1 -0
- package/dist/modules/utils/commands/help.d.ts +1 -0
- package/dist/modules/utils/commands/help.js +29 -0
- package/dist/modules/utils/commands/help.js.map +1 -0
- package/dist/modules/utils/commands/ping.d.ts +1 -0
- package/dist/modules/utils/commands/ping.js +6 -0
- package/dist/modules/utils/commands/ping.js.map +1 -0
- package/dist/modules/utils/index.d.ts +4 -0
- package/dist/modules/utils/index.js +35 -0
- package/dist/modules/utils/index.js.map +1 -0
- package/dist/modules.json +478 -0
- package/package.json +26 -0
- package/scripts/buildBuiltinJson.ts +14 -0
- package/src/BuiltinModule.ts +125 -0
- package/src/__tests__/aliases.integration.test.ts +54 -0
- package/src/__tests__/builtinmodule.unit.test.ts +13 -0
- package/src/__tests__/commandArgs.integration.test.ts +285 -0
- package/src/__tests__/economyUtils.integration.test.ts +488 -0
- package/src/__tests__/geoblock.integration.test.ts +380 -0
- package/src/__tests__/gimme.integration.test.ts +97 -0
- package/src/__tests__/help.integration.test.ts +133 -0
- package/src/__tests__/lottery.integration.test.ts +332 -0
- package/src/__tests__/modulePermission.integration.test.ts +192 -0
- package/src/__tests__/onboarding.integration.test.ts +123 -0
- package/src/__tests__/ping.integration.test.ts +36 -0
- package/src/__tests__/roleExpiry.integration.test.ts +74 -0
- package/src/__tests__/serverMessages.integration.test.ts +104 -0
- package/src/__tests__/systemConfigCost.integration.test.ts +196 -0
- package/src/__tests__/teleports/listtp.integration.test.ts +115 -0
- package/src/__tests__/teleports/publicteleports.integration.test.ts +350 -0
- package/src/__tests__/teleports/teleport.integration.test.ts +109 -0
- package/src/__tests__/teleports/tpManagement.integration.test.ts +175 -0
- package/src/__tests__/teleports/waypoints.integration.test.ts +613 -0
- package/src/dto/base.ts +13 -0
- package/src/dto/discordEvents.ts +69 -0
- package/src/dto/gameEvents.ts +154 -0
- package/src/dto/index.ts +25 -0
- package/src/dto/takaroEvents.ts +290 -0
- package/src/main.ts +36 -0
- package/src/modules/.eslintrc +5 -0
- package/src/modules/chatBridge/hooks/DiscordToGame.js +18 -0
- package/src/modules/chatBridge/hooks/GameToDiscord.js +18 -0
- package/src/modules/chatBridge/hooks/PlayerConnected.js +11 -0
- package/src/modules/chatBridge/hooks/PlayerDisconnected.js +11 -0
- package/src/modules/chatBridge/index.ts +59 -0
- package/src/modules/economyUtils/commands/balance.js +8 -0
- package/src/modules/economyUtils/commands/confirmTransfer.js +55 -0
- package/src/modules/economyUtils/commands/grantCurrency.js +38 -0
- package/src/modules/economyUtils/commands/revokeCurrency.js +38 -0
- package/src/modules/economyUtils/commands/topCurrency.js +29 -0
- package/src/modules/economyUtils/commands/transfer.js +73 -0
- package/src/modules/economyUtils/index.ts +125 -0
- package/src/modules/geoBlock/hooks/IPDetected.js +52 -0
- package/src/modules/geoBlock/index.ts +331 -0
- package/src/modules/gimme/commands/gimme.js +28 -0
- package/src/modules/gimme/index.ts +49 -0
- package/src/modules/highPingKicker/cronJobs/Ping check.js +66 -0
- package/src/modules/highPingKicker/index.ts +39 -0
- package/src/modules/lottery/commands/buyTicket.js +68 -0
- package/src/modules/lottery/commands/nextDraw.js +45 -0
- package/src/modules/lottery/commands/viewTickets.js +32 -0
- package/src/modules/lottery/cronJobs/drawLottery.js +124 -0
- package/src/modules/lottery/index.ts +80 -0
- package/src/modules/playerOnboarding/commands/starterkit.js +47 -0
- package/src/modules/playerOnboarding/hooks/playerConnected.js +14 -0
- package/src/modules/playerOnboarding/index.ts +58 -0
- package/src/modules/serverMessages/cronJobs/Automated message.js +12 -0
- package/src/modules/serverMessages/index.ts +40 -0
- package/src/modules/teleports/commands/deletetp.js +25 -0
- package/src/modules/teleports/commands/deletewaypoint.js +77 -0
- package/src/modules/teleports/commands/listwaypoints.js +55 -0
- package/src/modules/teleports/commands/setprivate.js +39 -0
- package/src/modules/teleports/commands/setpublic.js +71 -0
- package/src/modules/teleports/commands/settp.js +54 -0
- package/src/modules/teleports/commands/setwaypoint.js +112 -0
- package/src/modules/teleports/commands/teleport.js +93 -0
- package/src/modules/teleports/commands/teleportwaypoint.js +72 -0
- package/src/modules/teleports/commands/tplist.js +61 -0
- package/src/modules/teleports/functions/utils.js +20 -0
- package/src/modules/teleports/index.ts +193 -0
- package/src/modules/utils/commands/help.js +38 -0
- package/src/modules/utils/commands/ping.js +7 -0
- package/src/modules/utils/index.ts +40 -0
- package/tsconfig.build.json +10 -0
- package/tsconfig.json +9 -0
- package/typedoc.json +3 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { IsEnum, IsString, ValidateNested, IsOptional, IsNumber } from 'class-validator';
|
|
11
|
+
import { TakaroDTO } from '@takaro/util';
|
|
12
|
+
import { Type } from 'class-transformer';
|
|
13
|
+
import { BaseEvent } from './base.js';
|
|
14
|
+
export const GameEvents = {
|
|
15
|
+
LOG_LINE: 'log',
|
|
16
|
+
PLAYER_CONNECTED: 'player-connected',
|
|
17
|
+
PLAYER_DISCONNECTED: 'player-disconnected',
|
|
18
|
+
CHAT_MESSAGE: 'chat-message',
|
|
19
|
+
PLAYER_DEATH: 'player-death',
|
|
20
|
+
ENTITY_KILLED: 'entity-killed',
|
|
21
|
+
};
|
|
22
|
+
export class IGamePlayer extends TakaroDTO {
|
|
23
|
+
}
|
|
24
|
+
__decorate([
|
|
25
|
+
IsString(),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], IGamePlayer.prototype, "gameId", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
IsString(),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], IGamePlayer.prototype, "name", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
IsString(),
|
|
34
|
+
IsOptional(),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], IGamePlayer.prototype, "steamId", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
IsString(),
|
|
39
|
+
IsOptional(),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], IGamePlayer.prototype, "epicOnlineServicesId", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
IsString(),
|
|
44
|
+
IsOptional(),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], IGamePlayer.prototype, "xboxLiveId", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
IsString(),
|
|
49
|
+
IsOptional(),
|
|
50
|
+
__metadata("design:type", String)
|
|
51
|
+
], IGamePlayer.prototype, "platformId", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
IsString(),
|
|
54
|
+
IsOptional(),
|
|
55
|
+
__metadata("design:type", String)
|
|
56
|
+
], IGamePlayer.prototype, "ip", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
IsNumber(),
|
|
59
|
+
IsOptional(),
|
|
60
|
+
__metadata("design:type", Number)
|
|
61
|
+
], IGamePlayer.prototype, "ping", void 0);
|
|
62
|
+
export class BaseGameEvent extends BaseEvent {
|
|
63
|
+
}
|
|
64
|
+
__decorate([
|
|
65
|
+
IsEnum(GameEvents),
|
|
66
|
+
__metadata("design:type", Object)
|
|
67
|
+
], BaseGameEvent.prototype, "type", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
IsString(),
|
|
70
|
+
IsOptional(),
|
|
71
|
+
__metadata("design:type", String)
|
|
72
|
+
], BaseGameEvent.prototype, "msg", void 0);
|
|
73
|
+
export class EventLogLine extends BaseGameEvent {
|
|
74
|
+
constructor() {
|
|
75
|
+
super(...arguments);
|
|
76
|
+
this.type = GameEvents.LOG_LINE;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
__decorate([
|
|
80
|
+
IsString(),
|
|
81
|
+
__metadata("design:type", Object)
|
|
82
|
+
], EventLogLine.prototype, "type", void 0);
|
|
83
|
+
export class EventPlayerConnected extends BaseGameEvent {
|
|
84
|
+
constructor() {
|
|
85
|
+
super(...arguments);
|
|
86
|
+
this.type = GameEvents.PLAYER_CONNECTED;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
__decorate([
|
|
90
|
+
ValidateNested(),
|
|
91
|
+
Type(() => IGamePlayer),
|
|
92
|
+
__metadata("design:type", IGamePlayer)
|
|
93
|
+
], EventPlayerConnected.prototype, "player", void 0);
|
|
94
|
+
export class EventPlayerDisconnected extends BaseGameEvent {
|
|
95
|
+
constructor() {
|
|
96
|
+
super(...arguments);
|
|
97
|
+
this.type = GameEvents.PLAYER_DISCONNECTED;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
__decorate([
|
|
101
|
+
ValidateNested(),
|
|
102
|
+
Type(() => IGamePlayer),
|
|
103
|
+
__metadata("design:type", IGamePlayer)
|
|
104
|
+
], EventPlayerDisconnected.prototype, "player", void 0);
|
|
105
|
+
export var ChatChannel;
|
|
106
|
+
(function (ChatChannel) {
|
|
107
|
+
ChatChannel["GLOBAL"] = "global";
|
|
108
|
+
ChatChannel["TEAM"] = "team";
|
|
109
|
+
ChatChannel["WHISPER"] = "whisper";
|
|
110
|
+
})(ChatChannel || (ChatChannel = {}));
|
|
111
|
+
export class EventChatMessage extends BaseGameEvent {
|
|
112
|
+
constructor() {
|
|
113
|
+
super(...arguments);
|
|
114
|
+
this.type = GameEvents.CHAT_MESSAGE;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
__decorate([
|
|
118
|
+
ValidateNested(),
|
|
119
|
+
Type(() => IGamePlayer),
|
|
120
|
+
__metadata("design:type", IGamePlayer)
|
|
121
|
+
], EventChatMessage.prototype, "player", void 0);
|
|
122
|
+
__decorate([
|
|
123
|
+
IsEnum(Object.values(ChatChannel)),
|
|
124
|
+
__metadata("design:type", String)
|
|
125
|
+
], EventChatMessage.prototype, "channel", void 0);
|
|
126
|
+
export class IPosition {
|
|
127
|
+
}
|
|
128
|
+
__decorate([
|
|
129
|
+
IsNumber(),
|
|
130
|
+
__metadata("design:type", Number)
|
|
131
|
+
], IPosition.prototype, "x", void 0);
|
|
132
|
+
__decorate([
|
|
133
|
+
IsNumber(),
|
|
134
|
+
__metadata("design:type", Number)
|
|
135
|
+
], IPosition.prototype, "y", void 0);
|
|
136
|
+
__decorate([
|
|
137
|
+
IsNumber(),
|
|
138
|
+
__metadata("design:type", Number)
|
|
139
|
+
], IPosition.prototype, "z", void 0);
|
|
140
|
+
export class EventPlayerDeath extends BaseGameEvent {
|
|
141
|
+
constructor() {
|
|
142
|
+
super(...arguments);
|
|
143
|
+
this.type = GameEvents.PLAYER_DEATH;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
__decorate([
|
|
147
|
+
ValidateNested(),
|
|
148
|
+
Type(() => IGamePlayer),
|
|
149
|
+
__metadata("design:type", IGamePlayer)
|
|
150
|
+
], EventPlayerDeath.prototype, "player", void 0);
|
|
151
|
+
__decorate([
|
|
152
|
+
IsOptional(),
|
|
153
|
+
ValidateNested(),
|
|
154
|
+
Type(() => IGamePlayer),
|
|
155
|
+
__metadata("design:type", IGamePlayer)
|
|
156
|
+
], EventPlayerDeath.prototype, "attacker", void 0);
|
|
157
|
+
__decorate([
|
|
158
|
+
IsOptional(),
|
|
159
|
+
ValidateNested(),
|
|
160
|
+
Type(() => IPosition),
|
|
161
|
+
__metadata("design:type", IPosition)
|
|
162
|
+
], EventPlayerDeath.prototype, "position", void 0);
|
|
163
|
+
export class EventEntityKilled extends BaseGameEvent {
|
|
164
|
+
constructor() {
|
|
165
|
+
super(...arguments);
|
|
166
|
+
this.type = GameEvents.ENTITY_KILLED;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
__decorate([
|
|
170
|
+
ValidateNested(),
|
|
171
|
+
Type(() => IGamePlayer),
|
|
172
|
+
__metadata("design:type", IGamePlayer)
|
|
173
|
+
], EventEntityKilled.prototype, "player", void 0);
|
|
174
|
+
__decorate([
|
|
175
|
+
IsString(),
|
|
176
|
+
__metadata("design:type", String)
|
|
177
|
+
], EventEntityKilled.prototype, "entity", void 0);
|
|
178
|
+
__decorate([
|
|
179
|
+
IsString(),
|
|
180
|
+
__metadata("design:type", String)
|
|
181
|
+
], EventEntityKilled.prototype, "weapon", void 0);
|
|
182
|
+
export const GameEventsMapping = {
|
|
183
|
+
[GameEvents.PLAYER_CONNECTED]: EventPlayerConnected,
|
|
184
|
+
[GameEvents.PLAYER_DISCONNECTED]: EventPlayerDisconnected,
|
|
185
|
+
[GameEvents.CHAT_MESSAGE]: EventChatMessage,
|
|
186
|
+
[GameEvents.PLAYER_DEATH]: EventPlayerDeath,
|
|
187
|
+
[GameEvents.ENTITY_KILLED]: EventEntityKilled,
|
|
188
|
+
[GameEvents.LOG_LINE]: EventLogLine,
|
|
189
|
+
};
|
|
190
|
+
//# sourceMappingURL=gameEvents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gameEvents.js","sourceRoot":"","sources":["../../src/dto/gameEvents.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACzF,OAAO,EAAE,SAAS,EAAE,MA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U,CAAC,aAAa,CAAC;IAUlC,CAAC;CAAA;AAPC;IAFC,cAAc,EAAE;IAChB,IAAI,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC;8BAChB,WAAW;iDAAC;AAGpB;IADC,QAAQ,EAAE;;iDACI;AAGf;IADC,QAAQ,EAAE;;iDACI;AAGjB,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE,oBAAoB;IACnD,CAAC,UAAU,CAAC,mBAAmB,CAAC,EAAE,uBAAuB;IACzD,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,gBAAgB;IAC3C,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,gBAAgB;IAC3C,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,iBAAiB;IAC7C,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,YAAY;CAC3B,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ValueOf } from 'type-fest';
|
|
2
|
+
import { BaseEvent } from './base.js';
|
|
3
|
+
export * from './discordEvents.js';
|
|
4
|
+
export * from './gameEvents.js';
|
|
5
|
+
export * from './takaroEvents.js';
|
|
6
|
+
export * from './base.js';
|
|
7
|
+
export declare const HookEvents: {
|
|
8
|
+
readonly ROLE_ASSIGNED: "role-assigned";
|
|
9
|
+
readonly ROLE_REMOVED: "role-removed";
|
|
10
|
+
readonly ROLE_CREATED: "role-created";
|
|
11
|
+
readonly ROLE_UPDATED: "role-updated";
|
|
12
|
+
readonly ROLE_DELETED: "role-deleted";
|
|
13
|
+
readonly COMMAND_EXECUTED: "command-executed";
|
|
14
|
+
readonly HOOK_EXECUTED: "hook-executed";
|
|
15
|
+
readonly CRONJOB_EXECUTED: "cronjob-executed";
|
|
16
|
+
readonly CURRENCY_ADDED: "currency-added";
|
|
17
|
+
readonly CURRENCY_DEDUCTED: "currency-deducted";
|
|
18
|
+
readonly SETTINGS_SET: "settings-set";
|
|
19
|
+
readonly PLAYER_NEW_IP_DETECTED: "player-new-ip-detected";
|
|
20
|
+
readonly SERVER_STATUS_CHANGED: "server-status-changed";
|
|
21
|
+
readonly MODULE_CREATED: "module-created";
|
|
22
|
+
readonly MODULE_UPDATED: "module-updated";
|
|
23
|
+
readonly MODULE_DELETED: "module-deleted";
|
|
24
|
+
readonly MODULE_INSTALLED: "module-installed";
|
|
25
|
+
readonly MODULE_UNINSTALLED: "module-uninstalled";
|
|
26
|
+
readonly PLAYER_CREATED: "player-created";
|
|
27
|
+
readonly DISCORD_MESSAGE: "discord-message";
|
|
28
|
+
readonly LOG_LINE: "log";
|
|
29
|
+
readonly PLAYER_CONNECTED: "player-connected";
|
|
30
|
+
readonly PLAYER_DISCONNECTED: "player-disconnected";
|
|
31
|
+
readonly CHAT_MESSAGE: "chat-message";
|
|
32
|
+
readonly PLAYER_DEATH: "player-death";
|
|
33
|
+
readonly ENTITY_KILLED: "entity-killed";
|
|
34
|
+
};
|
|
35
|
+
export declare const EventMapping: Record<EventTypes, typeof BaseEvent<any>>;
|
|
36
|
+
export type EventPayload = ValueOf<(typeof EventMapping)[ValueOf<typeof HookEvents>]>;
|
|
37
|
+
export type EventTypes = ValueOf<typeof HookEvents>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DiscordEvents, DiscordEventsMapping } from './discordEvents.js';
|
|
2
|
+
import { GameEvents, GameEventsMapping } from './gameEvents.js';
|
|
3
|
+
import { TakaroEvents, TakaroEventsMapping } from './takaroEvents.js';
|
|
4
|
+
export * from './discordEvents.js';
|
|
5
|
+
export * from './gameEvents.js';
|
|
6
|
+
export * from './takaroEvents.js';
|
|
7
|
+
export * from './base.js';
|
|
8
|
+
export const HookEvents = {
|
|
9
|
+
...GameEvents,
|
|
10
|
+
...DiscordEvents,
|
|
11
|
+
...TakaroEvents,
|
|
12
|
+
};
|
|
13
|
+
export const EventMapping = {
|
|
14
|
+
...GameEventsMapping,
|
|
15
|
+
...DiscordEventsMapping,
|
|
16
|
+
...TakaroEventsMapping,
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dto/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAItE,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAE1B,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,GAAG,UAAU;IACb,GAAG,aAAa;IAChB,GAAG,YAAY;CACP,CAAC;AAEX,MAAM,CAAC,MAAM,YAAY,GAA8C;IACrE,GAAG,iBAAiB;IACpB,GAAG,oBAAoB;IACvB,GAAG,mBAAmB;CACd,CAAC"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { BaseEvent } from './base.js';
|
|
2
|
+
import { ValueOf } from 'type-fest';
|
|
3
|
+
import { TakaroDTO } from '@takaro/util';
|
|
4
|
+
export declare const TakaroEvents: {
|
|
5
|
+
readonly ROLE_ASSIGNED: "role-assigned";
|
|
6
|
+
readonly ROLE_REMOVED: "role-removed";
|
|
7
|
+
readonly ROLE_CREATED: "role-created";
|
|
8
|
+
readonly ROLE_UPDATED: "role-updated";
|
|
9
|
+
readonly ROLE_DELETED: "role-deleted";
|
|
10
|
+
readonly COMMAND_EXECUTED: "command-executed";
|
|
11
|
+
readonly HOOK_EXECUTED: "hook-executed";
|
|
12
|
+
readonly CRONJOB_EXECUTED: "cronjob-executed";
|
|
13
|
+
readonly CURRENCY_ADDED: "currency-added";
|
|
14
|
+
readonly CURRENCY_DEDUCTED: "currency-deducted";
|
|
15
|
+
readonly SETTINGS_SET: "settings-set";
|
|
16
|
+
readonly PLAYER_NEW_IP_DETECTED: "player-new-ip-detected";
|
|
17
|
+
readonly SERVER_STATUS_CHANGED: "server-status-changed";
|
|
18
|
+
readonly MODULE_CREATED: "module-created";
|
|
19
|
+
readonly MODULE_UPDATED: "module-updated";
|
|
20
|
+
readonly MODULE_DELETED: "module-deleted";
|
|
21
|
+
readonly MODULE_INSTALLED: "module-installed";
|
|
22
|
+
readonly MODULE_UNINSTALLED: "module-uninstalled";
|
|
23
|
+
readonly PLAYER_CREATED: "player-created";
|
|
24
|
+
};
|
|
25
|
+
export declare class BaseTakaroEvent<T> extends BaseEvent<T> {
|
|
26
|
+
type: ValueOf<typeof TakaroEvents>;
|
|
27
|
+
msg: string;
|
|
28
|
+
}
|
|
29
|
+
export declare class TakaroEventPlayerNewIpDetected extends BaseEvent<TakaroEventPlayerNewIpDetected> {
|
|
30
|
+
type: "player-new-ip-detected";
|
|
31
|
+
country: string;
|
|
32
|
+
city: string;
|
|
33
|
+
longitude: string;
|
|
34
|
+
latitude: string;
|
|
35
|
+
ip: string;
|
|
36
|
+
}
|
|
37
|
+
export declare class TakaroEventCurrencyDeducted extends BaseEvent<TakaroEventCurrencyDeducted> {
|
|
38
|
+
type: "currency-deducted";
|
|
39
|
+
amount: number;
|
|
40
|
+
}
|
|
41
|
+
export declare class TakaroEventCurrencyAdded extends BaseEvent<TakaroEventCurrencyAdded> {
|
|
42
|
+
type: "currency-added";
|
|
43
|
+
amount: number;
|
|
44
|
+
}
|
|
45
|
+
export declare class TakaroEventFunctionResult extends TakaroDTO<TakaroEventFunctionResult> {
|
|
46
|
+
logs: TakaroEventFunctionLog[];
|
|
47
|
+
success: boolean;
|
|
48
|
+
reason: string;
|
|
49
|
+
tryAgainIn: number;
|
|
50
|
+
}
|
|
51
|
+
export declare class TakaroEventFunctionLog extends TakaroDTO<TakaroEventFunctionLog> {
|
|
52
|
+
msg: string;
|
|
53
|
+
details: Record<string, unknown> | string | undefined;
|
|
54
|
+
}
|
|
55
|
+
export declare class TakaroEventCommandDetails extends TakaroDTO<TakaroEventCommandDetails> {
|
|
56
|
+
id: string;
|
|
57
|
+
name: string;
|
|
58
|
+
arguments: Record<string, unknown>;
|
|
59
|
+
}
|
|
60
|
+
export declare class TakaroEventCommandExecuted extends BaseEvent<TakaroEventCommandExecuted> {
|
|
61
|
+
type: "command-executed";
|
|
62
|
+
data: Record<string, unknown>;
|
|
63
|
+
result: TakaroEventFunctionResult;
|
|
64
|
+
command: TakaroEventCommandDetails;
|
|
65
|
+
}
|
|
66
|
+
export declare class TakaroEventHookExecuted extends BaseEvent<TakaroEventHookExecuted> {
|
|
67
|
+
type: "hook-executed";
|
|
68
|
+
data: Record<string, unknown>;
|
|
69
|
+
result: TakaroEventFunctionResult;
|
|
70
|
+
}
|
|
71
|
+
export declare class TakaroEventCronjobExecuted extends BaseEvent<TakaroEventCronjobExecuted> {
|
|
72
|
+
type: "cronjob-executed";
|
|
73
|
+
data: Record<string, unknown>;
|
|
74
|
+
result: TakaroEventFunctionResult;
|
|
75
|
+
}
|
|
76
|
+
export declare class TakaroEventRoleMeta extends TakaroDTO<TakaroEventRoleMeta> {
|
|
77
|
+
id: string;
|
|
78
|
+
name: string;
|
|
79
|
+
}
|
|
80
|
+
export declare class TakaroEventRoleAssigned extends BaseEvent<TakaroEventRoleAssigned> {
|
|
81
|
+
type: "role-assigned";
|
|
82
|
+
role: TakaroEventRoleMeta;
|
|
83
|
+
}
|
|
84
|
+
export declare class TakaroEventRoleRemoved extends BaseEvent<TakaroEventRoleRemoved> {
|
|
85
|
+
type: "role-removed";
|
|
86
|
+
role: TakaroEventRoleMeta;
|
|
87
|
+
}
|
|
88
|
+
export declare class TakaroEventRoleCreated extends BaseEvent<TakaroEventRoleCreated> {
|
|
89
|
+
type: "role-created";
|
|
90
|
+
role: TakaroEventRoleMeta;
|
|
91
|
+
}
|
|
92
|
+
export declare class TakaroEventRoleUpdated extends BaseEvent<TakaroEventRoleUpdated> {
|
|
93
|
+
type: "role-updated";
|
|
94
|
+
role: TakaroEventRoleMeta;
|
|
95
|
+
}
|
|
96
|
+
export declare class TakaroEventRoleDeleted extends BaseEvent<TakaroEventRoleDeleted> {
|
|
97
|
+
type: "role-deleted";
|
|
98
|
+
role: TakaroEventRoleMeta;
|
|
99
|
+
}
|
|
100
|
+
export declare class TakaroEventSettingsSet extends BaseEvent<TakaroEventSettingsSet> {
|
|
101
|
+
type: "settings-set";
|
|
102
|
+
key: string;
|
|
103
|
+
value: string | null;
|
|
104
|
+
}
|
|
105
|
+
export declare class TakaroEventServerStatusChanged extends BaseEvent<TakaroEventServerStatusChanged> {
|
|
106
|
+
type: "server-status-changed";
|
|
107
|
+
status: string;
|
|
108
|
+
details?: Record<string, unknown> | string | null;
|
|
109
|
+
}
|
|
110
|
+
export declare class TakaroEventModuleCreated extends BaseEvent<TakaroEventModuleCreated> {
|
|
111
|
+
type: "module-created";
|
|
112
|
+
}
|
|
113
|
+
export declare class TakaroEventModuleUpdated extends BaseEvent<TakaroEventModuleUpdated> {
|
|
114
|
+
type: "module-updated";
|
|
115
|
+
}
|
|
116
|
+
export declare class TakaroEventModuleDeleted extends BaseEvent<TakaroEventModuleDeleted> {
|
|
117
|
+
type: "module-deleted";
|
|
118
|
+
}
|
|
119
|
+
export declare class TakaroEventModuleInstalled extends BaseEvent<TakaroEventModuleInstalled> {
|
|
120
|
+
type: "module-installed";
|
|
121
|
+
userConfig: string;
|
|
122
|
+
systemConfig: string;
|
|
123
|
+
}
|
|
124
|
+
export declare class TakaroEventModuleUninstalled extends BaseEvent<TakaroEventModuleUninstalled> {
|
|
125
|
+
type: "module-uninstalled";
|
|
126
|
+
}
|
|
127
|
+
export declare class TakaroEventPlayerCreated extends BaseEvent<TakaroEventPlayerCreated> {
|
|
128
|
+
type: "player-created";
|
|
129
|
+
}
|
|
130
|
+
export declare const TakaroEventsMapping: {
|
|
131
|
+
readonly "role-assigned": typeof TakaroEventRoleAssigned;
|
|
132
|
+
readonly "player-new-ip-detected": typeof TakaroEventPlayerNewIpDetected;
|
|
133
|
+
readonly "currency-deducted": typeof TakaroEventCurrencyDeducted;
|
|
134
|
+
readonly "currency-added": typeof TakaroEventCurrencyAdded;
|
|
135
|
+
readonly "command-executed": typeof TakaroEventCommandExecuted;
|
|
136
|
+
readonly "role-removed": typeof TakaroEventRoleRemoved;
|
|
137
|
+
readonly "role-created": typeof TakaroEventRoleCreated;
|
|
138
|
+
readonly "role-updated": typeof TakaroEventRoleUpdated;
|
|
139
|
+
readonly "role-deleted": typeof TakaroEventRoleDeleted;
|
|
140
|
+
readonly "settings-set": typeof TakaroEventSettingsSet;
|
|
141
|
+
readonly "hook-executed": typeof TakaroEventHookExecuted;
|
|
142
|
+
readonly "cronjob-executed": typeof TakaroEventCronjobExecuted;
|
|
143
|
+
readonly "server-status-changed": typeof TakaroEventServerStatusChanged;
|
|
144
|
+
readonly "module-created": typeof TakaroEventModuleCreated;
|
|
145
|
+
readonly "module-updated": typeof TakaroEventModuleUpdated;
|
|
146
|
+
readonly "module-deleted": typeof TakaroEventModuleDeleted;
|
|
147
|
+
readonly "module-installed": typeof TakaroEventModuleInstalled;
|
|
148
|
+
readonly "module-uninstalled": typeof TakaroEventModuleUninstalled;
|
|
149
|
+
readonly "player-created": typeof TakaroEventPlayerCreated;
|
|
150
|
+
};
|