Page 1 of 2

GMCP Handling

Posted: Wed Mar 14, 2012 2:12 am
by Lierra
I'm trying to work out an oddity in how mudlet and a modified mudbot proxy are handling gmcp. GMCP requests to the server work fine, but any and all gmcp information sent from the server through the proxy are just being dumped to the client's screen like an echo, and not actually registering as gmcp information (display(gmcp) gives an empty table).

For example:
Code: [show] | [select all] lua
char.maxstats {"strength": 18, "knowledge": 20, "wisdom": 18, "agility": 20, "vitality": 19, "luck": 
20, "courage": 20, "sanity": 25, "personality": 18, "maxhp": 160, "maxsp": 464, "maxst": 268}
Sending char max stats information via GMCP.
This is what I get when requesting an update of the char.maxstats table when connected through the mudbot proxy. I'm wondering if anyone has any ideas where to look, either in the mudlet source or elsewhere, to get this working.

Of note, gmcp works just fine through the proxy on other clients (MUSH/CMud).

Re: GMCP Handling

Posted: Wed Mar 14, 2012 3:32 pm
by tsuujin
I haven't used it in a while, but I remember that having debugging enabled would push a message similar to that to the screen every time a gmcp packet was received.

What version of mudlet are you using?

Re: GMCP Handling

Posted: Wed Mar 14, 2012 4:04 pm
by Lierra
I'm using 2.0 rc5. I've figured out a workaround, I'm just not sure how to make it...well...work. What I need is a way to send data either to another connection in mudlet (ie, forward all gmcp.room.info updates to another connection in mudlet that is hooked into the server the proxy connects to) or a way to send the data over a tcp connection. I know the latter is possible with luasocket but I haven't figured out how to work that, yet.

Re: GMCP Handling

Posted: Wed Mar 14, 2012 5:17 pm
by tsuujin
Well, I know that mudlet properly listens for GMCP information. The only thing I can think of offhand is that your proxy is not actually passing the data to mudlet properly (perhaps it's sending it on the main packet stream instead of on the hidden protocol it's supposed to be on).

We'll have to get someone who's familiar with mudbot to chime in.

Re: GMCP Handling

Posted: Wed Mar 14, 2012 5:35 pm
by Lierra
Oh I know it handles gmcp properly. Which is why I'm trying to bypass the proxy with luasocket, or by using a 2nd connection in mudlet to pass the server behind the proxy the gmcp data.

Edit: Got luasocket working...mostly. socket:send(data) returns a blank error, but the function itself returns no error. Guess I have to rely on someone having a way to forward the raw gmcp data from the server to another connection in mudlet, like you can in Mush (via send() and getworld()) :(

Re: GMCP Handling

Posted: Thu Mar 15, 2012 5:00 am
by Vadi
I think something is dodgy with the GMCP implementation. Try Rakons modification to it, which has GMCP as well.

Re: GMCP Handling

Posted: Wed Apr 04, 2012 11:00 pm
by Lierra
Mostly got this working. I just had to beat luasocket until it worked, then create a script to convert the gmcp arrays into JSON strings. Only problem now is finding out why the JSON data I'm sending isn't being received right, which isn't a mudlet issue :)

I did, however, encounter a (possible) bug with gmcp arrays. I can't seem to get this to parse correctly:

gmcp.char.info.current-class

Mudlet always wants to subtract class from current.

Re: GMCP Handling

Posted: Wed Apr 04, 2012 11:05 pm
by Iocun
Try gmcp.char.info["current-class"]

Re: GMCP Handling

Posted: Wed Apr 04, 2012 11:06 pm
by Vadi
Yeah I think it needs to be one word. Use CurrentClass or somesuch - as an example, see ironrealms.com/gmcp-doc

Re: GMCP Handling

Posted: Thu Apr 05, 2012 2:34 pm
by Lierra
I'd tell that to Vassago but it's unlikely to be changed :p I'm not an admin, just a player.