Hey guys can someone help me with a deserialization problem on vON: Vercas' Object Notation ([url]http://lab.facepunch.com/thread/1194008/post/36623627/[/url]).
I have the following table that will be serialized and then deserialized, the problem is that vON is returning an error when I try to deserialize it, I'm not sure if it's problem with my code or with vON. Here is table, during the script execution some data is replaced on each field on this table and then I serialize and store it on a variable. After that process I need to deserialize it, note that the string (serialized table) was not modified, but when I try to deserialize it an error is returned.
[CODE]local tab = {
name = "N/A",
damage = "N/A",
clipsize = "N/A",
automatic = "NO",
spread = "0.00",
recoil = "0",
ammo = "N/A",
wpntype = "N/A"
}
(...)
local serializedtab = von.serialize(tab)
(...)
local deserializedtab = von.deserialize(serializedtab) // Error here
[/CODE]
The error output is the following:
[CODE][Wiremod] lua/autorun/von.lua:130: vON: Malformed data... Can't find a proper type definition. Char#2:'
1. error - [C]:-1
2. d_findVariable - lua/autorun/von.lua:130
3. deserialize - lua/autorun/von.lua:225
4. v - lua/cl_wpn.lua:147
5. unknown - lua/includes/modules/hook.lua:82[/CODE]
Here is an example of serialized table string that is generating the error when I try to deserialize: "~'clipsizev':n20;'recoilv':n2;'spreadv':n0.05;'automaticv':'NOv''damagev':n10;'namev':'N/Av''ammov':'pistolv'"
Can someone tell me what is wrong here?
Does anyone know how to fix this problem?
Why not just use JSON?
That's what I thought. I know vON apparantly has some pro's to it but I can't tell why you would need it over JSON in this case.
[QUOTE=Robotboy655;43795410]Why not just use JSON?[/QUOTE]
Lots of people have a real hardon for VON for some reason.
maybe / is causing some problems.
Are you using the latest version?
The thread you linked has a few download links to version 1.1.1
The latest is 1.3.3
Grab it from here, should fix the issue.
Don't have any issues myself.
[URL="https://github.com/vercas/vON/blob/master/von.lua"]https://raw.github.com/vercas/vON/master/von.lua[/URL]
Sorry, you need to Log In to post a reply to this thread.