Variables and Values
——————————————————————————–
If a variable is omitted it is assumed the previously reported value for that
value should be used. The "PLAYERS" and "UPTIME" variables should always be
included. For ease of parsing, variables and values cannot contain the MSSP_VAL,
MSSP_VAR, IAC, or NUL byte. The value can be an empty string unless an
integer value is expected. Given the data traffic generated by MSSP is very
small at less than 1 KB it is strongly suggested to always send all variables
and their values.
#define TELOPT_MSSP 70 /* used to send mud server information */
#define MSSP_VAR 1
#define MSSP_VAL 2
int recv_sb_mssp(unsigned char *src, int srclen)
{
char var[MAX_STRING_LENGTH], val[MAX_STRING_LENGTH];
char *pto;
int i;
var[0] = val[0] = i = 0;
while (i < srclen && src[i] != SE)
{
switch (src[i])
{
case MSSP_VAR:
i++;
pto = var;
while (i < srclen && src[i] >= 3 && src[i] != IAC)
{
*pto++ = src[i++];
}
*pto = 0;
break;
case MSSP_VAL:
i++;
pto = val;
while (i < srclen && src[i] >= 3 && src[i] != IAC)
{
*pto++ = src[i++];
}
*pto = 0;
printf("%-20s %s\n", var, val);
break;
default:
i++;
break;
}
}
return UMIN(i + 1, srclen);
}
MSSP_VAL 1
MSSP_VAR 2
MSSP_VAR 1
MSSP_VAL 2
Not sure I follow why you think this isn't an issue. MUD admins will have to make sure they handle the protocol correctly in their server if they want to talk to the snippet. You argue that most people are very bad at this, so why isn't it a problem to force MUD admins to handle it correctly?