… | |
… | |
24 | or return; |
24 | or return; |
25 | aio_write $fh, 0, undef, $who, 0; |
25 | aio_write $fh, 0, undef, $who, 0; |
26 | aio_close $fh; |
26 | aio_close $fh; |
27 | }; |
27 | }; |
28 | }; |
28 | }; |
|
|
29 | |
|
|
30 | cf::object->attach ( |
|
|
31 | on_kill => sub { |
|
|
32 | my ($ob, $hitter) = @_; |
|
|
33 | |
|
|
34 | return unless $hitter; |
|
|
35 | $hitter = $hitter->outer_owner; |
|
|
36 | my $pl = $hitter->contr |
|
|
37 | or return; |
|
|
38 | |
|
|
39 | ++$hitter->{stats_kill}{$ob->name}; |
|
|
40 | }, |
|
|
41 | ); |
29 | |
42 | |
30 | cf::player->attach ( |
43 | cf::player->attach ( |
31 | on_login => sub { |
44 | on_login => sub { |
32 | my ($pl) = @_; |
45 | my ($pl) = @_; |
33 | $pl->ob->set_ob_key_value (schmorplog_last_login => time); |
46 | $pl->ob->set_ob_key_value (schmorplog_last_login => time); |
… | |
… | |
69 | }, |
82 | }, |
70 | on_death => sub { |
83 | on_death => sub { |
71 | my ($pl) = @_; |
84 | my ($pl) = @_; |
72 | ext::irc::do_notice (sprintf "%s was killed by %s", $pl->ob->name, $pl->killer_name); |
85 | ext::irc::do_notice (sprintf "%s was killed by %s", $pl->ob->name, $pl->killer_name); |
73 | |
86 | |
|
|
87 | ++$pl->ob->{stats_death}{$pl->killer_name}; |
|
|
88 | |
74 | $pl->ob->set_ob_key_value (schmorplog_death_count => |
89 | $pl->ob->set_ob_key_value (schmorplog_death_count => |
75 | 1 + $pl->ob->get_ob_key_value ("schmorplog_death_count")); |
90 | 1 + $pl->ob->get_ob_key_value ("schmorplog_death_count")); |
76 | }, |
91 | }, |
77 | on_load => sub { |
92 | on_load => sub { |
78 | my ($pl, $path) = @_; |
93 | my ($pl, $path) = @_; |