1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
|
#include "swserv.h"
int NetHandleCreateObject(int condescriptor, char *arg)
{
return(0);
}
int NetSendCreateObject(int condescriptor, long object_num)
{
char sndbuf[CS_DATA_MAX_LEN];
xsw_object_struct *obj_ptr;
if(DBIsObjectGarbage(object_num))
return(-1);
else
obj_ptr = xsw_object[object_num];
/*
* CS_CODE_CREATEOBJ format:
*
* object_num,
* type, isref_num, owner, size,
* locked_on, intercepting_object, scanner_range,
* sect_x, sect_y, sect_z,
* x, y, z,
* heading, pitch, bank,
* velocity,
* velocity_heading, velocity_pitch, velocity_bank,
* current_frame, anim_int, total_frames, cycle_times
*/
sprintf(sndbuf,
"%i %ld\
%i %i %ld %ld\
%ld %ld %.4lf\
%ld %ld %ld\
%.4lf %.4lf %.4lf\
%.4lf %.4lf %.4lf\
%.4lf\
%.4lf %.4lf %.4lf\
%i %ld %i %i\n",
CS_CODE_CREATEOBJ,
object_num,
obj_ptr->type,
obj_ptr->imageset,
obj_ptr->owner,
obj_ptr->size,
obj_ptr->locked_on,
obj_ptr->intercepting_object,
obj_ptr->scanner_range,
obj_ptr->sect_x,
obj_ptr->sect_y,
obj_ptr->sect_z,
obj_ptr->x,
obj_ptr->y,
obj_ptr->z,
obj_ptr->heading,
obj_ptr->pitch,
obj_ptr->bank,
obj_ptr->velocity,
obj_ptr->velocity_heading,
0.0000,
0.0000,
obj_ptr->animation.current_frame,
obj_ptr->animation.interval,
obj_ptr->animation.total_frames,
obj_ptr->animation.cycle_times
);
NetDoSend(condescriptor, sndbuf);
return(0);
}
|