Skip to content


Subversion checkout URL

You can clone with
Download ZIP


JSON booleans represented as 0 and 1 #1

Qalthos opened this Issue · 4 comments

2 participants


Per the Nethack 4 network protocol, many parts of the protocol should send and accept boolean arguments. JSON has boolean values, true and false, however, the server is actually sending and accepting 1 and 0, respectively.


This is how the protocol is documented.

nethack_server/protocol_specification.txt specifically states:

5.1) Assorted integral types
All of the following are really just integers with a false nose and moustache.
* All enumerated types
* bitflags
* boolean
* charcode
* connid
* coordinate
* gameid

Feel free to, as such, perform some sort of XSLT-esque JSON transformation before it hits your real JSON parser to accommodate this without errors.


Well I feel quite silly now. I had looked to see if there was some sort of explanation in the document, but evidently did not look hard enough.

The problems are not so much with JSON, merely conceptual errors for trying to naively interperet the protocol. Closing for derp.

@Qalthos Qalthos closed this

I think it'd be hard to feel silly when the actual explanation is 'the documentation states that this and other data types are just integers with a false nose and moustache'.

Good luck on whatever y'all are hacking on!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.