View/Edit #29:match_local_player

Switch to edit mode.

Name(s): match_local_player
1:  "match_local_player(name)       => obj"
2:  "If an $ambiguous_match is returned from the regular player_match, this verb favours players who are:"
3:  "1) Connected and in the same room as player."
4:  "2) In the same room as player."
5:  "3) Connected."
6:  "If there is still a conflict, $ambiguous_match is returned."
7:  result = this:match_player(@args)
8:  if (result == $ambiguous_match)
9:    alpha = beta = gamma = {}
10:   for dude in ($player_db:find_all(args[1]))
11:     if (player.location == dude.location && $object_utils:connected(dude))
12:       alpha[1..0] = {dude}
13:     elseif (player.location == dude.location)
14:       beta[1..0] = {dude}
15:     elseif ($object_utils:connected(dude))
16:       gamma[1..0] = {dude}
17:     endif
18:   endfor
19:   result = length(alpha) == 1 ? alpha[1] | (length(beta) == 1 ? beta[1] | (length(gamma) == 1 ? gamma[1] | result))
20: endif
21: return result

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

You are not logged in.

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