ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/DC/Protocol.pm
(Generate patch)

Comparing deliantra/Deliantra-Client/DC/Protocol.pm (file contents):
Revision 1.106 by root, Sun Apr 29 20:03:08 2007 UTC vs.
Revision 1.107 by root, Sun Jun 24 03:46:46 2007 UTC

667); 667);
668 668
669sub msg { 669sub msg {
670 my ($self, $color, $type, $text, @extra) = @_; 670 my ($self, $color, $type, $text, @extra) = @_;
671 671
672 # we now weed out all tags we do not support
673 $text =~ s%<(?!/?i>|/?u>|/?b>|fg |/fg>)%&lt;%g;
674 # now all entities
675 $text =~ s/&(?!amp;|lt;|gt;|apos;|quot;|#[0-9]+;|#x[0-9a-fA-F]+;)/&amp;/g;
676
677 # handle some elements
678 $text =~ s/<fg name='([^']*)'>(.*?)<\/fg>/<span foreground='$1'>$2<\/span>/gs;
679 $text =~ s/<fg name="([^"]*)">(.*?)<\/fg>/<span foreground="$1">$2<\/span>/gs;
680
672 if (my $cb = $self->{cb_msg}{$type}) { 681 if (my $cb = $self->{cb_msg}{$type}) {
673 $_->($self, $color, $type, $text, @extra) for values %$cb; 682 $_->($self, $color, $type, $text, @extra) for values %$cb;
674 } elsif ($type =~ /^(?:chargen-race-title|chargen-race-description)$/) { 683 } elsif ($type =~ /^(?:chargen-race-title|chargen-race-description)$/) {
675 $type =~ s/-/_/g; 684 $type =~ s/-/_/g;
676 $self->{$type} = $text; 685 $self->{$type} = $text;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines