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,
|
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)
|
||||||
@@ -471,6 +472,11 @@ local function processMessage(channel, message)
|
|||||||
state.homePosition = message.homePosition
|
state.homePosition = message.homePosition
|
||||||
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)
|
||||||
|
|||||||
Reference in New Issue
Block a user