Error dealing with big gmcp message

Posted by Rdiniz on Fri 16 Nov 2018 08:31 PM — 4 posts, 14,773 views.

Brazil #0
Hi all,
I'm having some issues when the gmcp message I'm getting is too big, I even have to reinstall the plugin when it breaks so it can work well again. I adapted the GMCP_handler_NJG and GMCP_message_receiver_test given as example on my MUD.

The error I'm getting is:

Quote:
Run-time error
Plugin: GMCP_message_receiver_test (called from world: Avatar)
Function/Sub: OnPluginBroadcast called by Plugin GMCP_message_receiver_test
Reason: Executing plugin GMCP_message_receiver_test sub OnPluginBroadcast
C:\MUSHclient\lua\json\decode\util.lua:35: unexpected character @ character: 61 0:61 ["] line:
{ "location": "inv", "item": { "id": "15574945478", "name": "
stack traceback:
[C]: in function 'error'
C:\MUSHclient\lua\json\decode\util.lua:35: in function <C:\MUSHclient\lua\json\decode\util.lua:32>
[C]: in function 'match'
C:\MUSHclient\lua\json\decode.lua:74: in function <C:\MUSHclient\lua\json\decode.lua:72>
(tail call): ?
(tail call): ?
[string "Plugin: GMCP_message_receiver_test"]:262: in function <[string "Plugin: GMCP_message_receiver_test"]:245>


Anyone have any idea how to solve it?

Thank you
USA Global Moderator #1
I think we need to see the raw message that you're receiving before it reaches the JSON parser. You'll need to either modify the plugin to spit that out or enable packet debugging for us. If what I said doesn't make sense, I can explain how.
Amended on Sat 17 Nov 2018 03:16 PM by Fiendish
Brazil #2
Yeah, I know how to debug (gmcpdebug 1). I'll try to make the error happen again and get it.

Thank you :)
Australia Forum Administrator #3
Rdiniz said:

Hi all,
I'm having some issues when the gmcp message I'm getting is too big ...


Where does it say the message is too big? There is nothing in the error message about that. It actually says "unexpected character @ character: 61" so perhaps there is bad data in the JSON packet.