[ 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>
Im just a hobby programmer and not familiar with QT.
However i looked at the mudlet source code and looks like string being send to gmcp data is not filtered from Ansi Escape Characters
causing both error and not adding that line to the gmcp table itself.
So i propose a solution, dunno if it works but suggesting anyway.
in TLuaInterpreter.cpp
function void TLuaInterpreter::parseJSON(QString& key, const QString& string_data, const QString& protocol)
line 11162 auto dataInUtf8 = string_data.toUtf8();
Is it Possible to use QTextStream or QTextCodec to strip ansi from the json data?
Thank you.
GMCP and ANSI Escape
Re: GMCP and ANSI Escape
Mudlet could strip it out but that wouldn't solve the real problem: the game sending ANSI escapes in out of band data where they don't make sense. Could you file a bug with the game about this?
Re: GMCP and ANSI Escape
Thank you for your fast response,
This error only happens on GMCP events and causing some of the major triggers stop working in the middle of script.
Posted a note on Bug board about this error. Unfortunately, game is not maintained as well as it used to be.
I thought this would be a good alternative solution.
Thank you.
This error only happens on GMCP events and causing some of the major triggers stop working in the middle of script.
Posted a note on Bug board about this error. Unfortunately, game is not maintained as well as it used to be.
I thought this would be a good alternative solution.
Thank you.
Re: GMCP and ANSI Escape
We'll have a look. You are using Mudlet 3.7.1?
Re: GMCP and ANSI Escape
Thank you again for your fast response,
Yes I downloaded the latest version from mudlets Website "3.7.1"
Yes I downloaded the latest version from mudlets Website "3.7.1"
- SlySven
- Posts: 1023
- Joined: Mon Mar 04, 2013 3:40 pm
- Location: Deepest Wiltshire, UK
- Discord: SlySven#2703
Re: GMCP and ANSI Escape
Which MUD is doing this?
Re: GMCP and ANSI Escape
It a very good family mud actually, Been playing for like 23+ years,
Not glorious as used to be but we have still have some numbers. Its called avatar
Not glorious as used to be but we have still have some numbers. Its called avatar
- SlySven
- Posts: 1023
- Joined: Mon Mar 04, 2013 3:40 pm
- Location: Deepest Wiltshire, UK
- Discord: SlySven#2703
Re: GMCP and ANSI Escape
Given that sending out ANSI ESC codes in the main text is something that should be at the client/user's control (not all Telnet NVTs can handle them) is there any controls to frob on the Server?
Re: GMCP and ANSI Escape
There is only one option for it. To turn all the colors off from the game. But thats not practical. Tried to color the text from mudlet but there are
some things that cant be colored or even it is being colored it will add too many trigger check which eventually will slow response time or give
errors which will be hard to debug.
I posted some notes to the bug forums about this that GMCP should be completely filtered from ANSI or any color in the game However, i dont think it will be solved in close future.
some things that cant be colored or even it is being colored it will add too many trigger check which eventually will slow response time or give
errors which will be hard to debug.
I posted some notes to the bug forums about this that GMCP should be completely filtered from ANSI or any color in the game However, i dont think it will be solved in close future.
Re: GMCP and ANSI Escape
Regarding This problem,
I added the following code to the TLuaInterpreter.cpp to the Headers
around line 11168:
it works (able to compile Mudlet using ubuntu but couldn't manage to compile it in Windows.)
Moderator (SlySven) Edit: add code formatting to make it a bit clearer
I added the following code to the TLuaInterpreter.cpp to the Headers
Code: Select all
#include <QRegExp>
Code: Select all
QString buf_string = string_data;
buf_string.remove(QRegExp("'\\x001B\\[\\d+;\\d+m"));
// auto dataInUtf8 = string_data.toUtf8();
auto dataInUtf8 = buf_string.toUtf8();
Moderator (SlySven) Edit: add code formatting to make it a bit clearer