gps server record positions

This commit is contained in:
kepler155c@gmail.com
2019-01-05 01:50:58 -05:00
parent f148bee303
commit aa525dbd9c
2 changed files with 3 additions and 2 deletions

View File

@@ -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

View File

@@ -37,6 +37,7 @@ else
end
monitor.setTextScale(.5)
monitor.setBackgroundColor(colors.gray)
monitor.clear()
local monDim, termDim = { }, { }