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, {
|
||||
type = "player_position",
|
||||
playerID = os.getComputerID(),
|
||||
label = os.getComputerLabel() or ("Pocket #" .. os.getComputerID()),
|
||||
position = myPosition,
|
||||
timestamp = os.epoch("utc")
|
||||
})
|
||||
addLog("GPS: " .. x .. "," .. y .. "," .. z, colors.lime)
|
||||
return true
|
||||
else
|
||||
addLog("GPS: Failed to locate", colors.red)
|
||||
@@ -556,7 +556,7 @@ parallel.waitForAny(
|
||||
function()
|
||||
-- GPS update loop
|
||||
while true do
|
||||
sleep(5)
|
||||
sleep(2)
|
||||
updateMyPosition()
|
||||
end
|
||||
end,
|
||||
|
||||
Reference in New Issue
Block a user