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.60 by root, Sun Jul 16 23:43:46 2006 UTC vs.
Revision 1.61 by root, Wed Jul 19 23:00:07 2006 UTC

585 [0.11, 0.56, 1.00], 585 [0.11, 0.56, 1.00],
586 [0.93, 0.46, 0.00], 586 [0.93, 0.46, 0.00],
587 [0.18, 0.54, 0.34], 587 [0.18, 0.54, 0.34],
588 [0.56, 0.73, 0.56], 588 [0.56, 0.73, 0.56],
589 [0.80, 0.80, 0.80], 589 [0.80, 0.80, 0.80],
590 [0.55, 0.41, 0.13], 590 [0.75, 0.61, 0.20],
591 [0.99, 0.77, 0.26], 591 [0.99, 0.77, 0.26],
592 [0.74, 0.65, 0.41], 592 [0.74, 0.65, 0.41],
593 ); 593 );
594 594
595 $self->logprint ("info: ", $text); 595 $self->logprint ("info: ", $text);
985 985
986 my ($type, $msg) = split / /, $data, 2; 986 my ($type, $msg) = split / /, $data, 2;
987 987
988 if ($type eq "msg") { 988 if ($type eq "msg") {
989 my ($msg, @kw) = split /\x00/, $msg; 989 my ($msg, @kw) = split /\x00/, $msg;
990
991 utf8::decode $_ for ($msg, @kw);
992
990 $self->{kw}{$_} = 1 for @kw; 993 $self->{kw}{$_} = 1 for @kw;
991 994
992 $msg = "\n" . CFClient::UI::Label::escape $msg; 995 $msg = "\n" . CFClient::UI::Label::escape $msg;
993 my $match = join "|", map "\\b\Q$_\E\\b", sort { (length $b) <=> (length $a) } keys %{ $self->{kw} }; 996 my $match = join "|", map "\\b\Q$_\E\\b", sort { (length $b) <=> (length $a) } keys %{ $self->{kw} };
994 my @link; 997 my @link;
1021} 1024}
1022 1025
1023sub send { 1026sub send {
1024 my ($self, $msg) = @_; 1027 my ($self, $msg) = @_;
1025 1028
1026 $self->{conn}->send ("ext npc_dialog_tell $self->{token} $msg");
1027 $self->{textview}->add_paragraph ([1, 1, 0, 1], "\n" . CFClient::UI::Label::escape $msg); 1029 $self->{textview}->add_paragraph ([1, 1, 0, 1], "\n" . CFClient::UI::Label::escape $msg);
1028 $self->{textview}->scroll_to_bottom; 1030 $self->{textview}->scroll_to_bottom;
1031
1032 utf8::encode $msg;
1033 $self->{conn}->send ("ext npc_dialog_tell $self->{token} $msg");
1029} 1034}
1030 1035
1031sub destroy { 1036sub destroy {
1032 my ($self) = @_; 1037 my ($self) = @_;
1033 1038

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines