GMCP Handling

Lierra
Posts: 7
Joined: Mon Mar 12, 2012 2:46 pm

GMCP Handling

Post 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).

User avatar
tsuujin
Posts: 695
Joined: Fri Feb 26, 2010 12:59 am
Location: California
Contact:

Re: GMCP Handling

Post 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?

Lierra
Posts: 7
Joined: Mon Mar 12, 2012 2:46 pm

Re: GMCP Handling

Post 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.

User avatar
tsuujin
Posts: 695
Joined: Fri Feb 26, 2010 12:59 am
Location: California
Contact:

Re: GMCP Handling

Post 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.

Lierra
Posts: 7
Joined: Mon Mar 12, 2012 2:46 pm

Re: GMCP Handling

Post 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()) :(

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: GMCP Handling

Post by Vadi »

I think something is dodgy with the GMCP implementation. Try Rakons modification to it, which has GMCP as well.

Lierra
Posts: 7
Joined: Mon Mar 12, 2012 2:46 pm

Re: GMCP Handling

Post 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.

Iocun
Posts: 174
Joined: Wed Dec 02, 2009 1:45 am

Re: GMCP Handling

Post by Iocun »

Try gmcp.char.info["current-class"]

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: GMCP Handling

Post by Vadi »

Yeah I think it needs to be one word. Use CurrentClass or somesuch - as an example, see ironrealms.com/gmcp-doc

Lierra
Posts: 7
Joined: Mon Mar 12, 2012 2:46 pm

Re: GMCP Handling

Post by Lierra »

I'd tell that to Vassago but it's unlikely to be changed :p I'm not an admin, just a player.

Post Reply