ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra/Deliantra/Protocol.pm
(Generate patch)

Comparing deliantra/Deliantra/Deliantra/Protocol.pm (file contents):
Revision 1.4 by root, Fri Apr 7 13:53:37 2006 UTC vs.
Revision 1.5 by root, Fri Apr 7 19:26:54 2006 UTC

99sub feed_face1 { 99sub feed_face1 {
100 my ($self, $data) = @_; 100 my ($self, $data) = @_;
101 101
102 my ($num, $chksum, $name) = unpack "nNa*", $data; 102 my ($num, $chksum, $name) = unpack "nNa*", $data;
103 103
104 $self->{face}[$num] = { name => $name, chksum => $chksum }; 104 my $face = $self->{face}[$num] = { name => $name, chksum => $chksum };
105 105
106 if (my $data = $self->face_find ($name, $chksum)) { 106 if (my $data = $self->face_find ($face)) {
107 $self->{face}[$num]{image} = $data; 107 $face->{image} = $data;
108 $self->face_update ($num, $self->{face}[$num]); 108 $self->face_update ($face);
109 } else { 109 } else {
110 $self->send ("askface $num"); 110 $self->send ("askface $num");
111 } 111 }
112} 112}
113 113
199 my ($self, $data) = @_; 199 my ($self, $data) = @_;
200 200
201 my ($num, $len, $data) = unpack "NNa*", $data; 201 my ($num, $len, $data) = unpack "NNa*", $data;
202 202
203 $self->{face}[$num]{image} = $data; 203 $self->{face}[$num]{image} = $data;
204 $self->face_update ($num, $self->{face}[$num]); 204 $self->face_update ($self->{face}[$num]);
205 205
206 my @dirty; 206 my @dirty;
207 207
208 for my $x (0..$self->{mapw} - 1) { 208 for my $x (0..$self->{mapw} - 1) {
209 for my $y (0..$self->{maph} - 1) { 209 for my $y (0..$self->{maph} - 1) {
237 237
238=cut 238=cut
239 239
240sub map_scroll { } 240sub map_scroll { }
241 241
242=item $conn->face_update ($facenum, $face) [OVERWRITE] 242=item $conn->face_update ($face) [OVERWRITE]
243 243
244Called with the face number of face structure whenever a face image has 244Called with the face number of face structure whenever a face image has
245changed. 245changed.
246 246
247=cut 247=cut
248 248
249sub face_update { } 249sub face_update { }
250 250
251=item $conn->face_find ($facenum, $face) [OVERWRITE] 251=item $conn->face_find ($face) [OVERWRITE]
252 252
253Find and return the png image for the given face, or the empty list if no 253Find and return the png image for the given face, or the empty list if no
254face could be found, in which case it will be requested from the server. 254face could be found, in which case it will be requested from the server.
255 255
256=cut 256=cut

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines