120
121
122
123
124
125
126
127
128
129
130
131
132
133
...
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
|
on_metadata_inventory_put = function(pos)
minetest.get_node_timer(pos):start(1)
end;
on_timer = function(pos,delta)
local meta = minetest.get_meta(pos)
if not meta:contains('active-device') then return false end
local inv = meta:get_inventory()
if inv:is_empty('cache') then return false end
local dev = gettxr(pos)
local active = minetest.string_to_pos(meta:get_string('active-device'))
local ad
................................................................................
if ad.partner then
remote = gettxr(ad.partner)
elseif ad.code then
local net = sorcery.farcaster.junction(pos,constants.xmit_wattage)
for _,n in pairs(net) do
for _,d in pairs(n.caps.net.devices.consume) do
if d.id == 'sorcery:displacer' then
local t = gettxr(d.pos)
for _,d in pairs(t.connections) do
if d.mode == 'receive' and d.code then
local match = true
for i=1,#d.code do
if d.code[i] ~= ad.code[i] then
match = false break
end
end
if match then
remote = t
break
end
end
end
end
if remote then break end
end
if remote then break end
|
>
>
>
>
>
|
|
|
|
|
|
|
|
|
|
|
|
>
|
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
...
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
|
on_metadata_inventory_put = function(pos)
minetest.get_node_timer(pos):start(1)
end;
on_timer = function(pos,delta)
local meta = minetest.get_meta(pos)
if not meta:contains('active-device') then return false end
local probe = sorcery.spell.probe(pos)
if probe.disjunction then return true end
local inv = meta:get_inventory()
if inv:is_empty('cache') then return false end
local dev = gettxr(pos)
local active = minetest.string_to_pos(meta:get_string('active-device'))
local ad
................................................................................
if ad.partner then
remote = gettxr(ad.partner)
elseif ad.code then
local net = sorcery.farcaster.junction(pos,constants.xmit_wattage)
for _,n in pairs(net) do
for _,d in pairs(n.caps.net.devices.consume) do
if d.id == 'sorcery:displacer' then
local dp = sorcery.spell.probe(d.pos)
if not dp.disjunction then
local t = gettxr(d.pos)
for _,d in pairs(t.connections) do
if d.mode == 'receive' and d.code then
local match = true
for i=1,#d.code do
if d.code[i] ~= ad.code[i] then
match = false break
end
end
if match then
remote = t
break
end
end
end
end
end
if remote then break end
end
if remote then break end
|