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.43 by root, Fri Mar 16 02:37:54 2007 UTC vs.
Revision 1.45 by root, Tue Apr 3 00:21:38 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)
176 {
177 }
178
179 if (partial_face_ofs)
180 {
181 // one hell of a big thing that must be
182 }
175 if (askface.empty ()) 183 else if (askface.empty ())
176 { 184 {
185 // regularly send a new face when queue is empty
177 if (bg_scrub && !--bg_scrub && enable_bg_scrub) 186 if (bg_scrub && !--bg_scrub && enable_bg_scrub)
178 while (scrub_idx < faces.size () - 1) 187 while (scrub_idx < faces.size () - 1)
179 { 188 {
180 ++scrub_idx; 189 ++scrub_idx;
181 if (!faces_sent [scrub_idx]) 190 if (!faces_sent [scrub_idx])
182 { 191 {
183 send_face (scrub_idx); 192 send_face (scrub_idx);
193 flush_fx ();
194
184 bg_scrub = 1; // send up to one face per tick, unless an image was requested 195 bg_scrub = 1; // send up to one face per tick, unless an image was requested
185 break; 196 break;
186 } 197 }
187 } 198 }
199
200 rate_avail = max_rate - outputbuffer_len ();
188 } 201 }
189 else 202 else
190 while (!askface.empty () && outputbuffer_len () < max_rate) 203 {
204 int ol = outputbuffer_len ();
205
206 rate_avail = min (max_rate, rate_avail + max_rate);
207 rate_avail -= ol;
208
209 int avail = rate_avail;
191 { 210
211 // if we can split images, transfer up to mss packets if possible
212 if (fxix) avail += mss - (ol % mss);
213
214 while (!askface.empty () && avail > 0)
215 {
192 // use a lifo to send most recently requested images 216 // use a lifo to send most recently requested images
193 faceidx face = askface.back (); 217 faceidx facenum = askface.back ();
194 askface.pop_back (); 218 askface.pop_back ();
195 219
220 if (fxix && 0)
221 {
222 }
223 else
196 send_image (face); 224 send_image (facenum);
197 225
226 int consumed = ol - outputbuffer_len ();
227 avail -= consumed;
228 rate_avail -= consumed;
229
198 bg_scrub = BG_SCRUB_RATE; 230 bg_scrub = BG_SCRUB_RATE;
199 } 231 }
232 }
200} 233}
201 234

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines