This reverts commit e9c558ffdb, reversing
changes made to ca2fd07b90.
This is a quick-fix for crashing PA plugins. The intended change is
still useful and planned to land later.
The previous code accidently used the
C-string "host" and "serverID" variables
in the JSON output for the context and
identity.
To avoid too many changes, this commit
changes the JSON escape function to
work on C strings instead, and uses
that to escape the "host" and "serverID"
strings from the game before emitting
them into the JSON documents.
This commit also adds some extra code
to ensure that the game strings we
include in the JSON document are
within the printable ASCII range.