Thursday 13 October 2011

GUI snippet version 5

Version 4 was just a tiny update to fix a memory allocation problem, but this version has more changes.

While helping Splork get the snippet working in SlothMUD, we came across an interesting problem - it seems that the MXP specification doesn't actually define whether the server should initiate negotiation with IAC WILL MXP or IAC DO MXP. While some clients therefore support both, others support only one or the other. I've therefore updated the snippet to support both (it attempts one if the other fails).

There was also a complaint from another user about the MSSP table being cumbersome to update for non-static fields such as players and uptime. I've therefore changed the table to use function pointers, which should make it much easier to update in future.

Scandum also asked me to change LIST to use an array, as per the latest specification, which I've done.

Other than that there were a couple of bugfixes, but nothing serious. Here's the list of changes:
  • Added symbolic constants for MSDP_TABLE_OPEN/CLOSE and MSDP_ARRAY_OPEN/CLOSE.
  • MSDPSetArray() was using table values rather than the array values. Fixed.
  • Added MSDPSendList(), used for the MSDP LIST command (updated to an array in the spec).
  • Doubled MAX_VARIABLE_LENGTH for the list variables.
  • Some of the LISTs had no separators between values when sent using ATCP. Fixed.
  • The MSSP table now uses function pointers, making it easier to update dynamic fields.
  • Added support for both variants of MXP negotiation.
As usual it can downloaded from the GW2 website: http://www.godwars2.org/download/protocol.tgz

Or from the MudBytes code repository: http://www.mudbytes.net/file-2811