MOO-cows Mailing List Archive
[Prev][Next][Index][Thread]
Re: Connection redirection
(While just reading through this, I found that it might be a bit
confusing... you should still at least figure out the code.)
>I wrote a bind(obj, obj) function which would bind any connection
>(unconnected `negative' object or not) and rebind it to any other
>connection, playerbit or not.
^^^^^^^^^
While disagreeing with this whole idea, I suddenly found something that
makes sense. Wouldn't it be MUCH simpler if ALL incoming/outgoing
connections, positive OR negative, that are not in a read() simply went
through #0:handle_input()? :handle_input() would have to handle stuff like
redirect(login-screen-player,real-player) and parse(player,cmd).
#0:new_connection() would simply be called when someone connects.
To make this hack completely compatable with the current set up, the verbs
would look like this:
#0:handle_input
if(valid(player))
this:do_command(@args) || parse(player,argstr);
else
valid(what=this:do_login_command(@args)) && is_player(what) &&
redirect(player,what);
endif
.
#0:new_connection
valid(what=this:do_login_command("")) && is_player(what) &&
redirect(player,what);
.
This code won't print connected/created messages, but it'd still work. It
should clear up ALOT of mix-arounds in the server, make read()s in the login
possible, clear up confusion about user_connected/user_disconnected (one is
called with non-player connections and one isn't), and sort the connections
into four or five verbs:
new_incoming_connection
new_outgoing_connection
handle_input
user_client_disconnected
user_disconnected
I'm not sure how easy this would be to implement, or worse, how hard it'd be
to clean out the old way. I will see if I can make a patch for this!
- Kipp
-----BEGIN GEEK CODE BLOCK-----
GCS/CC d- s+:- a16 C++ UL++++ P+ L++ E-? W+ !N--@ !o-- K->K++++++
w++(--) O- M-- V--? PS++(+) PE(--) Y+ PGP-? t+ 5(+) X++ R+++(*)
!tv b+ DI++++ D++++ G e* h!()(*) r+ !y+
------END GEEK CODE BLOCK------
-----BEGIN NOT SO GEEKY BLOCK-----
MOO projects:
RPG Minimal.db: paradigm.microwave.com 5000
MOO2000: moo.microwave.com 2000
MundoHispano: europa.syr.edu 8888
------END NOT SO GEEKY BLOCK------
Home |
Subject Index |
Thread Index