5ea @verb #18:"defer" this none this rxo #55 @program #18:"defer" this none this "return 0;" if (!caller_perms().wizard) "...caller is not :do_login_command; doesn't matter what we return..." return this endif longest = 900 "...guests get 15 minutes before they can be dislodged..." candidate = #-1 "Use a deterministic algorithm to map from the host name to a guest. If that guest is free, use it, otherwise use a random one." sum = 0 for x in [1..length(args[1])] sum = sum + toint(args[1][x]) endfor sum = sum % length(children($guest)) + 1 g = children($guest)[sum] if (!(g in connected_players()) && is_player(g)) return g endif 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:tell("Sorry, guests are in short supply at the moment. We are disconnecting you to give someone else a turn.") $mail_agent:send_message(#33, #70, "All out of guests!", {"Was forced to boot a guest inorder to accomodate someone.", "Does a Wizard feel like executing a @make-guest command?"}) boot_player(candidate) player:home() endif return candidate "Last modified by Dax (#789) on Tue May 3 14:09:29 2005 MDT." . 0