… | |
… | |
12 | use base 'Crossfire::Protocol::Base'; |
12 | use base 'Crossfire::Protocol::Base'; |
13 | |
13 | |
14 | sub new { |
14 | sub new { |
15 | my $class = shift; |
15 | my $class = shift; |
16 | |
16 | |
17 | my $self = $class->SUPER::new (@_, setup_req => { extmap => 0 }); |
17 | my $self = $class->SUPER::new (@_, setup_req => { extmap => 1 }); |
18 | |
18 | |
19 | $self->{map_widget}->clr_commands; |
19 | $self->{map_widget}->clr_commands; |
20 | |
20 | |
21 | my @cmd_help = map { |
21 | my @cmd_help = map { |
22 | $_->{kw}[0] =~ /^(\S+) (?:\s+ \( ([^\)]*) \) )?/x |
22 | $_->{kw}[0] =~ /^(\S+) (?:\s+ \( ([^\)]*) \) )?/x |
… | |
… | |
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" |
… | |
… | |
877 | $::SERVER_INFO->set_markup ( |
883 | $::SERVER_INFO->set_markup ( |
878 | "server <tt>$self->{host}:$self->{port}</tt>\n" |
884 | "server <tt>$self->{host}:$self->{port}</tt>\n" |
879 | . "protocol version <tt>$self->{version}</tt>\n" |
885 | . "protocol version <tt>$self->{version}</tt>\n" |
880 | . "minimap support $yesno[$self->{setup}{mapinfocmd} > 0]\n" |
886 | . "minimap support $yesno[$self->{setup}{mapinfocmd} > 0]\n" |
881 | . "extended command support $yesno[$self->{setup}{extcmd} > 0]\n" |
887 | . "extended command support $yesno[$self->{setup}{extcmd} > 0]\n" |
|
|
888 | . "editor support $yesno[!!length $self->{cvs_root}]\n" |
|
|
889 | . "test server " . (length $self->{test_server} ? $self->{test_server} : $yesno[0]) . "\n" |
882 | . "map attributes $yesno[$self->{setup}{extmap} > 0]\n" |
890 | . "map attributes $yesno[$self->{setup}{extmap} > 0]\n" |
883 | . "cfplus support $yesno[$self->{cfplus_ext} > 0]" |
891 | . "cfplus support $yesno[$self->{cfplus_ext} > 0]" |
884 | . ($self->{cfplus_ext} > 0 ? ", version $self->{cfplus_ext}" : "") ."\n" |
892 | . ($self->{cfplus_ext} > 0 ? ", version $self->{cfplus_ext}" : "") ."\n" |
885 | . "map size $self->{mapw}×$self->{maph}\n" |
893 | . "map size $self->{mapw}×$self->{maph}\n" |
886 | ); |
894 | ); |
… | |
… | |
890 | my ($self) = @_; |
898 | my ($self) = @_; |
891 | |
899 | |
892 | $self->send_ext_req (cfplus_support => version => 1, sub { |
900 | $self->send_ext_req (cfplus_support => version => 1, sub { |
893 | $self->{cfplus_ext} = $_[0]{version}; |
901 | $self->{cfplus_ext} = $_[0]{version}; |
894 | $self->update_server_info; |
902 | $self->update_server_info; |
|
|
903 | |
|
|
904 | if ($self->{cfplus_ext} >= 2) { |
|
|
905 | $self->send_ext_req ("editor_support", sub { |
|
|
906 | $self->{cvs_root} = $_[0]{cvs_root}; |
|
|
907 | $self->{upload} = $_[0]{upload}; |
|
|
908 | $self->{test_server} = $_[0]{server}; |
|
|
909 | $self->update_server_info; |
|
|
910 | |
|
|
911 | 0 |
|
|
912 | }); |
|
|
913 | } |
895 | |
914 | |
896 | 0 |
915 | 0 |
897 | }); |
916 | }); |
898 | |
917 | |
899 | $self->update_server_info; |
918 | $self->update_server_info; |
… | |
… | |
1085 | |
1104 | |
1086 | $self->SUPER::destroy; |
1105 | $self->SUPER::destroy; |
1087 | } |
1106 | } |
1088 | |
1107 | |
1089 | 1 |
1108 | 1 |
|
|
1109 | |