feat: Add computer label handling and status broadcasting on rename command
This commit is contained in:
@@ -260,6 +260,7 @@ local function broadcastStatus()
|
||||
facing = state.facing,
|
||||
surroundings = surroundings,
|
||||
evalSupported = true,
|
||||
label = os.getComputerLabel(),
|
||||
}
|
||||
|
||||
modem.transmit(STATUS_CHANNEL, CHANNEL_RECEIVE, statusPacket)
|
||||
@@ -471,6 +472,11 @@ local function processMessage(channel, message)
|
||||
state.homePosition = message.homePosition
|
||||
print("Home confirmed by server")
|
||||
end
|
||||
|
||||
elseif message.type == "rename" and message.name then
|
||||
os.setComputerLabel(message.name)
|
||||
print("Renamed to: " .. message.name)
|
||||
broadcastStatus()
|
||||
|
||||
elseif message.command then
|
||||
processLegacyCommand(message)
|
||||
|
||||
Reference in New Issue
Block a user