diff --git a/webbridge.lua b/webbridge.lua index 692f32b..b30667d 100644 --- a/webbridge.lua +++ b/webbridge.lua @@ -491,11 +491,13 @@ parallel.waitForAny( local event, side, channel, replyChannel, message, distance = os.pullEvent("modem_message") stats.messagesReceived = stats.messagesReceived + 1 - if channel == STATUS_CHANNEL or channel == CHANNEL_RECEIVE then + -- Uses Channels.match() for dual-mode safety: accepts messages on + -- both legacy (101/102/103) and target (4211/4212/4213) during migration. + if (Channels.match('remoteturtle.status', channel) or Channels.match('remoteturtle.response', channel)) then if type(message) == "table" then forwardToServer(message) end - elseif channel == POCKET_CHANNEL then + elseif Channels.match('remoteturtle.pocket', channel) then if type(message) == "table" then handlePocketMessage(message) end