Skip to content

Commit

Permalink
~
Browse files Browse the repository at this point in the history
  • Loading branch information
Dalethium committed Oct 30, 2021
1 parent 559432d commit 7af59b8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 10 additions & 6 deletions storage/database.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,23 @@ while true do
local found = false
for _, entry in ipairs(rgxdata) do
if not found then
if entry.str ~= nil then
if string.match(s.item, entry.str) then
rednet.broadcast({["return"] = "success", ["location"] = entry, ["item"] = s.item}, "return:" .. s.item)
found = true
end
if string.match(s.item, entry.str) then
rednet.broadcast(
{["return"] = "success", ["location"] = entry, ["item"] = s.item},
"return:" .. s.item
)
found = true
end
end
end
if not found then
rednet.broadcast({["return"] = "none"}, "return:" .. s.item)
end
else
rednet.broadcast({["return"] = "success", ["location"] = items[s.item], ["item"] = s.item}, "return:" .. s.item)
rednet.broadcast(
{["return"] = "success", ["location"] = items[s.item], ["item"] = s.item},
"return:" .. s.item
)
end
elseif s.call == "del" then
if items[s.item] then
Expand Down
2 changes: 1 addition & 1 deletion storage/remote.lua
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ elseif method == "setr" then
print(serializeTable(get(tArgs[2])))
elseif method == "del" then
rednet.broadcast(call)
rednet.broadcast({["call"] = "get", ["del"] = tArgs[2]})
rednet.broadcast({["call"] = "del", ["item"] = tArgs[2]})
print(serializeTable(get(tArgs[2])))
elseif method == "get" then
print(serializeTable(get(tArgs[2])))
Expand Down

0 comments on commit 7af59b8

Please sign in to comment.