Archaegeo / DualUniverseLuaIssues

DualUniverse LUA Issue Tracking
GNU General Public License v3.0
5 stars 0 forks source link

Rendering API setOutput fails if it contains a quote #46

Open samdeane opened 2 years ago

samdeane commented 2 years ago

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.

NQ-Ligo commented 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 ?

samdeane commented 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 ?

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.

samdeane commented 2 years ago

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.