… | |
… | |
31 | $ob->message ("You stop calling your " . $item->base_name . " with weird names."); |
31 | $ob->message ("You stop calling your " . $item->base_name . " with weird names."); |
32 | } |
32 | } |
33 | |
33 | |
34 | $ob->esrv_update_item (cf::UPD_NAME, $item); |
34 | $ob->esrv_update_item (cf::UPD_NAME, $item); |
35 | |
35 | |
36 | return 1; |
36 | 1 |
37 | } |
37 | } |
38 | |
38 | |
39 | sub who_listing(;$) { |
39 | sub who_listing(;$) { |
40 | my ($privileged) = @_; |
40 | my ($privileged) = @_; |
41 | |
41 | |
… | |
… | |
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->client . "]" |
67 | . " [" . ($pl->peaceful || $privileged ? $ob->map->path : $ob->map->region ? $ob->map->region->name : "the unknown") . "]" |
67 | . " [" . ($pl->peaceful || $privileged ? $ob->map->path : $ob->map->region ? $ob->map->region->name : "the unknown") . "]" |
68 | . ($privileged ? " " . $pl->host : "") |
68 | . ($privileged ? " " . $pl->host : "") |
69 | } sort { $a->ob->name cmp $b->ob->name } @pl |
69 | } sort { (lc $a->ob->name) cmp (lc $b->ob->name) } @pl |
70 | ) |
70 | ) |
71 | } |
71 | } |
72 | |
72 | |
73 | cf::register_command who => $cf::TICK, sub { |
73 | cf::register_command who => $cf::TICK, sub { |
74 | my ($ob, $arg) = @_; |
74 | my ($ob, $arg) = @_; |
75 | |
75 | |
76 | $ob->reply (undef, (join "\n", who_listing $ob->flag (cf::FLAG_WIZ)), cf::NDI_UNIQUE | cf::NDI_GOLD); |
76 | $ob->reply (undef, (join "\n", who_listing $ob->flag (cf::FLAG_WIZ)), cf::NDI_UNIQUE | cf::NDI_DK_ORANGE); |
|
|
77 | |
|
|
78 | 1 |
77 | }; |
79 | }; |
78 | |
80 | |
79 | cf::register_command rename => $cf::TICK, sub { |
81 | cf::register_command rename => $cf::TICK, sub { |
80 | my ($ob, $arg) = @_; |
82 | my ($ob, $arg) = @_; |
81 | |
83 | |
82 | if ($arg =~ /^\s* (?: <([^>]+)> \s+)? to \s+ <([^>]+)> \s*$/x) { |
84 | if ($arg =~ /^\s* (?: <([^>]+)> \s+)? to \s+ <([^>]*)> \s*$/x) { |
83 | # compatibility syntax |
85 | # compatibility syntax |
84 | rename_to $ob, $1, $2; |
86 | rename_to $ob, $1, $2; |
85 | } elsif ($arg =~ / |
87 | } elsif ($arg =~ / |
86 | ^\s* |
88 | ^\s* |
87 | (?: |
89 | (?: |
… | |
… | |
94 | # does not unquote $1 or $3 |
96 | # does not unquote $1 or $3 |
95 | rename_to $ob, $2||$1, $4||$3; |
97 | rename_to $ob, $2||$1, $4||$3; |
96 | } else { |
98 | } else { |
97 | $ob->reply (undef, 'Syntax error. Rename usage: rename ["oldname"] to "newname"'); |
99 | $ob->reply (undef, 'Syntax error. Rename usage: rename ["oldname"] to "newname"'); |
98 | } |
100 | } |
|
|
101 | |
|
|
102 | 1 |
99 | }; |
103 | }; |
|
|
104 | |