View/Edit #12:set_name _set_name

Switch to edit mode.

Name(s): set_name _set_name
1:  "set_name(newname) attempts to change this.name to newname"
2:  "  => E_PERM   if you don't own this"
3:  "  => E_INVARG if the name is already taken or prohibited for some reason"
4:  "  => E_NACC   if the player database is not taking new names right now."
5:  "  => E_ARGS   if the name is too long (controlled by $login.max_player_name)"
6:  if (!$perm_utils:controls(caller_perms(), this) && !(this == caller))
7:    raise(E_PERM)
8:  elseif (!is_player(this))
9:    "we don't worry about the names of player classes."
10:   set_task_perms(caller_perms())
11:   return pass(@args)
12: elseif ($player_db.frozen)
13:   raise(E_NACC)
14: endif
15: name = args[1]
16: if ($html_utils:detag(name) != name)
17:   raise(E_INVARG)
18: endif
19: if (length(name) > $login.max_player_name)
20:   raise(E_ARGS)
21: endif
22: if (!($player_db:available(name) in {this, 1}))
23:   raise(E_INVARG)
24: else
25:   old = this.name
26:   pass(@args)
27:   if (name != old && !(old in this.aliases))
28:     $player_db:delete(old)
29:   endif
30:   $player_db:insert(name, this)
31:   return 1
32: endif
33: "Last modified by Dax (#789) on Sun Jul 28 13:07:42 2002 MDT."

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

You are not logged in.

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