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.349 by root, Fri Aug 31 04:10:43 2007 UTC vs.
Revision 1.351 by root, Sun Sep 2 00:57:38 2007 UTC

2091 { 2091 {
2092 my $lock = cf::lock_acquire "map_data:$self->{path}"; 2092 my $lock = cf::lock_acquire "map_data:$self->{path}";
2093 2093
2094 delete $cf::MAP{$self->path}; 2094 delete $cf::MAP{$self->path};
2095 2095
2096 $self->unlink_save;
2097
2096 bless $self, "cf::map"; 2098 bless $self, "cf::map";
2097 delete $self->{deny_reset}; 2099 delete $self->{deny_reset};
2098 $self->{deny_save} = 1; 2100 $self->{deny_save} = 1;
2099 $self->reset_timeout (1); 2101 $self->reset_timeout (1);
2100 $self->path ($self->{path} = "{nuke}/" . ($nuke_counter++)); 2102 $self->path ($self->{path} = "{nuke}/" . ($nuke_counter++));
2101
2102 $self->unlink_save;
2103 2103
2104 $cf::MAP{$self->path} = $self; 2104 $cf::MAP{$self->path} = $self;
2105 } 2105 }
2106 2106
2107 $self->reset; # polite request, might not happen 2107 $self->reset; # polite request, might not happen
2504the message, with C<log> being the default. If C<$color> is negative, suppress 2504the message, with C<log> being the default. If C<$color> is negative, suppress
2505the message unless the client supports the msg packet. 2505the message unless the client supports the msg packet.
2506 2506
2507=cut 2507=cut
2508 2508
2509our %CHANNEL = (
2510 "c/identify" => {
2511 id => "identify",
2512 title => "Identify",
2513 reply => undef,
2514 tooltip => "Items recently identified",
2515 },
2516);
2517
2509sub cf::client::send_msg { 2518sub cf::client::send_msg {
2510 my ($self, $channel, $msg, $color, @extra) = @_; 2519 my ($self, $channel, $msg, $color, @extra) = @_;
2511 2520
2512 $msg = $self->pl->expand_cfpod ($msg); 2521 $msg = $self->pl->expand_cfpod ($msg);
2513 2522
2514 $color &= cf::NDI_CLIENT_MASK; # just in case... 2523 $color &= cf::NDI_CLIENT_MASK; # just in case...
2524
2525 # check predefined channels, for the benefit of C
2526 $channel = $CHANNEL{$channel} if $CHANNEL{$channel};
2515 2527
2516 if (ref $channel) { 2528 if (ref $channel) {
2517 # send meta info to client, if not yet sent 2529 # send meta info to client, if not yet sent
2518 unless (exists $self->{channel}{$channel->{id}}) { 2530 unless (exists $self->{channel}{$channel->{id}}) {
2519 $self->{channel}{$channel->{id}} = $channel; 2531 $self->{channel}{$channel->{id}} = $channel;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines