From aa525dbd9c81c0d82ff65db5c84979e678c124f2 Mon Sep 17 00:00:00 2001 From: "kepler155c@gmail.com" Date: Sat, 5 Jan 2019 01:50:58 -0500 Subject: [PATCH] gps server record positions --- gps/gpsServer.lua | 4 ++-- monitor/mwm.lua | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gps/gpsServer.lua b/gps/gpsServer.lua index dd7ab94..d4ba54d 100644 --- a/gps/gpsServer.lua +++ b/gps/gpsServer.lua @@ -66,7 +66,7 @@ local function server() local modems = Config.load('gpsServer') local computers = { } - if #modems == 0 then + if Util.empty(modems) then error('Missing usr/config/gpsServer configuration file') end @@ -80,7 +80,7 @@ local function server() if e == "modem_message" then -- We received a message from a modem local side, channel, computerId, sMessage, distance = p1, p2, p3, p4, p5 - if channel == gps.CHANNEL_GPS and sMessage == "PING" then + if channel == gps.CHANNEL_GPS and sMessage == "PING" and distance then -- We received a ping message on the GPS channel, send a response local modem = modems[side] if modem then diff --git a/monitor/mwm.lua b/monitor/mwm.lua index 89cc259..80d25dc 100644 --- a/monitor/mwm.lua +++ b/monitor/mwm.lua @@ -37,6 +37,7 @@ else end monitor.setTextScale(.5) +monitor.setBackgroundColor(colors.gray) monitor.clear() local monDim, termDim = { }, { }