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.68 by root, Tue Sep 12 23:45:16 2006 UTC vs.
Revision 1.69 by root, Mon Sep 18 01:10:35 2006 UTC

808 } 808 }
809 809
810 wantarray ? @res : $res[0] 810 wantarray ? @res : $res[0]
811} 811}
812 812
813=item cf::register_script_function $function => $cb
814
815Register a function that can be called from within map/npc scripts. The
816function should be reasonably secure and should be put into a package name
817like the extension.
818
819Example: register a function that gets called whenever a map script calls
820C<rent::overview>, as used by the C<rent> extension.
821
822 cf::register_script_function "rent::overview" => sub {
823 ...
824 };
825
826=cut
827
813sub register_script_function { 828sub register_script_function {
814 my ($fun, $cb) = @_; 829 my ($fun, $cb) = @_;
815 830
816 no strict 'refs'; 831 no strict 'refs';
817 *{"safe::$fun"} = $safe_hole->wrap ($cb); 832 *{"safe::$fun"} = $safe_hole->wrap ($cb);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines