Open Road MP

Server settings and web data

Change the server name at runtime and publish data for websites.

Server name and welcome message

mp.config.setName("Convoy Night - Berlin to Rome")
mp.config.setMotd("Meeting point: Berlin, DFH. Start 20:00.")
mp.server.name // the current name

The change shows in the server list and for joining players right away. It lasts until the server restarts - the defaults stay in server.cfg.

Data for websites, bots and dashboards

mp.http.publish(key, data) puts JSON on the server's web server (the one of the live map):

setInterval(() => {
  const top = mp.players.all().map((p) => ({ name: p.name, deliveries: mp.storage.player(p).get("deliveries") ?? 0 }))
  mp.http.publish("leaderboard", top)
}, 10_000)

It is then at http://<server>:<http_port>/api/gamemodes/<gamemode>/leaderboard - for your website, a Discord bot or a stream overlay. Publish again to update; a key holds at most 256 KB. Keys are 1-40 of A-Z a-z 0-9 _ -.

On this page