feat: Add computer label handling and status broadcasting on rename command

This commit is contained in:
MayaTheShy
2026-02-20 02:33:25 -05:00
parent 11c289a3ed
commit 2a0a90892c

View File

@@ -260,6 +260,7 @@ local function broadcastStatus()
facing = state.facing, facing = state.facing,
surroundings = surroundings, surroundings = surroundings,
evalSupported = true, evalSupported = true,
label = os.getComputerLabel(),
} }
modem.transmit(STATUS_CHANNEL, CHANNEL_RECEIVE, statusPacket) modem.transmit(STATUS_CHANNEL, CHANNEL_RECEIVE, statusPacket)
@@ -472,6 +473,11 @@ local function processMessage(channel, message)
print("Home confirmed by server") print("Home confirmed by server")
end end
elseif message.type == "rename" and message.name then
os.setComputerLabel(message.name)
print("Renamed to: " .. message.name)
broadcastStatus()
elseif message.command then elseif message.command then
processLegacyCommand(message) processLegacyCommand(message)
end end