DP Crosschat+DiscordBot — Linux
===============================

A Discord bot for ARK: Survival Evolved clusters: live server status,
in-game <-> Discord cross-chat, and player join/leave logs.
Nothing needs to be installed — the bot runs from this folder.

Requires: x86_64 Linux with glibc (Ubuntu, Debian, RHEL, etc. — not
Alpine, not ARM).


INSTALL
-------
1. Extract the folder anywhere you like, e.g.:

     tar xzf DP-Crosschat-Bot-linux.tar.gz -C /opt
     cd /opt/DP-Crosschat-Bot-linux

   The binary is fully self-contained — the control panel UI is built
   into it, so "dpcrosschatbot" can live anywhere on its own.

2. Make sure it is executable (the tarball already sets this):

     chmod +x dpcrosschatbot

3. That's it. There is no installer.


RUN
---
    ./dpcrosschatbot

The log prints to the terminal. The control panel is at:

    http://localhost:8770

The panel binds to 127.0.0.1 only. On a remote/headless server, reach
it through an SSH tunnel from your own machine:

    ssh -L 8770:localhost:8770 user@your-server

...then open http://localhost:8770 in your local browser.


FIRST-TIME SETUP
----------------
The first run walks you through everything step by step — creating the
Discord bot, inviting it, choosing channels, RCON, and your maps. It
checks your token with Discord and can test each map's RCON connection
before anything is saved.

  - Run ./dpcrosschatbot in a terminal and the wizard starts right there.
  - Or open http://localhost:8770 — a fresh install lands on the wizard.
    (Started by systemd, with no terminal attached? The wizard is skipped
    so nothing blocks; use the control panel instead.)

Prefer the plain settings form? Click "Skip to advanced settings", or
open http://localhost:8770/panel directly. Re-run the wizard any time
from "Re-run setup wizard" on the panel.

You will need a Discord bot token, the RCON admin password for your ARK
servers, and each map's RCON port.

Settings are stored in a "config" directory created next to the binary.
Already have a config.json from a previous install? Create config/ next
to the binary and drop the file in BEFORE the first start — the bot
picks it up and starts automatically from then on.


RUN AS A SERVICE (systemd)
--------------------------
With a completed config the bot starts on its own, which makes it a
clean systemd service. Create /etc/systemd/system/dpcrosschatbot.service:

    [Unit]
    Description=DP Crosschat+DiscordBot
    After=network-online.target
    Wants=network-online.target

    [Service]
    WorkingDirectory=/opt/DP-Crosschat-Bot-linux
    ExecStart=/opt/DP-Crosschat-Bot-linux/dpcrosschatbot
    Restart=on-failure
    User=YOUR_USER

    [Install]
    WantedBy=multi-user.target

Then:

    sudo systemctl daemon-reload
    sudo systemctl enable --now dpcrosschatbot
    journalctl -u dpcrosschatbot -f     # follow the log


FIREWALL
--------
- The control panel (port 8770) is reachable from this machine only.
- The plugin bridge listens on port 8765. If the ARK servers run on a
  DIFFERENT machine, allow inbound TCP 8765 (e.g. ufw allow 8765/tcp)
  and use this machine's LAN IP in the plugin's BridgeUrl.


UPDATE / UNINSTALL
------------------
Update:    replace the dpcrosschatbot binary with the new version.
           Keep your config directory.
Uninstall: stop the bot (or disable the service) and delete the folder.
