ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/lib/cf.pm
(Generate patch)

Comparing deliantra/server/lib/cf.pm (file contents):
Revision 1.8 by root, Thu Mar 16 21:08:16 2006 UTC vs.
Revision 1.10 by root, Fri Mar 24 18:20:41 2006 UTC

22 print STDERR "cfperl: $msg"; 22 print STDERR "cfperl: $msg";
23 LOG llevError, "cfperl: $msg"; 23 LOG llevError, "cfperl: $msg";
24 }; 24 };
25} 25}
26 26
27my %ignore_set = (MAP_PROP_PATH => 1); # I hate the plug-in api. Deeply!
28
27# generate property mutators 29# generate property mutators
28sub prop_gen { 30sub prop_gen {
29 my ($prefix, $class) = @_; 31 my ($prefix, $class) = @_;
30 32
31 no strict 'refs'; 33 no strict 'refs';
41 $_[0]->get_property ($type, $idx) 43 $_[0]->get_property ($type, $idx)
42 }; 44 };
43 45
44 *{"$class\::set_$sub"} = sub { 46 *{"$class\::set_$sub"} = sub {
45 $_[0]->set_property ($type, $idx, $_[1]); 47 $_[0]->set_property ($type, $idx, $_[1]);
46 }; 48 } unless $ignore_set{$prop};
47 } 49 }
48} 50}
49 51
50# auto-generate most of the API 52# auto-generate most of the API
51 53
79 my ($data) = @_; 81 my ($data) = @_;
80 82
81 my $cb = $hook[$data->{event_code}] 83 my $cb = $hook[$data->{event_code}]
82 or return; 84 or return;
83 85
84 $_->($data) for values %$cb; 86 List::Util::max map $_->($data), values %$cb
85
86 ()
87} 87}
88 88
89sub inject_command { 89sub inject_command {
90 my ($name, $obj, $params) = @_; 90 my ($name, $obj, $params) = @_;
91 91

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines