@@ -303,12 +303,8 @@ if SERVER then
303303 include (" extloader.lua" )
304304
305305 -- -- Transfer E2 function info to the client for validation and syntax highlighting purposes -- --
306-
307- local miscdata = {} -- Will contain {E2 types info, constants}, this whole table is under 1kb
308- local functiondata = {} -- Will contain {functionname = {returntype, cost, argnames, extension}, this will be between 50-100kb
309-
310306 -- Fills out the above two tables
311- function wire_expression2_prepare_functiondata ()
307+ local function getE2FunctionData ()
312308 -- Sanitize events so 'listening' e2's aren't networked
313309 local events_sanitized = {}
314310 for evt , data in pairs (E2Lib .Env .Events ) do
@@ -325,20 +321,22 @@ if SERVER then
325321 types [typename ] = v [1 ] -- typeid (s)
326322 end
327323
328- miscdata = { types , wire_expression2_constants , events_sanitized }
329- functiondata = {}
324+ local miscdata = { types , wire_expression2_constants , events_sanitized }
325+ local functiondata = {}
330326
331327 for signature , v in pairs (wire_expression2_funcs ) do
332328 functiondata [signature ] = { v [2 ], v [4 ], v .argnames , v .extension , v .attributes } -- ret (s), cost (n), argnames (t), extension (s), attributes (t)
333329 end
334- end
335330
336- wire_expression2_prepare_functiondata ()
331+ return miscdata , functiondata
332+ end
337333
338334 -- Send everything
339335 local function sendData (ply )
340336 if not (IsValid (ply ) and ply :IsPlayer ()) then return end
341337
338+ local miscdata , functiondata = getE2FunctionData ()
339+
342340 local data = WireLib .von .serialize ( {
343341 miscdata = miscdata ,
344342 functiondata = functiondata
0 commit comments