From f10d5f526340b612168e46afbc18e97dcd83e6d4 Mon Sep 17 00:00:00 2001 From: NatureFreshMilk Date: Fri, 8 Feb 2019 12:37:38 +0100 Subject: [PATCH] advtrains stub --- mapserver_mod/mapserver/bridge.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mapserver_mod/mapserver/bridge.lua b/mapserver_mod/mapserver/bridge.lua index 5377968..125c4ef 100644 --- a/mapserver_mod/mapserver/bridge.lua +++ b/mapserver_mod/mapserver/bridge.lua @@ -1,5 +1,5 @@ -- mapserver http bridge - +local has_advtrains = minetest.get_modpath("advtrains") local function explode(sep, input) local t={} @@ -20,8 +20,6 @@ local http, url, key function send_stats() - -- send trains if 'advtrains' mod installed: advtrains.trains - local data = { time = minetest.get_timeofday() * 24000, uptime = minetest.get_server_uptime(), @@ -29,6 +27,11 @@ function send_stats() players = {} } + if has_advtrains then + -- send trains if 'advtrains' mod installed + data.trains = advtrains.trains + end + for _, player in ipairs(minetest.get_connected_players()) do local info = { name = player:get_player_name(),