--- deliantra/server/ext/schmorplog.ext 2008/09/19 01:39:45 1.22 +++ deliantra/server/ext/schmorplog.ext 2010/04/11 04:52:07 1.25 @@ -5,7 +5,7 @@ use Fcntl; use Coro::AIO; -our $UPDATE_LOGINS = EV::idle sub { +our $UPDATE_LOGINS = AE::idle sub { $_[0]->stop; cf::async { @@ -50,9 +50,7 @@ $pl->ob->kv_set (schmorplog_login_count => 1 + $pl->ob->kv_get ("schmorplog_login_count")); - (my $client = $pl->ns->version) =~ s/\n/\\n/g; - - $pl->ob->kv_set (schmorplog_client => $client); + $pl->ob->kv_set (schmorplog_client => $pl->ns->{who_version}); ext::irc::do_notice (sprintf "%s logged in", $pl->ob->name); @@ -121,10 +119,10 @@ my $s = $pl->ob->{stats_death} or return $who->reply ($npc, "$args didn't die even once."); - my $rep = "$args died a total of " . $pl->ob->kv_get ("schmorplog_death_count") . " times, among them:\n\n\n\n"; + my $rep = "$args died a total of " . $pl->ob->kv_get ("schmorplog_death_count") . " times, among them:\n\n"; for (sort { $s->{$b} <=> $s->{$a} } keys %$s) { - $rep .= "$s->{$_} time(s) due to $_.\n\n"; + $rep .= sprintf " C<%4d> time(s) due to %s.\n", $s->{$_}, $_; } $who->reply ($npc, $rep); @@ -137,9 +135,9 @@ my $s = $pl->ob->{stats_kill} or return $who->reply ($npc, "I don't know of I that $args has killed so far."); - my $rep = sprintf "\n\nC<%6s> %s\n\n", "Kills", "Name"; - for (sort { $s->{$a} <=> $s->{$b} } keys %$s) { - $rep .= sprintf "C<%6s> %s\n\n", $s->{$_}, $_; + my $rep = sprintf "Here is a list of all the kills I know about:\n\n"; + for (sort { $s->{$b} <=> $s->{$a} } keys %$s) { + $rep .= sprintf " C<%6s> %s\n", $s->{$_}, $_; } $who->reply ($npc, $rep); @@ -147,8 +145,8 @@ } elsif ($cmd eq "hi") { $who->reply ($npc, "Hello!\n\n" . "I am a statistician, I keep statistics about all people here.\n\n" - . "To know how often somebody died, ask C I\n\n" - . "To know how many kills somebody scored, ask C I"); + . " - To know how often somebody died, ask C I\n" + . " - To know how many kills somebody scored, ask C I"); } else { $who->reply ($npc, "No idea what you want of me, how about saying 'hi' first?"); }