Skip to content
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

Rendering API setOutput fails if it contains a quote #46

Open
samdeane opened this issue Aug 28, 2022 · 3 comments
Open

Rendering API setOutput fails if it contains a quote #46

samdeane opened this issue Aug 28, 2022 · 3 comments
Labels
bug Something isn't working NQ-COMMENTED This issue or pull request already exists

Comments

@samdeane
Copy link

samdeane commented Aug 28, 2022

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.

@Archaegeo Archaegeo added the bug Something isn't working label Sep 4, 2022
@NQ-Ligo
Copy link

NQ-Ligo commented Sep 5, 2022

It's not JSON in back, where are you getting the error ? On the controller or in the screen unit ?
Core extract ?

@Archaegeo Archaegeo added the NQ-COMMENTED This issue or pull request already exists label Sep 5, 2022
@samdeane
Copy link
Author

samdeane commented Sep 5, 2022

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
Copy link
Author

samdeane commented Sep 5, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working NQ-COMMENTED This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants