File tree 2 files changed +5
-21
lines changed
2 files changed +5
-21
lines changed Original file line number Diff line number Diff line change @@ -151,24 +151,6 @@ function mesecon.tablecopy(table) -- deep table copy
151
151
return newtable
152
152
end
153
153
154
- function mesecon .tablecopy_stripfunctions (table ) -- deep table copy, but remove all functions
155
- if type (table ) == " function" then return nil end -- functions become nil
156
- if type (table ) ~= " table" then return table end -- no need to copy
157
- local newtable = {}
158
-
159
- for idx , item in pairs (table ) do
160
- if type (idx ) ~= " function" then
161
- if type (item ) == " table" then
162
- newtable [idx ] = mesecon .tablecopy_stripfunctions (item )
163
- elseif type (item ) ~= " function" then
164
- newtable [idx ] = item
165
- end
166
- end
167
- end
168
-
169
- return newtable
170
- end
171
-
172
154
function mesecon .cmpAny (t1 , t2 )
173
155
if type (t1 ) ~= type (t2 ) then return false end
174
156
if type (t1 ) ~= " table" and type (t2 ) ~= " table" then return t1 == t2 end
Original file line number Diff line number Diff line change @@ -278,9 +278,11 @@ local function get_digiline_send(pos)
278
278
return false
279
279
end
280
280
281
- -- No sending functions over the wire and make sure serialized version
282
- -- of the data is not insanely long to prevent DoS-like attacks
283
- msg = mesecon .tablecopy_stripfunctions (msg )
281
+ -- It is technically possible to send functions over the wire since
282
+ -- the high performance impact of stripping those from the data has
283
+ -- been decided to not be worth the added realism.
284
+ -- Make sure serialized version of the data is not insanely long to
285
+ -- prevent DoS-like attacks
284
286
local msg_ser = minetest .serialize (msg )
Has conversations. Original line has conversations. 285
287
if # msg_ser > mesecon .setting (" luacontroller_digiline_maxlen" , 50000 ) then
286
288
return false
You can’t perform that action at this time.