… | |
… | |
1463 | sub expand_cfpod { |
1463 | sub expand_cfpod { |
1464 | ((my $self), (local $_)) = @_; |
1464 | ((my $self), (local $_)) = @_; |
1465 | |
1465 | |
1466 | # escape & and < |
1466 | # escape & and < |
1467 | s/&/&/g; |
1467 | s/&/&/g; |
1468 | s/(?<![BIUGH])</</g; |
1468 | s/(?<![BIUGHT])</</g; |
1469 | |
1469 | |
1470 | # this is buggy, it needs to properly take care of nested <'s |
1470 | # this is buggy, it needs to properly take care of nested <'s |
1471 | |
1471 | |
1472 | 1 while |
1472 | 1 while |
1473 | # replace B<>, I<>, U<> etc. |
1473 | # replace B<>, I<>, U<> etc. |
1474 | s/B<([^\>]*)>/<b>$1<\/b>/ |
1474 | s/B<([^\>]*)>/<b>$1<\/b>/ |
1475 | || s/I<([^\>]*)>/<i>$1<\/i>/ |
1475 | || s/I<([^\>]*)>/<i>$1<\/i>/ |
1476 | || s/U<([^\>]*)>/<u>$1<\/u>/ |
1476 | || s/U<([^\>]*)>/<u>$1<\/u>/ |
|
|
1477 | || s/T<([^\>]*)>/<big><b>$1<\/b><\/big>/ |
1477 | # replace G<male|female> tags |
1478 | # replace G<male|female> tags |
1478 | || s{G<([^>|]*)\|([^>]*)>}{ |
1479 | || s{G<([^>|]*)\|([^>]*)>}{ |
1479 | $self->gender ? $2 : $1 |
1480 | $self->gender ? $2 : $1 |
1480 | }ge |
1481 | }ge |
1481 | # replace H<hint text> |
1482 | # replace H<hint text> |
… | |
… | |
2091 | { |
2092 | { |
2092 | my $lock = cf::lock_acquire "map_data:$self->{path}"; |
2093 | my $lock = cf::lock_acquire "map_data:$self->{path}"; |
2093 | |
2094 | |
2094 | delete $cf::MAP{$self->path}; |
2095 | delete $cf::MAP{$self->path}; |
2095 | |
2096 | |
|
|
2097 | $self->unlink_save; |
|
|
2098 | |
2096 | bless $self, "cf::map"; |
2099 | bless $self, "cf::map"; |
2097 | delete $self->{deny_reset}; |
2100 | delete $self->{deny_reset}; |
2098 | $self->{deny_save} = 1; |
2101 | $self->{deny_save} = 1; |
2099 | $self->reset_timeout (1); |
2102 | $self->reset_timeout (1); |
2100 | $self->path ($self->{path} = "{nuke}/" . ($nuke_counter++)); |
2103 | $self->path ($self->{path} = "{nuke}/" . ($nuke_counter++)); |
2101 | |
|
|
2102 | $self->unlink_save; |
|
|
2103 | |
2104 | |
2104 | $cf::MAP{$self->path} = $self; |
2105 | $cf::MAP{$self->path} = $self; |
2105 | } |
2106 | } |
2106 | |
2107 | |
2107 | $self->reset; # polite request, might not happen |
2108 | $self->reset; # polite request, might not happen |
… | |
… | |
2511 | id => "identify", |
2512 | id => "identify", |
2512 | title => "Identify", |
2513 | title => "Identify", |
2513 | reply => undef, |
2514 | reply => undef, |
2514 | tooltip => "Items recently identified", |
2515 | tooltip => "Items recently identified", |
2515 | }, |
2516 | }, |
|
|
2517 | "c/examine" => { |
|
|
2518 | id => "examine", |
|
|
2519 | title => "Examine", |
|
|
2520 | reply => undef, |
|
|
2521 | tooltip => "Signs and other items you examined", |
|
|
2522 | }, |
2516 | ); |
2523 | ); |
2517 | |
2524 | |
2518 | sub cf::client::send_msg { |
2525 | sub cf::client::send_msg { |
2519 | my ($self, $channel, $msg, $color, @extra) = @_; |
2526 | my ($self, $channel, $msg, $color, @extra) = @_; |
2520 | |
2527 | |
… | |
… | |
2527 | |
2534 | |
2528 | if (ref $channel) { |
2535 | if (ref $channel) { |
2529 | # send meta info to client, if not yet sent |
2536 | # send meta info to client, if not yet sent |
2530 | unless (exists $self->{channel}{$channel->{id}}) { |
2537 | unless (exists $self->{channel}{$channel->{id}}) { |
2531 | $self->{channel}{$channel->{id}} = $channel; |
2538 | $self->{channel}{$channel->{id}} = $channel; |
2532 | $self->ext_msg (channel_info => $channel); |
2539 | $self->ext_msg (channel_info => $channel) |
|
|
2540 | if $self->can_msg; |
2533 | } |
2541 | } |
2534 | |
2542 | |
2535 | $channel = $channel->{id}; |
2543 | $channel = $channel->{id}; |
2536 | } |
2544 | } |
2537 | |
2545 | |