View/Edit #12:_kick

Switch to edit mode.

Name(s): _kick
1:  "Begin generic security check (_kick)"
2:  if (verb == "_kick" && !args[1]:isa(this))
3:    raise(E_INVARG, "Illegal object", args[1])
4:    return E_INVARG
5:  endif
6:  "End generic security check (_kick)"
7:  {victim} = args
8:  connect_places = `victim:all_connect_places() ! "E_FILE" => {}'
9:  connect_places = $list_utils:remove_duplicates(connect_places)
10: victim:filewrite("all_connect_places", connect_places)
11: "Toast old mail."
12: if (!victim:isa($player))
13:   raise(E_INVARG, "That ain't no player!", victim)
14: elseif (victim.owner == $repo_man)
15:   return "Never mind, the person is doomed, and toasting mail if you don't own yourself can cause TB"
16: endif
17: "The following line makes netforward work properly. - Raptor"
18: `victim:set_current_message(victim, victim:renumber(victim:current_message(victim))[2] || victim:current_message(victim)) ! ANY'
19: month = (pr = `player.mail_expiring ! E_PROPNF') ? pr | 30 * 24 * 60 * 60
20: toast = $seq_utils:range(1, victim:length_date_le(time() - month))
21: remove_messages = 1
22: if (toast && "netforward" in victim.mail_options)
23:   player = victim
24:   try
25:     victim:netforward(player, toast)
26:   except (ANY)
27:     remove_messages = 0
28:     $mail_agent:send_message($slacker, {victim}, "Netforward error", {"I was unable to forward old e-mail to your e-mail address as you'd like. Please contact a wizard to resolve this problem.", "", "The old messages that would have been removed have not been."})
29:   endtry
30: endif
31: if (remove_messages)
32:   victim:rm_message_seq(toast)
33:   victim:expunge_rmm()
34:   `victim:set_current_message(victim, victim:renumber(victim:current_message(victim))[2] || victim:current_message(victim)) ! ANY'
35: endif
36: if (victim.home == #-1 || !`victim.home:accept_for_abode(victim) ! ANY')
37:   victim.home = $player_start
38: endif
39: for x in (victim.features)
40:   if (!$recycler:valid(x) || (!`$code_utils:verb_or_property(x, "feature_ok", victim) ! $failed_match => 0' && !victim:controls(x)))
41:     victim.features = setremove(victim.features, x)
42:   endif
43:   $cmd_utils:suspend_if_needed()
44:   "Remove any features that might not be valid or may just not like this player anymore."
45: endfor
46: "Various cleanup for disconnected players."
47: if (!victim:connected() && victim.last_disconnect_time < time() - 300)
48:   `victim:moveto(victim.home) ! ANY'
49:   `clear_property(victim, "last_tb") ! E_INVARG'
50: endif
51: "Last modified by Cecil (#7407) on Mon Nov  4 16:18:38 2002 MST."

Verb arguments: this none this
Verb perms: Readable eXecutable NOT-Debug
Verb owned by: Dax (#789)

You are not logged in.

[home | help | who | search | setup | code]