ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/ext/schmorplog.ext
(Generate patch)

Comparing deliantra/server/ext/schmorplog.ext (file contents):
Revision 1.19 by root, Sat May 3 11:14:50 2008 UTC vs.
Revision 1.21 by root, Mon Sep 1 09:12:42 2008 UTC

114 or return $who->reply ($npc, "I don't know any person named '$args'."); 114 or return $who->reply ($npc, "I don't know any person named '$args'.");
115 115
116 my $s = $pl->ob->{stats_death} 116 my $s = $pl->ob->{stats_death}
117 or return $who->reply ($npc, "$args didn't die even once."); 117 or return $who->reply ($npc, "$args didn't die even once.");
118 118
119 my $rep = "$args died a total of " . $pl->ob->kv_set ("schmorplog_death_count") . " times, among them:\n\n\n\n"; 119 my $rep = "$args died a total of " . $pl->ob->kv_get ("schmorplog_death_count") . " times, among them:\n\n\n\n";
120 120
121 for (sort { $s->{$b} <=> $s->{$a} } keys %$s) { 121 for (sort { $s->{$b} <=> $s->{$a} } keys %$s) {
122 $rep .= "$s->{$_} time(s) due to $_.\n\n"; 122 $rep .= "$s->{$_} time(s) due to $_.\n\n";
123 } 123 }
124 124
149 } 149 }
150 150
151 $cmd = lc $cmd; 151 $cmd = lc $cmd;
152}; 152};
153 153
154# log "crash" messages, i.e. client exit reasons
155cf::register_exticmd clientlog => sub {
156 my ($ns, $msg) = @_;
157
158 my $name = $ns->pl && $ns->pl->ob ? $ns->pl->ob->name : "<unknown>";
159
160 $msg =~ y/\x0a\x20-\x7f//cd;
161 $msg =~ s/\s+$//;
162
163 warn sprintf "clientlog [%s/%s]: %s\n", $ns->host, $name, $msg;
164
165 ()
166};
167

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines