Generic Guest (#33)(an instance of Basic Local PC made by Hacker)     By definition, guests appear nondescript. VERB SOURCE CODE: @password:
player:tell("Sorry, but guest characters are not allowed to change their passwords.");
.
boot:
if (!caller_perms().wizard)
return;
endif
player = this;
this:notify(tostr("Sorry, but you've been here for ", $string_utils:from_seconds(connected_seconds(this)),
" and someone else wants to be a guest now. Feel free to come back", @$login:player_creation_enabled(player)
? {" or even create your own character if you want..."} | ($login.registration_address
? {" or send mail to ", $login.registration_address, " to obtain a character of your
own."} | {"."})));
fork (0)
oldloc = this.location;
move(this, #-1);
move(this, this.home);
"..force enterfunc to be called so that the newbie gets a room description.";
if ($object_utils:isa(oldloc, $room))
oldloc:announce("In the distance you hear someone's alarm clock going off.");
if (oldloc != this.location)
oldloc:announce(this.name, " wavers and vanishes into insubstantial mist.");
else
oldloc:announce(this.name, " undergoes a wrenching personality shift.");
endif
endif
endfork
.
disfunc:
if (((valid(cp = caller_perms()) && (caller != this)) && (!$perm_utils:controls(cp,
this))) && (cp != this))
return E_PERM;
endif
this:log_disconnect();
fork (0)
if (this.location != this.home)
this:room_announce("A gang of youths charge in, grab ", this.name, ", and
quickly drag ", this.po, " out of sight.");
move(this, this.home);
endif
for x in ({"paranoid", "lines", "responsible", "linelen", "linebuffer", "brief",
"gaglist", "rooms", "pagelen", "current_message", "current_folder", "messages", "request"})
if ($object_utils:has_property($guest, x))
clear_property(this, x);
endif
endfor
this:set_description(this.default_description);
this:set_gender(this.default_gender);
for x in (this.contents)
this:eject(x);
endfor
for x in (this.features)
if (!(x in $guest.features))
this:remove_feature(x);
endif
endfor
for x in ($guest.features)
if (!(x in this.features))
this:add_feature(x);
endif
endfor
if ($object_utils:has_callable_verb(this, "clear_refusals"))
this:clear_refusals();
endif
for x in ($object_utils:descendants($generic_editor))
if (loc = this in x.active)
x:kill_session(loc);
endif
endfor
endfork
pass(@args);
.
defer:
"Called by #0:connect_player when this object is about to be used as the next guest
character. Usually returns `this', but if for some reason some other guest character
should be used, that player object is returned instead";
if (!caller_perms().wizard)
"...caller is not :do_login_command; doesn't matter what we return...";
return this;
elseif ($login:blacklisted($string_utils:connection_hostname(connection_name(player))))
return #-2;
elseif (!(this in connected_players()))
"...not logged in, no problemo...";
return this;
endif
longest = 900;
"...guests get 15 minutes before they can be dislodged...";
candidate = #-1;
free = {};
for g in (children($guest))
if (!is_player(g))
"...a toaded guest?...";
elseif (!(g in connected_players()))
"...yay; found an unused guest...";
free = {@free, g};
elseif ((t = connected_seconds(g)) > longest)
longest = t;
candidate = g;
endif
endfor
if (free)
candidate = free[random(length(free))];
elseif (valid(candidate))
"...someone's getting bumped...";
candidate:boot();
endif
return candidate;
.
mail_catch_up: return; . create:
if ($login:player_creation_enabled(player))
player:tell("First @quit, then connect to the MOO again and, rather than doing
`connect guest' do `create
eject: return pass(@args); . log:
":log(islogin,time,where) adds an entry to the connection log for this guest.";
if (caller != this)
return E_PERM;
elseif (length(this.connect_log) < this.max_connect_log)
this.connect_log = {args, @this.connect_log};
else
this.connect_log = {args, @this.connect_log[1..this.max_connect_log - 1]};
endif
.
confunc:
if (((valid(cp = caller_perms()) && (caller != this)) && (!$perm_utils:controls(cp,
this))) && (cp != this))
return E_PERM;
else
$guest_log:enter(1, time(), $string_utils:connection_hostname(connection_name(this)));
ret = pass(@args);
this:tell_lines($string_utils:pronoun_sub(this.extra_confunc_msg));
return ret;
endif
.
log_disconnect:
if (caller != this)
return E_PERM;
else
cname = connection_name(this) || this.last_connect_place;
$guest_log:enter(0, time(), $string_utils:connection_hostname(cname));
endif
.
@last-c*onnection:
if (!valid(caller_perms()))
player:tell("Sorry, that information is not available.");
endif
.
connection_name_hash:
"Compute an encrypted hash of the guest's (last) connection, using 'crypt'. Basically,
you can't tell where the guest came from, but it is unlikely that two guests will
have the same hash";
"You can use guest:connection_name_hash(seed) as a string to identify whether two
guests are from the same place.";
hash = tonum(caller_perms());
host = $string_utils:connection_hostname(this.last_connect_place);
for i in [1..length(host)]
hash = (hash * 14) + index($string_utils.ascii, host[i]);
endfor
return crypt(tostr(hash), @args);
.
my_huh:
if (caller_perms() != this)
return E_PERM;
else
return pass(@args);
endif
.
@read: return pass(@args); . set_current_folder: return pass(@args); "only for setting permission"; . @request*-character @register: "Usage: @request init_for_core:
if (caller_perms().wizard)
this.extra_confunc_msg = "";
this.features = {};
endif
.
set_name set_aliases:
"disallow guests from setting aliases on themselves";
if ($perm_utils:controls(caller_perms(), this))
return pass(@args);
else
return E_PERM;
endif
.
request(older): return; "Old version, Dredful 2/16/94"; "Usage: @request @request(old): return; "Usage: @request PROPERTY DATA:       default_gender       default_description       request       extra_confunc_msg CHILDREN: Guest Mantis_Guest Scorpion_Guest Dragon_Guest Griffin_Guest Soylent_Guest |