• Networking Error
    2 replies, posted
Hey guys. I am messing around with networking and got this funky error: [ERROR] lua/includes/extensions/net.lua:182: net.ReadType: Couldn't read type 97 1. error - [C]:-1 2. ReadType - lua/includes/extensions/net.lua:182 3. ReadTable - lua/includes/extensions/net.lua:121 4. func - gamemodes/darkrp/gamemode/modules/efex-inventory/cl_inv.lua:95 5. unknown - lua/includes/extensions/net.lua:32 Here is the code for the net message: net.Receive( "armor", function(len)     local key = net.ReadFloat()     local tbl = net.ReadTable()     cl_armors[key] = {armor_name = tbl.armor_name, armor_desc = tbl.armor_desc, pacData = tbl.pacData} end) Line 95 is: local tbl = net.ReadTable() I am not sure what this error means or how to even begin to solve it. All help is appreciated thanks!
You are trying to send some data that cannot be sent over the network, such as functions, IMaterial objects, etc. Post the sending code and a full example of what is in the table you give to net.WriteTable()
Sending your table info in chunks instead of the whole table may be a better route. However you do have the option of encoding a table before sending and decoding it on arrival. [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/util/JSONToTable]util.JSONToTable[/url] [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/util/TableToJSON]util.TableToJSON[/url] Be aware of your string limits for large tables or information. (Appends a string to the current net message. The size of the string is 8 bits plus 8 bits for every ASCII character in the string. The maximum allowed length of a single written string is 65533 characters.)
Sorry, you need to Log In to post a reply to this thread.