-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rustg_read_toml_file is broken #111
Comments
way to go @tralezab |
Worked on the test data |
Yeah about that test...
Previously it was:
|
I wrote about this a bit in tgstation/tgstation#68690 but I think that what ZeWaka once termed a "dumb tramstation random error" (via #107 (comment), example found here: https://github.com/tgstation/tgstation/runs/7527162114?check_suite_focus=true) may also be related to this bug, since the runtimes seem to be specifically happening on just the Modular Map Loaders. [19:01:34] Runtime in modular_map_loader.dm,34: bad index
proc name: load map (/obj/modular_map_root/proc/load_map)
src: the tramstation (/obj/modular_map_root/tramstation)
src.loc: the floor (108,137,3) (/turf/open/floor/iron/smooth)
call stack:
the tramstation (/obj/modular_map_root/tramstation): load map()
world: ImmediateInvokeAsync(the tramstation (/obj/modular_map_root/tramstation), /obj/modular_map_root/proc/loa... (/obj/modular_map_root/proc/load_map))
the tramstation (/obj/modular_map_root/tramstation): Initialize(1)
Atoms (/datum/controller/subsystem/atoms): InitAtom(the tramstation (/obj/modular_map_root/tramstation), 0, /list (/list))
the tramstation (/obj/modular_map_root/tramstation): New(1)
/datum/parsed_map (/datum/parsed_map): create atom(/obj/modular_map_root/tramstat... (/obj/modular_map_root/tramstation), the floor (108,137,3) (/turf/open/floor/iron/smooth))
/datum/parsed_map (/datum/parsed_map): instance atom(/obj/modular_map_root/tramstat... (/obj/modular_map_root/tramstation), /list (/list), the floor (108,137,3) (/turf/open/floor/iron/smooth), 1, 0)
/datum/parsed_map (/datum/parsed_map): build coordinate(/list (/list), /list (/list), the floor (108,137,3) (/turf/open/floor/iron/smooth), 1, 0)
/datum/parsed_map (/datum/parsed_map): load impl(1, 1, 2, 0, 1, -1e+31, 1e+31, -1e+31, 1e+31, 0)
/datum/parsed_map (/datum/parsed_map): load(1, 1, 2, null, 1, null, null, null, null, null)
Mapping (/datum/controller/subsystem/mapping): LoadGroup(/list (/list), "Station", "map_files/tramstation", /list (/list), /list (/list), /list (/list), 0)
Mapping (/datum/controller/subsystem/mapping): loadWorld()
Mapping (/datum/controller/subsystem/mapping): Initialize(684916)
Master (/datum/controller/master): Initialize(10, 0, 1) /tg/station configs these modular map loaders for Tramstation via this TOML file here: https://github.com/tgstation/tgstation/blob/master/strings/modular_maps/Tramstation.toml . I hope that the associated PR can also rectify that issue as well. It's a good thing we have CI for all maps there otherwise I'm like 95% certain it would have gotten to production and we would probably just get majorly large fuckups. |
@san7890 The "bad index" runtimes on the map loader were exactly what we were seeing (leading to a Tramstation that was partly non-functional), and it was a royal pain to track down. I had noticed that it was also not loading the word filter toml, but I wasn't sure exactly why it was breaking until I created the testbed in the OP. |
As far as I can tell, #98 broke rustg_read_toml_file. We are using it in a tgstation branch, and when I happened to update rust_g, everything that depended on toml files broke.
the toml_file_to_json function in the library passes a json string containing "success" and "content" to byond, and the byond wrapper proc returns the value of "content" if it succeeds. From what I can tell, the value of content is escaped so that it is not actually parsed by json_decode() during this process, and returned as a json-formatted string (thankfully, with escape characters removed) instead of an associative array.
My current workaround is to json_decode the content again before you return it, and that appears to be working.
Test code (in an otherwise empty test environment, with rust_g.dm and a data.toml file to test):
For me, this code returns the incredulous "converted?!?" text. The workaround is also functioning on a live server, providing the correct associative list for the data loaded from file.
The text was updated successfully, but these errors were encountered: