Motor Town Admin Commands and Web API Guide

From Survival Servers
Jump to navigation Jump to search

Admin control on a Motor Town: Behind The Wheel dedicated server works differently from most survival games. Instead of a long list of chat commands, Motor Town gives admins an in-game admin menu, a police role system, and a full HTTP Web API on the server. It handles kicks, bans, announcements, roles, and live server data.

Making a player an admin

Admins are defined in the server's DedicatedServerConfig.json under the Admins list. Each entry pairs a UniqueNetId with a Nickname. For Steam players, the UniqueNetId is the SteamID64, your 17-digit Steam ID (look yours up at steamid.io). Add the player, restart the server, and when they rejoin they have access to the in-game admin tools. The bAllowAdminToRemoveAdmin setting controls whether admins can demote each other (off by default).

On a Survival Servers server, this is a field in Server Config: put the SteamID64s in Admin Steam IDs and click Save Configuration with Save & Restart selected.

The official ReadMe also gives a way to find non-Steam IDs: open the server from your game, add the admin in game, then read the new entry from GameUserSettings.ini in %LOCALAPPDATA%\MotorTown\Saved\Config\Windows.

The police role

Motor Town has a dedicated police role for RP servers. PoliceRolePlayers in the config lists the players (same UniqueNetId + Nickname shape as Admins), and bAllowPoliceVehicleByPlayerRole controls whether police vehicles are restricted to that role. Set it to true and only listed officers can drive them. Leave it false and anyone can.

The Web API: the server's real command console

The dedicated server can run an HTTP API with everything a community admin needs, with no one in the game. Turn it on in DedicatedServerConfig.json:

  • bEnableHostWebAPIServer: true
  • HostWebAPIServerPassword: a strong password. Every call needs it.
  • HostWebAPIServerPort: default 8080
  • HostWebAPIDisabledCommands: optional list of endpoints to switch off

Every call passes the password as a parameter and returns JSON with data, message, and succeeded fields. Example:

curl "http://127.0.0.1:8080/player/count?password=yourpassword"

Security note: the password is sent as plain text in the address, so don't open the API port to the internet. Call it from the server machine itself (or a trusted network) and keep the port closed in the firewall.

Endpoint reference

Endpoint Method What it does
/chat POST Send a server-wide announcement, or a chat message with type=message and an optional color (hex like FF00FF)
/player/count GET Current player count
/player/list GET Every online player with name, unique_id, world location, and current vehicle
/player/kick POST Kick by unique_id (from /player/list)
/player/ban POST Ban by unique_id, optional hours (permanent if omitted) and reason
/player/unban POST Lift a ban by unique_id
/player/banlist GET Current ban list
/player/role/list GET List admin or police roster (role=admin or role=police)
/player/role/add POST Grant admin or police to a unique_id
/player/role/remove POST Revoke admin or police from a unique_id
/delivery/sites GET Live delivery and cargo state across the island's job sites
/housing/list GET Housing plots with owner and rental expiry
/version GET The server's game version, handy for checking that the game and server versions match

Doing all of this without curl

On a Survival Servers server, the Command Center's Live Map uses this same Web API. It shows the drivers on the road, companies, island trade and town bonuses. Admins kick, ban and announce in the game, and the admin and police lists are fields in Server Config. The dedicated server setup guide covers getting a server running. The mods guide covers vehicle mods.