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.78 by root, Tue Nov 7 00:15:27 2006 UTC vs.
Revision 1.79 by root, Tue Nov 7 14:58:35 2006 UTC

775sub cf::player::exists($) { 775sub cf::player::exists($) {
776 cf::player::find $_[0] 776 cf::player::find $_[0]
777 or -f sprintf "%s/%s/%s/%s.pl", cf::localdir, cf::playerdir, ($_[0]) x 2; 777 or -f sprintf "%s/%s/%s/%s.pl", cf::localdir, cf::playerdir, ($_[0]) x 2;
778} 778}
779 779
780=item $object->reply ($npc, $msg[, $flags]) 780=item $player_object->reply ($npc, $msg[, $flags])
781 781
782Sends a message to the player, as if the npc C<$npc> replied. C<$npc> 782Sends a message to the player, as if the npc C<$npc> replied. C<$npc>
783can be C<undef>. Does the right thing when the player is currently in a 783can be C<undef>. Does the right thing when the player is currently in a
784dialogue with the given NPC character. 784dialogue with the given NPC character.
785 785
812 $msg{msgid} = $id; 812 $msg{msgid} = $id;
813 813
814 $self->send ("ext " . to_json \%msg); 814 $self->send ("ext " . to_json \%msg);
815} 815}
816 816
817=back 817=item $player_object->may ("access")
818
819Returns wether the given player is authorized to access resource "access"
820(e.g. "command_wizcast").
821
822=cut
823
824sub cf::object::player::may {
825 my ($self, $access) = @_;
826
827 $self->flag (cf::FLAG_WIZ) ||
828 (ref $cf::CFG{"may_$access"}
829 ? scalar grep $self->name eq $_, @{$cf::CFG{"may_$access"}}
830 : $cf::CFG{"may_$access"})
831}
818 832
819=cut 833=cut
820 834
821############################################################################# 835#############################################################################
822 836
824 838
825Functions that provide a safe environment to compile and execute 839Functions that provide a safe environment to compile and execute
826snippets of perl code without them endangering the safety of the server 840snippets of perl code without them endangering the safety of the server
827itself. Looping constructs, I/O operators and other built-in functionality 841itself. Looping constructs, I/O operators and other built-in functionality
828is not available in the safe scripting environment, and the number of 842is not available in the safe scripting environment, and the number of
829functions and methods that cna be called is greatly reduced. 843functions and methods that can be called is greatly reduced.
830 844
831=cut 845=cut
832 846
833our $safe = new Safe "safe"; 847our $safe = new Safe "safe";
834our $safe_hole = new Safe::Hole; 848our $safe_hole = new Safe::Hole;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines