GMCP and ANSI Escape

User avatar
SlySven
Posts: 927
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: GMCP and ANSI Escape

Post by SlySven » Sun Apr 08, 2018 2:01 pm

If you can put it up on *your* GitHub fork of the main Mudlet one we can review it as a Pull-Request - if you are up to that? We may need to add a checkbox on the "Special Options" tab of the "Preferences" dialogue with say a checkBox entitled: "Suppress ANSI SGR codes in incoming GMCP". OTOH Why is ANSI SGR codes invalid in a string as far as JSON is concerned? I think you may be suffering from inadequate escaping in the first post which could be hiding some details:

Code: Select all

<Lua error:InvalidJSONInput: lexical error: invalid character inside string. name": "'Captain Dieme's Saber[0;32m'[0;32m", "type": "wea
(right here) ------^
Could you capture a replay containing the data the MUD Server sent including some samples of this error? I.e. click the bottom button with the Video Cassette Icon on it, produce some samples of this error and then click the button again to end it and then post the file here?

Aconite
Posts: 10
Joined: Sat Mar 31, 2018 1:19 pm

Re: GMCP and ANSI Escape

Post by Aconite » Mon Apr 09, 2018 11:58 am

The code i suggested solved my problem with ANSI escape sequences in GMCP tables,
however as i said im a hobby programmer and never used github for my program codes before.
I revert the changes i made and compiled the code as original, and turn debug also on

>>>>>i typed: get saber urn

[ LUA ] - object:<JSON decoder error:> function:<json_to_value>
<Lua error:InvalidJSONInput: lexical error: invalid character inside string.
name": "'Captain Dieme's Saber[0;32m'[0;32m", "type": "wea
(right here) ------^
at ../3rdparty/lua_yajl/lua_yajl.c line 345>
System Message:
gmcp event <gmcp.Char> display(gmcp) to see the full content
System Message:
gmcp event <gmcp.Char.Items> display(gmcp) to see the full content
System Message:
gmcp event <gmcp.Char.Items.Remove> display(gmcp) to see the full content
[ LUA ] - object:<event handler function> function:<dispatchEventToFunctions>
<[string "Script: GMCP Functions Events"]:56: attempt to index field 'Remove' (a nil value)>
[ LUA ] - object:<JSON decoder error:> function:<json_to_value>
<Lua error:InvalidJSONInput: lexical error: invalid character inside string.
name": "'Captain Dieme's Saber[0;32m'[0;32m", "type": "wea
(right here) ------^
at ../3rdparty/lua_yajl/lua_yajl.c line 345>
System Message:
gmcp event <gmcp.Char> display(gmcp) to see the full content
System Message:
gmcp event <gmcp.Char.Items> display(gmcp) to see the full content
System Message:
gmcp event <gmcp.Char.Items.Add> display(gmcp) to see the full content
System Message:
gmcp event <gmcp.Char> display(gmcp) to see the full content
System Message:
gmcp event <gmcp.Char.Vitals> display(gmcp) to see the full content
You get 'Captain Dieme's Saber' from a cracked black urn.

>>>>My game Prompt

System Message:
gmcp event <gmcp.Char> display(gmcp) to see the full content
System Message:
gmcp event <gmcp.Char.Group> display(gmcp) to see the full content
System Message:
gmcp event <gmcp.Char.Group.List> display(gmcp) to see the full content

User avatar
SlySven
Posts: 927
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: GMCP and ANSI Escape

Post by SlySven » Mon Apr 09, 2018 2:32 pm

Yeah, what I ideally wanted was a copy of the data that the MUD server sent to provoke that error and a replay would capture it and enable me/others to replay it (over and over again if necessary) to debug and examine what is not working without having to create an account and play the MUD concerned... :geek:

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests