> For the complete documentation index, see [llms.txt](https://augu0107.gitbook.io/auguplugin-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://augu0107.gitbook.io/auguplugin-docs/auguplugin-docs-pt/plugins/webpat/setup.md).

# Configuração

1. Descarregue o site aquie: [Download](https://gitea.com/AuguPlugin/WebPat/src/branch/main/website)
2. Copie o site para a raiz do seu site (certifique-se de que o seu hoster suporta a execução de python)
3. Vá a um terminal e faça "pip install -r requirements.txt"
4. Quando terminar faça "python manage.py makemigrations"
5. Quando terminar faça "python manage.py migrate"
6. Fazer "python manage.py createsuperuser" e crie uma conta
7. Se o seu hoster for como um vps, faça "python manage.py runserver" se em vez disso for algo como o ptero ou outros painéis, basta criar um ficheiro wsgi
8. Aceda ao seu site/admin e faça login
9. Prossiga minecraft servers e clique "add minecraft server" e defina um nome e clique em guardar
10. Aparecerá uma API key (certifique-se de que a copia quando o servidor for guardado e não durante a criação)

{% tabs %}
{% tab title="Configuração" %}
No ficheiro: plugins/WebPat/config.yml encontrará a configuração.

O ficheiro ficará assim:

```
# WebPAT - configuration
# ------------------------------------------------------------
# Base URL of the self-hosted Django site (e.g. https://webpat.augugames.tld)
# Must be reachable OUTBOUND from the Minecraft server (no inbound port needed).
site-url: "https://webpat.augugames.tld"

# Pre-shared API key, generated when you register this server on the Django site.
# Copy it from the site's admin page after creating the "Server" entry.
api-key: "CHANGE-ME"

# How often (in seconds) the plugin checks the site for pending changes.
sync-interval-seconds: 5

# Path to ProAntiTab's storage.yml, relative to the server's /plugins folder.
proantitab-storage-path: "ProAntiTab/storage.yml"

# Console command run after rewriting storage.yml, so ProAntiTab reloads it.
# Leave empty to run nothing.
reload-command: "pat reload"

# Timeout (ms) for HTTP requests to the site.
http-timeout-ms: 4000

# Language used for the plugin's own in-game/console messages.
# Must match a language key inside messages.yml (default: "en").
language: "en"


```

| Opção                   | Uso                                                                                 |
| ----------------------- | ----------------------------------------------------------------------------------- |
| site-url                | O URL do painel                                                                     |
| api-key                 | API key para ligação ao painel                                                      |
| sync-interval-seconds   | O intervalo do plugin para verificar se o painel web atualizou os dados             |
| proantitab-storage-path | O caminho do ficheiro PAT storage.yml                                               |
| reload-command          | O comando que o plugin irá executar quando os dados forem atualizados               |
| http-timeout-ms         | O tempo que o plugin irá esperar antes de dizer que não se consegue ligar ao painel |
| language                | linguagem das mensagens do plugin                                                   |
| {% endtab %}            |                                                                                     |

{% tab title="Mensagens" %}
No ficheiro: plugins/WebPat/config.yml encontrará as mensagens.

O ficheiro ficará assim:

```
# WebPAT - messages
# ------------------------------------------------------------
# Pick which section is used with "language:" in config.yml (default: en).
# You can add more languages by copying a section and translating the values.
# Color codes use "&" (e.g. &c = red, &a = green, &e = yellow, &7 = gray, &6 = gold).
# {placeholder} values are replaced at runtime, keep them as-is.

en:
  no-permission: "&cYou don't have permission for this command."
  usage:
    header: "&6WebPAT:"
    trust: "&e/webpat trust <code>&7 - authorize the browser showing that code"
    sync: "&e/webpat sync&7 - force sending the current state to the site"
    status: "&e/webpat status&7 - show connection status"
    reload: "&e/webpat reload&7 - reload config.yml and messages.yml"
  trust:
    usage: "&cUsage: /webpat trust <code>"
    already-used: "&eThat code has already been used in this play session."
    checking: "&7Checking code..."
    success: "&aDone! The browser that showed that code can now edit groups until the next server restart."
    failure: "&cInvalid or expired code, or the site is unreachable. Reload the panel page and try again."
  sync:
    forcing: "&7Forcing a sync with the web panel..."
    sent: "&aRequest sent. The next sync cycle will apply any pending changes."
  status:
    header: "&6=== WebPAT ==="
    connected: "&aConnected"
    disconnected: "&cUnreachable"
    to-panel: "&7 to the web panel."
    known-version: "&7Known data version: &f{version}"
    confirmed-sessions: "&7Sessions confirmed this play session: &f{count}"
  reload:
    done: "&aConfiguration and messages reloaded."

it:
  no-permission: "&cNon hai il permesso per questo comando."
  usage:
    header: "&6WebPAT:"
    trust: "&e/webpat trust <codice>&7 - autorizza il browser che mostra quel codice"
    sync: "&e/webpat sync&7 - forza l'invio dello stato attuale al sito"
    status: "&e/webpat status&7 - mostra lo stato della connessione"
    reload: "&e/webpat reload&7 - ricarica config.yml e messages.yml"
  trust:
    usage: "&cUso: /webpat trust <codice>"
    already-used: "&eQuel codice è già stato usato in questa sessione di gioco."
    checking: "&7Verifica del codice in corso..."
    success: "&aFatto! Il browser che ha mostrato quel codice ora può modificare i gruppi fino al prossimo riavvio del server."
    failure: "&cCodice non valido, scaduto, o sito non raggiungibile. Ricarica la pagina del pannello e riprova."
  sync:
    forcing: "&7Sincronizzazione forzata con il pannello web..."
    sent: "&aRichiesta inviata. Il prossimo ciclo di sync applicherà eventuali modifiche."
  status:
    header: "&6=== WebPAT ==="
    connected: "&aConnesso"
    disconnected: "&cNon raggiungibile"
    to-panel: "&7 al pannello web."
    known-version: "&7Versione dati conosciuta: &f{version}"
    confirmed-sessions: "&7Sessioni confermate in questa sessione di gioco: &f{count}"
  reload:
    done: "&aConfigurazione e messaggi ricaricati."

```

<table><thead><tr><th>Categoria</th><th width="349.390625">Uso</th></tr></thead><tbody><tr><td>usage</td><td>Dica de utilização de comando</td></tr><tr><td>Trust</td><td>Textos para o comando /webpat trust</td></tr><tr><td>Sync</td><td>Textos para o comando /webpat sync</td></tr><tr><td>Status</td><td>Textos para o comando /webpat status</td></tr><tr><td>Reload</td><td>Textos para o comando /webpat reload</td></tr></tbody></table>
{% endtab %}
{% endtabs %}
