Crossfire Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CF: images & caching.




>> Seems to me that the biggest issue is to develop a method which client
>> can quickly and efficiently verify it has a complete local cache and
>> get whatever updates of whatever missing images.

[from Mark Wedel]
>  Easy enough to add something like:
> 
> C->S: RIN 0 500	(Request Image Names, 0->500)
> S->C: face <num><name>	(already there - although not especially
> 	efficient for 500 images - maybe something like:
> S->C FN 0 500 face0 face1 face2,....
> 
>  Client then checks to see if it has the image in local cache.  IF not,
> it uses the existing mechanism to request the face from the server.

A more efficient scheme would first presume client already has most of the
info, use checksums to determine differences and then deal with resending
that range.

For instance if client has 1238 images in local cache:

C->S: Request_Number_of_Image_Names
C->S: Req_Image_CKSM 0 1237	(request checksum of image names and image
				 contents)
S->C: Num_Images 1249		(client learns there are additional images)
S->C: Rsp_Image_CKSM 0 1237 ab8302ad def75749 (client 

So client can see if it has current images for lots of images in one
message.  And when client needs update then it could ask for smaller
checksum chunks until it discovers what it locally has that is different
from server.  And instead of recalculating checksum of image contents each
time it would be faster if instead it sent the checksum of image checksums
so each image would be checksummed once and checksum saved.

The adler-32 checksum is a nice fast simple arithmetic checksum.  It is
just one multiple and three adds per byte and a modulo every 5000 bytes.

							sdw
[to unsubscribe etc., send mail to crossfire-request@ifi.uio.no]


Follow-Ups: