ID:2370368
 
Resolved
The vars list belonging to most objects was not handled properly in json_encode().
BYOND Version:512.1423
Operating System:Linux
Web Browser:Chrome 67.0.3396.48
Applies to:Dream Daemon
Status: Resolved (512.1425)

This issue has been resolved.
Descriptive Problem Summary:

Running json_encode on the vars list treats it as a non-associated list and encodes it as an array, not grabbing the contents of the variables to encode as an object.


[13:57:13] <%MrStonedOne> !dm var/mob/m = new();;json_encode(m.vars)
[13:57:15] <+Bot32> TheAlmightyStoner: ["type","parent_type","tag","name","desc","suffix","text","icon","icon_state","overlays","underlays","dir","visibility","luminosity","opacity","density","layer","gender","mouse_over_pointer","mouse_drag_pointer","mouse_drop_pointer","mouse_drop_zone","verbs","vars","contents","invisibility","infra_luminosity","pixel_x","pixel_y","mouse_opacity","pixel_z","override","maptext","maptext_width","maptext_he...


(the final command is wrapped in a world.log << "[]")


Ah, this is because it's looking for the associated list directly and isn't prepared to handle a special case. I can add something for that. Of course it will be limited as to the kinds of things it can encode from the vars, but I can definitely at least have it handle this list as associative.
A proper json version of save file's object serialization would always be a cool thing, mainly for encoding to the new json mysql type.

Another thing to add to the future features piles i guess
Lummox JR resolved issue with message:
The vars list belonging to most objects was not handled properly in json_encode().

Login to reply.