… | |
… | |
260 | // if for some reason we let a client without face caching connect, |
260 | // if for some reason we let a client without face caching connect, |
261 | // we better support that decision here and implement it. |
261 | // we better support that decision here and implement it. |
262 | if (!facecache) |
262 | if (!facecache) |
263 | return send_image (facenum); |
263 | return send_image (facenum); |
264 | |
264 | |
|
|
265 | if (fxix) |
|
|
266 | { |
|
|
267 | fxface.push_back (facenum); |
|
|
268 | return; |
|
|
269 | } |
|
|
270 | |
265 | packet sl; |
271 | packet sl; |
266 | |
272 | |
267 | if (force_face0) |
273 | if (force_face0) |
268 | sl << "face " << uint16 (facenum); |
274 | sl << "face " << uint16 (facenum); |
269 | else if (image2) |
275 | else if (image2) |
… | |
… | |
273 | |
279 | |
274 | // how lame |
280 | // how lame |
275 | print_facename (sl, *d); |
281 | print_facename (sl, *d); |
276 | send_packet (sl); |
282 | send_packet (sl); |
277 | |
283 | |
|
|
284 | if (EMI_smooth) |
|
|
285 | { |
278 | faceinfo *f = face_info (facenum); |
286 | faceinfo *f = face_info (facenum); |
279 | if (f->smooth && EMI_smooth) |
287 | |
280 | { |
288 | if (f->smooth) |
|
|
289 | { |
281 | send_face (f->smooth); |
290 | send_face (f->smooth); |
282 | |
291 | |
283 | packet sl ("smooth"); |
292 | packet sl ("smooth"); |
284 | |
293 | |
285 | sl << uint16 (facenum) |
294 | sl << uint16 (facenum) |
286 | << uint16 (f->smooth); |
295 | << uint16 (f->smooth); |
287 | |
296 | |
288 | send_packet (sl); |
297 | send_packet (sl); |
|
|
298 | } |
|
|
299 | } |
|
|
300 | } |
|
|
301 | |
|
|
302 | void client::flush_fx () |
|
|
303 | { |
|
|
304 | while (!fxface.empty ()) |
|
|
305 | { |
|
|
306 | packet fx ("fx"); |
|
|
307 | packet sx ("sx"); |
|
|
308 | |
|
|
309 | do |
|
|
310 | { |
|
|
311 | faceidx facenum = fxface.back (); fxface.pop_back (); |
|
|
312 | |
|
|
313 | const facedata *d = face_data (facenum, faceset); |
|
|
314 | |
|
|
315 | if (d) |
|
|
316 | { |
|
|
317 | fx << ber32 (facenum) |
|
|
318 | << data8 (d->chksum, CHKSUM_SIZE); |
|
|
319 | |
|
|
320 | if (smoothing) |
|
|
321 | { |
|
|
322 | faceinfo *f = face_info (facenum); |
|
|
323 | |
|
|
324 | if (f->smooth) |
|
|
325 | { |
|
|
326 | send_face (f->smooth); |
|
|
327 | sx << ber32 (facenum) |
|
|
328 | << ber32 (f->smooth) |
|
|
329 | << ber32 (f->smoothlevel); |
|
|
330 | } |
|
|
331 | } |
|
|
332 | } |
|
|
333 | } |
|
|
334 | while (!fxface.empty () |
|
|
335 | && fx.room () > ber32::size + CHKSUM_SIZE + 1 |
|
|
336 | && sx.room () > ber32::size * 3); |
|
|
337 | |
|
|
338 | send_packet (fx); |
|
|
339 | if (sx.length () > 3) send_packet (sx); |
289 | } |
340 | } |
290 | } |
341 | } |
291 | |
342 | |
292 | void |
343 | void |
293 | client::send_image (faceidx facenum) |
344 | client::send_image (faceidx facenum) |
… | |
… | |
353 | { |
404 | { |
354 | /* Do some checking on the anim_num we got. Note that the animations |
405 | /* Do some checking on the anim_num we got. Note that the animations |
355 | * are added in contigous order, so if the number is in the valid |
406 | * are added in contigous order, so if the number is in the valid |
356 | * range, it must be a valid animation. |
407 | * range, it must be a valid animation. |
357 | */ |
408 | */ |
358 | if (anim_num < 0 || anim_num > num_animations) |
409 | if (anim_num < 0 || anim_num >= animations.size ()) |
359 | { |
410 | { |
360 | LOG (llevError, "esrv_send_anim (%d) out of bounds??\n", anim_num); |
411 | LOG (llevError, "esrv_send_anim (%d) out of bounds??\n", anim_num); |
361 | return; |
412 | return; |
362 | } |
413 | } |
363 | |
414 | |