--- deliantra/server/ext/commands.ext 2008/09/11 17:56:09 1.69 +++ deliantra/server/ext/commands.ext 2008/09/23 00:24:52 1.71 @@ -55,24 +55,26 @@ cf::register_command seen => sub { my ($pl, $args) = @_; - if (my ($login) = $args =~ /(\S+)/) { - if ($login eq $pl->name) { - $pl->message ("Very funny, $login. Ha. Ha.", cf::NDI_REPLY); - } elsif (cf::player::find_active $login) { - $pl->message ("$login is right here on this server!", cf::NDI_REPLY); - } elsif (cf::player::exists $login - and stat cf::player::path $login) { - my $time = (stat _)[9]; - - $pl->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_REPLY); + cf::async { + if (my ($login) = $args =~ /(\S+)/) { + if ($login eq $pl->name) { + $pl->message ("Very funny, $login. Ha. Ha.", cf::NDI_REPLY); + } elsif (cf::player::find_active $login) { + $pl->message ("$login is right here on this server!", cf::NDI_REPLY); + } elsif (cf::player::exists $login + and stat cf::player::path $login) { + my $time = (stat _)[9]; + + $pl->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_REPLY); + } else { + $pl->message ("No player named $login is known to me.", cf::NDI_REPLY); + } } else { - $pl->message ("No player named $login is known to me.", cf::NDI_REPLY); + $pl->message ("Usage: seen ", cf::NDI_REPLY); } - } else { - $pl->message ("Usage: seen ", cf::NDI_REPLY); - } + }; }; cf::register_command body => sub { @@ -172,8 +174,8 @@ ++$count{$pl->ob->region->longname}; } - my $msg = "In the world currently there are:\n\n" - . join "", map { sprintf "C<%2d >player(s) %s\r", $count{$_}, $_ } sort keys %count; + my $msg = "T\n\n" + . join "", map { sprintf " C<%3d >player(s) %s\r", $count{$_}, $_ } sort keys %count; $ob->send_msg ("c/who" => $msg, cf::NDI_REPLY | cf::NDI_CLEAR); };