[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [DISC] Escaping #$#

>>> I dunno about this bit; should this be #$#"?
>>> It's not a big deal, but it seems cleaner to me.
>> I thought that way at first, but then I realized that
>> (1) any implementation was going to have to treat the quote prefix
>> (whether it be #$#" or #$") entirely different from the OOB prefix
>> (#$#), i.e., the quote ISN'T a kind of OOB msg.
> Sure it is; it's just a DIFFERENT kind of OOB message.  In theory
> you could have multiple protocols that share the #$# prefix.  Not
> that we provide much room for them.  Quoting would ideally be either
> "just another protocol" or something that lives under all of them.

The latter.

The reason I say that a quoted line is *NOT* an OOB message is that,
when all is said and done, the quoted data is supposed to *REMAIN IN
BAND*.  The quoting convention is thus part of the definition of whether
something is OOB or not.

> I guess I'm being selfish about a particular implementation:

Implementations can, of course, do whatever they like to get the job
done.  My statement is mainly a conceptual one (and possibly even a
religious one), however IMHO implementations that follow it are likely
to be simpler; quoting is easy to implement *provided* you do it at the
right level.

> I'd like to be able to direct all incoming MCP-related MOO traffic
> $do_out_of_band_command().  (And I consider this quoting

The *issue* of quoting is MCP-related because the whole question of
how we identify OOB messages is one of the foundations of MCP (and any
other protocol based on OOB messages)... and thus it DOES need to be
in the spec --- or there needs to be a separate spec defining OOBness
and the MCP spec should refer to it.

HOWEVER, the quoted lines *themselves* are NOT MCP-related because they
are ultimately in-band data --- a quoted line will NEVER actually
be an MCP message or even an OOB message in any other protocol.  
That's the whole point of quoting, in fact:  how to keep something
from being sucked up as an MCP or any other kind of OOB message.

Thus, $do_out_of_band_command() should no more be handling quoted
lines than it should be handling player commands.  And removing such
handling can only simplify your implementation of the MCP dispatcher
which would otherwise have to deal with the re-insert-quoted-stuff-
into-the-inband-stream problem (which, again, is a very hard problem
at least in MOO, and probably other places as well...)

> Catching #$" requires me to go through $do_command(), which is a pain,
> or define the verb somewhere where it can be overridden by a
> programmer.  (No, I don't know why someone diabolical would bother.)

Catching #$" should be done at the same place that #$# is caught.
Of COURSE it's painful/impossible to do it in-db; recall that's why
#$# itself is caught directly by the server in the first place.

> I don't know, all my arguments on this subject end up crashing into
> the fact that the #$#/line-based level of our protocol seems pretty
> poorly thought-out.  As a result, I'll go along with whatever gets
> decided, but I'm not too happy with any of it.

It may have been poorly thought out, but it IS fixable.
The problem is, the longer we wait on fixing it, 
the harder it'll be to do so...