# 👥 Alt Protection

## Alt Protection

Alt Protection counts the accounts connecting from the same address and kicks the ones over `max-accounts-per-address`. Only the accounts online at that moment are counted, unless `count-offline-accounts` is turned on, which counts every account ever seen on that address instead.

This feature is part of the proxy plugin, so it needs PhoenixLobby installed on your BungeeCord or Velocity.

Players with `phoenixlobby.alts.bypass` are never limited, administrators with `phoenixlobby.alts.notify` are told when a player is kicked or joins next to another account, and `phoenixlobby.alts` is needed to use the command.

Addresses in `whitelisted-addresses` are never limited, which is what a shared connection such as a school or an internet cafe needs. Players in `exempt-players` are skipped as well, by name or by uuid.

### Commands

| Command                               | Description                                                   |
| ------------------------------------- | ------------------------------------------------------------- |
| `/alts <player>`                      | Lists the accounts linked to a player                         |
| `/alts ip <player/address>`           | Shows the addresses of a player, or who used an address       |
| `/alts info <player>`                 | Shows a summary of a player                                   |
| `/alts geo <player/address>`          | Shows where an address is located                             |
| `/alts remove <player> <address/all>` | Unlinks an address from a player                              |
| `/alts reload`                        | Reloads the alt account settings                              |

### History

Every address a player connects from is remembered, so the commands still answer for players that are offline. An address is forgotten once it has not been seen for `retention-days`. Turning the history off leaves only the players who are online right now.

### Geolocation

`/alts geo` shows the country, region, city and internet provider of an address. The lookup is done with a free service by default. You can point `api-url` to any service that answers with the same fields, and `%ip%` is replaced with the address. The result is kept for `cache-minutes` so the same address is not looked up again.

<details>

<summary>Alt Protection config.yml</summary>

```yaml
alts:
  enabled: false
  max-accounts-per-address: 2
  count-offline-accounts: false
  bypass-permission: phoenixlobby.alts.bypass
  whitelisted-addresses: []
  exempt-players: []
  history:
    enabled: true
    retention-days: 90
    save-interval-seconds: 300
  alerts:
    enabled: true
    on-blocked: true
    on-join: true
  geolocation:
    enabled: true
    api-url: 'http://ip-api.com/json/%ip%?fields=status,message,country,regionName,city,isp'
    cache-minutes: 720
    timeout-millis: 3000
```

</details>

> **Info:**
The addresses are saved in the **alt-history.json** file of the proxy, so they survive a restart.

Source: https://www.phoenixplugins.com/docs/phoenix-lobby/featues/alt-protection