rickparrish / fTelnet

fTelnet: An HTML5 WebSocket client
GNU Affero General Public License v3.0
70 stars 38 forks source link

ANSI Music Data Error #11

Closed ghost closed 4 years ago

ghost commented 6 years ago

Running "The Pit" first time player will be asked if they see color (ANSI) if you say yes, you should be asked if you heard music.

In SyncTERM this question works and it is yes/no. In fTelnet the line never prints and in the browser console the following error is displayed:

Uncaught TypeError: Cannot read property '0' of undefined
    at Ansi.AnsiCommand (ftelnet.norip.xfer.min.js:105)
    at Ansi.Write (ftelnet.norip.xfer.min.js:138)
    at fTelnetClient.OnConnectionData (ftelnet.norip.xfer.min.js:624)
    at Object.<anonymous> (ftelnet.norip.xfer.min.js:585)
    at TypedEvent.trigger (ftelnet.norip.xfer.min.js:91)
    at TelnetConnection.WebSocketConnection.OnWebSocketMessage (ftelnet.norip.xfer.min.js:406)
    at WebSocket._WebSocket.onmessage (ftelnet.norip.xfer.min.js:393)
Ansi.AnsiCommand @ ftelnet.norip.xfer.min.js:105
Ansi.Write @ ftelnet.norip.xfer.min.js:138
fTelnetClient.OnConnectionData @ ftelnet.norip.xfer.min.js:624
(anonymous) @ ftelnet.norip.xfer.min.js:585
TypedEvent.trigger @ ftelnet.norip.xfer.min.js:91
WebSocketConnection.OnWebSocketMessage @ ftelnet.norip.xfer.min.js:406
_WebSocket.onmessage @ ftelnet.norip.xfer.min.js:393

Normally not an issue, but since the game is asking for a Y or N, the line never printed and people force disconnect because they don't know whats going on. If you hit Y or N the game continues and all is good.

Anyway to bypass that error? Print the line and ignore ANSI music codes?

If you wish to test on my system, I can send more information via email.

Thanks.

rickparrish commented 6 years ago

Fairly sure this is related to my handling of the ESC[M sequence -- I was looking to see if the sequence contained an '=' in a way that would have broken for the parameter-less ESC[M sequence.

I've now pushed a change to both the fTelnet repository and the embed-v2 wizard, so hopefully this fixes things for you. If not I'll have to actually install The Pit to do some proper testing.