ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/socket/image.C
(Generate patch)

Comparing deliantra/server/socket/image.C (file contents):
Revision 1.45 by root, Thu Jul 5 10:34:08 2007 UTC vs.
Revision 1.47 by root, Thu Jul 12 08:40:14 2007 UTC

211 211
212 ix.pri = pri; 212 ix.pri = pri;
213 ix.idx = idx; 213 ix.idx = idx;
214 ix.ofs = d->data.size (); 214 ix.ofs = d->data.size ();
215 215
216 // this is (hopefully) a temporary fix around older cfplus versions not 216 auto (pos, ns->ixface.end ());
217
218 if (ns->fxix < 2)
219 {
220 // gcfclient does not support prioritising, older cfplus versions
217 // supporting interleaved transfers 221 // do not support interleaved transfers.
218 ns->ixface.insert (ns->ixface.begin (), ix); 222 if (!ns->ixface.empty ())
223 pos = ns->ixface.end () - 1;
224 }
225 else
226 {
227 // the by far most common case will be to insert
228 // near the end, so little looping.
229 while (pos != ns->ixface.begin ())
230 {
231 --pos;
232
233 // sort within 2k bins, to slightly prefer smaller images
234 if (pri > pos->pri || (pri == pos->pri && (ix.ofs >> 11) <= (pos->ofs >> 11)))
235 {
236 ++pos;
237 break;
238 }
239 }
240 }
241
242 ns->ixface.insert (pos, ix);
219 243
220#if 0 244#if 0
221 // the by far most common case will be to insert 245 for (auto (i, ns->ixface.begin ()); i != ns->ixface.end (); ++i)
222 // right at the end, so no looping. 246 fprintf (stderr, "<%d,%d> ", i->pri, i->ofs);
223 auto (i, ns->ixface.end ()); 247 fprintf (stderr, "\n");
224 for (; i != ns->ixface.begin (); )
225 if (pri >= (--i)->pri)
226 break;
227
228 ns->ixface.insert (i, ix);
229#endif 248#endif
230} 249}
231 250
232/** 251/**
233 * Tells client the picture it has to use 252 * Tells client the picture it has to use
287 { 306 {
288 LOG (llevError, "client::send_face (%d) out of bounds??\n", facenum); 307 LOG (llevError, "client::send_face (%d) out of bounds??\n", facenum);
289 return; 308 return;
290 } 309 }
291 310
292 if (faces_sent[facenum]) 311 if (!must_send_face (facenum))
293 return; 312 return;
294
295 faces_sent[facenum] = true;
296 313
297 // if for some reason we let a client without face caching connect, 314 // if for some reason we let a client without face caching connect,
298 // we better support that decision here and implement it. 315 // we better support that decision here and implement it.
299 if (!facecache) 316 if (!facecache)
300 return send_image (facenum); 317 return send_image (facenum);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines