--- deliantra/server/ext/schmorplog.ext 2008/05/03 11:14:50 1.19 +++ deliantra/server/ext/schmorplog.ext 2008/09/01 09:12:42 1.21 @@ -116,7 +116,7 @@ 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_set ("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\n\n"; for (sort { $s->{$b} <=> $s->{$a} } keys %$s) { $rep .= "$s->{$_} time(s) due to $_.\n\n"; @@ -151,3 +151,17 @@ $cmd = lc $cmd; }; +# log "crash" messages, i.e. client exit reasons +cf::register_exticmd clientlog => sub { + my ($ns, $msg) = @_; + + my $name = $ns->pl && $ns->pl->ob ? $ns->pl->ob->name : ""; + + $msg =~ y/\x0a\x20-\x7f//cd; + $msg =~ s/\s+$//; + + warn sprintf "clientlog [%s/%s]: %s\n", $ns->host, $name, $msg; + + () +}; +