refactor: enhance player position update to include label and timestamp for improved tracking
This commit is contained in:
@@ -98,10 +98,10 @@ local function updateMyPosition()
|
|||||||
modem.transmit(POCKET_CHANNEL, CHANNEL_RECEIVE, {
|
modem.transmit(POCKET_CHANNEL, CHANNEL_RECEIVE, {
|
||||||
type = "player_position",
|
type = "player_position",
|
||||||
playerID = os.getComputerID(),
|
playerID = os.getComputerID(),
|
||||||
|
label = os.getComputerLabel() or ("Pocket #" .. os.getComputerID()),
|
||||||
position = myPosition,
|
position = myPosition,
|
||||||
timestamp = os.epoch("utc")
|
timestamp = os.epoch("utc")
|
||||||
})
|
})
|
||||||
addLog("GPS: " .. x .. "," .. y .. "," .. z, colors.lime)
|
|
||||||
return true
|
return true
|
||||||
else
|
else
|
||||||
addLog("GPS: Failed to locate", colors.red)
|
addLog("GPS: Failed to locate", colors.red)
|
||||||
@@ -556,7 +556,7 @@ parallel.waitForAny(
|
|||||||
function()
|
function()
|
||||||
-- GPS update loop
|
-- GPS update loop
|
||||||
while true do
|
while true do
|
||||||
sleep(5)
|
sleep(2)
|
||||||
updateMyPosition()
|
updateMyPosition()
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|||||||
Reference in New Issue
Block a user