MOO-cows Mailing List Archive

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

Re: Allowing commands from un-logged-in users



Pavel Curtis drew these hieroglyphs:
> 
> It was once suggested (by KMP, I think) that there be a way in the server to
> flush all unprocessed input on your connection.  I could certainly add a new
> built-in `.flush' command to do that, but I'm concerned about quoting issues:
> what if you really wanted to enter `.flush' as input to a MOO program?  The
> problem is that this special command I'd add would have to work at the I/O
> level of the server, since by definition it can't wait until its turn comes up
> in the user's command queue.
> 
> Suggestions?
> 

How about this:
Have a new builtin function that flushes the input buffer of a player.

Have a second out-of-band prefix (how about #!#) that switches to
a system verb, say #0:do_urgent_command(), immediately.

So a user types:

> @recycle Something_Irreplaceable

He screeches out in horror, and hits a macro on his client (or types
REALLY fast on his telnet connection), which sends

> #!#flush

Which calls #0, which I might program as:

@program #0:do_urgent_command tnt rxd
callers() && raise(E_PERM);
if (argstr == "#!#flush")
   flush_input(player);
   notify(player, ">>> Input flushed. <<<");
endif
.

It's trivial to write code that deals with offenders who would flood
the server with urgent commands as a denial-of-service attack.
Having #0:do_urgent_command call boot_player() comes to mind.

Heh, and with this, wizards truly CAN be immune to lag.  >:)

How about it?


References:

Home | Subject Index | Thread Index