View/Edit #23:co*nnect ac*cede

Switch to edit mode.

Name(s): co*nnect ac*cede
1:  caller == this || raise(E_PERM)
2:  if (!this:check_jabber())
3:    "Doh."
4:    "  this:reload_jabber();"
5:  endif
6:  argstr = dobjstr = ""
7:  host = $string_utils:connection_hostname(this.jabber_host)
8:  if (length(args) > 2)
9:    player:tell("It is not possible to have a space in your player's name or password.")
10:   return
11: endif
12: {?name = "", ?pwd = ""} = args
13: if (!name)
14:   player:tell("Please enter your player's name: (or \"guest\" if you don't have a player)")
15:   name = this:prompt("NAME > ")
16:   force_input(this.jabber, tostr(verb, " ", name, "~0D~0A"))
17:   return
18: elseif (!pwd && #-1 == this:do_authorise(name, pwd))
19:   player:tell("Please enter ", $su:match_player(name).name, "'s password:")
20:   try
21:     pwd = this:prompt("PASSWORD > ", 0)
22:   except (E_INVARG)
23:     return 0
24:   endtry
25:   player:tell()
26:   force_input(this.jabber, tostr(verb, " ", name, " ", pwd, "~0D~0A"))
27:   return
28: endif
29: if (!valid(who = this:do_authorise(name, pwd)))
30:   $msg:mtell(who == $failed_match ? "bad_player" | "bad_password", name)
31:   player:tell("Tip: Try logging in using 'connect (player) (password)' on one line.")
32:   return
33: elseif (this:yellowlisted(host) && !this:yellow_exempt(who))
34:   $msg:mtell("yellowlisted")
35:   return
36: elseif (who.IPlist && !this:IPlisted(host, who))
37:   $msg:mtell("IPlisted", host)
38:   return
39: elseif ($wiz_utils:isnewt(who))
40:   sentence = who.nologin[1] - time()
41:   notifier = who.nologin[2]
42:   player:sub_tell(notifier, who, $time_utils:english_time(sentence))
43:   $msg:mtell(who, "newt_login", who)
44:   return
45: elseif ($object_utils:isa(who, $guest))
46:   who = who:defer(string_hash(host))
47:   if (this:new_blacklist(host))
48:     $msg:mtell("blacklisted")
49:     return
50:   elseif (!valid(who))
51:     $msg:mtell("outtaguests")
52:     return
53:   endif
54: endif
55: fork (0)
56:   if (this:graylisted(host))
57:     $wiz_utils:guard_alert("Connection from a graylisted site (", host, ") by ", who.name, " (", who, ")")
58:   endif
59: endfork
60: cookies = `this:get_connection_info(this.jabber) ! E_INVARG => {}'
61: cracker_cookie = `listassoc(cookies, "cracker", 1)[2] ! E_RANGE, E_TYPE => {}'
62: fork (0)
63:   victims = `listdelete(cracker_cookie, 1) ! E_RANGE => {}'
64:   victims = setremove(victims, who)
65:   if (victims)
66:     $wiz_utils:guard_alert(tostr("After trying to connect as ", $string_utils:name_and_number_list(victims), ", ", host, " finally managed to connect as ", $string_utils:nn(who), "."))
67:   endif
68: endfork
69: $server_options:_set_connect_msg(who:first_connection() || who:isa($guest) ? "----" | `who:msg_login() ! E_PROPNF => "*** Connected ***"')
70: if (client = `listassoc(cookies, "client", 1)[2] ! E_RANGE, E_TYPE')
71:   try
72:     who:(client[1])(@client[2])
73:   finally
74:     set_connection_option(this.jabber, "binary", 0)
75:   endtry
76: endif
77: if (this.locked_out_msg && !who:isa($guardian))
78:   player:Tell("The Moo is currently locked out, you cannot connect.")
79:   return
80: endif
81: set_connection_option(this.jabber, "binary", 0)
82: "pool = $list_utils:randomly_permute({#789, #7921, #6319, #3135});"
83: "if ((ctime()[5..10] == \"Apr  1\") && (who in pool))"
84: "  for x in (pool)"
85: "    if ((!x:connected()) && (x != who))"
86: "      return x;"
87: "    endif"
88: "  endfor"
89: "endif"
90: return who
91: "Last modified by whiz (#3135) on Thu Jun 30 02:55:20 2011 UTC."

Verb arguments: any none any
Verb perms: Readable eXecutable NOT-Debug
Verb owned by: Slacker (#55)

You are not logged in.

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