Open samdeane opened 2 years ago
It's not JSON in back, where are you getting the error ? On the controller or in the screen unit ? Core extract ?
It's not JSON in back, where are you getting the error ? On the controller or in the screen unit ? Core extract ?
Interesting. I don’t have the game infront of me, but I think the error was in the screen.
Actually, yes, this confirms it I think.
Just had a chance to try this again. I removed my string-escaping from the rendering code, and sent back some output which is actually a little bit of JSON.
The error happens on the controller side, in the onOutputChanged
event handler.
Just having an onOutputChanged(*)
handler is enough to cause a script error to be reported in the corresponding controller panel - although when opening the script, no error is reported.
Adding back the string-escaping on the rendering side, before calling setOutput
, fixes the error.
This is what I'm currently seeing, anyway.
If I send a string with a quote in, I get an error. If I escape the quote (JSON-style), it works ok.
My guess is that under the hood the string is being turned into JSON without getting escaped.
See also #47 which would fix it.