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.184 by root, Thu Dec 27 18:35:56 2007 UTC vs.
Revision 1.201 by root, Wed Sep 3 06:35:55 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
194 ); 203 );
195} 204}
196 205
197# widgetset create template 206# widgetset create template
198sub ext_ws_ct { 207sub ext_ws_ct {
199 my ($self, $ws, $template, $cfg) = @_; 208 my ($self, $ws, $type, $template, $done_cb, $cfg) = @_;
200 209
201 $template = eval <<EOF; 210 $done_cb ||= sub { };
202[
203 Toplevel => {
204 s_id => "toplevel",
205 title => "Character Creation",
206 x => "center",
207 y => "center",
208 z => 5,
209 s_cl => [VBox => {s_cl => [
210 Label => {
211 text => "Character Creation",
212 fontsize => 1,
213 align => 0,
214 },
215 Label => {
216 markup => "View or Edit your character attributes below, then press <b>Finish</b> to create your character",
217 fontsize => 0.8,
218 align => 0,
219 },
220 Notebook => {
221 s_cl => [
222 Label => {
223 text => "hulla-hoop"
224 },
225 Entry => {
226 s_id => "entry",
227 },
228 ],
229 },
230 Button => {
231 s_id => "finish",
232 title => "Finish",
233 },
234 ]}],
235 },
236]
237EOF
238 die if $@;
239 211
240 my $parse_list; $parse_list = sub { 212 my $parse_list; $parse_list = sub {
241 my ($list) = @_; 213 my ($list) = @_;
242 my @w; 214 my @w;
243 215
260 } 232 }
261 233
262 @w 234 @w
263 }; 235 };
264 236
237 # either array reference, or face #
238 if ($type eq "inline") {
239 $done_cb->();
265 $parse_list->($template); 240 $parse_list->($template);
241 } elsif ($type eq "face") {
242 my $handler; $handler = $self->register_face_handler ($template, sub {
243 my ($face) = @_;
266 244
245 undef $handler;
246 $done_cb->();
247 $parse_list->($self->{json_coder}->decode ($face->{data}));
248 });
249 } else {
250 $done_cb->(0);
251 }
267} 252}
268 253
269# widgetset associate 254# widgetset associate
270sub ext_ws_a { 255sub ext_ws_a {
271 my ($self, %ass) = @_; 256 my ($self, %ass) = @_;
299 spell_list => $::SPELL_LIST, 284 spell_list => $::SPELL_LIST,
300 285
301 floorbox => $::FLOORBOX, 286 floorbox => $::FLOORBOX,
302 help_window => $::HELP_WINDOW, 287 help_window => $::HELP_WINDOW,
303 message_window => $::MESSAGE_WINDOW, 288 message_window => $::MESSAGE_WINDOW,
289 message_dist => $::MESSAGE_DIST,
304 statusbox => $::SDTATUSBOX, 290 statusbox => $::SDTATUSBOX,
305 291
306 inv => $::INV, 292 inv => $::INV,
307 invr => $::INVR, 293 invr => $::INVR,
308 invr_hb => $::INVR_HB, 294 invr_hb => $::INVR_HB,
357 343
358# message window 344# message window
359sub ext_channel_info { 345sub ext_channel_info {
360 my ($self, $info) = @_; 346 my ($self, $info) = @_;
361 $self->{channels}->{$info->{id}} = $info; 347 $self->{channels}->{$info->{id}} = $info;
362 $::MESSAGE_WINDOW->add_channel ($info); 348 $::MESSAGE_DIST->add_channel ($info);
363} 349}
364 350
365############################################################################# 351#############################################################################
366 352
367sub logprint { 353sub logprint {
549 $sktbl->clear; 535 $sktbl->clear;
550 536
551 my $sw = $self->{skillwid}{""} ||= [ 537 my $sw = $self->{skillwid}{""} ||= [
552 0, 0, (new DC::UI::Label text => "Experience", align => 1), 538 0, 0, (new DC::UI::Label text => "Experience", align => 1),
553 1, 0, (new DC::UI::Label text => "Lvl.", align => 1), 539 1, 0, (new DC::UI::Label text => "Lvl.", align => 1),
554 2, 0, (new DC::UI::Label text => "Progress", align => 0), 540 2, 0, (new DC::UI::Label text => "Progress"),
555 3, 0, (new DC::UI::Label text => "Skill", expand => 1), 541 3, 0, (new DC::UI::Label text => "Skill", expand => 1, align => 0),
556 4, 0, (new DC::UI::Label text => "Experience", align => 1), 542 4, 0, (new DC::UI::Label text => "Experience", align => 1),
557 5, 0, (new DC::UI::Label text => "Lvl.", align => 1), 543 5, 0, (new DC::UI::Label text => "Lvl.", align => 1),
558 6, 0, (new DC::UI::Label text => "Progress", align => 0), 544 6, 0, (new DC::UI::Label text => "Progress"),
559 7, 0, (new DC::UI::Label text => "Skill", expand => 1), 545 7, 0, (new DC::UI::Label text => "Skill", expand => 1, align => 0),
560 ]; 546 ];
561 547
562 my @add = @$sw; 548 my @add = @$sw;
563 549
564 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>";
603 589
604 # progress 590 # progress
605 (new DC::UI::ExperienceProgress), 591 (new DC::UI::ExperienceProgress),
606 592
607 # label 593 # label
608 (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,
609 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),
610 ]; 596 ];
611 597
612 push @add, 598 push @add,
613 $x * 4 + 0, $y, $sw->[0], 599 $x * 4 + 0, $y, $sw->[0],
655} 641}
656 642
657sub map_scroll { 643sub map_scroll {
658 my ($self, $dx, $dy) = @_; 644 my ($self, $dx, $dy) = @_;
659 645
660 $self->{map}->scroll ($dx, $dy); 646 $self->{map_widget}->scroll ($dx, $dy);
661} 647}
662 648
663sub feed_map1a { 649sub feed_map1a {
664 my ($self, $data) = @_; 650 my ($self, $data) = @_;
665 651
702} 688}
703 689
704sub flush_map { 690sub flush_map {
705 my ($self) = @_; 691 my ($self) = @_;
706 692
707 my $map_info = delete $self->{map_info} 693 return unless $self->{map_info};
708 or return;
709 694
695 for my $map_info (values %{ $self->{map_cache} || {} }) {
710 my ($hash, $x, $y, $w, $h) = @$map_info; 696 my ($hash, $rdata, $x, $y, $w, $h) = @$map_info;
711 697
712 my $data = Compress::LZF::compress $self->{map}->get_rect ($x, $y, $w, $h); 698 my $data = $self->{map}->get_rect ($x, $y, $w, $h);
713 $self->{map_cache_new}{$hash} = \$data; 699
700 if ($data ne $$rdata) {
701 $map_info->[1] = \$data;
702 my $cdata = Compress::LZF::compress $data;
714 DC::DB::put $self->{mapcache} => $hash => $data, sub { }; 703 DC::DB::put $self->{mapcache} => $hash => $cdata, sub { };
704 }
705 }
715} 706}
716 707
717sub map_clear { 708sub map_clear {
718 my ($self) = @_; 709 my ($self) = @_;
719 710
720 $self->flush_map; 711 $self->flush_map;
712 delete $self->{map_info};
721 delete $self->{neigh_map}; 713 delete $self->{neigh_map};
722 714
723 $self->{map}->clear; 715 $self->{map}->clear;
724 delete $self->{map_widget}{magicmap}; 716 delete $self->{map_widget}{magicmap};
725} 717}
746 738
747 $self->bg_fetch; 739 $self->bg_fetch;
748 }; 740 };
749} 741}
750 742
751sub load_map($$$) { 743sub load_map($$$$$$) {
752 my ($self, $hash, $x, $y) = @_; 744 my ($self, $hash, $x, $y, $w, $h) = @_;
753 745
754 my $gen = $self->{map_change_gen}; 746 my $map_info = $self->{map_cache}{$hash} = [$hash, \"", $x, $y, $w, $h];
755 747
756 my $cb = sub { 748 my $cb = sub {
757 return unless $gen == $self->{map_change_gen}; 749 $map_info->[1] = \$_[0];
758 750
759 my ($data) = @_;
760
761 if (defined $data) {
762 $self->{map_cache_new}{$hash} = \$data;
763
764 my $data = Compress::LZF::decompress $data;
765
766 my $inprogress = @{ $self->{bg_fetch} || [] }; 751 my $inprogress = @{ $self->{bg_fetch} || [] };
767 unshift @{ $self->{bg_fetch} }, $self->{map}->set_rect ($x, $y, $data); 752 unshift @{ $self->{bg_fetch} }, $self->{map}->set_rect ($x, $y, $_[0]);
768 $self->bg_fetch unless $inprogress; 753 $self->bg_fetch unless $inprogress;
769 }
770 }; 754 };
771 755
772 if (my $rdata = $self->{map_cache_old}{$hash}) { 756 if (my $map_info = $self->{map_cache_old}{$hash}) {
773 $cb->($$rdata); 757 $cb->(${ $map_info->[1] });
774 } else { 758 } else {
759 my $gen = $self->{map_change_gen};
760
775 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 };
776 } 766 }
777} 767}
778 768
779# hardcode /world/world_xxx_xxx map names, the savings are enourmous, 769# hardcode /world/world_xxx_xxx map names, the savings are enourmous,
780# (server resource,s latency, bandwidth), so this hack is warranted. 770# (server resources, latency, bandwidth), so this hack is warranted.
781# 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
782sub send_mapinfo { 772sub send_mapinfo {
783 my ($self, $data, $cb) = @_; 773 my ($self, $data, $cb) = @_;
784 774
785 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)$%) {
810} 800}
811 801
812# this method does a "flood fill" into every tile direction 802# this method does a "flood fill" into every tile direction
813# it assumes that tiles are arranged in a rectangular grid, 803# it assumes that tiles are arranged in a rectangular grid,
814# 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.
815# failure to comply are harmless and result in display errors 805# failure to comply is harmless and results in display errors
816# at worst. 806# at worst.
817sub flood_fill { 807sub flood_fill {
818 my ($self, $block, $gx, $gy, $path, $hash, $flags) = @_; 808 my ($self, $block, $gx, $gy, $path, $hash, $flags) = @_;
819 809
820 # the server does not allow map paths > 6 810 # the server does not allow map paths > 6
856 return if $mode ne "spatial"; 846 return if $mode ne "spatial";
857 847
858 $x += $self->{map}->ox; 848 $x += $self->{map}->ox;
859 $y += $self->{map}->oy; 849 $y += $self->{map}->oy;
860 850
861 $self->load_map ($hash, $x, $y) 851 $self->load_map ($hash, $x, $y, $w, $h)
862 unless $self->{neigh_map}{$hash}[5]++;#d# 852 unless $self->{neigh_map}{$hash}[5]++;#d#
863 853
864 $neigh->[$tile] = [$flags, $x, $y, $w, $h, $hash]; 854 $neigh->[$tile] = [$flags, $x, $y, $w, $h, $hash];
865 855
866 $self->flood_fill ($block, $gx, $gy, "$path$tile", $hash, $flags) 856 $self->flood_fill ($block, $gx, $gy, "$path$tile", $hash, $flags)
874 my ($self, $mode, $flags, $x, $y, $w, $h, $hash) = @_; 864 my ($self, $mode, $flags, $x, $y, $w, $h, $hash) = @_;
875 865
876 $self->flush_map; 866 $self->flush_map;
877 867
878 ++$self->{map_change_gen}; 868 ++$self->{map_change_gen};
879 $self->{map_cache_old} = delete $self->{map_cache_new}; 869 $self->{map_cache_old} = delete $self->{map_cache};
880 870
881 my ($ox, $oy) = ($::MAP->ox, $::MAP->oy); 871 my ($ox, $oy) = ($::MAP->ox, $::MAP->oy);
882 872
883 my $mapmapw = $self->{mapmap}->{w}; 873 my $mapmapw = $self->{mapmap}->{w};
884 my $mapmaph = $self->{mapmap}->{h}; 874 my $mapmaph = $self->{mapmap}->{h};
896 $self->{map_info} = [$hash, $x, $y, $w, $h]; 886 $self->{map_info} = [$hash, $x, $y, $w, $h];
897 887
898 (my $map = $hash) =~ s/^.*?\/([^\/]+)$/\1/; 888 (my $map = $hash) =~ s/^.*?\/([^\/]+)$/\1/;
899 $::STATWIDS->{map}->set_text ("Map: " . $map); 889 $::STATWIDS->{map}->set_text ("Map: " . $map);
900 890
901 $self->load_map ($hash, $x, $y); 891 $self->load_map ($hash, $x, $y, $w, $h);
902 $self->flood_fill (0, 0, 0, "", $hash, $flags); 892 $self->flood_fill (0, 0, 0, "", $hash, $flags);
903} 893}
904 894
905sub face_find { 895sub face_find {
906 my ($self, $facenum, $face, $cb) = @_; 896 my ($self, $facenum, $face, $cb) = @_;
1048 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;
1049 1039
1050 # handle some elements 1040 # handle some elements
1051 s/<fg name='([^']*)'>(.*?)<\/fg>/<span foreground='$1'>$2<\/span>/gs; 1041 s/<fg name='([^']*)'>(.*?)<\/fg>/<span foreground='$1'>$2<\/span>/gs;
1052 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+$//;
1053 1045
1054 $_ 1046 $_
1055} 1047}
1056 1048
1057our %NAME_TO_COLOR = ( 1049our %NAME_TO_COLOR = (
1163 1155
1164 my %skill_help; 1156 my %skill_help;
1165 1157
1166 for my $node (DC::Pod::find skill_description => "*") { 1158 for my $node (DC::Pod::find skill_description => "*") {
1167 my (undef, @par) = DC::Pod::section_of $node; 1159 my (undef, @par) = DC::Pod::section_of $node;
1168 $skill_help{$node->{kw}[0]} = DC::Pod::as_label @par; 1160 $skill_help{$node->[DC::Pod::N_KW][0]} = DC::Pod::as_label @par;
1169 }; 1161 };
1170 1162
1171 for my $skill (values %{$self->{skill_info}}) { 1163 for my $skill (values %{$self->{skill_info}}) {
1172 $self->{map_widget}->add_command ("ready_skill $skill", 1164 $self->{map_widget}->add_command ("ready_skill $skill",
1173 (DC::asxml "Ready the skill '$skill'\n\n") 1165 (DC::asxml "Ready the skill '$skill'\n\n")
1193 $::FLOORBOX->clear; 1185 $::FLOORBOX->clear;
1194 1186
1195 my @add; 1187 my @add;
1196 1188
1197 my $row; 1189 my $row;
1198 for (sort { $a->{count} <=> $b->{count} } values %{ $::CONN->{container}{$::CONN->{open_container} || 0} }) { 1190 for (sort { $b->{count} <=> $a->{count} } values %{ $::CONN->{container}{$::CONN->{open_container} || 0} }) {
1191 next if $_->{tag} & 0x80000000;
1199 if ($row < 6) { 1192 if ($row < 6) {
1200 local $_->{face_widget}; # hack to force recreation of widget 1193 local $_->{face_widget}; # hack to force recreation of widget
1201 local $_->{desc_widget}; # hack to force recreation of widget 1194 local $_->{desc_widget}; # hack to force recreation of widget
1202 DC::Item::update_widgets $_; 1195 DC::Item::update_widgets $_;
1203 1196
1230sub set_opencont { 1223sub set_opencont {
1231 my ($conn, $tag, $name) = @_; 1224 my ($conn, $tag, $name) = @_;
1232 $conn->{open_container} = $tag; 1225 $conn->{open_container} = $tag;
1233 update_floorbox; 1226 update_floorbox;
1234 1227
1235 $::INVR_HB->clear (); 1228 $::INVR_HB->clear;
1236 $::INVR_HB->add (new DC::UI::Label align => 0, expand => 1, text => $name); 1229 $::INVR_HB->add (new DC::UI::Label expand => 1, text => $name);
1237 1230
1238 if ($tag != 0) { # Floor isn't closable, is it? 1231 if ($tag != 0) { # Floor isn't closable, is it?
1239 $::INVR_HB->add (new DC::UI::Button 1232 $::INVR_HB->add (new DC::UI::Button
1240 text => "Close container", 1233 text => "Close container",
1241 tooltip => "Close the currently open container (if one is open)", 1234 tooltip => "Close the currently open container (if one is open)",
1296} 1289}
1297 1290
1298sub item_update { 1291sub item_update {
1299 my ($self, $item) = @_; 1292 my ($self, $item) = @_;
1300 1293
1301 #d# print "item_update: $item->{tag} in $item->{container} ($self->{player}{tag}) ($::CONN->{open_container})\n"; 1294 #print "item_update: $item->{tag} in $item->{container} pt($self->{player}{tag}) oc($::CONN->{open_container}) f($item->{flags})\n";
1302 1295
1303 DC::Item::update_widgets $item; 1296 DC::Item::update_widgets $item;
1304 1297
1305 if ($item->{tag} == $::CONN->{open_container} && not ($item->{flags} & F_OPEN)) { 1298 if ($item->{tag} == $::CONN->{open_container} && not ($item->{flags} & F_OPEN)) {
1306 set_opencont ($::CONN, 0, "Floor"); 1299 set_opencont ($::CONN, 0, "Floor");
1307 1300
1308 } elsif ($item->{flags} & F_OPEN) { 1301 } elsif ($item->{flags} & F_OPEN) {
1309 set_opencont ($::CONN, $item->{tag}, DC::Item::desc_string $item); 1302 set_opencont ($::CONN, $item->{tag}, DC::Item::desc_string $item);
1325 1318
1326 my $weight = .001 * $self->{player}{weight}; 1319 my $weight = .001 * $self->{player}{weight};
1327 my $limit = .001 * $self->{stat}{+CS_STAT_WEIGHT_LIM}; 1320 my $limit = .001 * $self->{stat}{+CS_STAT_WEIGHT_LIM};
1328 1321
1329 $::STATWIDS->{weight}->set_text (sprintf "Weight: %.1fkg", $weight); 1322 $::STATWIDS->{weight}->set_text (sprintf "Weight: %.1fkg", $weight);
1330 $::STATWIDS->{m_weight}->set_text (sprintf "%.1fkg", $limit); 1323 $::STATWIDS->{m_weight}->set_text (sprintf "Max Weight: %.1fkg", $limit);
1331 $::STATWIDS->{i_weight}->set_text (sprintf "%.1f/%.1fkg", $weight, $limit); 1324 $::STATWIDS->{i_weight}->set_text (sprintf "%.1f/%.1fkg", $weight, $limit);
1332} 1325}
1333 1326
1334sub update_server_info { 1327sub update_server_info {
1335 my ($self) = @_; 1328 my ($self) = @_;
1343 . "extended command support $yesno[$self->{setup}{extcmd} > 0]\n" 1336 . "extended command support $yesno[$self->{setup}{extcmd} > 0]\n"
1344 . "examine command support $yesno[$self->{setup}{excmd} > 0]\n" 1337 . "examine command support $yesno[$self->{setup}{excmd} > 0]\n"
1345 . "editing support $yesno[!!$self->{editor_support}]\n" 1338 . "editing support $yesno[!!$self->{editor_support}]\n"
1346 . "map attributes $yesno[$self->{setup}{extmap} > 0]\n" 1339 . "map attributes $yesno[$self->{setup}{extmap} > 0]\n"
1347 . "big image protocol support $yesno[$self->{setup}{fxix} > 0]\n" 1340 . "big image protocol support $yesno[$self->{setup}{fxix} > 0]\n"
1348 . "cfplus support $yesno[$self->{cfplus_ext} > 0]" 1341 . "client support $yesno[$self->{cfplus_ext} > 0]"
1349 . ($self->{cfplus_ext} > 0 ? ", version $self->{cfplus_ext}" : "") ."\n" 1342 . ($self->{cfplus_ext} > 0 ? ", version $self->{cfplus_ext}" : "") ."\n"
1350 . "map size $self->{mapw}×$self->{maph}\n" 1343 . "map size $self->{mapw}×$self->{maph}\n"
1351 ); 1344 );
1352 1345
1353} 1346}
1375 1368
1376 $self->update_server_info; 1369 $self->update_server_info;
1377 1370
1378 $self->send_command ("output-rate $::CFG->{output_rate}") if $::CFG->{output_rate} > 0; 1371 $self->send_command ("output-rate $::CFG->{output_rate}") if $::CFG->{output_rate} > 0;
1379 $self->send_command ("pickup $::CFG->{pickup}"); 1372 $self->send_command ("pickup $::CFG->{pickup}");
1373
1374 $self->send_exti_msg (clientlog => sprintf "OpenGL Info: %s [%s]",
1375 DC::OpenGL::gl_vendor, DC::OpenGL::gl_version);#d#
1380} 1376}
1381 1377
1382sub lookat { 1378sub lookat {
1383 my ($self, $x, $y) = @_; 1379 my ($self, $x, $y) = @_;
1384 1380

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines