From 8775b00e2fc722ca40eee2738bb8a9dc91eab8b5 Mon Sep 17 00:00:00 2001 From: Igor Timofeev Date: Tue, 7 Jun 2016 10:07:53 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=BB=D1=83=D1=87=D1=88=D0=B5=D0=BD?= =?UTF-8?q?=D0=B0=20=D1=81=D0=B8=D1=81=D1=82=D0=B5=D0=BC=D0=B0=20=D0=BF?= =?UTF-8?q?=D0=BE=D0=B8=D1=81=D0=BA=D0=B0=20=D1=81=D0=B5=D1=82=D0=B5=D0=B2?= =?UTF-8?q?=D0=BE=D0=B3=D0=BE=20=D0=BE=D0=BA=D1=80=D1=83=D0=B6=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Applications.txt | 2 +- Applications/Finder/Finder.lua | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Applications.txt b/Applications.txt index 2764b2dd..75cdfea4 100644 --- a/Applications.txt +++ b/Applications.txt @@ -743,7 +743,7 @@ ["icon"]="IgorTimofeev/OpenComputers/master/Applications/Finder/Icon.pic", ["createShortcut"]="dock", ["forceDownload"]=true, - ["version"]=1.0, + ["version"]=1.1, }, { ["name"]="MineOS/Applications/Control", diff --git a/Applications/Finder/Finder.lua b/Applications/Finder/Finder.lua index 25b937a6..3a1de805 100644 --- a/Applications/Finder/Finder.lua +++ b/Applications/Finder/Finder.lua @@ -307,8 +307,8 @@ local function openModem() if component.isAvailable("modem") then component.modem.open(port) end end -local function sendPersonalInfo() - if component.isAvailable("modem") then component.modem.broadcast(port, "addMeToList") end +local function sendPersonalInfo(sendAgain) + if component.isAvailable("modem") then component.modem.broadcast(port, sendAgain and "addMeToListToo" or "addMeToList") end end local function sendMessageOrFileWindow(text1, text2) @@ -504,9 +504,12 @@ while true do local localAddress, remoteAddress, remotePort, distance, message1, message2 = eventData[2], eventData[3], eventData[4], eventData[5], eventData[6], eventData[7] local truncatedRemoteAddress = unicode.sub(remoteAddress, 1, 5) if remotePort == port then - if message1 == "addMeToList" and not network[remoteAddress] then + if message1 == "addMeToList" then + sendPersonalInfo(true) + network[remoteAddress] = true + drawAll() + elseif message1 == "addMeToListToo" then network[remoteAddress] = true - sendPersonalInfo() drawAll() elseif message1 == "hereIsMessage" then GUI.error(message2, {title = {color = 0xFFDB40, text = MineOSCore.localization.gotMessageFrom .. truncatedRemoteAddress}})