[not a bug] GMCP tables

User avatar
Rakon
Posts: 350
Joined: Tue Feb 16, 2010 7:41 pm
Contact:

[not a bug] GMCP tables

Post by Rakon »

Currently, when Mudlet receives data update to a GMCP table, it overwrites the entire table, instead of just updating the CHANGED values. This bug is reproducible with Mudlet 2.0rc-1.2, and using as example gmcp.Char.Status given via Achaea (IRE) . (NOTE: I assumed this was a bug with IRE, and submitted the bug report there. However, after testing with Mudbot, and Nexus; this GMCP error only shows up -in- Mudlet.


GMCP code through mudbot (this shows gmcp.Char.Status):

Code: Select all

`gmcp char
[GMCP Char Info:]


<Characters fullname> (Xoran)
You are level 18 and 14% of the way to the next level.
You are a house member of The Maldaathi(1).
You are a citizen of Mhaldor (0).
You are an order member of (None).


Internal alias calling lua (Showing that Mudlet knows of the full gmcp.Char.Status table):

Code: Select all

table {
  'order': '(None)'
  'class': 'Infernal'
  'xp': '14%'
  'house': 'The Maldaathi(1)'
  'race': 'Xoran'
  'city': 'Mhaldor (0)'
  'level': '18'
  'name': '<Character name>'
  'fullname': '<character fullname>'
}

The following is Mudlet error output, showing that it received the updated gmcp.Char.Status (Note, the values sent by Achaea, only send the UPDATED key/values; not the entire table again:

System Message:
GMCP event <gmcp.Char> display(gmcp) to see the full content
System Message:
GMCP event <gmcp.Char.Status> 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 have slain a juvenile wildcat, retrieving the corpse.

Internal alias calling lua (Showing that Mudlet now only sees gmcp.Char.Status as the ONE updated value, instead of the complete table):

Code: Select all

table {
  'xp': '18%'
}
Mudbot gmcp char (Showing that Mudbot still has ALL the proper gmcp.Status information, and -only- updated the one updated field:

Code: Select all

<Character fullname> (Xoran)
You are level 18 and 18% of the way to the next level.
You are a house member of The Maldaathi(1).
You are a citizen of Mhaldor (0).
You are an order member of (None).

Thank you

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

Re: [BUG] GMCP tables

Post by Vadi »

Mudbot is no standard of implementation... and IRE's position on this is that it depends on the message. Char.Status is the only one that does partial changes, the rest do a full update.

Not replacing Comm.Channel.Players messages, for example, would lead to false information being stored over time.

So Mudlet is 90% right in it's handling of gmcp, other clients are not if they really do that.

User avatar
Rakon
Posts: 350
Joined: Tue Feb 16, 2010 7:41 pm
Contact:

Re: [BUG] GMCP tables

Post by Rakon »

Could it be changed perhaps, in Mudlet , so that if only one value is received in an already existing table, that only THAT value is updated instead of rewriting the entire table?

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

Re: [BUG] GMCP tables

Post by Vadi »

I just explained why that would be a bug - 'Not replacing Comm.Channel.Players messages, for example, would lead to false information being stored over time.'

User avatar
Rakon
Posts: 350
Joined: Tue Feb 16, 2010 7:41 pm
Contact:

Re: [BUG] GMCP tables

Post by Rakon »

Okay, so the Mudlet answer is that GMCP is being handled as correct as it can be, IE 'not a bug' ?

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

Re: [BUG] GMCP tables

Post by Vadi »

90% correct, it should replace that one value, but not others.

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: [BUG] GMCP tables

Post by Heiko »

Rakon wrote:Could it be changed perhaps, in Mudlet , so that if only one value is received in an already existing table, that only THAT value is updated instead of rewriting the entire table?
This is exactly what Mudlet is doing. Mudlet only does partial updates. However, in your example (if I understand your post correctly) the IRE server is clearly telling Mudlet to change the value of the entire table gmcp.char.status instead of correctly telling Mudlet to only change gmcp.char.status.xp. Just talk to the admins to fix the gmcp messages and you'll be fine.

Cardan
Posts: 2
Joined: Fri Apr 22, 2011 12:46 pm

Re: [BUG] GMCP tables

Post by Cardan »

I've been taking a look through the Achaean code relating to GMCP over the last couple of weeks and fixed up a pile of bugs in the process.

From the server side this is the debug that I can see when a player kills a baby rat:
[GMCP] To Player: Char.Vitals { "hp": "4918", "maxhp": "5053", "mp": "4371", "maxmp": "4471", "ep": "24135", "maxep": "24165", "wp": "21255", "maxwp": "21255", "nl": "97", "string": "H:4918/5053 M:4371/4471 E:24135/24165 W:21255/21255 NL:97/100 " }
A baby rat has been slain by Player.
[GMCP] To Player: Char.Status { "xp": "97.7%" }
[GMCP] To Player: Char.Items.Remove { "location": "room", "item": 258628 }
[GMCP] To Player: Char.Items.Add { "location": "inv", "item": { "id": "258628", "name": "the corpse of a baby rat" } }

As you can see, there's the Char.Items.Add and .Remove for moving the dead baby rat from the room into the players inventory, the Char.Vitals when the player is sent the prompt line and a Char.Status line, containing only a single name-value pair for 'xp' as it is the only value in the status table that has changed and this is in accordance with the gmcp-doc on the Iron Realms website.

I'm more than happy to help debug out any issues, just drop me a message in-game and I'll respond if I'm on.

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

Re: [BUG] GMCP tables

Post by Vadi »

Thanks for dropping by! It seems to be both sides are doing things right, just how clients (modded mudbot vs mudlet) handle it is differently - mudlet stores in gmcp tables only the data that was received, being lowest level - and thus allowing flexibility in doing modded mudbot-style 'total' information. for example, tsujinn has an items tracker: http://forums.mudlet.org/viewtopic.php? ... 1706#p6537

User avatar
Rakon
Posts: 350
Joined: Tue Feb 16, 2010 7:41 pm
Contact:

Re: [not a bug] GMCP tables

Post by Rakon »

Cardan: Would it be possible to please change the IRE GMCP implementation of the Char.Status updating?? That is, have it send the entire table, and not just the changed value?? If I'm understanding correctly, this is the issue, and Vadi/Heiko stating that Mudlet is handling the partial update correctly, by overwriting the entire table contents instead of updating the single value.

Post Reply