… | |
… | |
34 | $ob->esrv_update_item (cf::UPD_NAME, $item); |
34 | $ob->esrv_update_item (cf::UPD_NAME, $item); |
35 | |
35 | |
36 | return 1; |
36 | return 1; |
37 | } |
37 | } |
38 | |
38 | |
39 | sub who_listing() { |
39 | sub who_listing(;$) { |
40 | my ($privileged) = @_; |
40 | my ($privileged) = @_; |
41 | |
41 | |
42 | my ($numwiz, $numafk) = (0, 0); |
42 | my ($numwiz, $numafk) = (0, 0); |
43 | my @pl; |
43 | my @pl; |
44 | |
44 | |
… | |
… | |
61 | |
61 | |
62 | "* " . $ob->name . "/" . $ob->level . " " . (length $pl->own_title ? $pl->own_title : "the " . $pl->title) |
62 | "* " . $ob->name . "/" . $ob->level . " " . (length $pl->own_title ? $pl->own_title : "the " . $pl->title) |
63 | . ($pl->peaceful ? " [peaceful]" : " [HOSTILE]") |
63 | . ($pl->peaceful ? " [peaceful]" : " [HOSTILE]") |
64 | . ($ob->flag (cf::FLAG_AFK) ? " [AFK]" : "") |
64 | . ($ob->flag (cf::FLAG_AFK) ? " [AFK]" : "") |
65 | . ($ob->flag (cf::FLAG_WIZ) ? " [WIZ]" : "") |
65 | . ($ob->flag (cf::FLAG_WIZ) ? " [WIZ]" : "") |
|
|
66 | . " [" . $pl->client . "]" |
66 | . " [" . ($pl->peaceful ? $ob->map->path : $ob->map->region ? $ob->map->region->name : "the unknown") . "]" |
67 | . " [" . ($pl->peaceful ? $ob->map->path : $ob->map->region ? $ob->map->region->name : "the unknown") . "]" |
|
|
68 | . ($privileged ? " " . $pl->host : "") |
67 | } sort { $a->ob->name cmp $b->ob->name } @pl |
69 | } sort { $a->ob->name cmp $b->ob->name } @pl |
68 | ) |
70 | ) |
69 | } |
71 | } |
70 | |
72 | |
71 | cf::register_command who => $cf::TICK, sub { |
73 | cf::register_command who => $cf::TICK, sub { |
72 | my ($ob, $arg) = @_; |
74 | my ($ob, $arg) = @_; |
73 | |
75 | |
74 | $ob->reply (undef, (join "x\n", who_listing), cf::NDI_UNIQUE | cf::NDI_GOLD); |
76 | $ob->reply (undef, (join "x\n", who_listing $ob->flag (cf::FLAG_WIZ)), cf::NDI_UNIQUE | cf::NDI_GOLD); |
75 | }; |
77 | }; |
76 | |
78 | |
77 | cf::register_command rename => $cf::TICK, sub { |
79 | cf::register_command rename => $cf::TICK, sub { |
78 | my ($ob, $arg) = @_; |
80 | my ($ob, $arg) = @_; |
79 | |
81 | |