# Shade

The anonymous network: handles, channels, DMs, rooms and listings, installed from an SD card or bought from the Stranger.

## What Shade is

**Shade** is an anonymous network on the phone: public channels, direct messages, private rooms and a listings board, all under a random handle such as `ash-wolf-41`. Messages and listings delete themselves.

- Nothing a player sees links a handle to a number, a character or a Nova Account. [Subscriber records](#/docs/wd_phone/subscriber-records) never read Shade.
- Shade moves no money. Deals are agreed in DMs and paid for some other way.
- It needs no SIM: Wi-Fi works, otherwise it uses a little mobile data.

Shade is **not in Nova Store**. It comes installed on Wolfden Phone Secure, and every other phone gets it from a Shade SD card; see [Getting Shade](#getting-shade).

## Handles

Each phone gets its own handle the first time Shade opens. In the `~id` tab, the player can take a new one once an hour. The old handle goes dark: its DMs stop and its listings come down, and nobody can link the two.

Erasing or burning a phone also retires its handle. Blocks, rooms and bans stay with the phone, whatever handle it uses.

## Channels and DMs

- **Channels.** Four public channels are built in: `lobby`, `market`, `intel` and `jobs`. Each handle can also open one channel of its own, up to 30 across the server. A channel nobody writes in for 72 hours closes.
- **Mentions.** `@handle` in a message notifies that handle's phone.
- **DMs.** Players message a handle by tapping it in a channel or a listing, or by typing it.
- **Blocking.** A blocked handle cannot DM the player, and its channel messages and listings are hidden.
- **Self-destructing.** Channel messages and DMs delete themselves after 4 hours.

## Listings

The listings board holds anonymous ads: a title, a price written as text (such as "2k" or "trade"), details and an optional photo from the phone's Gallery. **DM** opens a conversation with the seller's handle. Each handle can have five listings up, and each comes down after 48 hours.

Photos need a [media host](#/docs/wd_phone/media).

## Rooms

Rooms are group chats listed nowhere public, in the `&room` tab. A phone can own two rooms and belong to ten, its own included. Rooms have no member limit.

| Room | How players get in |
| --- | --- |
| **Private** | With the invite code (`shade://r/XXXX-XXXX`) the owner shares. The owner can rotate the code, and old codes stop working |
| **Hidden** | With the exact room name and its passphrase (at least 8 characters). The passphrase is never shown again. The owner can change it, and members stay in |

The owner can kick members, choose a shorter message lifetime (15 minutes, 1 hour or 4 hours) and **burn** the room, which deletes every message, member and key. A room with no message for 72 hours closes.

The owner can also lock a room down further in its settings:

- **Keys.** The owner cuts a **Shade Key** item (`shade_key`) for 250. Anyone carrying it gets into the room without the code. **Revoke every key** makes all existing keys useless. With **burn on key loss**, members who came in with a key drop out once it leaves their inventory.
- **Dead drop.** The room only opens near a spot the owner sets where they stand, within a radius they pick from 5 to 50 metres. Elsewhere it shows as out of range.
- **Crew.** The owner ties the room to their current job or gang. Whoever holds that job or gang right now gets in, and anyone who leaves it is out.

Membership belongs to the phone, not the handle: taking a new handle keeps the player's rooms, and members are listed by their current handle only. Erasing a phone drops its memberships and closes the rooms it owns.

Wrong codes, names or passphrases always get the same answer. Five misses in ten minutes stop that phone and character joining rooms for 15 minutes, doubling with every lockout in a row, up to a day.

## Getting Shade

Using a **Shade SD card** (`shade_sdcard`, shown as "Unmarked SD Card") installs Shade on the phone the player has open, or the last one they opened. The phone must be carried, switched on and not in lost mode. The card is used up after a short progress bar. Players can uninstall Shade like any app, but need another card to reinstall it.

There are three ways to get a card:

1. **Buy one** from the black-market dealer; see [The Stranger](#the-stranger).
2. **Copy one.** Any phone with Shade, Wolfden Phone Secure included, can write the installer onto a blank **SD Card** (`sd_card`) the player carries. Phone stores sell blank cards in their Storage tab. In Shade, open the `~id` tab, then **sd card writer**. The write takes 25 seconds: moving away, dying or putting the phone away cancels it, and the blank card is left untouched. Each phone and each character can write one card every 30 minutes.
3. **From an admin** with `phoneadmin givecard <serverId> shade [count]`, or `blank` for blank cards; see [Admin tools](#/docs/wd_phone/admin).

Add `sd_card`, `shade_sdcard` and `shade_key` to your inventory from the item files in `migrations/`; see [Installation](#/docs/wd_phone/installation).

## The Stranger

The **Stranger** is a black-market dealer who sells only **Shade SD cards** (2500) and **Racing USBs** (1500), the item that opens underground races in the [Racing](#/docs/wd_phone/racing) app.

- **Cash only, one at a time.** Each character can buy once every two hours.
- **Limited stock.** He has 6 Shade cards and 8 Racing USBs until the next restart.
- **Night only.** He appears between 22:00 and 05:00 game time, with no blip. Players walk up to him and choose **Talk to the stranger**, through ox_target or an **[E]** prompt.
- **A new spot every day.** He stands at one of six spots across the map, picked again each morning at 06:00 server time. The spot stays the same all day and across restarts, and players cannot work it out from the config. They can still pass it on once found.

The dealer's hours are checked by players' games. To have the server enforce them on every sale too, give it the game hour with `serverHour` in `config/mobile_shops_server.lua`. The file's comments show examples for common time-sync resources.

Change his prices, stock, cooldown, hours and spots in the `black_market` store in `config/mobile_shops_server.lua`. Put your changes in a file under `config/local/server/`, which is never sent to players, so they cannot read his spots. Other phone stores sell Shade cards or Racing USBs only if you mark them `contraband = true`.

## Moderation

Give your staff the Shade moderator permission in `server.cfg`:

```cfg
add_ace group.admin wd_phone.shade.moderate allow
```

Moderators see extra controls in the app. They can delete a message or listing, close a player channel or a room, ban a handle for 24 hours, or ban it permanently and purge its messages, and lift bans from the `~id` tab. A ban covers the phone and the character, so a new handle does not escape it. Moderators see private rooms, but not hidden ones, unless you set `rooms.moderatorsSeeHidden = true`.

Staff resources can do the same with the `ShadeBanHandle`, `ShadeUnbanHandle` and `ShadeDeleteMessage` exports; see [Exports & integrations](#/docs/wd_phone/exports).

## Configure Shade

Edit `Config.Shade` in `config/shade.lua`:

| Setting | Default | What it does |
| --- | --- | --- |
| `enabled` | `true` | Turns Shade on or off |
| `access.item` | `nil` | An item players must carry to reach Shade, such as a VPN dongle you define yourself |
| `access.secureOnly` | `false` | Only Wolfden Phone Secure phones can connect |
| `install.item` | `shade_sdcard` | The card that installs Shade |
| `install.consume` | `true` | Whether installing uses the card up |
| `install.copy.enabled` | `true` | Show the SD card writer |
| `install.copy.seconds` | `25` | How long writing a card takes |
| `install.copy.cooldownMinutes` | `30` | Time between copies, per phone and per character |
| `install.copy.price` | `0` | Cost of writing a card; `0` is free |
| `messageTtlMinutes` | `240` | When channel messages and DMs delete themselves |
| `listingTtlHours` | `48` | When listings come down |
| `rotateCooldownMinutes` | `60` | How often a phone can take a new handle |
| `channels` | `lobby`, `market`, `intel`, `jobs` | The built-in public channels |
| `userChannels` | One per handle, 30 in all | Channels players open themselves |
| `rooms.maxOwnedPerIdentity` / `maxJoinedPerIdentity` | `2` / `10` | Rooms one phone can own and belong to |
| `rooms.key.price` | `250` | Cost of cutting a Shade Key; `0` is free |
| `listings.maxPerHandle` | `5` | Listings one handle can have up |

Moderators skip the `access` checks. Turn off parts of rooms with `rooms.key.enabled`, `rooms.deadDrop.enabled` and `rooms.crews.enabled`. Mobile data use is `shadeRead` and `shadeWrite` in `Config.MobileData.usage`.
