--- deliantra/server/ext/chat.ext 2007/02/28 19:23:21 1.5 +++ deliantra/server/ext/chat.ext 2007/07/22 14:17:57 1.22 @@ -1,4 +1,4 @@ -#! perl +#! perl # depends=irc #CONVERSION: PARTIAL # implement a replacement for the built-in say/chat/shout/tell/reply commands @@ -7,6 +7,20 @@ use NPC_Dialogue; use POSIX (); # for strftime only +our $SAY_CHANNEL = { + id => "say", + title => "Map", + reply => "say ", + tooltip => "Things said to and replied from npcs near you and other players on the same map only.", +}; + +our $CHAT_CHANNEL = { + id => "chat", + title => "Chat", + reply => "chat ", + tooltip => "Player chat and shouts, global to the server.", +}; + sub clean_timeouts($) { my ($player) = @_; my $NOW = time; @@ -24,34 +38,77 @@ } } +# send_irc ($format, @args, $msg) +# make sure the last argument is the message! +sub send_irc { + my ($format, @args) = @_; + my $msg = pop @args; + for (split /\n/, $msg) { + ext::irc::do_notice (sprintf $format, @args, $_) + } +} + cf::player->attach ( prio => -1000, on_login => sub { my ($pl) = @_; clean_timeouts $pl->ob; + $pl->ns->send_msg ($SAY_CHANNEL); + $pl->ns->send_msg ($CHAT_CHANNEL); }, - - 1 ); cf::register_command listen => sub { - my ($who, $msg) = @_; - my $player = cf::player::find_active $who->name; + my ($pl, $msg) = @_; + my $player = cf::player::find_active $pl->name; if ($msg ne "") { + $msg = 10 if $msg > 10; + my $prev_listen = $player->listening; $player->listening ($msg); if ($prev_listen == $player->listening) { - $who->message ("Your verbose level stayed $prev_listen.", cf::NDI_UNIQUE); + $pl->message ("Your verbose level stays at $prev_listen.", cf::NDI_UNIQUE); } else { - $who->message ("Your verbose level is now " . $player->listening . ". (previously: $prev_listen)", cf::NDI_UNIQUE); + $pl->message ("Your verbose level is now " . $player->listening . ". (previously: $prev_listen)", cf::NDI_UNIQUE); } } else { - $who->message ("Your verbose level is " . $player->listening . ".", cf::NDI_UNIQUE); + $pl->message ("Your verbose level is " . $player->listening . ".", cf::NDI_UNIQUE); } +}; + +cf::register_command cointoss => sub { + my ($pl, $msg) = @_; + + my $name = $pl->name; + my $coin = int rand 2 ? "Heads" : "Tails"; + + for my $other ( grep { $pl->on_same_map_as ($_->ob) } cf::player::list ) { + next + if $other->ob == $pl; + $other->ob->message ("$name flips a coin.... $coin!", cf::NDI_GREY | cf::NDI_UNIQUE); + } + + $pl->message ("You flip a coin.... $coin!", cf::NDI_GREY | cf::NDI_UNIQUE); +}; - 1 +cf::register_command orcknuckle => sub { + my ($pl, $msg) = @_; + my @orcknuckle = ("none", "beholder", "ghost", "knight", "princess", "dragon", "orc"); + + my $name = $pl->name; + + my ($i, $j, $k, $l) = ((int rand 5) + 1, (int rand 5) + 1, (int rand 5) + 1, (int rand 6) + 1); + my $result = "$orcknuckle[$i], $orcknuckle[$j], $orcknuckle[$k], $orcknuckle[$l]"; + + for my $other ( grep { $pl->on_same_map_as ($_->ob) } cf::player::list ) { + next + if $other->ob == $pl; + $other->ob->message ("$name rolls $result!", cf::NDI_GREY | cf::NDI_UNIQUE); + } + + $pl->message ("You roll $result!", cf::NDI_GREY | cf::NDI_UNIQUE); }; my $emotes = { @@ -191,7 +248,8 @@ self => "Have you got something in your eye?", }, params => { - target => " winks at .", + target => " winks at you.", + other => " winks at .", self => "You wink suggestively at .", }, self => { @@ -291,7 +349,8 @@ self => "You bleed all over your nice new armour.", }, params => { - target => " slashes his wrist and bleeds all over .", + target => " slashes his wrist and bleeds all over you.", + other => " slashes his wrist and bleeds all over .", self => "You slash your wrist and bleed all over ", }, self => { @@ -633,267 +692,259 @@ }, }, }; + for my $emotion (keys %$emotes) { cf::register_command $emotion => sub { - my ($ob, $tname) = @_; + my ($pl, $tname) = @_; cf::async { - my $name = $ob->name; + my $name = $pl->name; if ($tname eq $name) { my $emote = $emotes->{$emotion}->{self}; + + $emote->{other} = "You look away from ." + if !$emote->{other}; + $emote->{self} = "My god! Is that LEGAL?" + if !$emote->{self}; + $emote->{other} =~ s//$name/; - for my $other ( grep { $ob->on_same_map_as ($_->ob) } cf::player::list ) { + for my $other ( grep { $pl->on_same_map_as ($_->ob) } cf::player::list ) { next - if $other->ob == $ob; + if $other->ob == $pl; $other->ob->message ($emote->{other}, cf::NDI_GREY | cf::NDI_UNIQUE); } - $ob->message ($emote->{self}, cf::NDI_GREY | cf::NDI_UNIQUE); + $pl->message ($emote->{self}, cf::NDI_GREY | cf::NDI_UNIQUE); } elsif ($tname) { my $target = cf::player::find $tname - or return $ob->reply (undef, "$tname is not around."); + or return $pl->reply (undef, "$tname is not around."); my $emote = $emotes->{$emotion}->{params}; + + $emote->{other} = " is eyeing quizzically." + if !$emote->{other}; + $emote->{self} = "You are still nuts." + if !$emote->{self}; + $emote->{target} = "You get the distinct feeling that is nuts." + if !$emote->{target}; + $emote->{self} =~ s//$tname/; $emote->{target} =~ s//$name/; $emote->{other} =~ s//$tname/; $emote->{other} =~ s//$name/; - for my $other ( grep { $ob->on_same_map_as ($_->ob) } cf::player::list ) { + for my $other ( grep { $pl->on_same_map_as ($_->ob) } cf::player::list ) { next - if $other->ob == $ob or $other == $target; + if $other->ob == $pl or $other == $target; $other->ob->message ($emote->{other}, cf::NDI_GREY | cf::NDI_UNIQUE); } $target->ob->message ($emote->{target}, cf::NDI_GREY | cf::NDI_UNIQUE); - $ob->message ($emote->{self}, cf::NDI_GREY | cf::NDI_UNIQUE); + $pl->message ($emote->{self}, cf::NDI_GREY | cf::NDI_UNIQUE); } else { my $emote = $emotes->{$emotion}->{noparams}; $emote->{other} =~ s//$name/; + + $emote->{other} = " dances with glee." + if !$emote->{other}; + $emote->{self} = "You are a nut." + if !$emote->{self}; - for my $other ( grep { $ob->on_same_map_as ($_->ob) } cf::player::list ) { + for my $other ( grep { $pl->on_same_map_as ($_->ob) } cf::player::list ) { next - if $other->ob == $ob; + if $other->ob == $pl; $other->ob->message ($emote->{other}, cf::NDI_GREY | cf::NDI_UNIQUE); } - $ob->message ($emote->{self}, cf::NDI_GREY | cf::NDI_UNIQUE); + $pl->message ($emote->{self}, cf::NDI_GREY | cf::NDI_UNIQUE); } }; - - 1 }; } +cf::register_command me => sub { + my ($pl, $msg) = @_; + + my $name = $pl->name; + + $_->ns->send_msg ($SAY_CHANNEL => "* $name $msg", cf::NDI_GREY, $_ == $pl ? (reply => 1) : ()) + for grep $pl->on_same_map_as ($_->ob), cf::player::list; +}; + cf::register_command say => sub { - my ($who, $msg) = @_; + my ($pl, $msg) = @_; utf8::decode $msg; - return if $who->contr->invoke (cf::EVENT_PLAYER_SAY, $msg); + return if $pl->contr->invoke (cf::EVENT_PLAYER_SAY, $msg); if ($msg) { - my $name = $who->name; + my $name = $pl->name; + my @plonmap = grep $pl->on_same_map_as ($_->ob), cf::player::list; - utf8::encode $msg; # ->message not yet utf8-ified - $_->ob->message ("$name says: $msg", cf::NDI_GREY | cf::NDI_UNIQUE) - for grep $who->on_same_map_as ($_->ob), cf::player::list; - utf8::decode $msg; + $_->ns->send_msg ($SAY_CHANNEL => "$name says: $msg", cf::NDI_GREY, $_ == $pl ? (reply => 1) : ()) + for @plonmap; # npcs, magic_ears etc. - # first find all objects and theirt-level inventories - # within a 5x5 square # that have something resembling + # first find all objects and their first-level inventories + # within a 5x5 square that have something resembling # dialogue or support on_say. - my ($map, $x, $y) = ($who->map, $who->x - 2, $who->y - 2); + my ($map, $x, $y) = ($pl->map, $pl->x - 2, $pl->y - 2); for my $npc ( - grep +($_->invoke (cf::EVENT_OBJECT_SAY, $who->contr, $msg) && return) || NPC_Dialogue::has_dialogue $_, + grep +($_->invoke (cf::EVENT_OBJECT_SAY, $pl->contr, $msg) && return) || NPC_Dialogue::has_dialogue $_, map +($_, $_->inv), grep $_, map $map->at ($x + $_ % 5, $y + (int $_ / 5)), 0..24 ) { # if some listener teleported us somewhere else, stop right here - last unless $map->path == $who->map->path; + last unless $map->path == $pl->map->path; - my $dialog = new NPC_Dialogue ob => $who, npc => $npc; + my $dialog = new NPC_Dialogue pl => $pl->contr, npc => $npc; my ($reply, @kw) = $dialog->tell ($msg); if (defined $reply) { if ($npc->type == cf::MAGIC_EAR) { if (length $reply) { - $_->ob->message ($reply, cf::NDI_BROWN | cf::NDI_UNIQUE) - for grep $who->on_same_map_as ($_->ob), cf::player::list; + $_->contr->send_msg ($SAY_CHANNEL => $reply, cf::NDI_BROWN) + for @plonmap; } $npc->use_trigger; } else { if (length $reply) { - $_->ob->message ($npc->name . " says: $reply", cf::NDI_BROWN | cf::NDI_UNIQUE) - for grep $who->on_same_map_as ($_->ob), cf::player::list; + $_->contr->send_msg ($SAY_CHANNEL => $npc->name . " says: $reply", cf::NDI_BROWN) + for @plonmap; } } } if (@kw) { - $_->ob->message ("[further topics: " . (join ", ", @kw) . "]", cf::NDI_BROWN | cf::NDI_UNIQUE) - for grep $who->on_same_map_as ($_->ob), cf::player::list; + $_->contr->send_msg ($SAY_CHANNEL => "[further topics: " . (join ", ", @kw) . "]", cf::NDI_BROWN) + for @plonmap; } } } else { - $who->message ("What do you want to say?", cf::NDI_UNIQUE); + $pl->contr->send_msg ($SAY_CHANNEL => "What do you want to say?", 0, reply => 1); } - - 1 }; cf::register_command chat => sub { - my ($who, $msg) = @_; + my ($pl, $msg) = @_; utf8::decode $msg; - return if $who->contr->invoke (cf::EVENT_PLAYER_CHAT, $msg); + return if $pl->contr->invoke (cf::EVENT_PLAYER_CHAT, $msg); if ($msg) { - my $name = $who->name; + my $name = $pl->name; my $NOW = time; - utf8::encode $msg; # ->message not yet utf8-ified cf::LOG cf::llevDebug, sprintf "QBERT [%s] %s\n", $name, $msg; - ext::schmorp_irc::do_notice (sprintf "[%s] %s", $name, $msg); + send_irc ("[%s] %s", $name, $msg); - $_->ob->message ("$name chats: $msg", cf::NDI_BLUE) + $_->ns->send_msg ($CHAT_CHANNEL => "$name chats: $msg", cf::NDI_BLUE, $_ == $pl ? (reply => 1) : ()) for grep { $_->ob->{ext_ignore_shout}{$name} < $NOW && $_->listening >= 10 } cf::player::list; } else { - $who->message ("Chat what?", cf::NDI_UNIQUE); + $pl->ns->send_msg ($CHAT_CHANNEL => "Chat what?"); } - - 1 }; cf::register_command shout => sub { - my ($who, $msg) = @_; + my ($pl, $msg) = @_; utf8::decode $msg; - return if $who->contr->invoke (cf::EVENT_PLAYER_SHOUT, $msg); + return if $pl->contr->invoke (cf::EVENT_PLAYER_SHOUT, $msg); if ($msg) { my $NOW = time; - my $name = $who->name; + my $name = $pl->name; cf::LOG cf::llevDebug, sprintf "QBERT {%s} %s\n", $name, $msg; - ext::schmorp_irc::do_notice (sprintf "\007\0034{%s} %s\n", $name, $msg); + send_irc ("\007\0034{%s} %s\n", $name, $msg); - utf8::encode $msg; # ->message not yet utf8-ified - $_->ob->message ("$name shouts: $msg", cf::NDI_RED) + $_->ns->send_msg ($CHAT_CHANNEL => "$name shouts: $msg", cf::NDI_BLUE, $_ == $pl ? (reply => 1) : ()) for grep { $_->ob->{ext_ignore_shout}{$name} < $NOW && $_->listening >= 2 } cf::player::list; } else { - $who->message ("Shout what?", cf::NDI_UNIQUE); + $pl->ns->send_msg ($CHAT_CHANNEL => "Shout what?"); } - - 1 }; cf::register_command tell => sub { - my ($who, $args) = @_; + my ($ob, $args) = @_; my ($target, $msg) = split /\s+/, $args, 2; utf8::decode $msg; - return if $who->contr->invoke (cf::EVENT_PLAYER_TELL, $target, $msg); - - my $name = $who->name; + my $pl = $ob->contr; + my $ns = $pl->ns + or return; + my $name = $ob->name; + + return if $pl->invoke (cf::EVENT_PLAYER_TELL, $target, $msg); + + my $pl_channel = { + id => "tell-$target", + title => "$target", + reply => "tell $target ", + tooltip => "Private messages from/to $target", + }; if ($target =~ /irc\//) { my (undef, $nick) = split /\//, $target, 2; - $who->message ("You tell $target: $args"); - ext::schmorp_irc::do_notice (sprintf "(%s) %s: %s\n", $name, $nick, $msg); + $ns->send_msg ($pl_channel => "You tell $target: $args", reply => 1); + send_irc ("(%s) %s: %s\n", $name, $nick, $msg); } elsif (my $other = cf::player::find_active $target) { + my $other_channel = { + id => "tell-$name", + title => "$name", + reply => "tell $name ", + tooltip => "Private messages from/to $name", + }; if ($msg) { if ($target eq $name) { - $who->message ("You are talking to yourself, you freak!", cf::NDI_UNIQUE); + $ns->send_msg ($pl_channel => "You are talking to yourself, you freak!", reply => 1); } elsif ($other->ob->{ext_ignore_tell}{$name} >= time) { - $who->message ("$target ignores what you say. Give up on it.", cf::NDI_UNIQUE); + $ns->send_msg ($pl_channel => "$target ignores what you say. Give up on it.", reply => 1); } else { - utf8::encode $msg; # ->message not yet utf8-ified + return if $other->invoke (cf::EVENT_PLAYER_TOLD, $pl->contr, $msg); cf::LOG cf::llevDebug, sprintf "TELL [%s>%s] %s\n", $name, $target, $msg; - $who->message ("You tell $target: $msg"); - $other->ob->message ("$name tells you: $msg"); - $other->ob->{ext_last_tell} = $name; + $ns->send_msg ($pl_channel => "You tell $target: $msg", reply => 1); + $other->ns->send_msg ($other_channel => "$name tells you: $msg"); } } else { - $who->message ("What do you want to tell $target?", cf::NDI_UNIQUE); + $ns->send_msg ($pl_channel => "What do you want to tell $target?"); } } else { - $who->message ("No such player. Your message: $msg", cf::NDI_UNIQUE); + $ns->send_msg ($pl_channel => "No such player. Your message: $msg"); } - - 1 -}; - -cf::register_command reply => sub { - my ($who, $args) = @_; - my $name = $who->name; - - utf8::decode $args; - - return if $who->contr->invoke (cf::EVENT_PLAYER_TELL, $who->{ext_last_tell}, $args); - - if ($who->{ext_last_tell} =~ /irc\//) { - my (undef, $nick) = split /\//, $who->{ext_last_tell}, 2; - $who->message ("You tell " . $who->{ext_last_tell} . ": $args"); - ext::schmorp_irc::do_notice (sprintf "(%s) %s: %s\n", $name, $nick, $args); - } elsif (my $other = cf::player::find_active $who->{ext_last_tell}) { - - if ($args) { - $other->ob->{ext_ignore_tell}{$name} >= time - or delete $other->ob->{ext_ignore_tell}{$name}; - - if ($other->ob->{ext_ignore_tell}{$name} < time) { - utf8::encode $args; # ->message not yet utf8-ified - cf::LOG cf::llevDebug, sprintf "TELL [%s>%s] %s\n", $name, $other->ob->name, $args; - - $who->message ("You tell " . $other->ob->name . ": $args"); - $other->ob->message ("$name tells you: $args"); - $who->{ext_last_tell} = $other->ob->name; - } else { - $who->message ($other->ob->name . " ignores what you say. Give up on it.", cf::NDI_UNIQUE); - } - } else { - $who->message ("What do you want to tell ".$other->ob->name."?", cf::NDI_UNIQUE); - } - - } else { - $who->message ("Can't reply, player left. Your message: $args".$who->{ext_last_tell}, cf::NDI_UNIQUE); - } - - 1 }; cf::register_command ignore => sub { - my ($who, $args) = @_; + my ($pl, $args) = @_; my ($target, $type, $timeout) = split /\s+/, $args; if ($args eq "list") { - clean_timeouts $who; + clean_timeouts $pl; - if ((my @ignored_tell = sort keys %{$who->{ext_ignore_tell}}) - + (my @ignored_shout = sort keys %{$who->{ext_ignore_shout}})) { - $who->message ("Currently ignoring private messages from: ", cf::NDI_UNIQUE); - $who->message ((join ", ", @ignored_tell), cf::NDI_UNIQUE); - $who->message ("Currently ignoring shouts from: ", cf::NDI_UNIQUE); - $who->message ((join ", ", @ignored_shout), cf::NDI_UNIQUE); - $who->message ("To stop ignoring one, use unignore.", cf::NDI_UNIQUE); + if ((my @ignored_tell = sort keys %{$pl->{ext_ignore_tell}}) + + (my @ignored_shout = sort keys %{$pl->{ext_ignore_shout}})) { + $pl->message ("Currently ignoring private messages from: ", cf::NDI_UNIQUE); + $pl->message ((join ", ", @ignored_tell), cf::NDI_UNIQUE); + $pl->message ("Currently ignoring shouts from: ", cf::NDI_UNIQUE); + $pl->message ((join ", ", @ignored_shout), cf::NDI_UNIQUE); + $pl->message ("To stop ignoring one, use unignore.", cf::NDI_UNIQUE); } else { - $who->message ("Not ignoring anyone", cf::NDI_UNIQUE); + $pl->message ("Not ignoring anyone", cf::NDI_UNIQUE); } } elsif ($target && $type) { @@ -903,90 +954,61 @@ if (cf::player::exists $target) { if ($type eq "tell") { - $who->message ("Now ignoring private messages from $target for $timeout hours.", cf::NDI_UNIQUE); - $who->{ext_ignore_tell}{$target} = $absolute_timeout; + $pl->message ("Now ignoring private messages from $target for $timeout hours.", cf::NDI_UNIQUE); + $pl->{ext_ignore_tell}{$target} = $absolute_timeout; } elsif ($type eq "shout") { - $who->message ("Now ignoring shouts from $target for $timeout hours.", cf::NDI_UNIQUE); - $who->{ext_ignore_shout}{$target} = $absolute_timeout; + $pl->message ("Now ignoring shouts from $target for $timeout hours.", cf::NDI_UNIQUE); + $pl->{ext_ignore_shout}{$target} = $absolute_timeout; } elsif ($type eq "all") { - $who->message ("Now ignoring everything from $target for $timeout hours.", cf::NDI_UNIQUE); - $who->{ext_ignore_tell}{$target} = $absolute_timeout; - $who->{ext_ignore_shout}{$target} = $absolute_timeout; + $pl->message ("Now ignoring everything from $target for $timeout hours.", cf::NDI_UNIQUE); + $pl->{ext_ignore_tell}{$target} = $absolute_timeout; + $pl->{ext_ignore_shout}{$target} = $absolute_timeout; } else { - $who->message ("You need to specify tell, shout or all.", cf::NDI_UNIQUE); + $pl->message ("You need to specify tell, shout or all.", cf::NDI_UNIQUE); } } else { - $who->message ("No such player: $target", cf::NDI_UNIQUE); + $pl->message ("No such player: $target", cf::NDI_UNIQUE); } } else { - $who->message ("Usage: ignore \n" + $pl->message ("Usage: ignore \n" . "will ignore a player for hours.\n" . "Usage: ignore list\n" . "will show you a list of players currently ignored.", cf::NDI_UNIQUE); } - - 1 }; cf::register_command unignore => sub { - my ($who, $args) = @_; + my ($pl, $args) = @_; my ($target, $type) = split /\s+/, $args; if ($args eq "") { - if ($who->{ext_ignore_tell}) { - $who->message ("Currently ignoring private messages from: ", cf::NDI_UNIQUE); - $who->message ((join ", ", sort keys %{ $who->{ext_ignore_tell} }), cf::NDI_UNIQUE); - $who->message ("Currently ignoring shouts from: ", cf::NDI_UNIQUE); - $who->message ((join ", ", sort keys %{ $who->{ext_ignore_shout} }), cf::NDI_UNIQUE); + if ($pl->{ext_ignore_tell}) { + $pl->message ("Currently ignoring private messages from: ", cf::NDI_UNIQUE); + $pl->message ((join ", ", sort keys %{ $pl->{ext_ignore_tell} }), cf::NDI_UNIQUE); + $pl->message ("Currently ignoring shouts from: ", cf::NDI_UNIQUE); + $pl->message ((join ", ", sort keys %{ $pl->{ext_ignore_shout} }), cf::NDI_UNIQUE); } else { - $who->message ("Not ignoring anyone", cf::NDI_UNIQUE); + $pl->message ("Not ignoring anyone", cf::NDI_UNIQUE); } } else { if (cf::player::exists $target) { if ($type eq "tell") { - $who->message ("Not ignoring private messages from $target anymore.", cf::NDI_UNIQUE); - delete $who->{ext_ignore_tell} {$target}; + $pl->message ("Not ignoring private messages from $target anymore.", cf::NDI_UNIQUE); + delete $pl->{ext_ignore_tell} {$target}; } elsif ($type eq "shout") { - $who->message ("Not ignoring shouts from $target anymore.", cf::NDI_UNIQUE); - delete $who->{ext_ignore_shout}{$target}; + $pl->message ("Not ignoring shouts from $target anymore.", cf::NDI_UNIQUE); + delete $pl->{ext_ignore_shout}{$target}; } elsif ($type eq "all") { - $who->message ("Not ignoring anything from $target anymore.", cf::NDI_UNIQUE); - delete $who->{ext_ignore_tell} {$target}; - delete $who->{ext_ignore_shout}{$target}; + $pl->message ("Not ignoring anything from $target anymore.", cf::NDI_UNIQUE); + delete $pl->{ext_ignore_tell} {$target}; + delete $pl->{ext_ignore_shout}{$target}; } else { - $who->message ("You need to specify tell, shout or all.", cf::NDI_UNIQUE); + $pl->message ("You need to specify tell, shout or all.", cf::NDI_UNIQUE); } } else { - $who->message ("No such player or ambiguous name: $target", cf::NDI_UNIQUE); - } - } - - 1 -}; - -cf::register_command seen => sub { - my ($who, $args) = @_; - - if (my ($login) = $args =~ /(\S+)/) { - if ($login eq $who->name) { - $who->message ("Very funny, $login. Ha. Ha.", cf::NDI_UNIQUE); - } elsif (cf::player::find_active $login) { - $who->message ("$login is right here on this server!", cf::NDI_UNIQUE); - } elsif (cf::player::exists $login - and stat sprintf "%s/%s/%s/%s.pl", cf::localdir, cf::playerdir, ($login) x 2) { - my $time = (stat _)[9]; - - $who->message ("$login was last seen here " - . (POSIX::strftime "%Y-%m-%d %H:%M:%S +0000", gmtime $time) - . " which was " . (int +(time - $time) / 3600) . " hours ago.", cf::NDI_UNIQUE); - } else { - $who->message ("No player named $login is known to me.", cf::NDI_UNIQUE); + $pl->message ("No such player or ambiguous name: $target", cf::NDI_UNIQUE); } - } else { - $who->message ("Usage: seen ", cf::NDI_UNIQUE); } - - 1 };