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.84 by root, Fri Sep 29 00:56:06 2006 UTC vs.
Revision 1.86 by root, Sun Oct 8 21:22:30 2006 UTC

623 [0.74, 0.65, 0.41], 623 [0.74, 0.65, 0.41],
624 ); 624 );
625 625
626 $self->logprint ("info: ", $text); 626 $self->logprint ("info: ", $text);
627 627
628 my $time = sprintf "%02d:%02d:%02d", (localtime time)[2,1,0];
629
630 # try to create single paragraphs of multiple lines sent by the server 628 # try to create single paragraphs of multiple lines sent by the server
631 $text =~ s/(?<=\S)\n(?=\w)/ /g; 629 $text =~ s/(?<=\S)\n(?=\w)/ /g;
632 630
633 $text = CFPlus::asxml $text; 631 $text = CFPlus::asxml $text;
634 $text =~ s/\[b\](.*?)\[\/b\]/<b>\1<\/b>/g; 632 $text =~ s/\[b\](.*?)\[\/b\]/<b>\1<\/b>/g;
635 $text =~ s/\[color=(.*?)\](.*?)\[\/color\]/<span foreground='\1'>\2<\/span>/g; 633 $text =~ s/\[color=(.*?)\](.*?)\[\/color\]/<span foreground='\1'>\2<\/span>/g;
636 634
637 $self->{logview}->add_paragraph ({ fg => $color[$color], markup => $_ }) 635 ::message ({ fg => $color[$color], markup => $_ })
638 for map "<span foreground='#ffffff'>$time</span> $_", split /\n/, $text; 636 for split /\n/, $text;
639 $self->{logview}->scroll_to_bottom;
640 637
641 $self->{statusbox}->add ($text, 638 $self->{statusbox}->add ($text,
642 group => $text, 639 group => $text,
643 fg => $color[$color], 640 fg => $color[$color],
644 timeout => $color >= 2 ? 180 : 10, 641 timeout => $color >= 2 ? 180 : 10,
883 $::SERVER_INFO->set_markup ( 880 $::SERVER_INFO->set_markup (
884 "server <tt>$self->{host}:$self->{port}</tt>\n" 881 "server <tt>$self->{host}:$self->{port}</tt>\n"
885 . "protocol version <tt>$self->{version}</tt>\n" 882 . "protocol version <tt>$self->{version}</tt>\n"
886 . "minimap support $yesno[$self->{setup}{mapinfocmd} > 0]\n" 883 . "minimap support $yesno[$self->{setup}{mapinfocmd} > 0]\n"
887 . "extended command support $yesno[$self->{setup}{extcmd} > 0]\n" 884 . "extended command support $yesno[$self->{setup}{extcmd} > 0]\n"
885 . "editing support $yesno[!!$self->{editor_support}]\n"
888 . "map attributes $yesno[$self->{setup}{extmap} > 0]\n" 886 . "map attributes $yesno[$self->{setup}{extmap} > 0]\n"
889 . "cfplus support $yesno[$self->{cfplus_ext} > 0]" 887 . "cfplus support $yesno[$self->{cfplus_ext} > 0]"
890 . ($self->{cfplus_ext} > 0 ? ", version $self->{cfplus_ext}" : "") ."\n" 888 . ($self->{cfplus_ext} > 0 ? ", version $self->{cfplus_ext}" : "") ."\n"
891 . "map size $self->{mapw}×$self->{maph}\n" 889 . "map size $self->{mapw}×$self->{maph}\n"
892 ); 890 );
896 my ($self) = @_; 894 my ($self) = @_;
897 895
898 $self->send_ext_req (cfplus_support => version => 1, sub { 896 $self->send_ext_req (cfplus_support => version => 1, sub {
899 $self->{cfplus_ext} = $_[0]{version}; 897 $self->{cfplus_ext} = $_[0]{version};
900 $self->update_server_info; 898 $self->update_server_info;
899
900 if ($self->{cfplus_ext} >= 2) {
901 $self->send_ext_req ("editor_support", sub {
902 $self->{editor_support} = $_[0];
903 $self->update_server_info;
904
905 0
906 });
907 }
901 908
902 0 909 0
903 }); 910 });
904 911
905 $self->update_server_info; 912 $self->update_server_info;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines