… | |
… | |
730 | |
730 | |
731 | ############################################################################# |
731 | ############################################################################# |
732 | |
732 | |
733 | =head2 ATTACHABLE OBJECTS |
733 | =head2 ATTACHABLE OBJECTS |
734 | |
734 | |
735 | Many objects in crossfire are so-called attachable objects. That means you can |
735 | Many objects in deliantra are so-called attachable objects. That means you can |
736 | attach callbacks/event handlers (a collection of which is called an "attachment") |
736 | attach callbacks/event handlers (a collection of which is called an "attachment") |
737 | to it. All such attachable objects support the following methods. |
737 | to it. All such attachable objects support the following methods. |
738 | |
738 | |
739 | In the following description, CLASS can be any of C<global>, C<object> |
739 | In the following description, CLASS can be any of C<global>, C<object> |
740 | C<player>, C<client> or C<map> (i.e. the attachable objects in |
740 | C<player>, C<client> or C<map> (i.e. the attachable objects in |
… | |
… | |
790 | =item cf::CLASS::attachment $name, ... |
790 | =item cf::CLASS::attachment $name, ... |
791 | |
791 | |
792 | Register an attachment by C<$name> through which attachable objects of the |
792 | Register an attachment by C<$name> through which attachable objects of the |
793 | given CLASS can refer to this attachment. |
793 | given CLASS can refer to this attachment. |
794 | |
794 | |
795 | Some classes such as crossfire maps and objects can specify attachments |
795 | Some classes such as deliantra maps and objects can specify attachments |
796 | that are attached at load/instantiate time, thus the need for a name. |
796 | that are attached at load/instantiate time, thus the need for a name. |
797 | |
797 | |
798 | These calls expect any number of the following handler/hook descriptions: |
798 | These calls expect any number of the following handler/hook descriptions: |
799 | |
799 | |
800 | =over 4 |
800 | =over 4 |
… | |
… | |
1388 | |
1388 | |
1389 | =back |
1389 | =back |
1390 | |
1390 | |
1391 | =head2 CORE EXTENSIONS |
1391 | =head2 CORE EXTENSIONS |
1392 | |
1392 | |
1393 | Functions and methods that extend core crossfire objects. |
1393 | Functions and methods that extend core deliantra objects. |
1394 | |
1394 | |
1395 | =cut |
1395 | =cut |
1396 | |
1396 | |
1397 | package cf::player; |
1397 | package cf::player; |
1398 | |
1398 | |
… | |
… | |
1622 | } |
1622 | } |
1623 | |
1623 | |
1624 | \@paths |
1624 | \@paths |
1625 | } |
1625 | } |
1626 | |
1626 | |
1627 | =item $protocol_xml = $player->expand_cfpod ($crossfire_pod) |
1627 | =item $protocol_xml = $player->expand_cfpod ($cfpod) |
1628 | |
1628 | |
1629 | Expand crossfire pod fragments into protocol xml. |
1629 | Expand deliantra pod fragments into protocol xml. |
1630 | |
1630 | |
1631 | =item $player->ext_reply ($msgid, @msg) |
1631 | =item $player->ext_reply ($msgid, @msg) |
1632 | |
1632 | |
1633 | Sends an ext reply to the player. |
1633 | Sends an ext reply to the player. |
1634 | |
1634 | |
… | |
… | |
2692 | $self->contr->savebed ($map, $x, $y) |
2692 | $self->contr->savebed ($map, $x, $y) |
2693 | if $exit->flag (cf::FLAG_DAMNED); |
2693 | if $exit->flag (cf::FLAG_DAMNED); |
2694 | |
2694 | |
2695 | 1 |
2695 | 1 |
2696 | }) { |
2696 | }) { |
2697 | $self->message ("Something went wrong deep within the crossfire server. " |
2697 | $self->message ("Something went wrong deep within the deliantra server. " |
2698 | . "I'll try to bring you back to the map you were before. " |
2698 | . "I'll try to bring you back to the map you were before. " |
2699 | . "Please report this to the dungeon master!", |
2699 | . "Please report this to the dungeon master!", |
2700 | cf::NDI_UNIQUE | cf::NDI_RED); |
2700 | cf::NDI_UNIQUE | cf::NDI_RED); |
2701 | |
2701 | |
2702 | warn "ERROR in enter_exit: $@"; |
2702 | warn "ERROR in enter_exit: $@"; |
… | |
… | |
2791 | ); |
2791 | ); |
2792 | |
2792 | |
2793 | sub cf::client::send_msg { |
2793 | sub cf::client::send_msg { |
2794 | my ($self, $channel, $msg, $color, @extra) = @_; |
2794 | my ($self, $channel, $msg, $color, @extra) = @_; |
2795 | |
2795 | |
2796 | $msg = $self->pl->expand_cfpod ($msg); |
2796 | $msg = $self->pl->expand_cfpod ($msg) |
|
|
2797 | unless $color & cf::NDI_VERBATIM; |
2797 | |
2798 | |
2798 | $color &= cf::NDI_CLIENT_MASK; # just in case... |
2799 | $color &= cf::NDI_CLIENT_MASK; # just in case... |
2799 | |
2800 | |
2800 | # check predefined channels, for the benefit of C |
2801 | # check predefined channels, for the benefit of C |
2801 | if ($CHANNEL{$channel}) { |
2802 | if ($CHANNEL{$channel}) { |