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.185 by root, Thu Dec 27 19:12:19 2007 UTC vs.
Revision 1.202 by root, Tue Sep 9 10:27:26 2008 UTC

11use DC::Pod; 11use DC::Pod;
12use DC::Macro; 12use DC::Macro;
13use DC::Item; 13use DC::Item;
14 14
15use base 'Deliantra::Protocol::Base'; 15use base 'Deliantra::Protocol::Base';
16
17our $TEX_DIALOGUE = new_from_resource DC::Texture
18 "dialogue.png", minify => 1, mipmap => 1;
19
20our $TEX_NOFACE = new_from_resource DC::Texture
21 "noface.png", minify => 1, mipmap => 1;
16 22
17sub new { 23sub new {
18 my ($class, %arg) = @_; 24 my ($class, %arg) = @_;
19 25
20 my $self = $class->SUPER::new (%arg, 26 my $self = $class->SUPER::new (%arg,
27 ); 33 );
28 34
29 $self->{map_widget}->clr_commands; 35 $self->{map_widget}->clr_commands;
30 36
31 my @cmd_help = map { 37 my @cmd_help = map {
32 $_->{kw}[0] =~ /^(\S+) (?:\s+ \( ([^\)]*) \) )?/x 38 $_->[DC::Pod::N_KW][0] =~ /^(\S+) (?:\s+ \( ([^\)]*) \) )?/x
33 or die "unparseable command help: $_->{kw}[0]"; 39 or die "unparseable command help: $_->[DC::Pod::N_KW][0]";
34 40
35 my $cmd = $1; 41 my $cmd = $1;
36 my @args = split /\|/, $2; 42 my @args = split /\|/, $2;
37 @args = (".*") unless @args; 43 @args = (".*") unless @args;
38 44
43 for @args; 49 for @args;
44 50
45 map ["$cmd$_", $text], 51 map ["$cmd$_", $text],
46 sort { (length $a) <=> (length $b) } 52 sort { (length $a) <=> (length $b) }
47 @args 53 @args
48 } sort { $a->{par} <=> $b->{par} } 54 } sort { $a->[DC::Pod::N_PAR] <=> $b->[DC::Pod::N_PAR] }
49 DC::Pod::find command => "*"; 55 DC::Pod::find command => "*";
50 56
51 $self->{json_coder} 57 $self->{json_coder}
52 ->convert_blessed 58 ->convert_blessed
53 ->filter_json_single_key_object ("\fw" => sub { 59 ->filter_json_single_key_object ("\fw" => sub {
64 $self->{on_stop_game_guard} = $self->{map_widget}{root}->connect (stop_game => sub { 70 $self->{on_stop_game_guard} = $self->{map_widget}{root}->connect (stop_game => sub {
65 for my $ws (values %{delete $self->{widgetset} || {}}) { 71 for my $ws (values %{delete $self->{widgetset} || {}}) {
66 $_->destroy 72 $_->destroy
67 for values %{delete $ws->{w} || {}}; 73 for values %{delete $ws->{w} || {}};
68 } 74 }
75
76 delete $self->{items};
77 $::INV->clear;
78 $::INVR_HB->clear;
79 $::FLOORBOX->clear;
69 }); 80 });
70 81
71 $self->{map_widget}->add_command (@$_) 82 $self->{map_widget}->add_command (@$_)
72 for @cmd_help; 83 for @cmd_help;
73 84
74 { 85 {
75 $self->{dialogue} = my $tex = new_from_file DC::Texture 86 $self->{dialogue} = my $tex = $TEX_DIALOGUE;
76 DC::find_rcfile "dialogue.png", minify => 1, mipmap => 1;
77 $self->{map}->set_texture (1, @$tex{qw(name w h s t)}, @{$tex->{minified}}); 87 $self->{map}->set_texture (1, @$tex{qw(name w h s t)}, @{$tex->{minified}});
78 } 88 }
79 89
80 { 90 {
81 $self->{noface} = my $tex = new_from_file DC::Texture 91 $self->{noface} = my $tex = $TEX_NOFACE;
82 DC::find_rcfile "noface.png", minify => 1, mipmap => 1;
83 $self->{map}->set_texture (2, @$tex{qw(name w h s t)}, @{$tex->{minified}}); 92 $self->{map}->set_texture (2, @$tex{qw(name w h s t)}, @{$tex->{minified}});
84 } 93 }
85 94
86 $self->{open_container} = 0; 95 $self->{open_container} = 0;
87 96
225 @w 234 @w
226 }; 235 };
227 236
228 # either array reference, or face # 237 # either array reference, or face #
229 if ($type eq "inline") { 238 if ($type eq "inline") {
239 $done_cb->();
230 $parse_list->($template); 240 $parse_list->($template);
231 $done_cb->();
232 } elsif ($type eq "face") { 241 } elsif ($type eq "face") {
233 #... 242 my $handler; $handler = $self->register_face_handler ($template, sub {
243 my ($face) = @_;
244
245 undef $handler;
234 $done_cb->(0); 246 $done_cb->();
247 $parse_list->($self->{json_coder}->decode ($face->{data}));
248 });
235 } else { 249 } else {
236 $done_cb->(0); 250 $done_cb->(0);
237 } 251 }
238} 252}
239 253
270 spell_list => $::SPELL_LIST, 284 spell_list => $::SPELL_LIST,
271 285
272 floorbox => $::FLOORBOX, 286 floorbox => $::FLOORBOX,
273 help_window => $::HELP_WINDOW, 287 help_window => $::HELP_WINDOW,
274 message_window => $::MESSAGE_WINDOW, 288 message_window => $::MESSAGE_WINDOW,
289 message_dist => $::MESSAGE_DIST,
275 statusbox => $::SDTATUSBOX, 290 statusbox => $::SDTATUSBOX,
276 291
277 inv => $::INV, 292 inv => $::INV,
278 invr => $::INVR, 293 invr => $::INVR,
279 invr_hb => $::INVR_HB, 294 invr_hb => $::INVR_HB,
328 343
329# message window 344# message window
330sub ext_channel_info { 345sub ext_channel_info {
331 my ($self, $info) = @_; 346 my ($self, $info) = @_;
332 $self->{channels}->{$info->{id}} = $info; 347 $self->{channels}->{$info->{id}} = $info;
333 $::MESSAGE_WINDOW->add_channel ($info); 348 $::MESSAGE_DIST->add_channel ($info);
334} 349}
335 350
336############################################################################# 351#############################################################################
337 352
338sub logprint { 353sub logprint {
520 $sktbl->clear; 535 $sktbl->clear;
521 536
522 my $sw = $self->{skillwid}{""} ||= [ 537 my $sw = $self->{skillwid}{""} ||= [
523 0, 0, (new DC::UI::Label text => "Experience", align => 1), 538 0, 0, (new DC::UI::Label text => "Experience", align => 1),
524 1, 0, (new DC::UI::Label text => "Lvl.", align => 1), 539 1, 0, (new DC::UI::Label text => "Lvl.", align => 1),
525 2, 0, (new DC::UI::Label text => "Progress", align => 0), 540 2, 0, (new DC::UI::Label text => "Progress"),
526 3, 0, (new DC::UI::Label text => "Skill", expand => 1), 541 3, 0, (new DC::UI::Label text => "Skill", expand => 1, align => 0),
527 4, 0, (new DC::UI::Label text => "Experience", align => 1), 542 4, 0, (new DC::UI::Label text => "Experience", align => 1),
528 5, 0, (new DC::UI::Label text => "Lvl.", align => 1), 543 5, 0, (new DC::UI::Label text => "Lvl.", align => 1),
529 6, 0, (new DC::UI::Label text => "Progress", align => 0), 544 6, 0, (new DC::UI::Label text => "Progress"),
530 7, 0, (new DC::UI::Label text => "Skill", expand => 1), 545 7, 0, (new DC::UI::Label text => "Skill", expand => 1, align => 0),
531 ]; 546 ];
532 547
533 my @add = @$sw; 548 my @add = @$sw;
534 549
535 my $TOOLTIP_ALL = "\n\n<small>Left click - ready skill\nMiddle click - use spell\nRight click - further options</small>"; 550 my $TOOLTIP_ALL = "\n\n<small>Left click - ready skill\nMiddle click - use spell\nRight click - further options</small>";
574 589
575 # progress 590 # progress
576 (new DC::UI::ExperienceProgress), 591 (new DC::UI::ExperienceProgress),
577 592
578 # label 593 # label
579 (new DC::UI::Label text => $name, on_button_down => $spell_cb, 594 (new DC::UI::Label text => $name, on_button_down => $spell_cb, align => 0,
580 can_events => 1, can_hover => 1, tooltip => (DC::Pod::section_label skill_description => $name) . $TOOLTIP_ALL), 595 can_events => 1, can_hover => 1, tooltip => (DC::Pod::section_label skill_description => $name) . $TOOLTIP_ALL),
581 ]; 596 ];
582 597
583 push @add, 598 push @add,
584 $x * 4 + 0, $y, $sw->[0], 599 $x * 4 + 0, $y, $sw->[0],
626} 641}
627 642
628sub map_scroll { 643sub map_scroll {
629 my ($self, $dx, $dy) = @_; 644 my ($self, $dx, $dy) = @_;
630 645
631 $self->{map}->scroll ($dx, $dy); 646 $self->{map_widget}->scroll ($dx, $dy);
632} 647}
633 648
634sub feed_map1a { 649sub feed_map1a {
635 my ($self, $data) = @_; 650 my ($self, $data) = @_;
636 651
673} 688}
674 689
675sub flush_map { 690sub flush_map {
676 my ($self) = @_; 691 my ($self) = @_;
677 692
678 my $map_info = delete $self->{map_info} 693 return unless $self->{map_info};
679 or return;
680 694
695 for my $map_info (values %{ $self->{map_cache} || {} }) {
681 my ($hash, $x, $y, $w, $h) = @$map_info; 696 my ($hash, $rdata, $x, $y, $w, $h) = @$map_info;
682 697
683 my $data = Compress::LZF::compress $self->{map}->get_rect ($x, $y, $w, $h); 698 my $data = $self->{map}->get_rect ($x, $y, $w, $h);
684 $self->{map_cache_new}{$hash} = \$data; 699
700 if ($data ne $$rdata) {
701 $map_info->[1] = \$data;
702 my $cdata = Compress::LZF::compress $data;
685 DC::DB::put $self->{mapcache} => $hash => $data, sub { }; 703 DC::DB::put $self->{mapcache} => $hash => $cdata, sub { };
704 }
705 }
686} 706}
687 707
688sub map_clear { 708sub map_clear {
689 my ($self) = @_; 709 my ($self) = @_;
690 710
691 $self->flush_map; 711 $self->flush_map;
712 delete $self->{map_info};
692 delete $self->{neigh_map}; 713 delete $self->{neigh_map};
693 714
694 $self->{map}->clear; 715 $self->{map}->clear;
695 delete $self->{map_widget}{magicmap}; 716 delete $self->{map_widget}{magicmap};
696} 717}
717 738
718 $self->bg_fetch; 739 $self->bg_fetch;
719 }; 740 };
720} 741}
721 742
722sub load_map($$$) { 743sub load_map($$$$$$) {
723 my ($self, $hash, $x, $y) = @_; 744 my ($self, $hash, $x, $y, $w, $h) = @_;
724 745
725 my $gen = $self->{map_change_gen}; 746 my $map_info = $self->{map_cache}{$hash} = [$hash, \"", $x, $y, $w, $h];
726 747
727 my $cb = sub { 748 my $cb = sub {
728 return unless $gen == $self->{map_change_gen}; 749 $map_info->[1] = \$_[0];
729 750
730 my ($data) = @_;
731
732 if (defined $data) {
733 $self->{map_cache_new}{$hash} = \$data;
734
735 my $data = Compress::LZF::decompress $data;
736
737 my $inprogress = @{ $self->{bg_fetch} || [] }; 751 my $inprogress = @{ $self->{bg_fetch} || [] };
738 unshift @{ $self->{bg_fetch} }, $self->{map}->set_rect ($x, $y, $data); 752 unshift @{ $self->{bg_fetch} }, $self->{map}->set_rect ($x, $y, $_[0]);
739 $self->bg_fetch unless $inprogress; 753 $self->bg_fetch unless $inprogress;
740 }
741 }; 754 };
742 755
743 if (my $rdata = $self->{map_cache_old}{$hash}) { 756 if (my $map_info = $self->{map_cache_old}{$hash}) {
744 $cb->($$rdata); 757 $cb->(${ $map_info->[1] });
745 } else { 758 } else {
759 my $gen = $self->{map_change_gen};
760
746 DC::DB::get $self->{mapcache} => $hash, $cb; 761 DC::DB::get $self->{mapcache} => $hash, sub {
762 return unless $gen == $self->{map_change_gen};
763 return unless defined $_[0];
764 $cb->(Compress::LZF::decompress $_[0]);
765 };
747 } 766 }
748} 767}
749 768
750# hardcode /world/world_xxx_xxx map names, the savings are enourmous, 769# hardcode /world/world_xxx_xxx map names, the savings are enourmous,
751# (server resource,s latency, bandwidth), so this hack is warranted. 770# (server resources, latency, bandwidth), so this hack is warranted.
752# the right fix is to make real tiled maps with an overview file 771# the right fix is to make real tiled maps with an overview file
753sub send_mapinfo { 772sub send_mapinfo {
754 my ($self, $data, $cb) = @_; 773 my ($self, $data, $cb) = @_;
755 774
756 if ($self->{map_info}[0] =~ m%^/world/world_(\d\d\d)_(\d\d\d)$%) { 775 if ($self->{map_info}[0] =~ m%^/world/world_(\d\d\d)_(\d\d\d)$%) {
781} 800}
782 801
783# this method does a "flood fill" into every tile direction 802# this method does a "flood fill" into every tile direction
784# it assumes that tiles are arranged in a rectangular grid, 803# it assumes that tiles are arranged in a rectangular grid,
785# i.e. a map is the same as the left of the right map etc. 804# i.e. a map is the same as the left of the right map etc.
786# failure to comply are harmless and result in display errors 805# failure to comply is harmless and results in display errors
787# at worst. 806# at worst.
788sub flood_fill { 807sub flood_fill {
789 my ($self, $block, $gx, $gy, $path, $hash, $flags) = @_; 808 my ($self, $block, $gx, $gy, $path, $hash, $flags) = @_;
790 809
791 # the server does not allow map paths > 6 810 # the server does not allow map paths > 6
827 return if $mode ne "spatial"; 846 return if $mode ne "spatial";
828 847
829 $x += $self->{map}->ox; 848 $x += $self->{map}->ox;
830 $y += $self->{map}->oy; 849 $y += $self->{map}->oy;
831 850
832 $self->load_map ($hash, $x, $y) 851 $self->load_map ($hash, $x, $y, $w, $h)
833 unless $self->{neigh_map}{$hash}[5]++;#d# 852 unless $self->{neigh_map}{$hash}[5]++;#d#
834 853
835 $neigh->[$tile] = [$flags, $x, $y, $w, $h, $hash]; 854 $neigh->[$tile] = [$flags, $x, $y, $w, $h, $hash];
836 855
837 $self->flood_fill ($block, $gx, $gy, "$path$tile", $hash, $flags) 856 $self->flood_fill ($block, $gx, $gy, "$path$tile", $hash, $flags)
845 my ($self, $mode, $flags, $x, $y, $w, $h, $hash) = @_; 864 my ($self, $mode, $flags, $x, $y, $w, $h, $hash) = @_;
846 865
847 $self->flush_map; 866 $self->flush_map;
848 867
849 ++$self->{map_change_gen}; 868 ++$self->{map_change_gen};
850 $self->{map_cache_old} = delete $self->{map_cache_new}; 869 $self->{map_cache_old} = delete $self->{map_cache};
851 870
852 my ($ox, $oy) = ($::MAP->ox, $::MAP->oy); 871 my ($ox, $oy) = ($::MAP->ox, $::MAP->oy);
853 872
854 my $mapmapw = $self->{mapmap}->{w}; 873 my $mapmapw = $self->{mapmap}->{w};
855 my $mapmaph = $self->{mapmap}->{h}; 874 my $mapmaph = $self->{mapmap}->{h};
867 $self->{map_info} = [$hash, $x, $y, $w, $h]; 886 $self->{map_info} = [$hash, $x, $y, $w, $h];
868 887
869 (my $map = $hash) =~ s/^.*?\/([^\/]+)$/\1/; 888 (my $map = $hash) =~ s/^.*?\/([^\/]+)$/\1/;
870 $::STATWIDS->{map}->set_text ("Map: " . $map); 889 $::STATWIDS->{map}->set_text ("Map: " . $map);
871 890
872 $self->load_map ($hash, $x, $y); 891 $self->load_map ($hash, $x, $y, $w, $h);
873 $self->flood_fill (0, 0, 0, "", $hash, $flags); 892 $self->flood_fill (0, 0, 0, "", $hash, $flags);
874} 893}
875 894
876sub face_find { 895sub face_find {
877 my ($self, $facenum, $face, $cb) = @_; 896 my ($self, $facenum, $face, $cb) = @_;
1019 s/&(?!amp;|lt;|gt;|apos;|quot;|#[0-9]+;|#x[0-9a-fA-F]+;)/&amp;/g; 1038 s/&(?!amp;|lt;|gt;|apos;|quot;|#[0-9]+;|#x[0-9a-fA-F]+;)/&amp;/g;
1020 1039
1021 # handle some elements 1040 # handle some elements
1022 s/<fg name='([^']*)'>(.*?)<\/fg>/<span foreground='$1'>$2<\/span>/gs; 1041 s/<fg name='([^']*)'>(.*?)<\/fg>/<span foreground='$1'>$2<\/span>/gs;
1023 s/<fg name="([^"]*)">(.*?)<\/fg>/<span foreground="$1">$2<\/span>/gs; 1042 s/<fg name="([^"]*)">(.*?)<\/fg>/<span foreground="$1">$2<\/span>/gs;
1043
1044 s/\s+$//;
1024 1045
1025 $_ 1046 $_
1026} 1047}
1027 1048
1028our %NAME_TO_COLOR = ( 1049our %NAME_TO_COLOR = (
1075 1096
1076 ## try to create single paragraphs of multiple lines sent by the server 1097 ## try to create single paragraphs of multiple lines sent by the server
1077 # no longer neecssary with TRT servers 1098 # no longer neecssary with TRT servers
1078 #$text =~ s/(?<=\S)\n(?=\w)/ /g; 1099 #$text =~ s/(?<=\S)\n(?=\w)/ /g;
1079 1100
1080 for (split /\n/, $text) {
1081 ::message ({ 1101 ::message ({
1082 fg => $fg, 1102 fg => $fg,
1083 markup => $_, 1103 markup => $text,
1084 type => $type, 1104 type => $type,
1085 extra => [@extra], 1105 extra => [@extra],
1086 color_flags => $color, #d# ugly, kill 1106 color_flags => $color, #d# ugly, kill
1087 }); 1107 });
1088 1108
1089 $color &= ~NDI_CLEAR; # only clear once for multiline messages 1109# $color &= ~NDI_CLEAR; # only clear once for multiline messages
1090 # actually, this is an ugly design. _we_ should control the channels, 1110# # actually, this is an ugly design. _we_ should control the channels,
1091 # not some random other widget, as the channels are clearly protocol-specific. 1111# # not some random other widget, as the channels are clearly protocol-specific.
1092 # then we could also react to flags such as CLEAR without resorting to 1112# # then we could also react to flags such as CLEAR without resorting to
1093 # hacks such as color_flags, above. 1113# # hacks such as color_flags, above.
1094 }
1095 1114
1096 $self->{statusbox}->add ($text, 1115 $self->{statusbox}->add ($text,
1097 group => $text, 1116 group => $text,
1098 fg => $fg, 1117 fg => $fg,
1099 timeout => $color >= 2 ? 180 : 10, 1118 timeout => $color >= 2 ? 180 : 10,
1134 1153
1135 my %skill_help; 1154 my %skill_help;
1136 1155
1137 for my $node (DC::Pod::find skill_description => "*") { 1156 for my $node (DC::Pod::find skill_description => "*") {
1138 my (undef, @par) = DC::Pod::section_of $node; 1157 my (undef, @par) = DC::Pod::section_of $node;
1139 $skill_help{$node->{kw}[0]} = DC::Pod::as_label @par; 1158 $skill_help{$node->[DC::Pod::N_KW][0]} = DC::Pod::as_label @par;
1140 }; 1159 };
1141 1160
1142 for my $skill (values %{$self->{skill_info}}) { 1161 for my $skill (values %{$self->{skill_info}}) {
1143 $self->{map_widget}->add_command ("ready_skill $skill", 1162 $self->{map_widget}->add_command ("ready_skill $skill",
1144 (DC::asxml "Ready the skill '$skill'\n\n") 1163 (DC::asxml "Ready the skill '$skill'\n\n")
1164 $::FLOORBOX->clear; 1183 $::FLOORBOX->clear;
1165 1184
1166 my @add; 1185 my @add;
1167 1186
1168 my $row; 1187 my $row;
1169 for (sort { $a->{count} <=> $b->{count} } values %{ $::CONN->{container}{$::CONN->{open_container} || 0} }) { 1188 for (sort { $b->{count} <=> $a->{count} } values %{ $::CONN->{container}{$::CONN->{open_container} || 0} }) {
1189 next if $_->{tag} & 0x80000000;
1170 if ($row < 6) { 1190 if ($row < 6) {
1171 local $_->{face_widget}; # hack to force recreation of widget 1191 local $_->{face_widget}; # hack to force recreation of widget
1172 local $_->{desc_widget}; # hack to force recreation of widget 1192 local $_->{desc_widget}; # hack to force recreation of widget
1173 DC::Item::update_widgets $_; 1193 DC::Item::update_widgets $_;
1174 1194
1201sub set_opencont { 1221sub set_opencont {
1202 my ($conn, $tag, $name) = @_; 1222 my ($conn, $tag, $name) = @_;
1203 $conn->{open_container} = $tag; 1223 $conn->{open_container} = $tag;
1204 update_floorbox; 1224 update_floorbox;
1205 1225
1206 $::INVR_HB->clear (); 1226 $::INVR_HB->clear;
1207 $::INVR_HB->add (new DC::UI::Label align => 0, expand => 1, text => $name); 1227 $::INVR_HB->add (new DC::UI::Label expand => 1, text => $name);
1208 1228
1209 if ($tag != 0) { # Floor isn't closable, is it? 1229 if ($tag != 0) { # Floor isn't closable, is it?
1210 $::INVR_HB->add (new DC::UI::Button 1230 $::INVR_HB->add (new DC::UI::Button
1211 text => "Close container", 1231 text => "Close container",
1212 tooltip => "Close the currently open container (if one is open)", 1232 tooltip => "Close the currently open container (if one is open)",
1267} 1287}
1268 1288
1269sub item_update { 1289sub item_update {
1270 my ($self, $item) = @_; 1290 my ($self, $item) = @_;
1271 1291
1272 #d# print "item_update: $item->{tag} in $item->{container} ($self->{player}{tag}) ($::CONN->{open_container})\n"; 1292 #print "item_update: $item->{tag} in $item->{container} pt($self->{player}{tag}) oc($::CONN->{open_container}) f($item->{flags})\n";
1273 1293
1274 DC::Item::update_widgets $item; 1294 DC::Item::update_widgets $item;
1275 1295
1276 if ($item->{tag} == $::CONN->{open_container} && not ($item->{flags} & F_OPEN)) { 1296 if ($item->{tag} == $::CONN->{open_container} && not ($item->{flags} & F_OPEN)) {
1277 set_opencont ($::CONN, 0, "Floor"); 1297 set_opencont ($::CONN, 0, "Floor");
1278 1298
1279 } elsif ($item->{flags} & F_OPEN) { 1299 } elsif ($item->{flags} & F_OPEN) {
1280 set_opencont ($::CONN, $item->{tag}, DC::Item::desc_string $item); 1300 set_opencont ($::CONN, $item->{tag}, DC::Item::desc_string $item);
1296 1316
1297 my $weight = .001 * $self->{player}{weight}; 1317 my $weight = .001 * $self->{player}{weight};
1298 my $limit = .001 * $self->{stat}{+CS_STAT_WEIGHT_LIM}; 1318 my $limit = .001 * $self->{stat}{+CS_STAT_WEIGHT_LIM};
1299 1319
1300 $::STATWIDS->{weight}->set_text (sprintf "Weight: %.1fkg", $weight); 1320 $::STATWIDS->{weight}->set_text (sprintf "Weight: %.1fkg", $weight);
1301 $::STATWIDS->{m_weight}->set_text (sprintf "%.1fkg", $limit); 1321 $::STATWIDS->{m_weight}->set_text (sprintf "Max Weight: %.1fkg", $limit);
1302 $::STATWIDS->{i_weight}->set_text (sprintf "%.1f/%.1fkg", $weight, $limit); 1322 $::STATWIDS->{i_weight}->set_text (sprintf "%.1f/%.1fkg", $weight, $limit);
1303} 1323}
1304 1324
1305sub update_server_info { 1325sub update_server_info {
1306 my ($self) = @_; 1326 my ($self) = @_;
1314 . "extended command support $yesno[$self->{setup}{extcmd} > 0]\n" 1334 . "extended command support $yesno[$self->{setup}{extcmd} > 0]\n"
1315 . "examine command support $yesno[$self->{setup}{excmd} > 0]\n" 1335 . "examine command support $yesno[$self->{setup}{excmd} > 0]\n"
1316 . "editing support $yesno[!!$self->{editor_support}]\n" 1336 . "editing support $yesno[!!$self->{editor_support}]\n"
1317 . "map attributes $yesno[$self->{setup}{extmap} > 0]\n" 1337 . "map attributes $yesno[$self->{setup}{extmap} > 0]\n"
1318 . "big image protocol support $yesno[$self->{setup}{fxix} > 0]\n" 1338 . "big image protocol support $yesno[$self->{setup}{fxix} > 0]\n"
1319 . "cfplus support $yesno[$self->{cfplus_ext} > 0]" 1339 . "client support $yesno[$self->{cfplus_ext} > 0]"
1320 . ($self->{cfplus_ext} > 0 ? ", version $self->{cfplus_ext}" : "") ."\n" 1340 . ($self->{cfplus_ext} > 0 ? ", version $self->{cfplus_ext}" : "") ."\n"
1321 . "map size $self->{mapw}×$self->{maph}\n" 1341 . "map size $self->{mapw}×$self->{maph}\n"
1322 ); 1342 );
1323 1343
1324} 1344}
1346 1366
1347 $self->update_server_info; 1367 $self->update_server_info;
1348 1368
1349 $self->send_command ("output-rate $::CFG->{output_rate}") if $::CFG->{output_rate} > 0; 1369 $self->send_command ("output-rate $::CFG->{output_rate}") if $::CFG->{output_rate} > 0;
1350 $self->send_command ("pickup $::CFG->{pickup}"); 1370 $self->send_command ("pickup $::CFG->{pickup}");
1371
1372 $self->send_exti_msg (clientlog => sprintf "OpenGL Info: %s [%s]",
1373 DC::OpenGL::gl_vendor, DC::OpenGL::gl_version);#d#
1351} 1374}
1352 1375
1353sub lookat { 1376sub lookat {
1354 my ($self, $x, $y) = @_; 1377 my ($self, $x, $y) = @_;
1355 1378

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines