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.171 by root, Sat Sep 1 08:08:52 2007 UTC vs.
Revision 1.177 by root, Sat Nov 3 12:08:44 2007 UTC

10use CFPlus::UI; 10use CFPlus::UI;
11use CFPlus::Pod; 11use CFPlus::Pod;
12use CFPlus::Macro; 12use CFPlus::Macro;
13use CFPlus::Item; 13use CFPlus::Item;
14 14
15use Crossfire::Protocol::Base 0.95;
16
17use base 'Crossfire::Protocol::Base'; 15use base 'Crossfire::Protocol::Base';
18 16
19sub new { 17sub new {
20 my ($class, %arg) = @_; 18 my ($class, %arg) = @_;
21 19
22 my $self = $class->SUPER::new (%arg, 20 my $self = $class->SUPER::new (%arg,
23 setup_req => { 21 setup_req => {
24 extmap => 1, 22 extmap => 1,
25 excmd => 1, 23 excmd => 1,
26 xwidget2 => 1,#d# 24 widget => 1,
27 %{$arg{setup_req} || {}}, 25 %{$arg{setup_req} || {}},
28 }, 26 },
29 ); 27 );
30 28
31 $self->{map_widget}->clr_commands; 29 $self->{map_widget}->clr_commands;
969 967
970sub sanitise_xml($) { 968sub sanitise_xml($) {
971 local $_ = shift; 969 local $_ = shift;
972 970
973 # we now weed out all tags we do not support 971 # we now weed out all tags we do not support
974 s%<(?!/?i>|/?u>|/?b>|fg |/fg>)%&lt;%g; 972 s{ <(?! /?i> | /?u> | /?b> | /?big | /?small | /?s | /?tt | fg\ | /fg>)
973 }{
974 "&lt;"
975 }gex;
976
975 # now all entities 977 # now all entities
976 s/&(?!amp;|lt;|gt;|apos;|quot;|#[0-9]+;|#x[0-9a-fA-F]+;)/&amp;/g; 978 s/&(?!amp;|lt;|gt;|apos;|quot;|#[0-9]+;|#x[0-9a-fA-F]+;)/&amp;/g;
977 979
978 # handle some elements 980 # handle some elements
979 s/<fg name='([^']*)'>(.*?)<\/fg>/<span foreground='$1'>$2<\/span>/gs; 981 s/<fg name='([^']*)'>(.*?)<\/fg>/<span foreground='$1'>$2<\/span>/gs;
1038 ::message ({ 1040 ::message ({
1039 fg => $fg, 1041 fg => $fg,
1040 markup => $_, 1042 markup => $_,
1041 type => $type, 1043 type => $type,
1042 extra => [@extra], 1044 extra => [@extra],
1043 color_flags => $color, #d# ugly, kill 1045 color_flags => $color, #d# ugly, kill
1044 }); 1046 });
1045 1047
1046 $color &= ~NDI_CLEAR; # only clear once for multiline messages 1048 $color &= ~NDI_CLEAR; # only clear once for multiline messages
1047 # actually, this is an ugly design. _we_ should control the channels, 1049 # actually, this is an ugly design. _we_ should control the channels,
1048 # not some random other widget, as the channels are clearly protocol-specific. 1050 # not some random other widget, as the channels are clearly protocol-specific.
1053 $self->{statusbox}->add ($text, 1055 $self->{statusbox}->add ($text,
1054 group => $text, 1056 group => $text,
1055 fg => $fg, 1057 fg => $fg,
1056 timeout => $color >= 2 ? 180 : 10, 1058 timeout => $color >= 2 ? 180 : 10,
1057 tooltip_font => $::FONT_FIXED, 1059 tooltip_font => $::FONT_FIXED,
1058 ); 1060 ) if $type eq "info";
1059 } 1061 }
1060} 1062}
1061 1063
1062sub spell_add { 1064sub spell_add {
1063 my ($self, $spell) = @_; 1065 my ($self, $spell) = @_;
1301 0 1303 0
1302 }); 1304 });
1303 1305
1304 $self->update_server_info; 1306 $self->update_server_info;
1305 1307
1306 $self->send_command ("output-sync $::CFG->{output_sync}");
1307 $self->send_command ("output-count $::CFG->{output_count}");
1308 $self->send_command ("output-rate $::CFG->{output_rate}") if $::CFG->{output_rate} > 0; 1308 $self->send_command ("output-rate $::CFG->{output_rate}") if $::CFG->{output_rate} > 0;
1309 $self->send_command ("pickup $::CFG->{pickup}"); 1309 $self->send_command ("pickup $::CFG->{pickup}");
1310} 1310}
1311 1311
1312sub lookat { 1312sub lookat {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines