> For the complete documentation index, see [llms.txt](https://code-after-sex.gitbook.io/script-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://code-after-sex.gitbook.io/script-documentation/cas-advanced-loading-screen/staff-and-report.md).

# Staff and report

config/server.lua of Advanced Loading Screen. Staff on duty with their pictures, the Territory Report metrics, custom metrics and Discord pictures.

`config/server.lua` is server only: nothing in it is sent to players except the finished numbers and names.

## Staff (`ServerConfig.Staff`)

```lua
ServerConfig.Staff = {
    { name = "Hank Dalton", role = "SHERIFF", title = "HEAD ADMIN", rank = 5, since = "1897",
      note = "Keeps the peace since the first season.",
      identifiers = { "steam:110000xxxxxxxxx", "discord:your-discord-user-id" },
      avatar = "" },
}
```

* A staff member counts as **on duty** while any of their `identifiers` is online. The plates list the staff on duty; when nobody is online they list everyone.
* `rank` 1 to 5 fills the hat rating.
* `avatar`: a picture URL or a file in the pack. Empty = their Steam or Discord picture, refreshed in the background every `Config.Avatars.cacheMinutes`.

## Territory Report (`ServerConfig.Report`)

Four groups of four rows at the bottom of the Territory plate:

```lua
{ title = "Riders", icon = "revolver", rows = {
    { label = "Online", metric = "online" },
    { label = "New", metric = "newToday", max = 30 },
} },
```

| Metric         | Shows                                                          |
| -------------- | -------------------------------------------------------------- |
| `online`       | players online of `sv_maxclients`                              |
| `queue`        | `ServerConfig.QueueLength()` (0 unless you connect your queue) |
| `peak`         | most players today                                             |
| `newToday`     | players seen for the first time today                          |
| `uptime`       | time since the resource started                                |
| `resources`    | started resources                                              |
| `restart`      | time to the next `Config.Restarts` entry                       |
| `seasonDay`    | day of `Config.Season`                                         |
| `lawTotal`     | online players with a job in `Config.LawJobs`                  |
| `job:<name>`   | online players with that job (VORP Core or RSG Core)           |
| `custom:<key>` | your function in `ServerConfig.Metrics`                        |
| `static`       | `value` and `fill` written in the row                          |

`max` is the number that fills the bar. `icon`: `revolver`, `star`, `horse`, `train`, `watch`, `lantern`. A group titled `Season` gets your season number added.

Daily counters are kept in the resource's KVP store, so they survive restarts.

## Custom metrics

```lua
ServerConfig.Metrics = {
    bounties = function() return "37", 0.37 end,   -- value (string), fill (0..1)
}
```

Use it as `metric = "custom:bounties"`.

## Discord pictures

```lua
ServerConfig.DiscordBotToken = "..."
Config.Avatars.order = { "discord", "steam" }   -- in config.lua, to prefer Discord
```

The bot does not need to be in your guild to read a user's picture. Keep the token in `server.lua`: that file never reaches players.
