Posted 17 May 2014 - 10:28 PM
Hi all,
I'm working on a project and felt the need for an improved serialization function. Thus I used Immibis' script which is pretty well known across the boards. (http://www.computercraft.info/forums2/index.php?/topic/302-api-proper-serialization/) However, it doesn't work..
From the lua terminal:
a = serialize.serialize("ABC")
(returns 03?ABC, which I think, is good)
b = serialize.deserialize(a)
(returns nil)
No matter what kind of data I try to deserialize, it ALWAYS deserializes to nil. Naturally, I checked that the fuction is found properly:
type(serialize.serialize) returns me "function"
I really have no clue what is wrong.. I have been digging around in the code but can't seem to find a problem :-( Only by manually using the serializeInt and deserializeInt functions I have been able to get a correctly deserialized integer.. yay?
lastly, I copied the code + the "usage" proof of concept code to a separate program too, to eliminate the possibility of api-engine related problems.. again, it serializes properly, but deserializes to nil..
Anyone experienced similar behavior on 1.6? Any idea what might be the problem here?
I'm working on a project and felt the need for an improved serialization function. Thus I used Immibis' script which is pretty well known across the boards. (http://www.computercraft.info/forums2/index.php?/topic/302-api-proper-serialization/) However, it doesn't work..
From the lua terminal:
a = serialize.serialize("ABC")
(returns 03?ABC, which I think, is good)
b = serialize.deserialize(a)
(returns nil)
No matter what kind of data I try to deserialize, it ALWAYS deserializes to nil. Naturally, I checked that the fuction is found properly:
type(serialize.serialize) returns me "function"
I really have no clue what is wrong.. I have been digging around in the code but can't seem to find a problem :-( Only by manually using the serializeInt and deserializeInt functions I have been able to get a correctly deserialized integer.. yay?
lastly, I copied the code + the "usage" proof of concept code to a separate program too, to eliminate the possibility of api-engine related problems.. again, it serializes properly, but deserializes to nil..
Anyone experienced similar behavior on 1.6? Any idea what might be the problem here?