> For the complete documentation index, see [llms.txt](https://ghiaccioscripts.gitbook.io/ghiaccioscripts-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ghiaccioscripts.gitbook.io/ghiaccioscripts-docs/it/weapons-editor/configuration.md).

# Configurazione

L'editor ha due file di configurazione modificabili:

| File                | Inviato ai client  | Usalo per                                                        |
| ------------------- | ------------------ | ---------------------------------------------------------------- |
| `config.lua`        | **Sì** (condiviso) | Lingua, comando, permessi, storage, limiti. **Mai segreti qui.** |
| `config_server.lua` | No (solo server)   | Segreti, come l'URL del webhook Discord.                         |

{% hint style="warning" %}
`config.lua` viene scaricato da ogni client, quindi tutto ciò che contiene è leggibile da qualunque giocatore. Metti il webhook in `config_server.lua` o nel convar `gwe_webhook`.
{% endhint %}

## Generale

| Opzione            | Default          | Significato                                                                                                                                                                |
| ------------------ | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Config.Locale`    | `'it'`           | Lingua: `'it'` o `'en'`.                                                                                                                                                   |
| `Config.Framework` | `'auto'`         | `'auto'`, `'esx'`, `'qbcore'`, `'qbox'` o `'standalone'`. Vedi [Installazione](https://ghiaccioscripts.gitbook.io/ghiaccioscripts-docs/it/weapons-editor/installation.md). |
| `Config.Command`   | `'weaponeditor'` | Comando che apre l'editor (`/weaponeditor`). `/<comando>_close` è l'uscita di emergenza.                                                                                   |
| `Config.Keybind`   | `false`          | Tasto opzionale, es. `'F10'`. `false` = nessun tasto.                                                                                                                      |
| `Config.Debug`     | `false`          | Modalità debug.                                                                                                                                                            |

## Permessi

I permessi ACE sono sempre attivi (vedi [Comandi e permessi](https://ghiaccioscripts.gitbook.io/ghiaccioscripts-docs/it/weapons-editor/commands-and-permissions.md)). Queste opzioni aggiungono fonti opzionali:

| Opzione                        | Default                   | Significato                                                                                                                                                         |
| ------------------------------ | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Config.Permissions.acePrefix` | `'ghiaccio_weaponeditor'` | Prefisso dei permessi ACE (`<prefisso>.admin`, `.hot`, `.edit`, `.use`).                                                                                            |
| `Config.Permissions.groups`    | `{}`                      | Gruppo del framework -> livello, es. `{ admin = 'admin', god = 'admin' }`. ESX: `xPlayer.getGroup()`; QBCore: `HasPermission`; Qbox/standalone: ACE `group.<nome>`. |
| `Config.Permissions.jobs`      | `{}`                      | Job -> `{ minGrade, level }`, es. `{ armaiolo = { minGrade = 3, level = 'edit' } }`. I job possono dare al massimo `edit` (solo campi LIVE), mai `hot` o `admin`.   |
| `Config.AllowedLicenses`       | `{}`                      | **Deprecato (v1).** License con accesso admin. Usa invece `add_ace identifier.license:... ghiaccio_weaponeditor.admin allow`.                                       |

## Dati di riferimento

| Opzione                 | Default                             | Significato                                                                                                                                                                                                                                                                              |
| ----------------------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Config.Reference`      | `{ owner = false, vanilla = true }` | `vanilla` = meta vanilla di GTA V inclusi (tutte le armi a mano, DLC incluse). `owner` = pack di meta Ghiaccio Weapons, **non incluso nella versione in vendita: lasciare `false`**. Le risorse di armi avviate sul server vengono sempre scansionate e hanno la precedenza su entrambi. |
| `Config.ExtraMetaFiles` | `{}`                                | Se le risorse di armi usano glob e il server non può elencare le cartelle (`io.popen` non disponibile), indica a mano i file: `{ ['my_weapons'] = { 'metas/weapons.meta', ... } }`.                                                                                                      |
| `Config.ExtraWeapons`   | `{}`                                | Armi extra non presenti nei dati: `{ name = 'WEAPON_XXX', label = 'Nome', category = 'pistol' }`. Solo campi LIVE.                                                                                                                                                                       |

## Patch e reload a caldo

| Opzione                      | Default                         | Significato                                                                                                                                                                                                                                                                                                                  |
| ---------------------------- | ------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Config.HotReload`           | `false`                         | **Sperimentale, non funzionante su build 3258** (secondo `/wepeditor_selftest`). Lasciare `false`: i valori HOT vengono scritti nella patch (o in `generated/`) e valgono al prossimo ingresso o riavvio. `true` = dopo `HotDebounceMs` la risorsa patch viene riavviata e i client connessi ricaricano senza riconnettersi. |
| `Config.HotDebounceMs`       | `3000`                          | Attesa (ms) prima del riavvio della patch con `HotReload = true`.                                                                                                                                                                                                                                                            |
| `Config.PatchResource`       | `'ghiaccio_weaponeditor_patch'` | Nome della risorsa patch.                                                                                                                                                                                                                                                                                                    |
| `Config.PatchFile`           | `'weapons_gwe.meta'`            | File patch delle armi.                                                                                                                                                                                                                                                                                                       |
| `Config.PatchComponentsFile` | `'weaponcomponents_gwe.meta'`   | File patch degli accessori.                                                                                                                                                                                                                                                                                                  |

{% hint style="info" %}
In ogni caso servono `add_filesystem_permission ghiaccio_weaponeditor write ghiaccio_weaponeditor_patch` e `ensure ghiaccio_weaponeditor_patch` **dopo** tutte le altre risorse di armi. Con `HotReload` spento la UI non mostra "Applica e ricarica" e tutti i campi HOT sono etichettati "prossimo ingresso o riavvio".
{% endhint %}

## Persistenza

| Opzione             | Default  | Significato                                                                          |
| ------------------- | -------- | ------------------------------------------------------------------------------------ |
| `Config.Storage`    | `'json'` | `'json'` (file in `data/`) o `'oxmysql'` (tabella `gwe_kv`, creata automaticamente). |
| `Config.Backups`    | `20`     | Backup a rotazione di `overrides.json`.                                              |
| `Config.HistoryMax` | `500`    | Istantanee conservate nella cronologia.                                              |

## Limiti e rate limit

| Opzione                             | Default                         | Significato                                           |
| ----------------------------------- | ------------------------------- | ----------------------------------------------------- |
| `Config.Limits.maxImportBytes`      | `262144`                        | Dimensione massima di un import (256 KB).             |
| `Config.Limits.maxPresetName`       | `48`                            | Lunghezza massima del nome di un preset.              |
| `Config.Limits.maxBatchWeapons`     | `64`                            | Armi massime in un'operazione multipla.               |
| `Config.Limits.maxCompare`          | `4`                             | Armi massime nel confronto.                           |
| `Config.Limits.maxPresets`          | `100`                           | Preset salvati in totale.                             |
| `Config.Limits.maxPresetsPerAuthor` | `20`                            | Preset per autore (gli admin non hanno questo tetto). |
| `Config.RateLimit`                  | `{ burst = 12, perSecond = 4 }` | Token bucket per giocatore sulle richieste al server. |
| `Config.KillHealth`                 | `120`                           | Riferimento UI per "colpi per uccidere".              |

## Log

| Opzione                | Default                         | Significato                                                                                                                                                                       |
| ---------------------- | ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Config.Webhook`       | `''`                            | **Deprecato qui.** Se valorizzato viene ancora usato, ma all'avvio compare un avviso, perché `config.lua` arriva ai client. Usa `ServerConfig.Webhook` o il convar `gwe_webhook`. |
| `Config.LogRejections` | `true`                          | Registra anche i rifiuti (validazione, permessi, rate limit) in `data/logs/rejects_AAAA-MM.log`.                                                                                  |
| `Config.VersionCheck`  | `{ enabled = false, url = '' }` | Controllo versione (stub): non fa richieste finché non è configurato.                                                                                                             |

## config\_server.lua

| Opzione                | Default | Significato                                                                              |
| ---------------------- | ------- | ---------------------------------------------------------------------------------------- |
| `ServerConfig.Webhook` | `''`    | URL del webhook Discord per l'audit (vuoto = disattivo). Throttle di 2 s tra i messaggi. |

In alternativa, nel `server.cfg` (il convar ha la precedenza):

```cfg
set gwe_webhook "https://discord.com/api/webhooks/..."
```

## Lingue

I testi (nomi dei campi, tooltip, errori, messaggi, nomi dei preset) sono in `locales/it.lua` e `locales/en.lua`, entrambi modificabili. Ogni chiave deve esistere in entrambi i file.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://ghiaccioscripts.gitbook.io/ghiaccioscripts-docs/it/weapons-editor/configuration.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
