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.374 by root, Wed Sep 19 22:07:16 2007 UTC vs.
Revision 1.378 by root, Thu Oct 4 11:36:54 2007 UTC

2273=cut 2273=cut
2274 2274
2275sub deref { 2275sub deref {
2276 my ($ref) = @_; 2276 my ($ref) = @_;
2277 2277
2278 # temporary compatibility#TODO#remove
2279 $ref =~ s{^<}{player/<};
2280
2281 if ($ref =~ m{^player\/(<1\.\d+>)/(.*)$}) { 2278 if ($ref =~ m{^player\/(<1\.[0-9a-f]+>)/(.*)$}) {
2282 my ($uuid, $name) = ($1, $2); 2279 my ($uuid, $name) = ($1, $2);
2283 my $pl = $cf::PLAYER_LOADING{$name} || cf::player::find $name 2280 my $pl = $cf::PLAYER_LOADING{$name} || cf::player::find $name
2284 or return; 2281 or return;
2285 $pl->ob->uuid eq $uuid 2282 $pl->ob->uuid eq $uuid
2286 or return; 2283 or return;
2633 2630
2634=cut 2631=cut
2635 2632
2636our %CHANNEL = ( 2633our %CHANNEL = (
2637 "c/identify" => { 2634 "c/identify" => {
2638 id => "identify", 2635 id => "infobox",
2639 title => "Identify", 2636 title => "Identify",
2640 reply => undef, 2637 reply => undef,
2641 tooltip => "Items recently identified", 2638 tooltip => "Items recently identified",
2642 }, 2639 },
2643 "c/examine" => { 2640 "c/examine" => {
2644 id => "examine", 2641 id => "infobox",
2645 title => "Examine", 2642 title => "Examine",
2646 reply => undef, 2643 reply => undef,
2647 tooltip => "Signs and other items you examined", 2644 tooltip => "Signs and other items you examined",
2648 }, 2645 },
2646 "c/lookat" => {
2647 id => "infobox",
2648 title => "Look",
2649 reply => undef,
2650 tooltip => "What you saw there",
2651 },
2649); 2652);
2650 2653
2651sub cf::client::send_msg { 2654sub cf::client::send_msg {
2652 my ($self, $channel, $msg, $color, @extra) = @_; 2655 my ($self, $channel, $msg, $color, @extra) = @_;
2653 2656
2654 $msg = $self->pl->expand_cfpod ($msg); 2657 $msg = $self->pl->expand_cfpod ($msg);
2655 2658
2656 $color &= cf::NDI_CLIENT_MASK; # just in case... 2659 $color &= cf::NDI_CLIENT_MASK; # just in case...
2657 2660
2658 # check predefined channels, for the benefit of C 2661 # check predefined channels, for the benefit of C
2659 $channel = $CHANNEL{$channel} if $CHANNEL{$channel}; 2662 if ($CHANNEL{$channel}) {
2663 $channel = $CHANNEL{$channel};
2660 2664
2665 $self->ext_msg (channel_info => $channel)
2666 if $self->can_msg;
2667
2668 $channel = $channel->{id};
2669
2661 if (ref $channel) { 2670 } elsif (ref $channel) {
2662 # send meta info to client, if not yet sent 2671 # send meta info to client, if not yet sent
2663 unless (exists $self->{channel}{$channel->{id}}) { 2672 unless (exists $self->{channel}{$channel->{id}}) {
2664 $self->{channel}{$channel->{id}} = $channel; 2673 $self->{channel}{$channel->{id}} = $channel;
2665 $self->ext_msg (channel_info => $channel) 2674 $self->ext_msg (channel_info => $channel)
2666 if $self->can_msg; 2675 if $self->can_msg;
3614 $AIO_POLL_WATCHER = Event->io ( 3623 $AIO_POLL_WATCHER = Event->io (
3615 reentrant => 0, 3624 reentrant => 0,
3616 data => WF_AUTOCANCEL, 3625 data => WF_AUTOCANCEL,
3617 fd => IO::AIO::poll_fileno, 3626 fd => IO::AIO::poll_fileno,
3618 poll => 'r', 3627 poll => 'r',
3619 prio => 6, 3628 prio => 0,
3620 cb => \&IO::AIO::poll_cb, 3629 cb => \&IO::AIO::poll_cb,
3621 ); 3630 );
3622} 3631}
3623 3632
3624my $_log_backtrace; 3633my $_log_backtrace;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines