gps server record positions
This commit is contained in:
@@ -66,7 +66,7 @@ local function server()
|
|||||||
local modems = Config.load('gpsServer')
|
local modems = Config.load('gpsServer')
|
||||||
local computers = { }
|
local computers = { }
|
||||||
|
|
||||||
if #modems == 0 then
|
if Util.empty(modems) then
|
||||||
error('Missing usr/config/gpsServer configuration file')
|
error('Missing usr/config/gpsServer configuration file')
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -80,7 +80,7 @@ local function server()
|
|||||||
if e == "modem_message" then
|
if e == "modem_message" then
|
||||||
-- We received a message from a modem
|
-- We received a message from a modem
|
||||||
local side, channel, computerId, sMessage, distance = p1, p2, p3, p4, p5
|
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
|
-- We received a ping message on the GPS channel, send a response
|
||||||
local modem = modems[side]
|
local modem = modems[side]
|
||||||
if modem then
|
if modem then
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ else
|
|||||||
end
|
end
|
||||||
|
|
||||||
monitor.setTextScale(.5)
|
monitor.setTextScale(.5)
|
||||||
|
monitor.setBackgroundColor(colors.gray)
|
||||||
monitor.clear()
|
monitor.clear()
|
||||||
|
|
||||||
local monDim, termDim = { }, { }
|
local monDim, termDim = { }, { }
|
||||||
|
|||||||
Reference in New Issue
Block a user