13 Sep, 2011, Tyche wrote in the 1st comment:
Votes: 0
Quote
Variables and Values

Variables are send as a typical telnet sub-negotiation having the format: IAC SB MSDP MSDP_VAR <VARIABLE> MSDP_VAL <VALUE> IAC SE. For ease of parsing, variables and values cannot contain the NUL, MSDP_VAL, MSDP_VAR, MSDP_TABLE_OPEN, MSDP_TABLE_CLOSE, or IAC byte.


The above should probably also forbid MSDP_ARRAY_OPEN and MSDP_ARRAY_CLOSE.

I presume it is allowed to send strings with escape codes since the protocol doesn't define how string might be processed client side.
For example:
IAC SB MSDP MSDP_VAR "FOO" MSDP_VAL "FOO\000BAR\003BAZ" IAC SE

What's the difference between…
IAC SB MSDP MSDP_VAR "SEND" MSDP_VAL "HEALTH" MSDP_VAL "HEALTH_MAX" MSDP_VAL "MANA" MSDP_VAL "MANA_MAX" IAC SE
and
IAC SB MSDP MSDP_VAR "SEND" MSDP_VAL MSDP_ARRAY_OPEN MSDP_VAL "HEALTH" MSDP_VAL "HEALTH_MAX" MSDP_VAL "MANA" MSDP_VAL "MANA_MAX" MSDP_ARRAY_CLOSE

Aren't they both arrays?
Or should the client assign SEND to MANA_MAX ignoring the rest?
14 Sep, 2011, Cratylus wrote in the 2nd comment:
Votes: 0
lol MSDPBytes
14 Sep, 2011, Tyche wrote in the 3rd comment:
Votes: 0
Is this correct?

BNF grammar for MSDP

<variable_list> ::= <variable_assignment> { <variable_assignment> }
<variable_assignment> ::= MSDP_VAR <string> MSDP_VAL <value_expr> { MSDP_VAL <value_expr> }
<value_expr> ::= <string> | <array> | <table>
<string> ::= { CHARACTERS }
<array> ::= MSDP_ARRAY_OPEN { MSDP_VAL <value_expr> } MSDP_ARRAY_CLOSE
<table> ::= MSDP_TABLE_OPEN { <variable_assignment> } MSDP_TABLE_CLOSE

where:
MSDP_VAR = 1
MSDP_VAL = 2
MSDP_TABLE_OPEN = 3
MSDP_TABLE_CLOSE = 4
MSDP_ARRAY_OPEN = 5
MSDP_ARRAY_CLOSE = 6
CHARACTERS = ASCII in range (x'07'…x'FE')
14 Sep, 2011, Scandum wrote in the 4th comment:
Votes: 0
Tyche said:
The above should probably also forbid MSDP_ARRAY_OPEN and MSDP_ARRAY_CLOSE.

It should indeed, I've updated the spec.

Tyche said:
I presume it is allowed to send strings with escape codes since the protocol doesn't define how string might be processed client side.
For example:
IAC SB MSDP MSDP_VAR "FOO" MSDP_VAL "FOO\000BAR\003BAZ" IAC SE

That'd be valid, though it introduces some security concerns when it comes to player channels over MSDP. This would force MUDs to escape the escapes when tunneling player input, so I'm hoping MSDP can get by without it.

Tyche said:
What's the difference between…
IAC SB MSDP MSDP_VAR "SEND" MSDP_VAL "HEALTH" MSDP_VAL "HEALTH_MAX" MSDP_VAL "MANA" MSDP_VAL "MANA_MAX" IAC SE
and
IAC SB MSDP MSDP_VAR "SEND" MSDP_VAL MSDP_ARRAY_OPEN MSDP_VAL "HEALTH" MSDP_VAL "HEALTH_MAX" MSDP_VAL "MANA" MSDP_VAL "MANA_MAX" MSDP_ARRAY_CLOSE

Aren't they both arrays?
Or should the client assign SEND to MANA_MAX ignoring the rest?

In the case of the first sub-negotiation the client should raise 4 events and provide each value to the given event. In the case of the second sub-negotiation the client should raise 1 event and provide the array to the given event.

So the first is treated as a redefinition comparable to int x = 1 = 2 = 3; and the second as an array int x[] = { 1, 2, 3 };

Regarding the server command interface, only the first sub-negotiation is valid server side.
14 Sep, 2011, Scandum wrote in the 5th comment:
Votes: 0
Tyche said:
Is this correct?

BNF grammar for MSDP

<variable_list> ::= <variable_assignment> { <variable_assignment> }
<variable_assignment> ::= MSDP_VAR <string> MSDP_VAL <value_expr> { MSDP_VAL <value_expr> }
<value_expr> ::= <string> | <array> | <table>
<string> ::= { CHARACTERS }
<array> ::= MSDP_ARRAY_OPEN { MSDP_VAL <value_expr> } MSDP_ARRAY_CLOSE
<table> ::= MSDP_TABLE_OPEN { <variable_assignment> } MSDP_TABLE_CLOSE

Looks pretty good, I think <table> should be:

<table> ::= MSDP_TABLE_OPEN { <variable_list> } MSDP_TABLE_CLOSE
14 Sep, 2011, Scandum wrote in the 6th comment:
Votes: 0
Thought I'd give some additional clarification, in TinTin++ I only raise events for the top level variables. If a variable is nested inside a table and repeatedly redefined it won't raise any events, so all but the last definition would be pointless.
14 Sep, 2011, kiasyn wrote in the 7th comment:
Votes: 0
that seems like one of those things that would be a fustrating quirk
14 Sep, 2011, Scandum wrote in the 8th comment:
Votes: 0
It's somewhat confusing, which is the reason I changed the spec to have the LIST command return an array.

The feature makes sense in an event driven environment however, and it works quite elegant behind the scenes.
14 Sep, 2011, Tyche wrote in the 9th comment:
Votes: 0
Scandum said:
Thought I'd give some additional clarification, in TinTin++ I only raise events for the top level variables. If a variable is nested inside a table and repeatedly redefined it won't raise any events, so all but the last definition would be pointless.


I was just about to ask that.
So I need a different production. Like…

<top_level_variable_list> ::= <top_level_variable_assignment> { <top_level_variable_assignment> }
<top_level_variable_assignment> ::= MSDP_VAR <string> MSDP_VAL <value_expr> { MSDP_VAL <value_expr> }
<array> ::= MSDP_ARRAY_OPEN { MSDP_VAL <value_expr> } MSDP_ARRAY_CLOSE
<variable_list> ::= <variable_assignment> { <variable_assignment> }
<variable_assignment> ::= MSDP_VAR <string> MSDP_VAL <value_expr>
<table> ::= MSDP_TABLE_OPEN { <variable_list> } MSDP_TABLE_CLOSE
<value_expr> ::= <string> | <array> | <table>
<string> ::= { CHARACTERS }
15 Sep, 2011, Scandum wrote in the 10th comment:
Votes: 0
Maybe rename top_level_variable to package for brevity.

<package_list> ::= <package_assignment> { <package_assignment> }
<package_assignment> ::= MSDP_VAR <string> MSDP_VAL <value_expr> { MSDP_VAL <value_expr> }
<variable_list> ::= <variable_assignment> { <variable_assignment> }
<variable_assignment> ::= MSDP_VAR <string> MSDP_VAL <value_expr>
<value_expr> ::= <string> | <array> | <table>
<table> ::= MSDP_TABLE_OPEN { <variable_list> } MSDP_TABLE_CLOSE
<array> ::= MSDP_ARRAY_OPEN { MSDP_VAL <value_expr> } MSDP_ARRAY_CLOSE
<string> ::= { CHARACTERS }
0.0/10