-
Notifications
You must be signed in to change notification settings - Fork 5
/
mtasa-meta.schema.json
389 lines (389 loc) · 15 KB
/
mtasa-meta.schema.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "MTASA Meta",
"description": "MTASA Meta file. Extended for mtasa-lua-compiler",
"type": "object",
"properties": {
"info": {
"type": "object",
"description": "General resource information",
"properties": {
"author": {
"type": "string",
"description": "The author of this resource"
},
"version": {
"type": "string",
"description": "The version of this resource"
},
"name": {
"type": "string",
"description": "The name of this resource"
},
"description": {
"type": "string",
"description": "A brief description of this resource"
},
"type": {
"type": "string",
"description": "The type of this resource",
"enum": ["gamemode", "script", "map", "misc"]
},
"gamemodes": {
"type": "array",
"description": "The gamemodes to be compatible with the resource",
"items": {
"type": "string",
"description": "Gamemode name"
}
}
},
"additionalProperties": false,
"required": ["type"]
},
"compilerConfig": {
"type": "object",
"description": "Internal configuration for compiler",
"properties": {
"srcDir": {
"type": "string",
"description": "Directory with resource source files"
},
"outMetaComments": {
"type": "boolean",
"description": "Show comments in the meta.xml file"
},
"outMetaAdditionalProperties": {
"type": "boolean",
"description": "Show additional properties (not included in the default meta.xml) in the meta.xml file"
}
},
"additionalProperties": false,
"required": ["srcDir"]
},
"scripts": {
"type": "array",
"description": "List of scripts",
"items": {
"$ref": "#/definitions/Script"
}
},
"maps": {
"type": "array",
"description": "Map definitions",
"items": {
"$ref": "#/definitions/Map"
}
},
"files": {
"type": "array",
"description": "File definitions",
"items": {
"$ref": "#/definitions/File"
}
},
"includes": {
"type": "array",
"description": "Include definitions",
"items": {
"$ref": "#/definitions/Include"
}
},
"configs": {
"type": "array",
"description": "Config definitions",
"items": {
"$ref": "#/definitions/Config"
}
},
"exports": {
"type": "array",
"description": "Export definitions",
"items": {
"$ref": "#/definitions/Export"
}
},
"htmls": {
"type": "array",
"description": "HTML definitions",
"items": {
"$ref": "#/definitions/Html"
}
},
"settings": {
"type": "array",
"description": "Most gamemodes use settings system to let server admins to configure it how they like. For instance you could set round time and then use get and set to get the value or change it, respectively.",
"items": {
"$ref": "#/definitions/Setting"
}
},
"minMtaVersion": {
"$ref": "#/definitions/MinMtaVersion"
},
"aclRequests": {
"type": "array",
"description": "A list of ACL rights this resource will need. Any user with admin permission can accept or reject a resource ACL request by using the command: /aclrequest [list/allow/deny] <resourceName>",
"items": {
"$ref": "#/definitions/AclRequest"
}
},
"syncMapElementData": {
"type": "boolean",
"description": "Controls whether map element data such as \"PosX\" and \"DoubleSided\" are transferred to the client. This data is usually not required by most gamemodes or resources. (Map Editor and Interiors require this to be not set to false to work). When set in a gamemode meta.xml, the setting will apply to all maps loaded by that resource."
},
"downloadPriorityGroup": {
"type": "number",
"description": "If not set, the download priority group for a resource defaults to 0. If this is set higher than 0, then the resource will be downloaded and started on the client earlier than other resources. This option is useful for resources with critical client functionality that other things in your gamemode (or fair play) rely on. If set to less than 0 (a negative number, like -1), the resource will be downloaded and started on the client later than other resources."
},
"additionalTags": {
"type": "array",
"description": "Put additional XML tags in this list",
"items": {
"$ref": "#/definitions/XMLTagData"
}
}
},
"required": ["info", "compilerConfig"],
"additionalProperties": false,
"definitions": {
"XMLTagData": {
"type": "object",
"description": "XML Tag",
"properties": {
"name": {
"type": "string",
"description": "Tag name"
},
"value": {
"description": "XML Tag value",
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"description": "Inner XML Tags",
"items": {
"$ref": "#/definitions/XMLTagData"
}
}
]
},
"properties": {
"type": "object",
"description": "XML Tag properties",
"additionalProperties": { "type": "string" }
}
},
"additionalProperties": false,
"required": ["name"]
},
"Script": {
"type": "object",
"description": "Source code for this resource",
"properties": {
"src": {
"type": "string",
"description": "TypeScript script file"
},
"type": {
"type": "string",
"description": "The type of source code",
"enum": ["server", "client", "shared"]
},
"cache": {
"type": "boolean",
"description": "When the script file type is \"client\", this setting controls whether the file is saved on the clients' hard drive"
},
"validate": {
"type": "boolean",
"description": "If set to \"false\", compatibility checks are skipped"
},
"bundled": {
"type": "boolean",
"description": "Set to true, if you would like to bundle dependent TS files into a single one"
}
},
"additionalProperties": false,
"required": ["src", "type"]
},
"Map": {
"type": "object",
"description": "The map for a gamemode",
"properties": {
"src": {
"type": "string",
"description": "Must be in the resource source directory"
},
"dimension": {
"type": "number",
"description": "Dimension in which the map will be loaded"
}
},
"additionalProperties": false,
"required": ["src"]
},
"File": {
"type": "object",
"description": "A client-side file. Generally these are images, .txd, .col, .dff or .xml files. They'll be downloaded by clients when the resources is started (or on join",
"properties": {
"src": {
"type": "string",
"description": "Client-side file name (can be path too eg. \"images/image.png\")\n"
},
"download": {
"type": "boolean",
"description": "Whether or not to be sent to the client automatically"
},
"doCompileCheck": {
"type": "boolean",
"description": "Perform file-existence check on compile"
}
},
"additionalProperties": false,
"required": ["src"]
},
"Include": {
"type": "object",
"description": "Include resources that this resource will use",
"properties": {
"resource": {
"type": "string",
"description": "Resource name that you want to start with this resource"
},
"minVersion": {
"type": "string",
"description": "Minimum version that resource needs to be"
},
"maxVersion": {
"type": "string",
"description": "Maximum version that resource needs to be"
}
},
"additionalProperties": false,
"required": ["resource"]
},
"Config": {
"type": "object",
"description": "Config file (.xml) can be accessed by resource",
"properties": {
"src": {
"type": "string",
"description": "The file name of the config file"
},
"type": {
"type": "string",
"description": "The type of the config file",
"enum": ["client", "server"]
}
},
"additionalProperties": false,
"required": ["src", "type"]
},
"Export": {
"type": "object",
"description": "This exports functions from this resource, so other resources can use them with call",
"properties": {
"function": {
"type": "string",
"description": "The function name"
},
"type": {
"type": "string",
"description": "Whether function is exported server-side or client-side",
"enum": ["client", "server", "shared"]
},
"http": {
"type": "boolean",
"description": "Can the function be called via HTTP"
}
},
"additionalProperties": false,
"required": ["function", "type"]
},
"Html": {
"type": "object",
"description": "HTML file",
"properties": {
"src": {
"type": "string",
"description": "The filename for the HTTP file"
},
"default": {
"type": "boolean",
"description": "The html file is one that is shown by default when visiting /resourceName/ on the server. Only one html can be default, the rest are ignored"
},
"raw": {
"type": "boolean",
"description": "The html file is not parsed by the Lua interpreter and is treated as binary data. Must be used for binary files"
}
},
"additionalProperties": false,
"required": ["src", "default", "raw"]
},
"Setting": {
"type": "object",
"description": "Resource settings can be accessed by resource and Admin panel",
"properties": {
"name": {
"type": "string",
"description": "The setting name used by the scripts to get or set the setting value"
},
"value": {
"type": "string",
"description": "The setting default value used by the scripts"
},
"friendlyName": {
"type": "string",
"description": "A friendly name to the setting"
},
"accept": {
"type": "string",
"description": "The values the setting could accept"
},
"examples": {
"type": "string",
"description": "An Example of a value"
},
"desc": {
"type": "string",
"description": "A description of the setting"
}
},
"additionalProperties": false,
"required": ["name", "value"]
},
"MinMtaVersion": {
"type": "object",
"description": "Minimum version requirements for this resource to run correctly. When authoring resources, the minimum version should usually be set to the current released version of MTA:SA",
"properties": {
"client": {
"type": "string",
"description": "The minimum client version"
},
"server": {
"type": "string",
"description": "The minimum server version"
}
},
"additionalProperties": false,
"required": ["client", "server"]
},
"AclRequest": {
"type": "object",
"description": "An individual right",
"properties": {
"name": {
"type": "string",
"description": "The right name"
},
"access": {
"type": "boolean",
"description": "Set to true to allow the resource to access this right. Set to false to deny the access to this right"
}
},
"additionalProperties": false,
"required": ["name", "access"]
}
}
}