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

Comparing deliantra/server/socket/loop.C (file contents):
Revision 1.45 by root, Tue Apr 3 00:21:38 2007 UTC vs.
Revision 1.46 by root, Tue Apr 3 01:06:09 2007 UTC

170 draw_client_map (pl->ob); 170 draw_client_map (pl->ob);
171 171
172 if (update_look) 172 if (update_look)
173 esrv_draw_look (pl->ob); 173 esrv_draw_look (pl->ob);
174 174
175 if (partial_face_ofs) 175 if (askface.empty () && !partial_face_ofs)
176 {
177 }
178
179 if (partial_face_ofs)
180 {
181 // one hell of a big thing that must be
182 }
183 else if (askface.empty ())
184 { 176 {
185 // regularly send a new face when queue is empty 177 // regularly send a new face when queue is empty
186 if (bg_scrub && !--bg_scrub && enable_bg_scrub) 178 if (bg_scrub && !--bg_scrub && enable_bg_scrub)
187 while (scrub_idx < faces.size () - 1) 179 while (scrub_idx < faces.size () - 1)
188 { 180 {
205 197
206 rate_avail = min (max_rate, rate_avail + max_rate); 198 rate_avail = min (max_rate, rate_avail + max_rate);
207 rate_avail -= ol; 199 rate_avail -= ol;
208 200
209 int avail = rate_avail; 201 int avail = rate_avail;
210 202
211 // if we can split images, transfer up to mss packets if possible 203 // if we can split images, transfer up to mss packets if possible
204 // but never more 768 bytes more.
212 if (fxix) avail += mss - (ol % mss); 205 if (fxix) avail += min (768, mss - (ol % mss));
213 206
214 while (!askface.empty () && avail > 0) 207 bg_scrub = BG_SCRUB_RATE;
208
209 while (avail > 0)
215 { 210 {
216 // use a lifo to send most recently requested images 211 if (partial_face_ofs)
217 faceidx facenum = askface.back ();
218 askface.pop_back ();
219
220 if (fxix && 0)
221 { 212 {
213 if (facedata *d = face_data (partial_face, faceset))
214 {
215 // 9 bytes is enough for fx_FFFOOO, 40 leaves some room
216 int chunk = min (min (avail - 40, MAXSOCKBUF - 9), partial_face_ofs);
217
218 if (chunk <= 0)
219 break;
220
221 partial_face_ofs -= chunk;
222
223 packet sl ("ix");
224
225 sl << ber32 (partial_face)
226 << ber32 (partial_face_ofs)
227 << data (d->data.data () + partial_face_ofs, chunk);
228
229 send_packet (sl);
230 }
231 else
232 partial_face_ofs = 0;
233 }
234 else if (!askface.empty ())
235 {
236 // use a lifo to send most recently requested images
237 faceidx facenum = askface.back ();
238 askface.pop_back ();
239
240 if (fxix)
241 {
242 if (facedata *d = face_data (facenum, faceset))
243 {
244 partial_face = facenum;
245 partial_face_ofs = d->data.size ();
246 }
247 }
248 else
249 send_image (facenum);
222 } 250 }
223 else 251 else
224 send_image (facenum); 252 break;
225 253
226 int consumed = ol - outputbuffer_len (); 254 int consumed = ol - outputbuffer_len ();
227 avail -= consumed; 255 avail -= consumed;
228 rate_avail -= consumed; 256 rate_avail -= consumed;
229
230 bg_scrub = BG_SCRUB_RATE;
231 } 257 }
232 } 258 }
233} 259}
234 260

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines