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.82 by root, Sat Aug 19 02:53:48 2006 UTC vs.
Revision 1.86 by root, Sun Oct 8 21:22:30 2006 UTC

41 $self->{map_widget}->add_command (@$_) 41 $self->{map_widget}->add_command (@$_)
42 for @cmd_help; 42 for @cmd_help;
43 43
44 $self->{noface} = new_from_file CFPlus::Texture 44 $self->{noface} = new_from_file CFPlus::Texture
45 CFPlus::find_rcfile "noface.png", minify => 1, mipmap => 1; 45 CFPlus::find_rcfile "noface.png", minify => 1, mipmap => 1;
46
47 {
48 $self->{dialogue} = my $tex = new_from_file CFPlus::Texture
49 CFPlus::find_rcfile "dialogue.png", minify => 1, mipmap => 1;
50 $self->{map}->set_texture (1, @$tex{qw(name w h s t)}, @{$tex->{minified}});
51 }
46 52
47 $self->{open_container} = 0; 53 $self->{open_container} = 0;
48 54
49 # "global" 55 # "global"
50 $self->{tilecache} = CFPlus::db_table "tilecache" 56 $self->{tilecache} = CFPlus::db_table "tilecache"
617 [0.74, 0.65, 0.41], 623 [0.74, 0.65, 0.41],
618 ); 624 );
619 625
620 $self->logprint ("info: ", $text); 626 $self->logprint ("info: ", $text);
621 627
622 my $time = sprintf "%02d:%02d:%02d", (localtime time)[2,1,0];
623
624 # 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
625 $text =~ s/(?<=\S)\n(?=\w)/ /g; 629 $text =~ s/(?<=\S)\n(?=\w)/ /g;
626 630
627 $text = CFPlus::asxml $text; 631 $text = CFPlus::asxml $text;
628 $text =~ s/\[b\](.*?)\[\/b\]/<b>\1<\/b>/g; 632 $text =~ s/\[b\](.*?)\[\/b\]/<b>\1<\/b>/g;
629 $text =~ s/\[color=(.*?)\](.*?)\[\/color\]/<span foreground='\1'>\2<\/span>/g; 633 $text =~ s/\[color=(.*?)\](.*?)\[\/color\]/<span foreground='\1'>\2<\/span>/g;
630 634
631 $self->{logview}->add_paragraph ({ fg => $color[$color], markup => $_ }) 635 ::message ({ fg => $color[$color], markup => $_ })
632 for map "<span foreground='#ffffff'>$time</span> $_", split /\n/, $text; 636 for split /\n/, $text;
633 $self->{logview}->scroll_to_bottom;
634 637
635 $self->{statusbox}->add ($text, 638 $self->{statusbox}->add ($text,
636 group => $text, 639 group => $text,
637 fg => $color[$color], 640 fg => $color[$color],
638 timeout => $color >= 2 ? 180 : 10, 641 timeout => $color >= 2 ? 180 : 10,
877 $::SERVER_INFO->set_markup ( 880 $::SERVER_INFO->set_markup (
878 "server <tt>$self->{host}:$self->{port}</tt>\n" 881 "server <tt>$self->{host}:$self->{port}</tt>\n"
879 . "protocol version <tt>$self->{version}</tt>\n" 882 . "protocol version <tt>$self->{version}</tt>\n"
880 . "minimap support $yesno[$self->{setup}{mapinfocmd} > 0]\n" 883 . "minimap support $yesno[$self->{setup}{mapinfocmd} > 0]\n"
881 . "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"
882 . "map attributes $yesno[$self->{setup}{extmap} > 0]\n" 886 . "map attributes $yesno[$self->{setup}{extmap} > 0]\n"
883 . "cfplus support $yesno[$self->{cfplus_ext} > 0]" 887 . "cfplus support $yesno[$self->{cfplus_ext} > 0]"
884 . ($self->{cfplus_ext} > 0 ? ", version $self->{cfplus_ext}" : "") ."\n" 888 . ($self->{cfplus_ext} > 0 ? ", version $self->{cfplus_ext}" : "") ."\n"
885 . "map size $self->{mapw}×$self->{maph}\n" 889 . "map size $self->{mapw}×$self->{maph}\n"
886 ); 890 );
890 my ($self) = @_; 894 my ($self) = @_;
891 895
892 $self->send_ext_req (cfplus_support => version => 1, sub { 896 $self->send_ext_req (cfplus_support => version => 1, sub {
893 $self->{cfplus_ext} = $_[0]{version}; 897 $self->{cfplus_ext} = $_[0]{version};
894 $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 }
895 908
896 0 909 0
897 }); 910 });
898 911
899 $self->update_server_info; 912 $self->update_server_info;
1085 1098
1086 $self->SUPER::destroy; 1099 $self->SUPER::destroy;
1087} 1100}
1088 1101
10891 11021
1103

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines