====================================================
  SHAGGY'S ASM
  A local desktop app for running an ARK server
====================================================

WHAT THIS IS
------------
A normal Windows program for starting, stopping and configuring an
ARK: Survival Evolved dedicated server.

It is completely offline. There is no browser, no web page, no web
server and no internet connection at any point. Everything runs on
this computer, out of this folder. Nothing is uploaded anywhere.

The only network connection it ever makes is the RCON admin
connection to your own ARK server, which is how ARK admin commands
work and is normally to 127.0.0.1 on your own machine.


INSTALLING
----------
1. Install Python 3 from https://python.org if you don't have it.
   Tick "Add Python to PATH" during setup.

2. Double-click INSTALL.bat in this folder.

3. An icon called "Shaggy's ASM" appears on your
   Desktop and in the Start Menu. That's it.

INSTALL.bat does not copy or move anything. The app runs from this
folder, so keep the folder where it is (or move the whole folder and
re-run INSTALL.bat).


FIRST LAUNCH
------------
Open the app, go to the Settings tab and fill in:

  Server root folder  - the folder that CONTAINS "ShooterGame".
                        For example  E:\MyArkServer
  Admin password      - your ServerAdminPassword. This is also the
                        RCON password, so nothing on the RCON tab or
                        the shutdown countdown works without it.
  Server name, map, ports, max players - as you want them.

Press Save. Nothing touches your server until you do.

If you were given a "server_files" folder alongside this one, it
holds the INI sources and merge script from the original setup. Put
them wherever you like, then set "Work folder" on the Settings tab to
point at them.


RUNNING MORE THAN ONE SERVER
----------------------------
The row of buttons under the header is your server switcher - Island 1,
Island 2 and so on. Click one and every tab below reloads for that
server. Whichever one is highlighted green is the one the buttons act
on, so Start, Stop, Merge and RCON only ever touch that server.

The servers are kept completely apart on purpose:

  - each has its OWN INI files, in its own folder
  - each has its OWN copy of merge_inis.py
  - each has its OWN ARK install and its own world save
  - each has its own ports, mods and countdown messages

So breaking something on the test server cannot reach the main one.

To add one, go to the Servers tab:

1. Pick the server you want to copy and press "Clone selected into a
   new server". Every setting comes across - rates, mods, drops,
   messages - and it is given fresh ports automatically.

2. A second server needs its own ARK install, because two servers
   sharing one folder would overwrite each other's config and world
   save. If you don't have one, use "Copy an ARK install" at the
   bottom of the tab. It copies about 20 GB and skips the Saved
   folder, so the new server starts on a fresh world.

   Do this while nobody is playing - it hammers the disk and can lag
   a live server.

3. Switch to the new server and check its Settings tab.

The Servers tab warns you in red if two servers ever end up sharing a
folder or a port. Each one needs its own game port, query port AND
RCON port - if two shared an RCON port, a shutdown or an admin command
meant for the test server could land on the live one.

Because each server has its own copy of merge_inis.py, a fix you make
to one does not reach the others. When you have fixed something and
want them all to have it, select that server and press "Push merge
script to the others".

A LAN test server needs no port forwarding. Other machines in your
house reach it on this PC's local IP and the game port shown in the
list. The "LAN / test server" tick is only a label to remind you.


THE TABS
--------
Dashboard        Start / Stop / Restart, a live activity log, and who
                 is online right now. Also has the quick message box:
                 type a line, press Enter or "Send to screen", and it
                 appears big across everyone's view. "Send to chat"
                 puts it in the chat box instead. To message one person,
                 click their name under Players Online first, then
                 "Send to selected player only".

Start / Stop     The shutdown countdown. One message per minute, so
                 players get a warning before the server goes down.
                 Only the minutes inside your chosen countdown are
                 sent. Blank minutes stay quiet.

                 Underneath is "STOP NOW (no countdown)", which is also
                 on the Dashboard next to the normal Stop. It skips
                 every warning and takes the server down immediately -
                 handy for shutting a test server at the end of the
                 night without sitting through three minutes.

                 It still saves the world first, so nothing is lost by
                 using it. If anyone is online it names them in the
                 confirmation before you commit, since they get no
                 warning and will just drop out. Like every other
                 button here it only ever touches the server selected
                 at the top.

Game.ini         Edit your Game.ini source file.
GameUserSettings Edit your GameUserSettings source file.

Drops            Every supply crate override, listed and searchable,
                 plus the raw file to edit.

Mods             Your mod load order. Shows whether each mod is
                 actually downloaded. Order matters - the list is
                 sent top to bottom.

Live Files       The INI files the server really reads on boot. Use
                 these to confirm a setting actually landed.

RCON             An admin console, with a list of common commands and
                 a plain-English note on what each one does.

Players & Chat   Two sub-tabs.

                 "Player history" is a permanent list of everyone who
                 has ever played, with their Steam ID, their Steam
                 name, their character name, when they first joined
                 and when they were last on. Green means online right
                 now. It fills itself in two ways: whoever is online is
                 recorded every few seconds while the app is open, and
                 "Read ARK's profile files" reads the .arkprofile files
                 the game keeps forever - which covers players from
                 before you had this app and any time the app was shut.
                 Press that button once and you have your back
                 catalogue. "Mins watched" only counts time the app was
                 open, so treat it as a minimum, not real playtime.

                 "Timed announcements" are messages that send
                 themselves, either at a set time every day or every so
                 many minutes. Good for events - "Boss fight at 8pm at
                 Green Ob". Each one can also fire an extra RCON
                 command, for something like a special dino spawn.

                 They can NEVER stop or restart the server. doexit,
                 shutdown and the like are refused when you save the
                 entry and refused again before it fires. Announcements
                 only run while the app is open, and "Send it now"
                 lets you test one before trusting it.

Backups          Copies of the world kept on a DIFFERENT drive.

                 ARK already keeps its own: the live Ragnarok.ark, a
                 dated Ragnarok_<date>_<time>.ark every couple of hours,
                 a Ragnarok_AntiCorruptionBackup.bak if it spots a save
                 going bad, a Ragnarok_NewLaunchBackup.bak each start,
                 and one previous version of every player and tribe.
                 The problem is they all live in the same folder on the
                 same drive as the live save, so one dead disk takes the
                 lot. Note their filenames are in UTC, not your clock.

                 This tab copies whole sets to a backups folder you
                 choose - the world, every player, every tribe and both
                 INI files - every hour, keeping the newest 48. Safe to
                 do while the server runs; it asks the server to save
                 first, which is the same harmless save it already does
                 every 15 minutes, and it never stops anything.

                 Each set is checked before AND after copying, so a
                 damaged save is never quietly backed up over your good
                 ones, and a bad copy is reported instead of trusted.

                 To roll back, stop the server yourself, then pick a set
                 and press Restore. It REFUSES while the server is
                 running and will never stop it for you. Your current
                 save is moved aside to Saved\_before_restore_<time>
                 rather than deleted, so a restore can be undone, and
                 ARK's own dated backups are left alone as a second
                 fallback.

                 Automatic backups only run while this app is open.

Plugins          Two sub-tabs.

                 "All plugins" lists every ArkApi plugin on the
                 selected server and lets you edit any of its config
                 files. The real config.json is always first in the
                 list; the *commented* / *help* copies are reference
                 only and the plugin never reads them.

                 Saving a config does NOT apply it - press "Reload
                 plugin". Plugins with their own reload command use it;
                 the rest are unloaded and loaded again. Either way the
                 server is not restarted and nobody is kicked. JSON is
                 checked before saving, because a plugin with a broken
                 config.json just silently fails to load.

                 "Shop points & kits" shows everyone in ArkShop's
                 database with their points and how many of each kit
                 they have left. You can set or add points, zero one
                 player's points or everyone's, and reset kits either
                 one kit at a time, all kits for one player, or all
                 kits for everyone. A reset puts a kit back to the
                 DefaultAmount in ArkShop's config.json.

Settings         Server name, map, ports, passwords, folders and the
                 exact launch command. All for the selected server.

Servers          Add, clone and remove servers, and copy an ARK
                 install so a second one can run.

Share / Backup   Makes a standalone copy of this app for someone
                 else, optionally with your settings baked in.
                 Passwords are always stripped from a copy.


HOW EDITS REACH THE SERVER
--------------------------
The source INI files are not what the server reads. The flow is:

    your edits  ->  Merge  ->  live INI files  ->  server reads
                                                   them on boot

So after editing, press Merge, then restart the server. By default
the merge runs automatically every time you press Start, so usually
you can just edit and restart.

Every save takes a timestamped backup into the "backups" folder
first, keeping the 60 most recent.


NOTES ON THE SHOP
-----------------
Points are changed through the plugin over RCON, so the server has to
be running and anyone online is updated immediately. Note that this
build of ArkShop wants the STEAM ID FIRST:

    SetPoints <steamid> <amount>
    AddPoints <steamid> <amount>

The order quoted in most guides (amount first) is rejected.

Kit resets are a direct edit to ArkShop's database, because the plugin
has no command for resetting one player. Its own ResetPoints and
ResetKits only work from the server console, do everybody at once, and
do nothing at all over RCON. The database is backed up before every
change.

If a player is online when you reset their kits, ArkShop is holding
their counts in memory and they may need to rejoin before it shows up.
The app tells you when that applies.

Points and kits are per server, and so are plugin configs - they live
inside each server's own ARK install, so editing the test server never
touches the live one.


IMPORTANT
---------
The manager never restarts your server on its own. There is no
scheduler and no auto-restart. The server only stops when you press
a button and confirm.

Closing the app window does NOT stop the game server.


FILES IN THIS FOLDER
--------------------
ASM.pyw        the app entry point
ark_gui.py            the window and all the tabs
ark_core.py           the logic - config, process control, RCON, merge
ark_rcon.py           the RCON client
make_icon.py          builds the app icon
INSTALL.bat           creates the desktop and Start Menu shortcuts
UNINSTALL.bat         removes those shortcuts only
manager_config.json   settings for every server you have set up
servers/              one folder per extra server, holding its own
                      INI files and its own copy of merge_inis.py
backups/              automatic backups of every file you save
manager_log.txt       a plain text log of what the manager did
_probe_settings.py    checks a setting name against the server .exe,
                      to prove an INI setting is real before using it
